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>
8.3 KiB
8.3 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 wait for K-U10a's exact operations. 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 round silently (K-U10a, in flight).
Decimal::checked_addandchecked_mulreturn a rounded answer when the exact one needs more than 28 digits. The kernel'sAmount for Decimalshould refuse instead. Independent review before it merges. - An exact tie between shares goes where Decimal's 28th digit sends it (K-U10b, written and measured). 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 moves, two-member books cannot differ, at most one cent per part. Merges after K-U10a (the same file).
- 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 carry no third-party licence notices. The .deb, the
.rpm, the AUR tarball and the installers hold the program and little
else. The fonts (OFL, MIT, Bitstream Vera) and the MIT, Apache and BSD
crates all ask that their notice travel with a binary. Nothing has
been released yet, so nothing is out of terms, but this closes before
the first
releaserun: one generated notices text (cargo-about for the crates, the font licences beside it), compiled into the program (wanderbooks licenses; the viewer has no About page yet), with a check in the lint part that it is current. Worker, well specified. - The Lean model of the books covers 14 steps; the Rust
Ledgerhas about 100 commands, and no list maps one to the other, so "every reachable state" covers less than it reads. First the inventory (worker, scout), then the steps that matter (hard implementation). - 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 (done), K-U9 (done), K-U10a (reviewed), K-U10b (the owner answered: exact; after K-U10a).
- 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 command-to-step inventory, the allocation preludes, then bookspec's examples and second implementation.