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>
11 KiB
11 KiB
Triage, 2026-11-09
What a full evaluation of the project found, in the order it should be
worked. Each item says what is wrong, how it is known, what closes it and
who does it. "Mine" is the orchestrating session; "worker" is a delegated
model (docs/routing.md); "owner" is Steve.
The engine itself is in good shape: 36 parity items done, more than 188 Lean theorems, 97 Kani harnesses, every rule cited by its bookspec id, 95.5% of ledger-core's lines covered. Nothing below is a wrong number in the live books. The gaps are in what the gates do not see.
P0: broken now
portable-windowswas red for four pushes and nobody looked. Onlycheckwas being read. Cause: a test named a Unix path forbackup.folder. Fixed in5cad55023, pushed with0ef1ef2c2, and that commit's Windows gate read green on 2026-11-09 (all four gates green). Closed. The rule since: read all four gates after every batch push.
P1: a promise of the manual that is not kept, or a correctness risk
- The kernel rule is not met and nothing enforced it. Bar item 1
says money arithmetic lives in
kernel/and nowhere else.scripts/raw-decimal-arith.sh(95ae7717d) asks the compiler, and at8ad55e82ait lists 210 places in ledger-core that add, subtract, multiply, negate or sum aDecimaloutside the kernel: raw operators that panic on overflow, andchecked_*calls that reach rust_decimal's methods (which round silently past 28 digits) instead of the kernel's. The outer crates, after K-U9: ledger-gui 123 (the viewer computes averages, shares and totals of its own inbooks.rsand the pages; 137 before K-U9), ledger-import 18 (was 22), ledger-mcp 19, ledger-package 13, ledger-store 8, ledger-config 2, and none in ledger-cli, ledger-host, ledger-reader and ledger-vault. Closes with:- K-U11a, ledger-core: every site routed through the kernel (branch
k-u11a; a script driven by the compiler's own spans, so no site is hand-copied). 199 of the 210 are done and committed there; the last 11 waited for K-U10a's exact operations, now on main. Mine. - K-U12, the outer crates. Worker or script, decided on the counts.
- The script in
just checkat zero, so the count cannot rise again.
- K-U11a, ledger-core: every site routed through the kernel (branch
- Decimal sums and products rounded silently. Done (K-U10a, merged
e632855f1).Decimal::checked_addandchecked_mulreturn a rounded answer when the exact one needs more than 28 digits; the kernel'sAmount for Decimalnow gives the exact answer or refuses, and a foreign amount is rounded once from a 256-bit product. Within the line cap no sum moves and no golden moved. One figure a new line can book does move: 1050000010.0000000001 at 9.9999999999 books 10500000099.89, the exact product's cent, where the double rounding booked .90 (posted lines are not recomputed). What the worker's own run missed and the checks found:checked_div_exactaccepted a rounded quotient (10 / 3); the independent review's six findings, all reproduced (a refusal at steps of 27 and 28 places the docs did not state, four gaps in what the properties covered, stale sentences). Not proved: the 256-bit helpers have no Kani harness (checked against exact rationals by property instead;docs/proofs/k-u10.mdsays why). - An exact tie between shares went where Decimal's 28th digit sent
it. Done (K-U10b, merged
5e9591725). The docs and bookspec's Lean say a tie goes to the earlier part; the engine ranked rounded remainders, so 20.00 by 4/1/1 came out 13.33 / 3.34 / 3.33. The owner decided on 2026-11-09 (D-76): exact ranking from now on (13.34 / 3.33 / 3.33). No golden moved; of the engine's splits only the K-1 worksheet's share of contributed property can differ, by a cent a part. Kani then found the same rule on whole numbers: a part whose share is exact never takes a leftover unit (5 by 2/3/5 is 1, 2, 2), and the harness now asserts it with the strict bound. The worker had not run Kani; its cover would have failedjust prove. - The audit's close check (V-D3, merged
abafa94a5,09a8707e2): it checked a JPY close at a cent, and its pre-true-up bound ignored the member count. Left open: the bound covers one legacy close, not several in one set of books. - Rounding for display was done outside the kernel in ledger-gui,
ledger-import and ledger-package, each with its own copy, and the
viewer's percentages were f64. Done (K-U9, merged
0e9990f11): oneround_displaythrough the kernel, percentages by the kernel'spercent_of. A change against a zero or negative base now shows no percentage. - Recorded regression seeds that no test read. Fixed (
129a90dcf): the failures are replayed again, and a seed file no test reads fails the build. overflow-checkswas off in the release profile. An integer overflow in the shipped program wrapped silently where the test build would panic. Fixed (724edc61f), checked with a release build.- The live books are not on
documents_v2orschedule_minor_unit. Two format upgrades the code supports and the live file has not taken. Owner (exact commands when he is ready). - P12 step 2 has never run on today's code: the overnight mutation
and fuzz run (
just p12-night). Owner, overnight.
P2: the gates themselves
- CI's
checktook 72 minutes, one test binary at a time. Done (5544a3e66): five parts on five runners from one definition in the justfile, and the lint part fails if CI's list is not the justfile's. Not yet seen on CI: the first push shows it. just provehad one 1800 s cap for all 97 Kani harnesses. On a loaded machine it was cut off with no failure named. Done (fe3b10e2d): a cap per harness, and a run that does not verify everything lists what failed, what ran past its cap and what never finished.- There was no supply-chain gate. Done:
just deny(cargo-deny,deny.toml) in the lint part ofjust checkand in the weekly run. Its first run found 23 known vulnerabilities in the lock file, one unsound crate, two yanked and nine unmaintained. Closed by upgrades (quick-xml 0.42, rusqlite 0.41, rust_xlsxwriter 0.102, rmcp 3.9, rustls, tokio, zstd, pulldown-cmark); two quick-xml advisories remain for the copy typst brings, which parses nothing from outside, and are written down indeny.toml. The upgrade also found a wrong answer: the XLSX reader dropped every&and&#...;in a cell (AT&Tread asATT), since the parser reports a reference as its own event and the reader took only the text. Fixed with a test. The licence list allows two that are not plain permissive: MPL-2.0 (one crate, unchanged) and CDLA-Permissive-2.0 (Mozilla's root certificates). It allows no font licence: egui's default font set carried Ubuntu Light under the Ubuntu Font Licence, which Debian and Fedora class as non-free, so that set is switched off and the viewer names its own fonts (Inter, Hack, Noto, two symbol fonts; OFL 1.1, MIT and Bitstream Vera), each beside its licence (crates/ledger-gui/assets/fonts/README.md). - The packages carried no third-party licence notices. The fonts
(OFL, MIT, Bitstream Vera) and the MIT, Apache and BSD crates all ask
that their notice travel with a binary. Done (merged
9d1cb28f2, then two commits of mine):THIRD-PARTY-NOTICES.txtis generated from the lock file (just notices: cargo-about for the crates, the font licences beside it), compiled into the program (wanderbooks licenses), andjust notices-checkin the lint part fails when it is out of date (about 2 minutes). What checking it found: for 70 crates cargo-about could give only a licence's standard text with a placeholder where the copyright line goes (Copyright (c) <year> <copyright holders>), since their own licence file is a compound one (chrono, libm, aws-lc, the windows crates) or they were packaged with none (egui, objc2, wasmi). MIT, BSD and ISC ask for the notice itself, so the file now also gives those crates' own licence files whole, and names the repository of the 35 packaged with none. The bundled C libraries are covered: zstd's and AWS-LC's notices come from their-syscrates, and SQLite is in the public domain. The .deb, the .rpm and the Arch tarball carry the file under/usr/share/doc/wanderbooks/and the package test compares it with what the program prints; no package was built to check those entries (the firstjust package-linuxdoes). The AppImage, the .dmg and the Windows program carry it compiled in. - The Lean model of the books covers 14 steps; the Rust
Ledgerhas 119 commands, and no list mapped one to the other, so "every reachable state" covered less than it read. The inventory is done (docs/command-steps.md, kept whole bytests/command_steps.rs): 71 commands are therecordstep, 11 are one step, 19 are several steps run as one, 17 are replay doors and one is no step. What it found, each closing with Lean in bookspec (hard implementation, then the pin moves):renumber_accountis no step of the model. Arenumberstep: codes stay distinct, and every balance is the old one under the new code.- Four doors apply a change without a check the model's step requires
(
create_entry,replay_generate_recurring,replay_create_period,replay_reverse_entry), so books replayed from an old journal can be outsideReachable. The laws that rest on distinct codes, acceptable entries and known accounts still hold, by reading the proofs; aReplaySteprelation and its theorem would make that proved. - The registers (fixed assets, schedules, recurring entries, payroll runs) have proved arithmetic and no step model of how they change.
- Nothing proves a Rust command is its Lean step. Two tests check it:
bookspec's examples and the differential test (
lean_model.rs), which does not reach a standalone period, a close with explicit targets, a draft left unposted or an account added late. Extend it.
- Coverage is measured only for ledger-core and ledger-store.
- Three allocation preludes are still outside the kernel
(
try_allocate,allocate_cumulative,tax_capital::split): they prepare the remainders the kernel then apportions. Each needs a Kani harness, a Lean theorem and a bridge property. Hard implementation.
P3: drift and debt
plan/roadmap.mdPhase 3 and a few other pages describe an older state.- bookspec: 39 CHOICE options and 2 rules (BS-asset-9, BS-partner-16) without examples; the second implementation (X-O, hledger), X-K2 and L-G4 are not started.
ledger.rsis past 9,000 lines;reports.rs,parties.rsandcashflow.rsare large too. Not a correctness problem.
The owner's alone
Mac, Windows and clean-Linux trials; the first release run; the icon;
signing (D-64); the re-audit (P10); Q-6 before P9b.
Order of work
- Land what is in flight: V-D3, K-U9, K-U10a, K-U10b (all four done).
- K-U11a on top of them, then K-U12, then the detector in
just check. overflow-checks, the CI split,just prove's cap,cargo-deny(all four done).- One gate at the end (
just check,just prove), one push, four gates read. - The steps the inventory found missing (bookspec), the allocation preludes, then bookspec's examples and second implementation.