docs(verification): every Ledger command, and the step of the Lean model it is
bookspec proves its laws (the trial balance, the accounting equation, posted is forever) for every state its steps reach. The engine has 119 public commands and the model 14 steps, and nothing said which command is which step, so "every reachable state" read wider than it was. docs/command-steps.md is that map, command by command: 71 are the `record` step (they change how the books are kept and no figure), 11 are one step, 19 are several steps run as one, 17 are the doors a journal is replayed through, and one, `renumber_account`, is no step at all. What the map shows that was not written down before: - A renumber changes the chart's codes and the model has no step for it. - Four doors apply a journaled change without a check the model's step requires (a draft dated in a closed period, a period overlapping another, a reversal dated before its original). Books replayed from an old journal can therefore be outside the model's reachable states. The laws resting on distinct codes, acceptable entries and known accounts still hold by reading their proofs; no theorem says so yet. - The registers (assets, schedules, recurring entries, payroll runs) have proved arithmetic and no model of how they change over time. - No proof ties a Rust command to its step: bookspec's examples and the differential test do, and the page lists what that test does not reach. Each closes with Lean in bookspec; the triage (P2.5) lists them. tests/command_steps.rs keeps the map whole: a command with no row, a row with no command, a step the model does not have, or a new command marked as no step without being added to the pinned list fails the build. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
ae23efe5a3
commit
c09f492c46
6 files changed
+426
-5
No files matched your search
@@ -21,6 +21,7 @@ promise.
|
||||
| Fault injection (store) | a full disk or a cut-off append leaves whole, openable books (1) | `ledger-store/tests/faults.rs`, `store.rs` (`power_loss_at_any_byte_of_the_last_append_is_recovered`) | `just check` | ~5s | every change |
|
||||
| Concurrency (store) | a viewer reading while the books are written sees only whole books, never a false "differs" (2) | `ledger-store/tests/concurrency.rs` | `just check` | <1s | every change |
|
||||
| Model-based stateful | the Lean state machine, transcribed (3) | `tests/model.rs` | `just check` | ~3s | every change |
|
||||
| Model coverage | every public command on `Ledger` is named on `docs/command-steps.md` with the step of the Lean model it is, and the commands that are no step are a pinned list (3) | `tests/command_steps.rs` | `just check` | <1s | every change |
|
||||
| Differential: Decimal vs i64 | the kernel at two types (3) | `kernel_bridge/` | `just check` | <1s | every change |
|
||||
| Differential: GnuCash | another implementation, adjudicated (3) | `tests/oracle_gnucash.rs`, bookspec `gnucash/oracle/` | `just oracle` | ~2 min | weekly |
|
||||
| Formal proofs | Kani (bounded) and Lean (unbounded) | `src/proofs/`, `verify/lean/` | `just prove` (51 harnesses and Lean), `just prove-slow` (the 9 in the justfile's `kani_slow`, each under its own 30-minute cap); 60 harnesses in all with the checker canary (2026-10-28) | prove ~5 min and prove-slow ~8 min at four jobs on a quiet laptop (each ~25 min under heavy load; docs/verification.md, "Running it") | weekly (CI runs both) |
|
||||
|
||||
Reference in new issue
Block a user