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
@@ -188,6 +188,13 @@ Each step carries the checks the engine makes before it mutates. These
|
||||
theorems hold in **every state reachable from empty books, by any
|
||||
sequence of commands, of any length**:
|
||||
|
||||
"Commands" there are the model's steps. Which command of the engine is
|
||||
which step is `docs/command-steps.md`: 119 commands, of which one
|
||||
(`renumber_account`) is no step, and 17 are the doors a journal is
|
||||
replayed through, four of which do not make a check the model's step
|
||||
requires. That page says what the theorems below do and do not cover for
|
||||
each, and `tests/command_steps.rs` fails when a command has no row.
|
||||
|
||||
11. **The invariant holds**: chart codes are unique, every posted entry is
|
||||
acceptable and on known accounts, and no draft is dated in a closed
|
||||
period. (That last one is why the store can journal a post before
|
||||
|
||||
Reference in new issue
Block a user