Commit Graph
863 Commits
Author SHA1 Message Date
swaitsandClaude Opus 5.5 50e966e8fb docs(coverage): the store's floor stays at 92.58%; a run inside the tolerance is recorded, not written over it
The merged, reviewed tree measured the store at 92.45%, twenty lines
fewer on the same lines (main's store changes were comments, the fixes
added no store code): run-to-run movement in the property and process
tests, which the 0.5 pp tolerance exists to absorb. The floor recorded
the run as measured, which lowered it, against the rule the same
paragraph states, that a floor only rises. The store's floor is back to
92.58% and the 92.45% run is in the table; the core's floor rises to
95.49%. scripts/coverage-floor.sh passes on both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 07:33:46 -07:00
swaitsandClaude Sonnet 5.5 cefb9bc83f docs(coverage): the floors are what the merged, reviewed tree measures
`just coverage` on the tree after the review fixes and the merge of main:
ledger-core 95.49% lines (18,422 of 19,292), 93.09% regions, 88.98% branches;
ledger-store 92.45% lines (14,359 of 15,531), 85.86%, 81.72%. The store is 20
covered lines under the earlier run's 92.58% on the same 15,531 lines: main's
store changes are comments only and the fixes add no store code, so it is
run-to-run movement in the property and process tests, inside the 0.5 pp
tolerance. `just coverage-check` passes at both floors.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 07:32:49 -07:00
swaitsandClaude Sonnet 5.5 ae32a83407 docs(spec): WB-ledger-17, the reconciliations rule, and the order the tests pin
Which accounts the monthly close reconciles, and when each is due, was a
module's own spec block with no id. It is now WB-ledger-17 (product-only, a
CONVENTION sourced to docs/parties-and-attachments.md "Reconciliations"),
checked against the code: the cash accounts (configured ones in the order
given, else by name in ascending account id), the card accounts (ascending
id), then the other liabilities with a statement in the order the statements
are given (period end, then file; not ascending id), each once; and an account
is due through last month's end when it has a posted line on or before it and
no reconciliation not voided is dated on or after it. The module and the test
file cite it.

The order within the cash group is the account id's, as `card_accounts` sorts,
not the chart code's (`ChartOfAccounts::all` is unordered). The test is renamed
to say so and its codes are out of creation order, so a sort by code fails it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 06:15:39 -07:00
swaitsandClaude Sonnet 5.5 2ce48090fd test(core): a replayed line past the line limit is refused when it posts
Opening old books is a real input: a draft line an earlier version accepted
past MAX_LINE_AMOUNT replays as journaled, and its post refuses it
(AmountOutOfRange, BS-entry-4), leaving the draft and the books as they were.
Covered for a plain line and a foreign line (bounded by its booked base
amount), at Decimal::MAX and one cent past the limit, and a draft at the limit
itself posts. A foreign original of any size beside an in-range base amount is
not refused by replay or by the post, and no journal writes one, so it is
left documented, not pinned.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 06:15:38 -07:00
swaitsandClaude Sonnet 5.5 344e09933d test(core): cite the rule that states the fact, and assert the fact, not the wording
Review of V-D2's tests:
- S-E3's vocabulary: `item k` and `INVARIANT k` become `invariant k` of
  WB-ledger-15, WB-ledger-9 (no numbered parts: cited whole), and the statements
  and invariants of BS-arap-5 and BS-arap-6 that the tests actually pin.
- The split-group tests cite WB-entry-6, the only rule that says "as part of a
  split group", not BS-entry-5.
- A refusal is pinned by its variant plus the fragment that states the fact (a
  figure, "positive", "strictly greater"), not its whole sentence; the
  `ConventionKind::ALL.len() == 7` pin is dropped.
- `a_send...moves_no_figure` compared receivables with itself; it now asserts
  the bank unchanged and receivables at 500.00.
- The disposal test says a day before the asset was acquired is refused and
  now asserts DisposalBeforeAcquisition.
- Main's FeeAboveCash variant replaces the InvalidSettlement text the fee test
  matched; it now asserts the variant and both figures.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 06:15:38 -07:00
swaitsandClaude Sonnet 5.5 7ac1ef8c5a fix(core): the audit holds a close's split to under one unit once the count is trued up
BS-partner-1 statement 5 says that after a close that posts, each member's
running total MUST be under one smallest unit from its exact share. The audit
flagged drift only when it was greater than a unit, so exactly one unit passed.
The looser bound is right only until the first true-up (statement 6,
WB-partner-1): a count that still holds closes made under the older rules may
carry their rounding until a cumulative close posts.

A close records both facts replay needs: its rule (`MembersClosed.rule`) and
whether it posted (`closing_entry`). `Ledger::member_close_trued_up` says a
count has had a cumulative close that posted, at or before a given close, and
`audit::check_split` flags drift of a unit or more once it has, drift beyond a
unit before. Closes under the older rules are not read by the audit at all.

Tests: both regimes at the edge in either direction, and a count walked through
a per-close January, a non-posting February (not trued up), a posting March
(trued up) and a non-posting April (still trued up). WB-ledger-16 gains
invariant 8 for it. The same test file now cites WB-ledger-16 for the audit
(BS-ledger-13 is retired), and audit.rs's own invariant and scenario where
WB-ledger-16's numbering does not match.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 06:15:38 -07:00
swaits 5fd382450b Merge branch 'main' into t3/coverage-gap-tests-v-d2 2026-11-09 05:07:33 -07:00
swaitsandClaude Opus 5.5 f74eccddfc build: pin bookspec at c597c8f, drafts and evidence
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
bookspec main now carries X-H1c: drafts, receipts, discards and the
evidence decision as examples, BS-entry-1 without the choice it never
owned, payroll its own exemption source. Lean 179 theorems, standard
axioms only; 88 of 101 examples run and pass, the other 13 are for
options wanderbooks did not pick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 04:34:41 -07:00
swaitsandClaude Opus 5.5 ef9995ebed test(core): the sub-reference self-tests read their bounds from the record
They hard-coded BS-entry-1's four statements and one scenario; X-H1c
moved a choice's statement out of BS-entry-1, an authority rule, into
BS-entry-6, which owns it, and the self-tests broke on the merge. They now
take a record's counts from the pinned bookspec and test one past each,
so a record that gains or loses a part moves them with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 04:34:41 -07:00
swaitsandClaude Opus 5.5 b8e9b3ea8e merge: the adapter runs drafts and evidence (X-H1c's wanderbooks half; reviewed, re-checked)
Wanderbooks passes every bookspec example for its picks on drafts and
their evidence: a draft waiting on its receipt, a discard that leaves the
books as they were, a draft holding its period open, the one evidence
decision answering for every entry. A refused hand entry is posted on a
rehearsal of the real store, so the refusal is the engine's own; payroll
postings are their own exemption source. No engine change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 04:25:01 -07:00
swaitsandClaude Sonnet 5.5 56461c1bb6 test(core): the adapter's refused hand entries go through a real Store, and payroll is its own source
A hand entry the example says is refused when posted at once was made on a
clone of the Ledger and the receipt-gate error hand-built from
`evidence::requirement`, as `Store::post_entry_checked` builds it: the
adapter, not the engine, produced the refusal. A store journals a draft the
moment it is made, so the entry is now made, lined and posted on a rehearsal:
the books replayed from their journal into a Store of their own (the journal
and blobs copied, opened as any store is), and posted through
`post_entry_checked` under a policy, `post_entry` otherwise. The refusal is the
engine's own (ReceiptRequired included) and the example's books keep nothing.

A payroll run or tax remittance is exempt by its own source, so the engine's
"a payroll ..." sentence now reads as bookspec's new `payroll_posting`, not
`document_entry`. A draft reversal, which wanderbooks has no path for, is
returned as an unsupported-operation error (reported as "another refusal"), not
a panic that takes the harness down with it.

The claims for B-43 name the new example, entry-only-a-draft-can-be-posted-or-
discarded (a posted entry or a discarded draft is no draft), and the rehearsal.
Needs bookspec's x-h1c commits (payroll_posting, the new example, the
25.00 threshold example); the pin moves when they land.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 04:23:10 -07:00
swaitsandClaude Sonnet 5.5 1a25e66f23 docs(coverage): the floor rises to 95.45% core and 92.58% store
V-D2's tests (94 of them: 85 in ledger-core, 9 in ledger-store) take the
core from 89.79% to 95.45% of lines (17,299 -> 18,391 of 19,267) and the
store from 92.09% to 92.58% (14,301 -> 14,379 of 15,531), from the full
`just coverage` run before and after on the same code and tools. The
recorded floors, 90.01% and 91.71%, rise to the new totals; coverage-check
reads them from the floor line of docs/coverage-floor.md and passes at
exactly the new numbers.

Per file: evidence.rs 33.85% -> 100%, conventions.rs 77.76% -> 97.24%,
audit.rs 80.33% -> 94.14%, settings.rs 91.05% -> 98.16%, ledger.rs 86.00%
-> 96.87%, reconcilable.rs 0% -> 100%. What is left is mostly arms no
posted book reaches (a sum past Decimal's range; a line is capped at 1e15)
and replay-only refusals. docs/testing.md gets V-D2's record: the tests by
area and rule, the finding, what was not reached and the P12 mutation
targets.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 04:05:17 -07:00
swaitsandClaude Opus 5.5 b62625ea71 merge: sub-references name bookspec's statements, invariants and scenarios (S-E3; reviewed, fixes applied)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
S-E rewrote B-37 item 7 as BS-statement-5 item 7, but the old number
counted the rules.md text's items, and bookspec's records number their
statements their own way. S-E3 mapped every sub-reference by content
(the last rules.md that held the text against the pinned records) and
wrote it in bookspec's words: statement, invariant, scenario. Where
bookspec states no counterpart, the product rule that does is cited.

The mapping caught citations that were wrong before the renumbering (a
discount rule cited as the payment bound, three times), and the review
caught nine more. A test now checks all 361: each names a part its
record has, product rules' parts included, no old word survives, and
none can vanish unseen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 04:01:42 -07:00
swaitsandClaude Sonnet 5.5 dfdb066245 test(core): the sub-reference test sees every old form, and checks product rules
- An id closed by a backtick before the part word (`BS-asset-1` rules
  23), the filler "states (rules 25-26", and a bare spec-block word on
  the id's line (BS-arap-3 SCENARIOS:) now fail as old vocabulary; each
  has a self-test.
- Product rules (WB-<area>-<n>) are checked: the numbered INVARIANTS: and
  SCENARIOS: lists in docs/spec/claims/*.md are parsed (a list that does
  not count 1, 2, 3 fails the parse), and WB-ledger-15 invariant 3 is
  checked like a bookspec part. A product rule with no list takes no
  sub-number, and has no statements.
- Counting: every member of a range and every number of a list is one
  reference ("27-30" is 4); a backwards range fails. The floor is
  exactly the number found, 361.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 04:01:09 -07:00
swaitsandClaude Sonnet 5.5 74fc553272 docs: the sub-references the review found land on the part that states the claim
A review of S-E3 against the pinned bc92cf3 records found citations one
part off, and old vocabulary the test could not see. Each is checked
against the record's own text:

- BS-statement-5: the partition of the P&L is statement 3 (not 2, and
  not BS-statement-3, the cash-flow statement); the ASC 340-40-25-7/-8
  trail (a cost traceable to one job is that job's, several only by a
  stated allocation) is statement 4, not 6.
- BS-asset-1: "one figure everywhere" is statement 31 (28 is the two
  figures, schedule and books); "disposed only for a disposal dated by
  then" is statement 30 (and 7 where the schedule stops).
- BS-arap-6: one receivable line per invoice, each tagged, is statements
  1-2 and invariant 4 (one application per document).
- BS-asset-1 statements 8 and 9 for the true-up and the credit back.
- BS-arap-2: "nothing unattached, no command adds a hand line" is
  invariants 2 and 3, beside 1, 6 and 9.
- BS-format-2: a class name written differently and reported adds 32.
- BS-arap-5: the cash-basis refusal is statement 6, everywhere.
- BS-partner-3: statement 3's cases are lettered (a)-(e), not numbered.
- BS-asset-1 "rules 23-24 / 25-26" in the claims, "BS-arap-3 SCENARIOS:"
  and "WB-ledger-15 INVARIANT 3" are in the new vocabulary.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 04:01:09 -07:00
swaitsandClaude Sonnet 5.5 d889f2e7fb docs(claims): the draft and evidence examples are checked lines
B-1 (BS-entry-1, BS-entry-6), B-43 (BS-entry-5) and B-20 (BS-ledger-7,
BS-ledger-17) name the bookspec examples that now show their rules, the real
engine functions each runs through, and the examples for the options
wanderbooks did not pick, which are skipped.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:44:13 -07:00
swaitsandClaude Sonnet 5.5 8c57046c53 test(core): the adapter runs drafts and evidence
bookspec's examples for BS-entry-5, BS-entry-6 and BS-ledger-17 are run through
the real Store, none reimplemented: a draft is made by `Store::create_entry` and
`add_line` (tried on a clone first, so a line the engine refuses on a header
account leaves no half-made draft in the journal), posted by `post_entry_checked`
when the example states an evidence policy (the server's gate; the primitive
otherwise), given its state by `set_draft_state`, its document by
`attach_receipt` and thrown away by `discard_draft`. A close a draft holds back
is tried on a clone too. The two queries are read off the engine: a draft's
state from the entry itself, and the evidence decision from
`evidence::requirement`, its sentence of exemption read into the examples'
closed words. The refusals are read off the engine's errors: a placeholder
account is `header_account`, the receipt gate `evidence_required`, a draft's
command on an entry that is no draft `not_drafted`, a close with a draft in its
period `drafts_in_period`.

Wanderbooks passes every example for its picks (check-when-line-added,
reversal-evidence-is-originals); the two examples for the other options are
skipped, so the pinned skip count goes from 11 to 13.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:44:13 -07:00
swaitsandClaude Opus 5.5 7b40d243a6 docs(plan): S-C8, bookspec's records cite their own parts by position
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
S-E3 found two records still using the old words inside bookspec:
BS-format-2's statements cite each other as items, and BS-statement-3's
and BS-partner-3's statements carry Rule n labels that no longer equal
their positions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 03:31:29 -07:00
swaitsandClaude Sonnet 5.5 d26a75b2ae test(core): every sub-reference names a part its record has
`sub_refs` scans every tracked file outside plan/ and checks each
`BS-<area>-<n> statement k`, `invariant k` and `scenario k` (a list, a
range, a parenthesised or comment-wrapped form, or a continuation on the
same id such as "invariant 2 and statement 11") against the pinned
record: k must lie within the length of that list. It also fails the old
vocabulary after a bookspec id (item, rule, INVARIANT, SCENARIO, r, or a
miscased word) when a number follows, so S-E's leftover forms cannot
creep back. The number of references checked is printed (328) and
floored (320); the self-tests refuse `BS-entry-1 statement 99`, a list or
range with one bad number, a wrapped reference, a bad continuation and
every old form, and accept the forms the records do have.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:30:06 -07:00
swaitsandClaude Sonnet 5.5 e41cc3a161 docs: sub-references name bookspec's statements, invariants and scenarios
Unit S-E rewrote each `B-n` citation to its bookspec id but kept the
sub-reference after it ("item 7", "rule 11", "INVARIANT 2"). Those
numbers counted parts of the retired rules.md text, so `BS-statement-5
item 7` pointed at finished and abandoned projects, not at the snapshot
it meant. Bookspec numbers a record's parts from 1 as `statement`,
`invariant` and `scenario`; every sub-reference now says so.

The map was built by content, not by position: each old item,
INVARIANT or SCENARIO was read in `git show ca8d676d5^:docs/spec/rules.md`
(the last full rule text), found in the pinned records
(bookspec bc92cf3) and in docs/spec/claims/, and each reference was
read in its context before it was mapped. Where the old numbering still
survives as the "Rule n" labels inside bookspec's statements (the cash
flow, party totals) the new number is that statement's position; where
a record carries the whole rule differently (the asset depreciation, the
IIF file, the arap invariants) the reference follows the content. Where
bookspec keeps no counterpart, the product rule that states it is cited
instead: WB-statement-5 (a project's facts and names), -7 (the snapshot),
WB-arap-4 (the document_standing feature), -8 (the issued PDF), -15 (a
payment event names its line), WB-ledger-15 (BS-ledger-12 is retired).
A reference that had pointed at the wrong part is corrected, for example
the discount-reason references that said BS-arap-6 INVARIANT 2 (a
bound) now say invariant 6 (the discount cap and date).

Only the reference tokens and their sentence change; no paragraph is
reflowed. A reference wrapped across a comment prefix keeps its wrap.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:30:06 -07:00
swaitsandClaude Opus 5.5 609e4e6b26 build: pin bookspec at bc92cf3, settlements and the shares law
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
bookspec main now carries X-H1b (settlements, recoveries, invoice
numbers, vendor references and their examples; BS-arap-10 ignores
hyphens as plan P4b S4 decided) and K-U3's law 42. The checker and the
Lean move together (tests/bookspec/pin.rs): Lean 179 theorems, standard
axioms only; 80 of 91 examples run and pass, the other 11 are for
options wanderbooks did not pick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 03:09:18 -07:00
swaitsandClaude Sonnet 5.5 11314db1f7 fix(store): cash accounts found by name come in chart order
FINDING from V-D2's reconcilable tests: cash_accounts returned the asset
accounts whose names say cash in the order ChartOfAccounts::all yields
them (a HashMap: "order unspecified"), so books.digest's
unreconciled_accounts could list the same books' accounts in a different
order from one run to the next. card_accounts, the rule beside it,
already sorts by account id. The name-matched path now sorts the same
way; configured codes keep the order they were configured in. No figure,
membership or due date changes, only the order of the list.

The earlier ignored test (cash_accounts_come_in_chart_order) now runs.
This is a small fix kept in its own commit so it can be dropped without
touching the tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:08:03 -07:00
swaitsandClaude Sonnet 5.5 7a1d4a51a8 docs(spec): claims cite the V-D2 tests
WB-entry-5 and WB-entry-6 (the evidence requirement and its exemptions),
WB-ledger-15 (annotations and entry.settles), WB-ledger-10 (approval
rules and renumbering) and WB-ledger-16 (the audit) now name the tests
that check them; the traceability gate resolves each.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:08:03 -07:00
swaitsandClaude Sonnet 5.5 f2058931d8 test(core): document events replay as journaled
The store rebuilds a payment's entry from its own entry events and then
tells the ledger which line is the payment, the discount, the write-off.
The core's own suite reached none of this (tag_replayed_at,
replay_invoice_payment_at, replay_bill_payment_at, replay_set_draft_state,
replay_add_line_fx); only the store's replay tests did.

- BS-arap-6 INVARIANT 3: an event that names a line tags exactly it; the
  invoice then reads the figures its lines carry (40.00 paid, 460.00
  owed; 490.00 paid + 10.00 discounted of 500.00) and the control
  accounts tie out with nothing untagged.
- BS-entry-4: an event that names a line the entry cannot answer to (the
  wrong account, amount, side or index) is not refused: the line stays
  untagged, the control check lists it, and the control account still
  ties. Only an unknown document is refused, and the ledger is unchanged.
- A bill's payment is the mirror (debit to payables); a write-off tags
  the receivables credit; a draft's state and a foreign line replay as
  journaled and a foreign line in the wrong base currency is refused.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:08:03 -07:00
swaitsandClaude Sonnet 5.5 22df07162a test(core): the ledger's edits refuse what their rules refuse
The small commands in ledger.rs whose refusal arms the core's own suite
did not reach. Each drives the public command, compares the ledger to its
clone after a refusal, and names its rule.

- BS-ledger-19 / WB-ledger-10: renumbering needs a known account, a
  non-blank free code, no approval rule naming the old code, and no
  control role's default code the account's type does not fit.
- BS-partner-8 / WB-partner-4: a party's fields hold no full TIN, no
  control character, at most 500 characters; a name is not blank or
  another's; an archived party returns only when no live party took its
  name; emails are addresses.
- BS-asset-1: a description is never blank; a disposal is refused for
  another currency, negative proceeds, an unknown asset, a second time.
- settings.rs's fiscal-year rule (IRS Form 1128, BS-period-2): the year
  does not move under a closed period; with none closed, it moves.
- WB-ledger-15 items 4, 5: annotations replace by file, receipt numbers
  run from the max (a duplicate is not renumbered, saturating at u32);
  entry.settles names existing, distinct entries, never itself.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:08:03 -07:00
swaitsandClaude Sonnet 5.5 268f9aac52 test(core): command steps refuse what their rules refuse
ledger.rs's document command steps ran thin from the core's own suite
(mark_sent_steps not at all; settle and write_off only on their happy
paths; the store's replay tests were their other callers). Each test
drives the public command, names the rule, and checks a refusal changes
nothing (the whole Ledger equals its clone) and a success moves the
figures its rule says.

- mark_sent (BS-arap-2, BS-format-1): a send moves no figure on any date;
  an unknown invoice, a send dated before the invoice, no recipients,
  a TIN or control character in a recipient/reference/note are refused;
  a void invoice is refused by the send's day (a later void doesn't
  un-send); open, partial, paid and written-off invoices may be sent.
- settle (BS-arap-6): empty, mixed kinds, differing parties, unknown
  document, out-of-calendar date, unknown instrument, a revenue account
  as the cash account, duplicate document, non-positive cash, negative
  discount, payment before the document, overpayment, a bad discount
  reason, a discount with no terms and no reason, a fee that is the whole
  payment or above it or on a non-expense account, a closed period; a
  fee settlement posts bank 96.80, fee 3.20, receivable down by the
  gross 100.00; a bill settles as the mirror.
- write_off (BS-arap-5): cash basis, reason, amount, calendar, before the
  invoice, unknown invoice, the room a later payment leaves (70.00 of
  100.00 with a 30.00 payment dated later), a closed period; then the
  write-off at that room posts bad debt 70.00 and clears the receivable.
- aging (BS-arap-2): what is owed on the day, oldest due first, invoices
  and bills apart, not what is paid, void or not yet issued.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:08:03 -07:00
swaitsandClaude Sonnet 5.5 3f60e3e192 test(core): settings refuse bad values
settings.rs ran 91% of lines; its validators for members, payment
methods, the attestation bar, terms and a whole change were the gap.
Each test asks the public check and encodes the rule it serves.

- WB-ledger-5 / INVARIANT 1: company.members are refused unless they hold
  together (shape, unknown field, shares in (0,1] summing to exactly 100%,
  no repeated name or capital account, a distributions account is not
  another's capital account, joint filers name each other), each refusal
  naming the member; members as party shares leave out who cannot be
  derived and prefer the live party over an archived one.
- INVARIANTS 1, 7: payment methods are at most eight, each of a known
  kind with string lines, flags true/false in either spelling and kept as
  bools, a routing number allowed only in ach/wire lines.
- BS-entry-4 / INVARIANT 3: replay takes any value of the right shape
  (a future kind, a total not 100%) but refuses a share outside (0,1]
  and a malformed method or member.
- INVARIANT 2: a change is all or nothing (a key twice, an unknown key, a
  half-bad command change nothing); changes that change nothing are left
  out; null clears.
- INVARIANTS 5, 6, 8: defaults when unset, one spelling for terms and the
  bar and month starts, an invoice prefix of 1..12 visible ASCII.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 02:38:35 -07:00
swaitsandClaude Sonnet 5.5 6048635c2f test(core): conventions refuse bad values
conventions.rs (and the check_*/apply_* commands in ledger.rs that front
it) ran 78% of lines, the gap being its validation refusals. Each test
asks the public check the store calls before it journals, names the rule
it encodes, and compares the books to a clone: a check, and an apply the
replay path refuses, change nothing.

- INVARIANT 1 / WB-ledger-6: an id is a slug and never a TIN; revising a
  live id counts up; a kind can't change; a retired id is gone for good;
  saying what is already said is refused.
- INVARIANT 2 / WB-ledger-9: a posting template is 2..50 lines, each share
  in (0,1], each side summing to exactly 1, slots lowercase names in
  braces, accounts in the chart and not headings; a template needs its
  structure and other kinds take none; drafting from one refuses a missing
  or surplus slot, a non-positive, over-limit, sub-cent or too-small
  amount, and splits what it can exactly (conventions::split).
- INVARIANT 3 / WB-ledger-10: an approval rule needs an approver and a
  limit; approvals bind only under enforcement, match the approver by
  name, notice any change to the draft (fingerprint over parties, shares
  and a no-party reason), and a rule this version can't read fails closed.
- INVARIANT 4: decisions and open items take ids in order, supersede or
  resolve once, name existing projects once each.
- INVARIANT 6 / WB-ledger-6: every text is bounded, control-free and
  TIN-free; sources are checked like a setting's; source corrections need
  a reason and change nothing but the source.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 02:36:24 -07:00
swaitsandClaude Sonnet 5.5 fe85ca8a64 test(core): the audit's branches
audit.rs ran 80% of lines and 61% of branches. The one-seed-per-code test
covers each finding code once; these cover the words, the orders and the
thresholds around them.

- BS-ledger-13: a finding takes its code's severity, an unknown code is a
  Failure; Subject::describe in words; the cash flow check says nothing
  when absent or footed, and the figures or the reason otherwise
  (INVARIANT 4); control accounts report a difference, an unattached line
  and an overpaid bill or invoice (and not other attention statuses).
- BS-partner-1: a close split drifts only beyond a minor unit (exactly
  one is fine, either direction); a members close the audit walks raises
  nothing.
- BS-entry-5 / D-47: evidence_missing only through the date and without a
  receipt; a reversal without its own receipt is Info and only when the
  policy would cover it.
- D-9: scope and effort words round-trip; only a month is held to the
  effort alone, only a hand-off or full audit serves the CPA; the bar
  setting parses what it names and refuses the rest, naming the word;
  the bar counts at its edges and asks only for what it sets.

Not reached, by design: the "cannot be made" arms of equation, control and
register, which need a sum past exact arithmetic that a posted book (a line
is capped at 1e15) cannot reach.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 02:33:23 -07:00
swaitsandClaude Sonnet 5.5 ab2d40e4c0 test(core): the evidence requirement's branches
evidence.rs ran 34% of lines and 9% of branches from the core's own suite
(the store, server and viewer are its callers). These tests go through
evidence::{requirement, Policy, Annotation} and the Ledger commands that
make an entry of each origin, and each asks the question twice: it is
pure (WB-entry-5), the books equal their clone afterwards.

- BS-entry-5 / WB-entry-5: a hand entry is Required strictly above the
  threshold (25.00 default; at it, none), with its reason in words; a
  required account needs a receipt at any amount; exempt accounts exempt
  only an entry whose every line is on one; threshold 0.00 means every
  entry; debits past exact arithmetic are TooLargeToCompute from the sum
  and past any threshold for the gate, never a panic.
- BS-entry-5, the anti-gaming rule: same-day, same-description,
  same-debit-account drafts are one purchase; a group over the threshold
  makes the draft Required and names the group; other days/descriptions/
  accounts, a group under the threshold, and a reversal are not groups.
- WB-entry-6: each origin is Exempt with its source: a reversal, a
  closing entry, a schedule month, a depreciation run, an asset disposal,
  a payroll tax remittance, a document's entry, a payroll run; a recurring
  draft is the policy's.
- WB-ledger-15 item 4: an annotation's fields are trimmed, blank ones are
  not kept, a receipt number is positive, an amount not negative, a date
  inside the calendar; at least one field or a note.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 02:33:23 -07:00
swaitsandClaude Sonnet 5.5 32514662d1 test(store): reconcilable lines, by rule
The module that decides which accounts the monthly close reconciles, and
when one is due, ran 0% from the store's own suite (the server and the
viewer are its readers). These tests build real books in a Store, record
real statements, complete and void real reconciliations, and ask the
module, with expected values worked by hand from its two invariants:

- INVARIANT 1: the reconcilable accounts are the cash accounts, then the
  card accounts, then every other liability with a statement, each once;
  an asset with a statement but no cash name never joins.
- INVARIANT 2: an account is due, through last month's end, iff it has a
  posted line on or before it and no standing reconciliation reaches it;
  a voided one reaches nothing; a draft counts for nothing; activity
  only this month is not due.
- cash accounts by name (case-insensitive, no placeholders, no
  expenses/liabilities) or by configured code; card accounts by the
  recorded business-card method, else by name (not "gift").

SOURCE: docs/parties-and-attachments.md "Reconciliations" and the
module's own CONVENTION; no BS- or WB- id covers the module yet.

FINDING (ignored test cash_accounts_come_in_chart_order): cash_accounts
yields name-matched accounts in HashMap order, so books.digest's
unreconciled_accounts can list them in a different order between runs.
card_accounts sorts by account id; cash_accounts does not.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 02:33:23 -07:00
swaitsandClaude Opus 5.5 81bc16c386 merge: the adapter runs settlements, recoveries, invoice numbers and vendor references; a fee above the cash is its own refusal (X-H1b's wanderbooks half; reviewed, re-checked)
Wanderbooks passes every bookspec example for the options it picked: 80
run, 80 passed, 11 for options it did not pick. The settlement refusal
that read a fee above the cash out of one half of an error message's 'or'
is now a typed refusal (LedgerError::FeeAboveCash), checked before the
kernel's settle at the same point, so no refusal's order changes; the
remaining message names only what is left (an amount too large, a
negative fee). BS-arap-10's pick is ignore-case-spaces-and-hyphens, as
plan P4b S4 decided and the engine always did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 01:56:38 -07:00
swaitsandClaude Sonnet 5.5 0ffb0935fe fix(core): a fee above the cash is its own refusal
A processor cannot keep more than it was paid. The engine already refused
a settlement whose fee is above its cash, but as InvalidSettlement, one
message for two causes ("the cash and discounts don't cover the
applications exactly, or the fee is above the cash"), so the bookspec
adapter had to read the refusal out of the message's prose. Settlement
now checks fee > Σ cash itself, in the same place as before (after the
per-application checks, before kernel::settle), and returns the typed
LedgerError::FeeAboveCash { fee, cash }. InvalidSettlement keeps what
remains (a sum too large, a negative fee, a fee that leaves no deposit),
and its message no longer claims the fee case. The adapter matches the
variant like every sibling.

The refusal's precedence is unchanged, and nothing was journaled by a
refused settlement before or now (the store journals only a settlement
that succeeded); no stored data changes. The only output change is the
error text of a fee above the cash and of the leftover InvalidSettlement
cases; no golden or test asserted either text, and no caller matched the
variant (ledger-mcp, ledger-store, ledger-cli pass them on as text).
a_fee_above_the_cash_is_refused_and_changes_nothing encodes the rule
(150.00 of cash, a fee of 150.01 refused, books untouched; a fee equal to
the cash is the other refusal; a fee of 3.00 posts, deposit 147.00).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 01:53:36 -07:00
swaitsandClaude Opus 5.5 3d026b6473 merge: the last rule citations in program output name bookspec ids (S-E2; re-checked)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
S-E kept thirteen old B-n citations in program output and one golden,
since output is a contract and a golden changes only when verified by
hand. They now cite bookspec: the eight evidence sources BS-entry-5, the
CPA package's aging tie-out BS-ledger-8, the bills-due tool BS-arap-2,
and the projects note BS-statement-5 items 2 and 4 (the figures and that
no cost is allocated). None is stored: each is computed when shown, so
old books replay and show the new text. The golden moved in exactly
those two strings. No retired number now remains anywhere outside the
plan and the index. Found on the way: the sub-references S-E carried
over keep the old numbering (S-E3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 01:44:13 -07:00
swaitsandClaude Opus 5.5 3b0ae5b440 docs(plan): S-E3 moves the carried-over sub-references to bookspec's numbering
S-E2 found that S-E's rewrite kept the old item numbers after the new
ids: BS-statement-5 item 7 now means finished or abandoned projects, not
what B-37 item 7 meant. 261 sub-references outside plan/ carry the old
numbering; S-E3 maps them from the last rules.md that held the text and
adds a test that each names an item the pinned record has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 01:38:19 -07:00
swaitsandDeepSeek V4.1 Flash 885cbe403e test(core): no retired rule number remains anywhere
The retired B-1..B-45 allow-list is empty: every citation outside
`plan/`, `docs/spec/rules.md` and `docs/spec/claims/` now names a
bookspec id, program output included. The check still scans whole
tracked file text for any word-boundary B-<1..45>, so a regression fails
with the file and count. The allow-list mechanism stays for a future
deliberate keep, which must edit the list and its count in the same
commit.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 01:36:47 -07:00
swaitsandDeepSeek V4.1 Flash 797c418184 fix: the last rule citations in program output name bookspec ids
The engine's last program-output citations were the retired wanderbooks
numbers. Each moves to the bookspec id that states the rule:

- B-43 -> BS-entry-5, in the eight evidence-source strings of
  `Ledger::origin_exemption` and the two golden lines that record them.
- B-23 -> BS-ledger-8, in the CPA package README's aging tie-out.
- B-38 -> BS-arap-2, in `books.bills_due`'s description.
- B-37 -> BS-statement-5, in the project page's contribution note. The
  old "item 7" was the snapshot presentation in the retired numbering;
  in BS-statement-5 the figures are item 2 (a project's figures are
  exactly its tagged lines, net revenue less expenses) and item 4 (no
  cost is allocated), so the note cites those.

None of the strings is stored. The evidence source is computed on every
call by `evidence::requirement` from the ledger (`origin_exemption`);
the journal records only a draft state's note and a discard's reason
(`entry.draft_state_set`, `entry.draft_discarded`), never the gate's
source. The CPA README is built on request into the package's bytes and
exported for a token; it is never read back. Tool descriptions are
compiled into the router. The GUI note is a `const`. So an old book
replays unchanged and reports the new text; no compatibility layer is
needed.

Golden verification: `draft_states_and_evidence_gate.json` changes in
exactly two strings, the reversal's and the closing entry's evidence
sources. Both are recomputed from the same ledger by the test and
compared whole; after the change the test passes against the file, and
`git diff` shows no other line moved. The figures, decisions, journal
lines and trial balances are untouched, as the hand worksheet
`plan/golden-worksheets/draft-states-and-evidence-gate.md` derives.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 01:36:40 -07:00
swaitsandClaude Opus 5.5 1ea3f9a226 merge: proportional shares in the kernel, one copy for six sites (K-U3; reviewed, fixes applied)
Six places computed a share as whole x weight / total, rounded it and
handed out the leftover, each with its own copy: the K-1 property split,
the tax-capital running split, a convention's split, a party's shares,
the 1099 bucket split, the cash-flow split. They now call one kernel
function, each keeping its own rounding, step and leftover recipient, so
no figure moves: every golden and every test passes unchanged, and a
review fuzzed 700,000 cases a site, old against new, as strings.

Proved: eight Kani harnesses, bridge properties against an independent
integer reference, and law 42 in bookspec's Lean (exact shares sum to the
whole; a part is within one step of its share). Found and pinned: an
exact tie between remainders goes where Decimal's 28th digit sends it,
as it always did (K-U10 puts exact ranking to the owner, with the cents
it moves); a product of two ten-place amounts can round (K-U10). Fixed
in review: the first part of a first-absorbs split had lost its scale,
and an inherited correction loop could run without end on absurd input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 01:32:29 -07:00
swaitsandDeepSeek V4.1 Flash fb45b290d3 test(core): the kernel shares pass the traceability gate
split_by_weights_with allocates its Vec buffers and has no harness of its
own, so it joins the gate's EXCEPTIONS (15 now) and SKIPPED, with its law
18 carried by split_by_weights_into, whose fixed-array call the bridge
makes directly; the harnesses call share_of and share_floor_with by name,
their SOURCE lines cite the rules laws 18 and 42 serve (share_floor_with
cites BS-partner-1 and BS-1099-1 so it intersects law 42), and the K-U3
note's rows give each harness its law number.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 01:31:45 -07:00
swaitsandDeepSeek V4.1 Flash d6bc8d6cfe docs(core): what the shares round, where ties go, and the API
The K-U3 note listed share_floor and split_by_weights, which are gone;
it now names the two public functions. The Kani table carries the law
number in its own column (the traceability gate reads only a bare integer
there), law 18 for the split's shape and law 42 for the exact share and
the floor. The note records the bridge's ranking, ties, scale and cap
properties, and its findings say both checked_mul and checked_div can
round at Decimal's edge (the product's rounding is reachable below the
line cap, the pinned quotient case is not), that the correction is
bounded, that the first part keeps the old scale, and that ties follow
the rounded quotient.

The proof-harness comments no longer claim a step of 7 or a strict i64
bound, and Lean is described as proving the exact-share model at any
size, not the engine's rounded ranking.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 01:31:45 -07:00
swaitsandDeepSeek V4.1 Flash 8edc2e85dd fix(core): the shares keep the old scale, and the floor's correction is bounded
The review's kernel findings, with the bridge properties that hold them.

FirstAbsorbs computed the first part as whole minus the rest, which is
algebraically the old split_first's parts[0] + (whole minus the sum of
parts) but not the same scale: 4860 by 6/0.7/0.5 gave 4050.00 where the
old code gave 4050, and 902 by 1/0.000001/0.000001 gave 902 where the old
code gave 902.00. That scale reaches Part.amount, so a printed share
moved. The kernel computes the old expression now, with checked ops;
LastAbsorbs was already the old plug_last and the no-places conventions
split. The bridge compares the strings.

share_floor_with's correction loop could walk without end on a rounded
product far from the exact floor: 0.1113 x 5909471247797156928749568911.8
/ 0.11134381908633486049673 hangs. Both directions now stop at
MAX_CORRECTION_STEPS and refuse, so an input past the cap is None, never
a hang; no figure produced within the cap changes. The bridge pins the
input.

Ranking needed a property of its own: on i64 every remainder is zero, so
the harnesses never rank. A random-weight bridge checks the split against
the independent exact reference over non-terminating totals, excluding
exact ties because the kernel ranks the rounded quotients' remainders;
finding_ties_follow_the_rounded_quotient pins those ties (20.00 by 4/1/1
over 6 is 13.33/3.34/3.33, 20 whole is 13/4/3), today's behaviour and the
pre-U3 sites' alike, for K-U10 to decide.

share_floor and split_by_weights had no engine caller (only the bridge),
so they are gone; split_by_weights_with and share_floor_with are the
public API, and the docs say both checked_mul and checked_div can round
at Decimal's edge.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 01:31:45 -07:00
swaitsandDeepSeek V4.1 Flash d4440b6a4e build: pin bookspec at 6e1b99d, the shares law
Law 42 (the split's exact shares sum, and each part is near its exact
share) is merged in bookspec, so the Lean package and the Rust checker
move to the same rev. The two must name one spec version: the checker
runs the bookspec the Lean proves.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 01:06:36 -07:00
swaits 73879044b2 Merge branch 'main' into t3/k-u3-kernel-shares 2026-11-09 01:05:05 -07:00
swaitsandClaude Opus 5.5 f5ad691b80 docs(plan): K-U10 carries the exact tie-break, an owner decision
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
K-U3's review found the split ranks remainders by a rounded quotient, so
a tie goes where the 28th digit sends it. Making it exact moves a cent
between parties in recomputed past reports, so it is put to the owner
with the cents it moves; K-U3 keeps today's behaviour and pins it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 01:03:52 -07:00
swaitsandClaude Sonnet 5.5 d35775922b docs(claims): BS-arap-10's pick is ignore-case-spaces-and-hyphens, as the plan decided
The engine has always dropped hyphens too (plan P4b S4, the owner:
"(vendor, normalized vendor_ref) (lower-case, spaces and hyphens
removed)", pinned by duplicate_vendor_ref_refused_unless_a_reason_is_given);
bookspec's record lost the hyphens in transcription and is corrected, so
there is no divergence to note. PICKS and the claims file name the option
ignore-case-spaces-and-hyphens, "spaces" being any whitespace, and the
example ids follow the record's rename.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 00:58:02 -07:00
swaitsandClaude Sonnet 5.5 b78b5e9f39 docs(claims): the arap Checked lines name the X-H1b examples
B-38, B-40, B-41 and B-42 list the new bookspec examples the adapter runs
for the options wanderbooks picked, and those it skips for the options it
did not (BS-arap-2, -10, -11, -12, -13, -14). B-40 records that wanderbooks'
vendor-reference comparison also drops hyphens, which BS-arap-10's option
(case and spaces) does not say; no example distinguishes them yet. B-41
notes the allowance method of BS-arap-5 still has no example (it needs a
provision event).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 00:16:28 -07:00
swaitsandClaude Sonnet 5.5 ea4d8bc86e test(core): the adapter runs settlements, recoveries, numbers and vendor references
bookspec's X-H1b examples state BS-arap-4, -6 and -10 to -14 through new
events and queries; the adapter runs each through the real API, none
reimplemented.

- settlement: `Store::settle` with the applications, the fee and the
  deposit account; the party is the first document's customer or vendor, so
  the engine itself finds an invoice mixed with a bill, two customers, a
  document twice, more than a document owes, a discount that needs a reason,
  a discount on an asset bill and a fee above the cash. Each engine error is
  read as the examples' word (the fee case from the one InvalidSettlement
  error that can arise from exact inputs).
- recovery (BS-arap-11, reverse-then-plain-entry): in the write-off's fiscal
  year `Store::reverse_entry` of the write-off then `Store::receive_payment`;
  in a later year a plain entry, deposit debited and the recoveries account
  credited, naming the invoice. The engine has no recovery command; the two
  calls are the pick's own procedure.
- a bill's vendor reference and duplicate reason go to `BillFields`, so
  `Ledger::check_vendor_ref` is what refuses a second bill; each invoice is
  numbered with `Ledger::next_invoice_number`; a line's own account goes to
  `DocumentLine`.
- queries `document` (`Ledger::invoice_state`/`bill_state`) and
  `invoice_numbers` (the number the engine stored, read as its place in the
  order of issue).

Wanderbooks passes all 80 examples it runs. The runner skips eleven for the
options it did not pick (six new: documents-kept-apart, compare-exactly,
recovery-movement, net-of-expected-discount, net-against-the-deposit,
apportion-across-the-lines), so the pinned count is 11. No engine disagreed
with an example.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 00:16:28 -07:00
swaitsandDeepSeek V4.1 Flash f6069cbcff test(core): Kani and bridge for the kernel shares
Prove the split's laws on the integer model and carry them to Decimal:
the parts sum to the whole, each is within one step of its share, no
part exceeds the whole, a zero total and all-zero weights are the
callers' answer, and overflow is None rather than a panic. The bridge
checks the i64 and Decimal instantiations against each other and the
Decimal split against an independent i128 exact reference, with weights
summing to one and to arbitrary totals, every leftover policy, one and
many members, and Decimal::MAX and scale 28 edges.

The one finding is K-U10's: at Decimal's 96-bit mantissa edge the
quotient's rounding can move a share across a step, and the comparison
product's rounding can hide it from the floor correction; the split
refuses rather than emit a part above the whole, and the bridge pins the
case. The i64 division truncates, so the proof's within-one-step bound
is inclusive there; the bridge checks the strict Decimal bound.

The note records the harnesses, bounds and times, including the
unwind(4) the floor harness needed and the just-prove batch cap that the
shared machine's load hit.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 00:14:37 -07:00
swaitsandDeepSeek V4.1 Flash 24b59e7b85 refactor(core): proportional shares in the kernel, one copy
The K-1/1065 worksheet, the 1099 worksheet, the parties' shares, the
conventions' template split and the cash-flow government split each
computed "whole x weight / total, round, hand out the leftover" for
themselves. Six copies meant six places for a rounding or sign change to
reach a filed figure.

Put the shape in kernel::allocate: share_of (the engine's division,
rounded at Decimal's 28 significant digits, truncating on a machine
integer), share_floor_with (the exact floor to a step by multiplication,
the 1099 correction loop's arithmetic), and split_by_weights_with (the
split, with the leftover policy named: largest remainder, first absorbs,
last absorbs; the running policy stays apportion_cumulative). Each site
keeps its own mode, step, sign and leftover policy, so every figure is
the same to the digit; the frozen periods rules only gain a doc line
naming the kernel policy they equal.

Amount gains checked_div, the engine's division as distinct from
checked_div_exact.

All goldens and existing tests pass unchanged.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 00:14:26 -07:00
swaitsandClaude Opus 5.5 b304fc9a9a docs(plan): X-H1e makes BS-prepaid-2's examples depend on its pick
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Found in X-H1a's re-check: every schedule event names its convention,
so no schedule example depends on the engine's BS-prepaid-2 pick, and
for whole months from the 1st the daily and equal-months methods agree.
The fix is a schedule that takes the engine's method, with a mid-month
start, where the two differ.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 23:24:40 -07:00