merge: the traceability gate (X-J; reviewed, re-checked twice, fixes applied)
Every claim in docs/spec/claims/ now has to be backed. A yes or partly claim names where the engine enforces it and what checks it, and every name resolves strictly: a Rust item by its whole path (a method on its own type), a test by its #[test], a Kani harness by its #[kani::proof], a Lean theorem in the list bookspec audits, a path that exists. Every kernel function has a harness and a bridge property that call it, and a law whose rules its own SOURCE cites; the fourteen that cannot are listed with why, and the seven it cannot check for a law are pinned. The gate found what the claims got wrong: B-22 claimed partial enforcement of a rule the engine does not enforce (now no); WB-prepaid-2 claimed K-U5's rounding before it landed (now partly); two rules cited retired ids as live; nineteen names had moved or never existed. The reviews found three ways a wrong name could still pass, then two more; all closed, with probes that a made-up name of each kind fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
90e62e20b3
23 files changed
+3393
-36
No files matched your search
@@ -29,6 +29,25 @@ instead:
|
||||
- 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
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
# Entries: the party direction and a part's weight
|
||||
|
||||
Status: landed 2026-11-08 with the traceability gate's review fixes. Two
|
||||
kernel functions that had no proof of their own now have one; both were on
|
||||
the exception list before.
|
||||
|
||||
## The functions
|
||||
|
||||
| Function | Meaning |
|
||||
|---|---|
|
||||
| `kernel::Direction::of` | the direction of a signed amount: paid above zero, received below zero, neither at zero (BS-partner-3) |
|
||||
| `kernel::part_weight` | a month part's weight in `MONTH_L`ths: `days × MONTH_L / month_days`, exactly; `None` for a part no calendar month has (BS-asset-1, BS-prepaid-1) |
|
||||
|
||||
## Kani harnesses (`crates/ledger-core/src/proofs/mod.rs`)
|
||||
|
||||
| Harness | Law | Bounds |
|
||||
|---|---|---|
|
||||
| `direction_of_is_the_sign` | 23 | any `i64` amount; all three signs covered |
|
||||
| `part_weight_is_days_of_the_month` | 27 | `days` and `month_days` 0..=40; valid, partial, whole and invalid parts covered |
|
||||
|
||||
`part_weight_is_days_of_the_month` proves the weight formula a proration
|
||||
charge is computed from, which is law 27's statement (each part but the
|
||||
last is its days times the monthly rate); it is a lemma for laws 26-28,
|
||||
not a restatement of law 26 (that the parts sum to the total, which is
|
||||
`prorate_parts_sum_to_total` below).
|
||||
|
||||
The bookspec law each harness proves (machine-readable for the
|
||||
traceability gate, `crates/ledger-core/tests/bookspec/traceability.rs`):
|
||||
|
||||
| Harness | Law |
|
||||
|---|---|
|
||||
| `direction_of_is_the_sign` | 23 |
|
||||
| `part_weight_is_days_of_the_month` | 27 |
|
||||
|
||||
Times: measured alone with
|
||||
`cargo kani -p ledger-core --exact --harness proofs::<name>` on 2026-11-08:
|
||||
`direction_of_is_the_sign` 18 s wall (0.06 s verification, 3 covers, build
|
||||
included); `part_weight_is_days_of_the_month` 11 s wall (0.49 s
|
||||
verification, 3 covers, build included).
|
||||
|
||||
## Bridge (`crates/ledger-core/tests/kernel_bridge/entries.rs`)
|
||||
|
||||
- `direction_of_agrees`: `Direction::of` classifies the same sign at `i64`
|
||||
and `Decimal`, and each case keeps its meaning (law 23).
|
||||
- `part_weight_agrees`: `part_weight` is the same weight at `i32`, `i64`
|
||||
and `i128`, and `None` exactly for a part no month has (laws 26-28).
|
||||
- `reverse_target_agrees`: `reverse_target` is the exact opposite at both
|
||||
types. The edge strategy reaches `i64::MIN`, which `i64` refuses because
|
||||
no negation can hold it; `Decimal` can hold the negation, so the property
|
||||
compares its answer there (the exact opposite). The refusal is the
|
||||
integer proof model's bound, not the law's. The earlier bridge only
|
||||
passed it to `and_then`, which is a mention, not a call; this property
|
||||
calls it.
|
||||
|
||||
Why these laws: `Direction::of` is the sign classification the party
|
||||
direction law (23) is stated over, and `part_weight` is the weight the
|
||||
proration charges of laws 26-28 are computed from, its harness numbered
|
||||
for the law it restates most closely (27).
|
||||
@@ -88,6 +88,16 @@ carries the same laws to every `Decimal` step, and Lean to any step.
|
||||
| `fx_booked_positive_for_positive` | positive inputs book non-negative, positive once the product reaches half a unit | 3.2 s (2 covers) |
|
||||
| `fx_booked_refuses_overflow` | an overflowing product and a non-positive rate are `None`, never a panic | 2.6 s (2 covers) |
|
||||
|
||||
The bookspec law each harness proves (machine-readable for the
|
||||
traceability gate, `crates/ledger-core/tests/bookspec/traceability.rs`):
|
||||
|
||||
| Harness | Law |
|
||||
|---|---|
|
||||
| `fx_booked_is_whole_unit` | 41 |
|
||||
| `fx_booked_within_half_unit` | 41 |
|
||||
| `fx_booked_positive_for_positive` | 41 |
|
||||
| `fx_booked_refuses_overflow` | 41 |
|
||||
|
||||
What the harnesses do and do not prove, stated plainly:
|
||||
|
||||
- `fx_booked_refuses_overflow` proves **two concrete overflow cases**
|
||||
|
||||
@@ -54,6 +54,21 @@ bookspec's Lean proves them for any step.
|
||||
| `round_step_sign_preserved` | every mode: `0 <= x` gives `0 <= r`, `x <= 0` gives `r <= 0` | 13 s wall incl. build (3 covers) |
|
||||
| `round_step_refuses_nonpositive_step` | a step of zero or less is `None` | 8 s total (1 cover) |
|
||||
|
||||
The bookspec law each harness proves (machine-readable for the
|
||||
traceability gate, `crates/ledger-core/tests/bookspec/traceability.rs`):
|
||||
|
||||
| Harness | Law |
|
||||
|---|---|
|
||||
| `round_step_is_multiple` | 40 |
|
||||
| `round_step_is_nearest` | 40 |
|
||||
| `round_step_ties` | 40 |
|
||||
| `round_step_is_idempotent` | 40 |
|
||||
| `round_step_never_negative_zero` | 40 |
|
||||
| `round_step_toward_zero_bounds` | 40 |
|
||||
| `round_step_toward_neg_inf_is_floor` | 40 |
|
||||
| `round_step_sign_preserved` | 40 |
|
||||
| `round_step_refuses_nonpositive_step` | 40 |
|
||||
|
||||
The three directed-mode harnesses were added after review: the spec block's
|
||||
invariants 3, 4 and 6 had no proof of their own (Lean had the ties, Kani
|
||||
checked these two modes only at exact ties). Demonstrated: with
|
||||
|
||||
@@ -34,6 +34,18 @@ model-checking/kani#4904), each with `kani::cover!`.
|
||||
| `total_try_is_map_sum` | `total_try` of differences is the sum of the differences; a failing map fails the total | 0..=4 pairs, in-range | 5.3 s |
|
||||
| `total_overflow_is_none` | for two arbitrary `i64`s, `total` is `Some` exactly when the true sum fits; both overflow directions covered | all `i64` pairs | 0.5 s |
|
||||
|
||||
The bookspec law each harness proves (machine-readable for the
|
||||
traceability gate, `crates/ledger-core/tests/bookspec/traceability.rs`):
|
||||
|
||||
| Harness | Law |
|
||||
|---|---|
|
||||
| `total_empty_is_zero` | 4 |
|
||||
| `total_append` | 4 |
|
||||
| `total_is_sound` | 4 |
|
||||
| `total_of_is_map_sum` | 4 |
|
||||
| `total_try_is_map_sum` | 4 |
|
||||
| `total_overflow_is_none` | 4 |
|
||||
|
||||
Times: alone, `cargo kani --exact --harness`, the shared dev machine under
|
||||
`nice -n 10`, 2026-11-08. `total_append` was 115 s at runs of up to 4 and
|
||||
was reduced to up to 3 (the same law; 60 s) to keep `just prove` fast. A
|
||||
|
||||
@@ -73,7 +73,7 @@ and no one owes), leaving out payroll runs, entries marked as having no
|
||||
counterparty, entries naming only parties with no 1099 role, and entries
|
||||
reversed in the year: one count, the entries when ten or fewer, and the
|
||||
tool to tag them.
|
||||
*Enforced:* `form1099::Vendor1099Report::untagged`, `books.vendor_1099`,
|
||||
*Enforced:* `form1099::untagged_payments`, `books.vendor_1099`,
|
||||
`books.set_entry_vendor`; the digest and Needs attention.
|
||||
*Checked:* `the_untagged_note_counts_only_money_out`,
|
||||
`the_other_receipts_note_says_what_each_entry_did` (ledger-package).
|
||||
|
||||
@@ -76,7 +76,7 @@ Lean `Documents.control_agrees`, `Documents.Step.document_unattached`,
|
||||
(through role assignments and releases),
|
||||
`Documents.Reachable.control_is_documents`. The model's limits: it
|
||||
starts from empty books (legacy lines are covered by the identity
|
||||
`control_agrees` alone), it names documents by one id space (an injective
|
||||
`Documents.control_agrees` alone), it names documents by one id space (an injective
|
||||
coding of `DocRef`), and an account becoming a control account by its
|
||||
first document, holding lines from before, is outside it (those lines are
|
||||
listed as unattached).
|
||||
@@ -325,8 +325,9 @@ check_discount}`, `arap::{Application, Fee, SettleParams, SettlementRow}`,
|
||||
(`a_settlement_names_its_lines_and_replays`, `settlement_waits_for_documents_v2`,
|
||||
`legacy_payment_events_keep_the_positional_rule`), `tests/arap_props.rs`;
|
||||
`ledger-cli` `tests/documents.rs`; `ledger-package`'s aging tie-out test.
|
||||
The Lean step is `Documents.Step.document` with every control line tagged
|
||||
(`Documents.settle_unattached`); no new `Step` constructor.
|
||||
The Lean step is the document constructor of the Lean documents model, with
|
||||
every control line tagged (`Documents.settle_unattached`); no new step
|
||||
constructor.
|
||||
|
||||
### Product rules
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ those dates say. (That depreciation starts on the in-service date and that
|
||||
the register holds the asset from the acquired date are `BS-asset-1`
|
||||
rules 23-24.)
|
||||
*Enforced:* `set_asset_acquisition` / `replay_set_asset_acquisition`,
|
||||
`Ledger::asset_acquired_date`, `dispose_asset`, `Asset::set_entry`.
|
||||
`Ledger::asset_acquired_date`, `dispose_asset`, `Ledger::set_asset_acquisition`.
|
||||
*Checked:* `ledger-core` `tests/spec_asset_basis.rs` (each bound and its
|
||||
replay pair); `ledger-store` `tests/bounds.rs`.
|
||||
|
||||
@@ -103,7 +103,7 @@ run again and that run reversed is the month's run.
|
||||
|
||||
**bookspec:** `BS-asset-2`
|
||||
|
||||
**Claims:** partly (the books' own AGENTS.md follows it; the engine enforces nothing)
|
||||
**Claims:** no (no engine enforcement exists: the policy is the books' own AGENTS.md, and the de minimis and 12-month elections are made on the return)
|
||||
|
||||
**Pick:** none (AUTHORITY; procedural). The books' own AGENTS.md sets the policy; the de minimis and 12-month elections are made on the return.
|
||||
|
||||
@@ -124,11 +124,11 @@ None.
|
||||
**Pick:** `tag-and-never-reuse`: CHOICE (the owner, 2026-10-15): each asset may carry one tag, generated `PREFIX-0001` or the human's own, unique ignoring case and never reused, and the register reconciles to the cost and accumulated depreciation accounts.
|
||||
|
||||
**Enforced:** `Ledger::set_asset_tag` / `check_asset_tag_for` /
|
||||
`check_asset_tag` (`tag_in_use`, the retag keeping the old tag reserved),
|
||||
`check_asset_tag` (the tag already taken is refused, the retag keeping the old tag reserved),
|
||||
`Ledger::set_asset_serial` / `check_asset_serial`, `assets::check_asset_tag`,
|
||||
`assets::check_serial`, `reports::fixed_asset_register`.
|
||||
**Checked:** `ledger-core` `tests/spec_asset_tags.rs`; `ledger-store`
|
||||
`tests/asset_tags.rs` (`a_tag_is_unique_ignoring_case`,
|
||||
`tests/asset_tags.rs` (`a_journaled_tag_taken_by_another_asset_is_refused_on_open`,
|
||||
`a_retagged_assets_old_tag_is_never_reused`);
|
||||
`ledger-cli` `tests/spec_assets.rs`.
|
||||
|
||||
@@ -184,7 +184,7 @@ and Needs attention asks for the value.
|
||||
*Enforced:* `replay_set_asset_tax_basis`, `AssetBasis::check_legacy_journaled`;
|
||||
`ledger-gui` Needs attention.
|
||||
*Checked:* `ledger-core` `tests/spec_asset_basis.rs`
|
||||
(`a_legacy_basis_record_reads_its_book_cost`); `ledger-store`
|
||||
(`legacy_tax_basis_set_lines_replay_to_todays_figures`); `ledger-store`
|
||||
`tests/asset_tags.rs`.
|
||||
|
||||
**WB-asset-5** The tool surface never assumes a contributed property's
|
||||
|
||||
@@ -178,7 +178,7 @@ open, never a panic.
|
||||
*Enforced:* derived: `Invoice::total`/`balance`,
|
||||
`Bill::total`/`balance`, `AgingRow::total`, `ar_aging`, `ap_aging`,
|
||||
`PayrollLine::net_pay`, `payroll_entry_plan`, `parties::entry_flow`,
|
||||
`shares::share_target`, `shares::resolve`, `fixed_asset_register`,
|
||||
`shares::target`, `shares::resolve`, `fixed_asset_register`,
|
||||
`schedules::amortization_plan`, `month_end`, `depreciation_schedule`,
|
||||
`analysis::intervals`, `form1099::vendor_part`, `k1::share_property`,
|
||||
`ReceiptPolicy::entry_debits`.
|
||||
@@ -203,7 +203,7 @@ pinned; every tool over every old book).
|
||||
`Ledger::{set_draft_state, discard_draft, posted_seq}`,
|
||||
`Store::{set_draft_state, discard_draft, post_entry_checked}` (the gate the server posts a hand draft by; `Store::post_entry` stays the primitive commands and fixtures post through); events
|
||||
`entry.draft_state_set`, `entry.draft_discarded` (feature `drafts_v2`).
|
||||
**Checked:** Lean `Step.discard`, `Step.discard_keeps_books`,
|
||||
**Checked:** Lean `Step.discard_keeps_books`,
|
||||
`Step.discard_unblocks_close`; `ledger-core` `tests/invariants.rs`
|
||||
(`discard_unblocks_close`); `ledger-store` `tests/store.rs`
|
||||
(`draft_states_replay_and_project`, `drafts_v2_waits_for_the_upgrade`,
|
||||
|
||||
@@ -12,7 +12,7 @@ Rules: B-27, B-34.
|
||||
|
||||
## B-27 The journal format gate: newer is not corrupt
|
||||
|
||||
**bookspec:** `BS-format-1`
|
||||
**retired bookspec:** `BS-format-1`
|
||||
|
||||
**Claims:** no (retired 2026-11-08, D-71: wholly wanderbooks'); its one
|
||||
engine-independent sentence — a reader that does not know a record's format
|
||||
@@ -161,7 +161,7 @@ the W-9 when the vendor's W-9 flag follows it. A value in a line of a known
|
||||
type that only a newer version writes (a 1099 decision or reason kind, a
|
||||
payment method's kind) is newer, never corrupt.
|
||||
|
||||
*Enforced:* `ledger_store::format` (`JournalFormat::declared`, `require_format`, `require_feature`), `Store::ensure_feature`, `Store::declare_journal_format`, `StoreError::FormatUpgradePending`, `format::setting_feature`, `format::tax_category_feature`.
|
||||
*Enforced:* `ledger_store::format` (`format::declared`, `require_format`, `require_feature`), `Store::ensure_feature`, `Store::declare_journal_format`, `StoreError::FormatUpgradePending`, `format::setting_feature`, `format::tax_category_feature`.
|
||||
*Checked:* `ledger-store` `tests/settings.rs` (`a_change_needs_journal_format_2`), `tests/format_upgrade.rs` (`a_write_waiting_for_the_upgrade_journals_nothing`, a newer feature still refused); `tests/p2_compat.rs` (every P3 setting key and tax category needs a feature); the unit tests in `format.rs`.
|
||||
|
||||
**WB-format-3 The other way round: the format upgrade, with the owner's
|
||||
|
||||
+30
-10
@@ -84,8 +84,7 @@ None.
|
||||
**Enforced:** posted entries immutable; `ledger_store::format`
|
||||
(`JournalFormat::admit`, `gate`): a record in a format version this
|
||||
version does not know is refused as newer, neither misread nor skipped,
|
||||
and never called corrupt (statement 4). **Checked:** Lean `Step.extends`,
|
||||
`Steps.extends`; property `prop_posted_entries_immutable`; `ledger-store`
|
||||
and never called corrupt (statement 4). **Checked:** Lean `Steps.extends`; property `prop_posted_entries_immutable`; `ledger-store`
|
||||
`tests/format.rs` (`old_reader_gets_newer_journal`,
|
||||
`a_newer_line_the_next_line_chains_onto_is_newer_and_intact`,
|
||||
`damaged_journals_are_still_corrupt`).
|
||||
@@ -161,6 +160,11 @@ None.
|
||||
**Pick:** a reversal's evidence is its original's (a reversal needs no evidence of its own): CHOICE D-47 (the owner, 2026-10-26; options: a reversal's evidence is its original's / a reversal needs its own). The rest is AUTHORITY; a procedural rule.
|
||||
|
||||
**Enforced:** the MCP receipt policy (not the engine; R-13).
|
||||
**Checked:** `ledger-cli` `tests/drafts.rs`
|
||||
(`a_draft_waits_for_its_receipt_and_posts`,
|
||||
`a_reversal_needs_no_receipt_of_its_own`); `ledger-store`
|
||||
`tests/store.rs` (`draft_states_replay_and_project`,
|
||||
`drafts_v2_waits_for_the_upgrade`).
|
||||
|
||||
### Product rules
|
||||
|
||||
@@ -190,10 +194,13 @@ frees its code); the control guard and `Ledger::control_check` (B-38).
|
||||
*Enforced:* `Ledger::assign_role` / `check_assign_role`. *Checked:* `ledger-store` replay of `role.assigned`.
|
||||
|
||||
**WB-ledger-3** The account at a role's default code is the role's control account only once a document posts there (or the role is assigned to it): before that, a chart's own 1200 Equipment or a card at 2000 is the chart's.
|
||||
*Enforced and checked:* with B-23 above (`Ledger::check_controls`, the control guard, `Ledger::control_check`; `tests/spec_roles.rs`, `tests/spec_documents.rs`).
|
||||
**Enforced:** `Ledger::check_controls`, the control guard, `Ledger::control_check`; `tests/spec_roles.rs`, `tests/spec_documents.rs`.
|
||||
**Checked:** `tests/spec_roles.rs`, `tests/spec_documents.rs`.
|
||||
|
||||
**WB-ledger-4** Until the balance of a receivables or payables control account moves with its documents (plan P4b S7), a receivables or payables role whose control account holds a balance stays where it is, and the refusal says so: it names no hand entry, which the control guard would refuse.
|
||||
*Enforced and checked:* with B-23 above (`Ledger::check_assign_role`, `Ledger::check_renumber_account`, the control guard; `tests/spec_roles.rs`, `tests/spec_documents.rs`).
|
||||
**Enforced:** `Ledger::check_assign_role`, `Ledger::check_renumber_account`,
|
||||
the control guard. **Checked:** `tests/spec_roles.rs`,
|
||||
`tests/spec_documents.rs`.
|
||||
|
||||
## B-29 The books keep how they are kept
|
||||
|
||||
@@ -225,7 +232,10 @@ checked to change no figure or entry;
|
||||
*Checked:* `ledger-config` `tests/codec_props.rs` (`exports_round_trip`) and codec unit tests; `ledger-store` `tests/settings.rs` (`books_written_under_p1_open_to_their_record`, fixture `old-books/p1_record`).
|
||||
|
||||
**WB-ledger-6** No setting, convention id, convention, decision, open item or approval holds a number that reads as a full TIN (nine digits standing alone, bare or printed 3-2-4 or 2-7 with a dash or a space), except the company's own EIN, shown masked everywhere but reports, packages and the viewer, and a D-U-N-S number in its own key.
|
||||
*Enforced and checked:* with B-29 above (the settings and conventions checks and their tests).
|
||||
**Enforced:** `ledger_core::settings::check` and the conventions checks
|
||||
(`check_new`, `check_decision`, `check_open_item`).
|
||||
**Checked:** `ledger-core` settings and conventions unit tests;
|
||||
`ledger-store` `tests/settings.rs` (`settings_replay_is_pure`).
|
||||
|
||||
**WB-ledger-7** Books keep their own settings, and only `books.set_setting` changes them; old books bring their settings file in once, whole, as they are adopted (`wanderbooks books adopt`), and nothing reads one after.
|
||||
*Enforced:* `Store::adopt_settings`; `ledger-mcp` adoption (`local.rs` `settings_to_move`: a settings file, whole, through `codec::import`).
|
||||
@@ -269,7 +279,7 @@ which is journaled with its name trimmed too. **Checked:** `ledger-core`
|
||||
`ledger-core` `tests/spec_ledger.rs`
|
||||
(`a_new_name_is_one_trimmed_line_of_bounded_length`), `ledger-store`
|
||||
`tests/store.rs` (`a_new_accounts_name_is_journaled_trimmed`); Lean
|
||||
`Step.record` (a name is outside the model: `docs/verification.md` law 15);
|
||||
`Step.record_changes_no_figure` (a name is outside the model: `docs/verification.md` law 15);
|
||||
bookspec `examples/rename-changes-no-amount.toml`.
|
||||
|
||||
### Product rules
|
||||
@@ -300,8 +310,8 @@ rounding). **Checked:** `ledger-core`
|
||||
`a_category_rounds_once_across_different_percents`); Kani
|
||||
`deductible_amount_rounds_once`, `deductible_amount_refuses_overflow`;
|
||||
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
|
||||
(`Deductible.near`, `Deductible.tie_away_pos`, `Deductible.tie_away_neg`, `Deductible.sign`, `Deductible.neg`, `Deductible.of_sum`,
|
||||
`Deductible.per_account_differs`, `Deductible.scale_books`, `Deductible.scale_percents`: the one rounding, at any
|
||||
number of accounts and any sizes); bookspec `examples/tax-category-required.toml`.
|
||||
|
||||
### Product rules
|
||||
@@ -316,12 +326,17 @@ number of accounts and any sizes); bookspec `examples/tax-category-required.toml
|
||||
|
||||
## B-44 Evidence is read from the bytes, never trusted over them; identical files are kept once
|
||||
|
||||
**bookspec:** `BS-ledger-12`
|
||||
**retired bookspec:** `BS-ledger-12`
|
||||
|
||||
**Claims:** yes (wholly a product rule: BS-ledger-12 is retired, D-71)
|
||||
|
||||
**Pick:** none (CONVENTION; Rev. Proc. 98-25 and Pub. 583 for the audit trail).
|
||||
|
||||
**Enforced:** the product rule below, `WB-ledger-15` (its *Enforced:*
|
||||
paragraph names the import, store and attachment functions).
|
||||
**Checked:** the product rule below, `WB-ledger-15` (its *Checked:*
|
||||
paragraph names the import, store and CLI tests).
|
||||
|
||||
### Product rules
|
||||
|
||||
**WB-ledger-15** Evidence is read from the bytes, never trusted over them; identical files are kept once.
|
||||
@@ -402,12 +417,17 @@ withdraw_attachment_duplicate}` and `Store::attach`'s dedup; feature
|
||||
|
||||
## B-45 An audit is deterministic over the books; an attestation is a claim by a named client
|
||||
|
||||
**bookspec:** `BS-ledger-13`
|
||||
**retired bookspec:** `BS-ledger-13`
|
||||
|
||||
**Claims:** yes (wholly a product rule: BS-ledger-13 is retired, D-71)
|
||||
|
||||
**Pick:** CHOICE D-9 (owner-adopted recommendation, 2026-10-16): the attestation bar, and the CPA package waits for a counted audit unless given a reason. Otherwise CONVENTION (the SOURCE block below; Pub. 583 and Rev. Proc. 98-25 for the audit trail).
|
||||
|
||||
**Enforced:** the product rule below, `WB-ledger-16` (its *Enforced:*
|
||||
paragraph names the audit and store functions).
|
||||
**Checked:** the product rule below, `WB-ledger-16` (its *Checked:*
|
||||
paragraph names the core, store, import and CLI tests).
|
||||
|
||||
### Product rules
|
||||
|
||||
**WB-ledger-16** An audit is deterministic over the books; an attestation is a claim by a named client.
|
||||
|
||||
@@ -36,8 +36,8 @@ Rules: B-13, B-26, B-35, B-36.
|
||||
`closePart_total`, `trueUp_total`, `trueUp_running`,
|
||||
`closePart_eq_trueUp`, `cumulative_drift`, `statement_after_close`,
|
||||
`statement_unmoved_by_close`, `Apportion.rem_pos_of_rank_lt`,
|
||||
`apportion_drift`, `allocW_sum`, `allocW_drift`,
|
||||
`allocW_cumulative_drift`, `allocW_cumulative_total`; properties
|
||||
`Apportion.apportion_drift`, `Apportion.allocW_sum`, `Apportion.allocW_drift`,
|
||||
`Apportion.allocW_cumulative_drift`, `Apportion.allocW_cumulative_total`; properties
|
||||
`prop_split_*`, `each_members_capital_chains_across_statements`,
|
||||
`each_member_stays_within_a_cent_of_their_share`,
|
||||
`members_capital_never_drifts_a_cent_from_their_share`,
|
||||
|
||||
@@ -59,8 +59,11 @@ schedules round to the currency's minor unit. Schedules an earlier
|
||||
version took mid-month under equal months replay as they were. (The
|
||||
engine change is unit K-U5's; this note records the claim.)
|
||||
|
||||
**Enforced:** `schedules` replay (`amortization_plan`),
|
||||
`Ledger::schedule_month_hold`. **Checked:**
|
||||
`defect9_legacy_schedules_stay_monthly_even`,
|
||||
**Claims:** partly (the replay half is implemented; moving new monthly-even
|
||||
schedules to the currency's minor unit is K-U5, not landed)
|
||||
|
||||
**Enforced:** `schedules::amortization_plan` (the cent rule, kept for
|
||||
replay), `Ledger::replay_register_schedule`, `Ledger::schedule_month_hold`.
|
||||
**Checked:** `defect9_legacy_schedules_stay_monthly_even`,
|
||||
`prop_monthly_even_plan_is_unchanged`,
|
||||
`a_schedule_month_posted_again_waits_for_month_reposting_and_replays`.
|
||||
@@ -22,6 +22,11 @@ Lean `trial_balance_iff`, `Reachable.trial_balance`,
|
||||
|
||||
**Claims:** yes
|
||||
|
||||
**Enforced:** every posted entry obeys B-1, so `kernel::check_lines`
|
||||
refuses an unbalanced one; `Ledger::post_entry` applies it to every
|
||||
posting, and `kernel::normal_balance` reads each account by its type, so
|
||||
`reports::balance_sheet` and `reports::trial_balance` present the same
|
||||
assets and liabilities-plus-equity at every date.
|
||||
**Checked:** Kani `accounting_equation`; Lean `accounting_equation`,
|
||||
`Reachable.accounting_equation[_through]`; property
|
||||
`prop_balance_sheet_balances`.
|
||||
|
||||
Reference in new issue
Block a user