Commit Graph
215 Commits
Author SHA1 Message Date
swaitsandClaude ef86f7820a build(check): every crate is held at zero Decimal arithmetic outside the kernel (K-U12)
The viewer was the last crate with arithmetic of its own on amounts. With
it at zero, `just kernel-only` runs the detector over all eleven crates,
and it now fails when a folder under crates/ is not in its list, so a new
crate cannot do money arithmetic of its own from the day it is added.

Why it matters for the books: the proofs (Kani, Lean) are about the
kernel. A sum or a product computed anywhere else is one they say nothing
about, and rust_decimal's own operators either panic or round without
saying so. Bar item 1 of AGENTS.md is now a property the compiler checks
for the whole workspace, not a rule to remember.

Checked on main after the merge: the detector reads 0 places and 0
waivers for ledger-gui, the crate's whole test suite passes in one run
(300 passed, 0 failed, 1 ignored), clippy with warnings denied and fmt
are clean.

docs/proofs/k-u12.md is the account: the 183 places by crate, the rule
each kind followed, and the decision for every site that was not a plain
sum or sign.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-10 01:55:11 -07:00
swaitsandClaude 0de906e9ed docs(plan): K-U11a landed: the triage and the status say so
The kernel rule holds in ledger-core and is held by the lint part for
five crates; the six outer crates with places left are K-U12. The
traceability gate's counts are 62 functions and 16 listed exceptions
(kernel::rescale_exact is the sixteenth).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 23:42:15 -07:00
swaitsandClaude c5c57aaf4b docs(plan): K-U10 landed: the triage, the status and the log say so
The triage marked exact Decimal arithmetic and the tie rule as in
flight; both are on main. It now says what each closed, the one figure
a new foreign line can book differently (the exact product's cent,
10500000099.89 where the double rounding booked .90; posted lines are
not recomputed), and what the checks found that the workers' own runs
did not: an exact division that accepted a rounded quotient, the six
review findings, and the Kani cover the tie change made unreachable.

The comment in add_line_fx said a 20-place product past 7.9e8 rounds
twice; since K-U10 the kernel holds that product in 256 bits and rounds
once. The K-U1 note's open edge points at the unit that closed it.

Three lines in the delegation log: the two hard implementations and the
review.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 22:41:34 -07:00
swaitsandClaude 5e9591725a merge: a tie between shares goes to the earlier part, exactly (K-U10b, D-76)
The rule (BS-partner-1, bookspec's Apportion) is that leftover cents go
to the largest remainders, ties to the earlier part. The engine ranked
the difference of quotients rounded at Decimal's 28th digit, so an exact
tie went where that digit sent it: 20.00 by 4/1/1 came out 13.33 / 3.34 /
3.33. It now ranks the exact remainder, whole x weight - part x total,
and gives 13.34 / 3.33 / 3.33. The owner decided for the exact ranking on
2026-11-09 (D-76, recorded here).

What moves: no golden, nothing between two parts or by equal weights, at
most a cent a part elsewhere (tests/kernel_bridge/ties.rs measures it).
Of the engine's splits only the K-1 worksheet's share of contributed
property divides by a total that is not one; a convention's split and the
frozen close rule already ranked exactly. Posted splits are not
recomputed.

Changed in the merge:
- The ranking's two products are the rounding ones (checked_mul_rounded).
  The kernel's checked_mul is exact or refused since K-U10a, and would
  refuse a split by weights of 27 places; the split is made, ranked by
  the nearest figures Decimal holds. A test splits by thirds, sevenths,
  ninths and elevenths at 27 and 28 places, both signs.
- Kani failed the unit as it came: with the exact ranking a part whose
  share is exact never takes a leftover unit (5 by 2/3/5 is 1, 2, 2, where
  i64's truncated quotients gave 2, 1, 2), so the cover "a part exactly
  one step above its truncated share" could not be reached. The harness
  split_by_weights_within_one_step now asserts the strict bound and that
  an exact share takes no unit; both covers are reached.
- docs/verification.md also takes K-U10a's account (sums and products
  exact or refused), which closes the edges it listed as pinned.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 22:39:13 -07:00
swaitsandClaude 164adc0b32 docs(plan): the notices landed: what checking them found, and the log line
Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 22:00:44 -07:00
swaitsandClaude c09f492c46 docs(verification): every Ledger command, and the step of the Lean model it is
bookspec proves its laws (the trial balance, the accounting equation,
posted is forever) for every state its steps reach. The engine has 119
public commands and the model 14 steps, and nothing said which command is
which step, so "every reachable state" read wider than it was.

docs/command-steps.md is that map, command by command: 71 are the
`record` step (they change how the books are kept and no figure), 11 are
one step, 19 are several steps run as one, 17 are the doors a journal is
replayed through, and one, `renumber_account`, is no step at all.

What the map shows that was not written down before:

- A renumber changes the chart's codes and the model has no step for it.
- Four doors apply a journaled change without a check the model's step
  requires (a draft dated in a closed period, a period overlapping
  another, a reversal dated before its original). Books replayed from an
  old journal can therefore be outside the model's reachable states. The
  laws resting on distinct codes, acceptable entries and known accounts
  still hold by reading their proofs; no theorem says so yet.
- The registers (assets, schedules, recurring entries, payroll runs) have
  proved arithmetic and no model of how they change over time.
- No proof ties a Rust command to its step: bookspec's examples and the
  differential test do, and the page lists what that test does not reach.

Each closes with Lean in bookspec; the triage (P2.5) lists them.

tests/command_steps.rs keeps the map whole: a command with no row, a row
with no command, a step the model does not have, or a new command marked
as no step without being added to the pinned list fails the build.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 21:00:11 -07:00
swaitsandClaude ae23efe5a3 docs(plan): K-U9 landed: the log line, and the outer crates' counts after it
The detector, run again on the three crates K-U9 touched: ledger-gui
123 places of money arithmetic outside the kernel (was 137),
ledger-import 18 (was 22), ledger-package 13 (unchanged: its sums are
totals, not display rounding).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 20:44:40 -07:00
swaitsandClaude 7359d700d9 docs(plan): the 2026-11-09 triage: what a full evaluation found, in order
One page (plan/2026-11-09_TRIAGE.md) of what is missing or not as the
manual promises, each item with how it is known, what closes it and who
does it. The engine's numbers are not in question; the gaps are in what
the gates did not see: a red Windows gate nobody read, 210 places in
ledger-core and 201 in the outer crates that do money arithmetic outside
the kernel, Decimal sums that round silently, a tie between shares that
went where the 28th digit sent it (the owner's decision D-76: the
earlier part, exactly), no supply-chain gate, no third-party notices in
the packages, and a Lean model of 14 steps against about 100 commands.

docs/routing.md: Muse Code still lists no Ember (19:30 MST).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 19:50:40 -07:00
swaitsandClaude Opus 5.5 17c9f32be7 docs(plan): K-U9 does not close until the viewer's percentages are Decimal
K-U6's review: ledger-gui's fmt::pct_change divides money amounts in f64
and prints the result, a money path by AGENTS.md's first non-negotiable.
It predates the sweep and routing it through percent_of would change
what it shows (it divides by the absolute previous figure), so it waits
for K-U9, which now names it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 09:25:38 -07:00
swaitsandClaude Opus 5.5 b3ee97a94f docs(plan): S-E5, the old Rule n labels in wanderbooks move to statement positions
S-C8 dropped BS-statement-3's and BS-partner-3's Rule n labels, which
had drifted from their positions; wanderbooks' cash-flow code and tests
still cite them by label (Rule 11 is statement 16).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:49:18 -07:00
swaitsandClaude Opus 5.5 7a5cb6873a docs(status): 2026-11-09, P14 most of the way
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
What landed since yesterday's status, unit by unit, what the reviews and
the units found and fixed, and what is next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:34:49 -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 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
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 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
swaitsandClaude Opus 5.5 71df823080 docs(plan): X-H1 in five slices, one after another
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
Every slice adds to the same four files (the schema, its derivation, the
Lean runner and the adapter), so they cannot run in parallel; split by
what the schema must learn, A/R and A/P reading first (the most rules
for one new event and two queries).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 20:15:30 -07:00
swaitsandClaude Opus 5.5 9ac8f4f768 docs(plan): S-E2 moves the kept output citations to bookspec ids
S-E rewrote every rule citation in comments, docs and tests, but kept
13 in program output and one golden unchanged: output is a contract,
and a golden only changes when recomputed by hand. S-E2 changes them
together, after checking none is stored in the books.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:44:59 -07:00
swaitsandClaude Opus 5.5 7a177a3cfc docs(status): 2026-11-08, P14 under way
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:14:44 -07:00
swaitsandClaude Opus 5.5 61a381b921 docs(plan): K-U10 makes Decimal's multiply exact-or-None too (found by K-U1's fix)
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:51:50 -07:00
swaitsandClaude Opus 5.5 7ed3f431de docs(plan): V-D2, tests where coverage is thinnest
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:07:05 -07:00
swaitsandClaude Opus 5.5 ed9adaeec5 docs(plan): D-75, foreign amounts and rates take at most 10 places
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:06:14 -07:00
swaitsandClaude Opus 5.5 b24062e8fa docs(plan): K-U10, the Decimal sum exact at the edge (found by K-U4)
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:50:14 -07:00
swaitsandClaude Opus 5.5 27e47a2b51 docs(plan): D-74, any rule a command breaks is a conformant refusal
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:48:58 -07:00
swaitsandClaude Opus 5.5 9d58502a09 docs(plan): X-I checks ids-issued only grows against the base commit
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:45:02 -07:00
swaitsandClaude Opus 5.5 512352ecec docs(plan): every CHOICE is a record now; the ones no example shows go on the allow-list
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:50:32 -07:00
swaitsandClaude Opus 5.5 cbcb7f07a6 docs(plan): X-H1 carries the 16 CHOICEs no example can show yet
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:48:46 -07:00
swaitsandClaude Opus 5.5 c5fc16cad6 docs(plan): D-73, every reversal is dated on or after its original
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:07:04 -07:00
swaitsandClaude Opus 5.5 3cd251255d docs(plan): S-C7, embedded CHOICEs become their own records
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:47:03 -07:00
swaitsandClaude Opus 5.5 959464ec53 docs(plan): product rules are WB-<area>-<n>; each content unit reduces its own claims file
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:35:26 -07:00
swaitsandClaude Opus 5.5 66d9b7ac54 docs(plan): P13 step 6 names bookspec's pin after the history rewrite
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:11:47 -07:00
swaitsandClaude Opus 5.5 c99a24893c docs(plan): P14, bookspec the definitive spec, the kernel sweep, D-68 to D-72
The owner's decisions of 2026-11-08 and the plan built from the two
audits: bookspec becomes the specification (one structured record per
rule with a plain-English description, the laws proved once in its
Lean, wanderbooks keeping claims and WB-n product rules), every money
computation moves into the proved kernel, the Lean model is run against
the code, and hledger joins GnuCash as an oracle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:03:07 -07:00
swaitsandClaude Opus 5.5 c433bc5062 merge: the kernel sweep and hledger audit (commit 9369c1f4; plan input)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:02:11 -07:00
swaitsandClaude Sonnet 5.5 671d2fd6cc docs(plan): bookspec audit
Read-only audit of what it takes to make bookspec the definitive
accounting specification: the 45 rules classed (accounting law,
convention/choice, format, product) with bookspec's completeness for
each, the 27 vendored sources and their licences, the Lean drift and a
verified lake require, the golden files as candidate examples, the
executable reference model (decidability, soundness, TOML in Lean), and
a unit breakdown with dependencies and file ownership.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 09:58:18 -07:00
swaitsandDeepSeek V4.1 Flash 9369c1f45a docs(plan): kernel sweep and hledger audit
Read-only audit of money arithmetic outside kernel.rs: 211 sites
(169 must move, 35 display-only, 7 not money), 76 raw/panic-capable
operators, grouped into nine sweep units with kernel signatures, Kani
harnesses, bridge properties, Lean laws, and a module layout that keeps
parallel units from conflicting. Also assesses hledger as a second
semantic oracle: what it can compare, how to map the journal, the
display-precision trap, a pinned static 1.52.4 image, and an hledger
engine adapter for bookspec.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 09:56:28 -07:00
swaitsandClaude Sonnet 5.5 aa1331c8bd docs: law 39 names its Lean theorems
Law 39 said no Lean theorem was needed because the Books model has no
tax categories. That reasoning was wrong: the law is pure kernel
arithmetic, like Prorate's roundUnit laws, and needs no Books model.
verify/lean/Wanderbooks/Deductible.lean now proves it at any size.

verification.md law 39 lists the Lean theorems in the usual format and
states the split plainly: Lean proves the law on integers over a common
denominator (one rounding, Prorate.roundUnit on the magnitude, signed
after); Kani proves the code on i64; the bridge and exact-reference
properties carry it to Decimal; overflow stays outside the model.
rules.md B-32's Checked line and plan/STATUS.md name the Lean file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 08:14:49 -07:00
swaitsandClaude Opus 5.5 5353b5ae58 docs(status): the deductible share is kernel arithmetic, proved (2026-11-08)
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 07:01:23 -07:00
swaitsandClaude Opus 5.5 7aa1297840 docs(status): 2026-11-07, eleven golden files, the floor to 36, D-67
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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 12:11:45 -07:00
swaitsandClaude Opus 5.5 30bbf9a1ba docs: B-32 names D-67 and its tests; the tax worksheet notes the rounding is decided
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
Review notes on the round-once change: B-32's Status line now lists the
owner's 2026-11-07 CHOICE and its Checked line the two tests that pin
it; the Form 1065 worksheet's two remarks that no rule stated the
rounding now say D-67 settled it (the golden, one account per
category, is unchanged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 12:10:52 -07:00
swaitsandClaude Opus 5.5 107571fd5e merge: the tax summary rounds a category's deductible amount once (D-67; branch t3/tax-summary-round-once, 5b1f9d02; reviewed)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 12:10:39 -07:00
swaitsandMuse Wonder 1.0 5b1f9d0232 docs: D-67, the tax summary rounds once per category
Record the owner's 2026-11-07 decision in rules.md B-32 and as D-67 in plan/served.md 10.1: a category's deductible amount is the exact sum of its accounts' shares, rounded once to the cent, following B-21's 'round off only the total'.

Co-Authored-By: Muse Wonder 1.0
2026-11-07 12:03:43 -07:00
swaitsandClaude Opus 5.5 341ef2eb6e merge: golden file for the audit workpaper (branch t3/audit-workpaper-golden, 5e526d1c; reviewed and recomputed independently, review fixes applied)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 11:59:42 -07:00
swaitsandClaude Sonnet 5.5 5e526d1cd9 test(core): the audit golden derives its 1099 finding from a posted payment
The audit golden used to hand the vendor and amount to the audit; the
ledger held no payment to that vendor. Now the fixture adds the vendor
(Ledger::add_vendor, which makes its party) and posts entry 5, 900.00 of
supplies paid from the bank on 2026-03-10 with a receipt, 1099 decision
left undecided. The audit's 1099 input is built as ledger-mcp's
audit_findings builds it: ledger_package::vendor_1099_report(year 2026,
as of 2026-03-31), keeping the vendors with decision_needed. Because the
books name the bank as their cash account, the cash-flow footing is tried
the same way instead of handed in as None.

Recomputed by hand (worksheet): opening raised to 3,000.00 so the bank
stays positive (860.00 = 3,000 - 40 - 1,200 - 900); trial balance 3,000.00
= 3,000.00; assets 2,060.00 = equity 3,000 - 940; net income -940.00 =
current earnings; cash flow operating -2,140.00 + financing 3,000.00 =
+860.00 = change in cash. The vendor's 900.00 is under the 2026 threshold
of 2,000.00 (B-19, status under_threshold), yet decision_needed is
has_undecided && hi(U) > 0, so the code flags it; the worksheet records
that this is the code's rule, which B-19 does not state separately. The
payment debits Supplies (already categorized) and is entry 5 so the draft
stays entry 4: no other finding changes, and the golden JSON is unchanged.

The worksheet no longer says B-45 gives the severities or the checks'
list: B-45 asks for a deterministic, fixed-order list; the severities are
the CODES table's, the code's own CONVENTION, which this golden pins. It
also lists which checks the golden leaves silent and that tests/audit.rs
seeds each one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 11:59:13 -07:00
swaitsandClaude Opus 5.5 0162ee436e docs(parity): draft states and discard, and the one evidence gate, are done, floor 35
Both rows waited on a hand-verified golden covering a discard. One store
fixture now pins every draft's state, each entry's evidence requirement
(a reversal exempt by origin above the threshold, D-47), the gate's two
refusals, a discard that moves no balance and spends no id, and a close
refused while a draft holds the period and accepted after its discard.
A second model (Muse) recomputed every value independently from B-43
and D-47 and showed a wrong balance, a flipped exemption and a bypassed
gate each fail the test. Worksheet: the closing entry is pinned under
close_after_discard, not posted_entries (review note).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 11:57:14 -07:00
swaitsandClaude Sonnet 5.5 2593931c47 test(store): golden file for draft states, discard and the evidence gate
One fixture serves both parity rows (draft states and discard; the one
evidence gate). A Store fixture, because the gate's receipt-on-file half
lives in the store. New fixture, built like books_for_drafts and extended.

Hand-computed in plan/golden-worksheets/draft-states-and-evidence-gate.md,
before serializing anything:
- Requirement (B-43 inv. 2, threshold strictly > 25.00): drafts of 40.00,
  60.00 and 100.00 are Required; 12.50 is Exempt (policy); the reversal
  (debits 100.00) is Exempt by origin (D-47, D-12); the closing entry
  (52.50) is Exempt by origin. Receipt counts are pinned beside them: the
  gate refuses the 40.00 and 60.00 drafts (no receipt) with the journal
  head unchanged, then lets the rest post; the reversal has no receipt.
- Trial balance 2026-01-31 before and after the discard of the 60.00
  draft: Cash 447.50 Dr, Equity 500.00 Cr, Software 52.50 Dr, totals
  500.00; identical after the discard, next entry id 7 both times.
- The close is refused while the draft is open (B-12), accepted after the
  discard: Dr Retained Earnings 52.50 / Cr Software 52.50 (a loss), id 7;
  trial balance then 447.50 Dr, 500.00 Cr, 52.50 Dr.
Code and hand values agreed on the first run. Strength: four scratch edits
of the golden (a balance, a decision, a discard reason, the next id) each
fail the test.

Adds serde::Serialize to evidence::Requirement (tagged, snake_case) so the
gate's result can be pinned.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 10:39:36 -07:00
swaitsandDeepSeek V4.1 Flash 3fa0bddfda test(core): golden file for the audit workpaper
The audit's statements programme (rules.md B-45) now has a golden for one
small book, hand-worked from B-45 in plan/golden-worksheets/audit-workpaper.md:
2,000.00 of capital, a 40.00 purchase with no receipt, a year of prepaid
insurance never posted, a 5.00 draft, and one Revenue account with no tax
category. Through 2026-03-31 that gives one failure (evidence_missing,
entry 2, debits 40.00 over the 25.00 threshold) and four warnings: draft 4
on 2026-02-10, schedule 1 with 3 months / 300.00 due from 2026-01-31,
account 4100, and vendor Tobin Harlow Supply at 900.00. Trial balance,
equation, P&L articulation, control accounts, closes, assets, settings and
the receipted entries are all silent.

The golden holds the workpaper's statements data (scope, through, summary,
findings). Hashes, the figure head and the programme version are not
hand-verifiable, and the static check catalogue is not a finding, so they
stay out; the worksheet says so. The first draft mis-marked evidence_missing
a warning: the table and CODES say failure, the prose was wrong, and both
the worksheet and the golden were corrected to the books.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-07 10:38:59 -07:00
swaitsandClaude Opus 5.5 de584309fc merge: golden files for the 1099 worksheet (with a recorded business card's exclusion) and prepaid and deferred amortization (branch t3/golden-1099-prepaid-amortization, 06b571c1; reviewed and recomputed independently)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 10:30:49 -07:00
swaitsandClaude Sonnet 5.5 06b571c109 test(core): the 1099 golden covers a recorded business card's exclusion
The golden's fixture charged Sam's 5,000 to 2100 Credit Card with no
business-card payment method recorded, so by B-19 ("anything else" row)
the charge landed in no bucket and the golden pinned no excluded_card
figure at all, though the parity row claims card exclusion.

The golden test now records 2100 as a business-card method (books() is
untouched; other tests rely on its unrecorded card). Worked by hand from
B-19's table before running: #8's Cr 2100 is a company card's account, so
the line is card (excluded) 5,000; Dr 6000 is an expense, no payment
line; the entry nets to card 5,000 alone. So in 2026 Sam gets
excluded_card 5,000, paid 0, undetermined 0, still under_threshold
(F = U = 0; a card is never the vendor's reason), and
excluded_card_payments lists entry 8, 2026-04-01, vendor 3, 5,000,
instrument null (untagged). Every bank payment, the untagged note and all
of 2025 are unchanged. The code agreed with every hand figure; the golden
differs from its predecessor in exactly those two fields.

cash_paid_per_vendor_and_who_is_reportable now also asserts that on the
unrecorded books() Sam's card charge is in no exclusion bucket and the
card list is empty, keeping the unrecorded case covered.

Vendor1099Report, Vendor1099Line and Payment1099 drop the unused
Deserialize derive (Serialize stays for the golden).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 10:30:31 -07:00
swaitsandDeepSeek V4.1 Flash 72f7bcece9 test(core): golden file for prepaid and deferred amortization
The two hand-verified amortization fixtures in schedules.rs now have one
golden covering both plans, their rounding, their remaining balance and
the statements they move. Recomputing them by hand from rules.md B-16
(monthly_even: each period total/months to the cent, the last period
taking the remainder) before serializing:

- Prepaid: 1,200.00 of insurance from 2026-03-01 over 12 months is
  100.00 a month exactly. March-May are posted, so 300.00 is expensed and
  900.00 remains; the balance sheet carries 900.00 of prepaid.
- Deferred: 1,000.00 from 2026-01-01 over 3 months is 333.33, 333.33 and
  333.34 (the last period absorbs the 0.01 remainder), summing to
  1,000.00 exactly. All three are posted, so 1,000.00 is revenue and
  nothing remains a liability.

Every period, cumulative and remaining figure agrees with the hand
worksheet in plan/golden-worksheets/amortization-plans.md. No existing
golden or assertion changes.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-07 10:24:53 -07:00
swaitsandDeepSeek V4.1 Flash 025c0942ee test(core): golden file for the 1099 vendor worksheet
The `books()` fixture's worksheet is now a golden: 2025 and 2026, so the
year boundary and both thresholds (600 and 2,000) are pinned. Recomputing
it by hand from rules.md B-19 before serializing the report:

- Dana: 1,500 bill payment + 700 direct = 2,200 in 2026 (reportable at
  2,000); the 300 dated 2025-12-30 counts only in 2025 (under 600).
- Ace Rentals: 1,200 in January; the February 1,200 and its reversal net
  to zero, so 1,200, under 2,000.
- Sam: 5,000 charged to 2100, which no cash, financing or business-card
  method names, so no payment line: paid 0, under. The card exclusion is
  the fixture's documented "nothing counts" case.
- Bigco: 9,000 from the bank while never decided: undetermined, a decision
  needed, never reportable until one is made.
- The untagged 50.00 contract-labor payment is the quieter note.

Every field agrees with the hand worksheet in
plan/golden-worksheets/1099-worksheet.md. `Vendor1099Report`,
`Vendor1099Line` and `Payment1099` gain serde derives so the report can be
serialized; no existing golden or assertion changes.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-07 10:24:15 -07:00
swaitsandClaude Opus 5.5 805633ef7b merge: golden files for the date-range P&L, the balance sheet and trial balance as of a date, and the general ledger (branch t3/golden-pl-balance-trial-gl, c5824c4f; reviewed and recomputed independently)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 10:05:13 -07:00