Files
wanderbooks/docs/proofs
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
..

Proof notes for the kernel sweep

docs/verification.md is the one place the proofs are described: the law table, the bounds, the times, and what is and isn't proved. The kernel sweep (plan/kernel-sweep-audit.md) runs several units in parallel, so editing that file from every branch would collide on every hunk. The rule instead:

  • Each unit that adds proofs writes docs/proofs/<unit>.md, where <unit> is the lowercase name of its code files (fx, round, allocate, total, schedule, ratio, payroll, control; U9 display adds no proofs). The note lists, for that unit:
    • every Kani harness it added, with the law each proves;
    • the bounds Kani explores (lines, accounts, amounts, scales), and why they are enough;
    • the measured time, alone or in a just prove run, with the machine and date;
    • every bridge property in tests/kernel_bridge/<unit>.rs, and every Lean theorem it added;
    • anything the solver could not do, and what carries it instead (Lean at any size, a bridge property, an exhaustive unit test).
  • Workers do not edit docs/verification.md. The integrator folds the unit notes into its tables and prose in one edit per batch, after the batch's merges.
  • A unit's Lean theorems go into bookspec, on the unit's bookspec branch: the theorem in lean/Bookspec/, its #print axioms line in bookspec's lean/Audit.lean. Wanderbooks keeps no audit list of its own; just prove audits bookspec's, from the pinned package (D-69).
  • A unit's note lands in the same commit as its harnesses, so the proof and its description are never apart in history.

The harness-to-law table (machine-readable)

The traceability gate (crates/ledger-core/tests/bookspec/traceability.rs) reads every note here for a table pairing each Kani harness with the bookspec law it proves:

Harness Law
round_step_is_multiple 40

The first cell must be the harness name in backticks and the second a bare integer (the number in bookspec's spec/laws.md); extra columns are allowed after them (bounds, time, verification). The gate fails:

  • a kernel pub fn whose harnesses have no such row ("lacks a law");
  • a harness listed twice with different law numbers;
  • a law whose Rules column shares no BS- id with the function's own SOURCE: line, when the function has one.

just prove finds the harnesses by scanning crates/ledger-core/src/proofs/ (mod.rs plus every <unit>.rs), not one file; just prove-list prints each harness, its module path, and whether it runs in prove or prove-slow.