Files
wanderbooks/docs/proofs/README.md
T
swaitsandDeepSeek V4.1 Flash 0cf013b578 refactor(core): the kernel and its proofs become modules, one file per sweep unit
kernel.rs is now kernel/: mod.rs keeps the laws and re-exports entries
(the old file, unchanged) plus one file per kernel-sweep unit (U1 fx, U2
round, U3 allocate, U4 total, U5 schedule, U6 ratio, U7 payroll, U8
control). proofs.rs is proofs/: mod.rs holds the original 63 harnesses and
each unit gets a file of its own. tests/kernel_bridge.rs is now
tests/kernel_bridge/main.rs plus one file per unit; Cargo still builds the
single test target named kernel_bridge.

`_kani` now scans proofs/mod.rs and proofs/*.rs and passes the fully
qualified name each file gives its harness (Kani's --exact matches only a
fully qualified name), so a harness resolves wherever it lives. It fails
when kani_slow names no harness, or when two harnesses share a name and
would make the slow list ambiguous; `just prove-list` prints every harness
with its module path and set, showing the slow list resolved without
running it.

Nothing moves in the books: the same 53 fast Kani harnesses and 118 Lean
theorems verify, and the same 1096 tests pass (27 in the bridge).

Docs: verification.md gains the kernel-sweep policy (each unit writes
docs/proofs/<unit>.md; the integrator folds the notes into
verification.md and Audit.lean in one edit per batch), and the file
references in AGENTS.md, testing.md, architecture.md, oracle.md and
spec/rules.md follow the new paths.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 11:30:47 -07:00

33 lines
1.7 KiB
Markdown

# 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` or `verify/lean/Audit.lean`.**
The integrator folds the unit notes into `verification.md`'s tables and
prose, and adds the `#print axioms` lines to `Audit.lean` in one place,
in one edit per batch, after the batch's merges.
- A unit's note lands in the same commit as its harnesses, so the proof
and its description are never apart in history.
`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`.