merge: verify/lean requires bookspec's Lean; the laws live once (L-F2; branch t3/lean-laws-bookspec-dependency, 4d9c73de)
The ten Lean files were code-identical to bookspec's (checked per file); wanderbooks keeps a thin Wanderbooks.lean importing Bookspec and audits the same 151 theorems. The Lean pin moves to 62c0bf26 at the merge, the rev the Rust checker was pinned to after S-B (the new pin test caught the difference), and lake-manifest.json is regenerated. Conflicts with K-U0 and S-D0 resolved: the proofs/ path and the bookspec Lean path both kept, L-F2's Deductible path fix applied to the claims file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
05702b5a34
25 files changed
+265
-3837
No files matched your search
@@ -385,7 +385,7 @@ their first `settings.set` naming the key, B-27); `ledger-mcp` `books.add_accoun
|
||||
`tests/tax.rs` (the rounding: `a_category_rounds_its_deductible_amount_once_not_per_account`,
|
||||
`a_category_rounds_once_across_different_percents`); Kani
|
||||
`deductible_amount_rounds_once`, `deductible_amount_refuses_overflow`;
|
||||
bridge `deductible_amount_agrees`; Lean `verify/lean/Wanderbooks/Deductible.lean`
|
||||
bridge `deductible_amount_agrees`; Lean `bookspec/lean/Bookspec/Deductible.lean`
|
||||
(`Deductible.near`, `tie_away_pos`, `tie_away_neg`, `sign`, `neg`, `of_sum`,
|
||||
`per_account_differs`, `scale_books`, `scale_percents`: the one rounding, at any
|
||||
number of accounts and any sizes); `ledger-store` `tests/store.rs`
|
||||
|
||||
+3
-3
@@ -2548,7 +2548,7 @@ B-14) are the first.
|
||||
| End-to-end | SKIP for the core (a library) | the MCP tests through a real books server (ledger-cli) cover the journeys |
|
||||
| Security properties | SKIP for the core (no roles, no secrets) | the first permission concept, or a secret-bearing field |
|
||||
| Concurrency stress | SKIP for the core (no shared state); DONE for the store's writer + viewer (found the false "differs") | the first `Arc`, atomic, or lock in the core; the MCP server's HTTP transport shares one store across sessions (next) |
|
||||
| Lean: apportion's sum law for any n | DONE (2026-10-14) | verify/lean/Wanderbooks/Apportion.lean: ranks are a permutation of 0..n-1 (strict total order + pigeonhole, core Lean only), so exactly u parts get a unit and one the fraction; `apportion_sum` and `apportion_sum_of_shortfall`, standard axioms only |
|
||||
| Lean: apportion's sum law for any n | DONE (2026-10-14) | bookspec/lean/Bookspec/Apportion.lean (once `verify/lean/Wanderbooks/Apportion.lean`; D-69): ranks are a permutation of 0..n-1 (strict total order + pigeonhole, core Lean only), so exactly u parts get a unit and one the fraction; `apportion_sum` and `apportion_sum_of_shortfall`, standard axioms only |
|
||||
| ASC paragraphs not yet read | DONE (2026-10-14) | read in the ASC basic view (`docs/spec/sources/fasb-asc.md`): all confirm the rules; one citation fixed (230-10-45-14(b), not (2)) |
|
||||
| GnuCash's own close | OPEN | the oracle books closes as ordinary entries; comparing GnuCash's Close Book needs its Scheme API |
|
||||
| Import: spec-blind suite, footing properties, mutation | DONE | sources vendored (Intuit bank CSV and IIF, ECMA-376/Excel numbers, IRS form lines); specs on every module; tests/spec_import.rs (spec-blind, footing and round-trip properties, XLSX read back from its XML, layout and styles); fuzz_import_csv; templates checked against the engine's control accounts; mutation one equivalent left |
|
||||
@@ -2638,7 +2638,7 @@ the wiring into verify, the digest and Needs attention) is part B.
|
||||
is the definition), `bounds_kept_is_the_definition_on_books_in_bounds`
|
||||
(the command's check is the definition on books in bounds, and never
|
||||
lets a day get worse on books out of bounds).
|
||||
- **Lean:** `Wanderbooks/Documents.lean`: `control_agrees` (GL = Σ docs
|
||||
- **Lean:** `bookspec/lean/Bookspec/Documents.lean`: `control_agrees` (GL = Σ docs
|
||||
+ unattached, for any lines, and through any day), `Step.document_unattached`,
|
||||
`Step.reverse_moves`, `reverse_twice`, `Reachable.unattached_zero`,
|
||||
`Reachable.control_is_documents`. The steps include assigning a
|
||||
@@ -3397,7 +3397,7 @@ in the same call.
|
||||
`crates/ledger-gui/tests/view_model.rs`: `a_write_off_is_flagged_for_the_cpa`
|
||||
(one item, "Write-off awaiting the CPA's note", the same through the
|
||||
server's read of the store and the viewer's snapshot).
|
||||
- **Lean, `Wanderbooks/Documents.lean`:** `Step.writeOff` (a tagged
|
||||
- **Lean, `bookspec/lean/Bookspec/Documents.lean`:** `Step.writeOff` (a tagged
|
||||
control line and an untagged expense line: a `Step.document` in shape),
|
||||
`Step.writeOff_unattached` (it moves nothing unattached, so
|
||||
`control_agrees` and `Reachable.control_is_documents` still hold),
|
||||
|
||||
+16
-11
@@ -33,10 +33,12 @@ smallest unit; the four proration charge harnesses at `i32`) and
|
||||
explores every input in the bounds. (Grouping by
|
||||
account is proved through `movements_into`, the allocation-free core
|
||||
that `movements` wraps: symbolic heap growth is beyond what the model
|
||||
checker explores in reasonable time.) The Lean model in
|
||||
`verify/lean` restates each function over `Int` (proration over `Nat`,
|
||||
checker explores in reasonable time.) The Lean model (bookspec's, which
|
||||
`verify/lean` requires) restates each function over `Int` (proration over `Nat`,
|
||||
both of `prorated_through`'s branches) and proves the laws with no bounds
|
||||
at all.
|
||||
at all. That model lives once, in bookspec's Lean (`bookspec/lean/`,
|
||||
namespace `Bookspec`); `verify/lean` requires it at the same pinned rev as
|
||||
the Rust checker (D-69) and holds no copy of its files.
|
||||
|
||||
### Kernel sweep
|
||||
|
||||
@@ -55,7 +57,7 @@ file (see `docs/proofs/README.md`).
|
||||
|
||||
Each law, and what proves it. Kani harnesses are in
|
||||
`crates/ledger-core/src/proofs/`; Lean theorems are in
|
||||
`verify/lean/Wanderbooks/`.
|
||||
`bookspec/lean/Bookspec/` (the laws live once, in bookspec: D-69).
|
||||
|
||||
### Entries
|
||||
|
||||
@@ -519,7 +521,7 @@ it. Rule: `docs/spec/rules.md` B-38.
|
||||
`crates/ledger-store/tests/arap_props.rs` (`subledger_equals_control`
|
||||
after every operation, at every date; `status_is_a_function_of_journal
|
||||
_and_date`; `reversal_twice_restores_state`).
|
||||
- Lean, `verify/lean/Wanderbooks/Documents.lean`: `control_agrees` and
|
||||
- Lean, `bookspec/lean/Bookspec/Documents.lean`: `control_agrees` and
|
||||
`control_agrees_through` (the identity, for every account and through
|
||||
every day), `Step.document_unattached` (an untagged legacy line only
|
||||
grows `unattached`, never a document), `Step.reverse_moves` and
|
||||
@@ -849,8 +851,8 @@ panic, the import roots' lockdown (a property over generated paths, and a
|
||||
component walk that refuses a folder swapped for a link; removed with the
|
||||
import roots in P2 slice 5), files with full
|
||||
TINs kept out of the books (B-26), and the agent text lint. Out of scope
|
||||
for proof today: the format gate and the walk are I/O, and the model in
|
||||
`verify/lean` stops at the ledger.
|
||||
for proof today: the format gate and the walk are I/O, and bookspec's Lean
|
||||
model stops at the ledger.
|
||||
|
||||
### P3: the odd cent (2026-10-20)
|
||||
|
||||
@@ -888,10 +890,13 @@ just prove-all # both
|
||||
```
|
||||
|
||||
`just prove` runs every Kani harness but the justfile's `kani_slow`, in
|
||||
parallel (`-j $(nproc)`), the whole run under a 30-minute timeout; builds
|
||||
the Lean proofs (seconds); and fails if any headline theorem depends on
|
||||
anything beyond Lean's standard axioms (`propext`, `Quot.sound`,
|
||||
`Classical.choice`). In particular, `sorryAx` fails it. `just prove-slow`
|
||||
parallel (`-j $(nproc)`), the whole run under a 30-minute timeout; fetches
|
||||
and builds bookspec's Lean proofs (seconds; the git dependency is pinned in
|
||||
`verify/lean/lakefile.toml` and its manifest); and fails if any theorem
|
||||
depends on anything beyond Lean's standard axioms (`propext`,
|
||||
`Quot.sound`, `Classical.choice`). It audits all 151 theorems: the 118
|
||||
headline laws and the 33 named laws in `Laws.lean` that cite them. In
|
||||
particular, `sorryAx` fails it. `just prove-slow`
|
||||
runs the slow harnesses, `$(nproc)` at a time, each under its own
|
||||
30-minute timeout. Both fail if a harness they ask for isn't verified (the
|
||||
count is checked), if any cover is unsatisfiable (a vacuous proof), or if
|
||||
|
||||
Reference in new issue
Block a user