From 9aeee94fd2d5d62b9cea26f55785aecf011a31c9 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sun, 8 Nov 2026 20:02:08 -0700 Subject: [PATCH] fix: rule references the rewrite missed and ranges it mangled common.rs (two doc comments and a test-helper panic message) and the fuzz target still cited the retired numbering outside the script's roots; they now cite BS-period-3 and BS-arap-2. A repo-wide sweep of tracked files found no other real citations beyond the deliberately kept strings. Bookspec ids are not ordered across areas, so ranges the script produced are nonsense: the three 'all rules' ranges now say all 45 rules in docs/spec/rules.md's index, the seven allocated ids and the nine statement-era ids are listed explicitly, taken from that index table. Co-Authored-By: Claude Opus 5.5 --- crates/ledger-core/src/audit.rs | 6 ++++-- crates/ledger-core/tests/bookspec/common.rs | 6 +++--- docs/architecture.md | 5 +++-- docs/parity.md | 6 +++--- docs/testing.md | 7 +++---- fuzz/fuzz_targets/fuzz_op_sequence.rs | 4 ++-- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/crates/ledger-core/src/audit.rs b/crates/ledger-core/src/audit.rs index 57f20fe8..2c8ed2ed 100644 --- a/crates/ledger-core/src/audit.rs +++ b/crates/ledger-core/src/audit.rs @@ -7,8 +7,10 @@ //! reproducible and its workpaper hashes the same twice. //! SOURCE: IRS Pub. 583 (records that support entries); Rev. Proc. 98-25 //! ยง5.01 (the relationship between the records and the books must -//! be demonstrable); BS-statement-1 to BS-statement-3 (the -//! statements), BS-arap-2 (control accounts), BS-entry-5 (evidence); +//! be demonstrable); BS-statement-1, BS-statement-2, BS-ledger-4, BS-ledger-5, +//! BS-ledger-6, BS-period-1, BS-period-2, BS-partner-1 and +//! BS-statement-3 (the statements), BS-arap-2 (control accounts), +//! BS-entry-5 (evidence); //! DECISION D-9 (the audit and its bar), D-53 (a run, not a job). //! INVARIANTS: //! 1. Pure: reads the ledger and the facts [`AuditInput`] hands in, diff --git a/crates/ledger-core/tests/bookspec/common.rs b/crates/ledger-core/tests/bookspec/common.rs index ed7f7445..dc57f41e 100644 --- a/crates/ledger-core/tests/bookspec/common.rs +++ b/crates/ledger-core/tests/bookspec/common.rs @@ -16,7 +16,7 @@ pub(crate) fn account_type(a: &AccountSpec, id: &str) -> AccountType { } /// The period `[from, to]` a period query covers, each date omitted -/// resolved by the one rule (B-30) on `setup.today`; panics on +/// resolved by the one rule (BS-period-3) on `setup.today`; panics on /// `as_of`, on an omitted date without `setup.today`, and on a period the /// rule refuses. pub(crate) fn period(ex: &Example, x: &Expect) -> (NaiveDate, NaiveDate) { @@ -83,12 +83,12 @@ pub(crate) trait Pipe: Sized { } } impl Pipe for T {} -/// What an omitted date means for `ex` (B-30): its fiscal year +/// What an omitted date means for `ex` (BS-period-3): its fiscal year /// on `setup.today`, which `query` needs. pub(crate) fn defaults(ex: &Example, query: &str) -> PeriodDefaults { let today = ex.setup.today.as_deref().unwrap_or_else(|| { panic!( - "{}: {query} omits a date: setup.today says what it means (B-30)", + "{}: {query} omits a date: setup.today says what it means (BS-period-3)", ex.id ) }); diff --git a/docs/architecture.md b/docs/architecture.md index 0085886a..ea787df2 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -327,8 +327,9 @@ to move to its own repository (P13 step 6, D-34, Z-17): per rule: pass, fail or not claimed. It compares the engine's answers with the examples' exact expected values; it never asks the engine whether its own answer is right. -- `bookspec/spec/rules-index.md` maps BS-entry-1 to BS-ledger-13 to the bookspec ids; - `docs/spec/rules.md` carries each stated rule's id under its heading. +- `bookspec/spec/rules-index.md` maps all 45 rules in `docs/spec/rules.md`'s index to the bookspec ids; + the rules themselves are bookspec's `rules/` records, and wanderbooks' + claims on them are in `docs/spec/claims/` (`docs/spec/rules.md` is only the index). - `crates/ledger-core/tests/bookspec/` is the wanderbooks adapter: it implements `Engine` over `Store` (a dev-dependency only, so no engine crate depends on the specification) and remains the loader that checks diff --git a/docs/parity.md b/docs/parity.md index 96eed7e6..5c6ef791 100644 --- a/docs/parity.md +++ b/docs/parity.md @@ -108,7 +108,7 @@ P13 is a specification, not a feature, so no row of the semantic catalog moves and the floor stands. It adds the checker crate (`bookspec/checker`: the example schema, the rule identifiers `BS--` and the `Engine` trait), the runner (`bookspec/runner`: pass, fail or not claimed per rule), -and the rule index from BS-entry-1 to BS-ledger-13 (`bookspec/spec/rules-index.md`). Every +and the rule index covering all 45 rules in `docs/spec/rules.md`'s index (`bookspec/spec/rules-index.md`). Every existing bookspec example still runs on every `cargo test`, through both the loader's own checks and the `Engine` trait. @@ -142,8 +142,8 @@ The viewer's invoice page shows the number, terms, bill-to and PO and saves the issued copy beside the re-created one; the Money in list names an invoice by its number. The handbook's invoices-and-bills procedure is complete (issue, collect, pay on terms, void or write off, the fee, the -CPA's list) and says what waits for the owner's upgrade. rules.md gains -BS-arap-3 (terms) and BS-arap-4 (numbers and the issued copy). No golden moved. +CPA's list) and says what waits for the owner's upgrade. `docs/spec/claims/arap.md` gains +the claims for BS-arap-3 (terms) and BS-arap-4 (numbers and the issued copy). No golden moved. ### P9a self-host deployment (2026-10-26) diff --git a/docs/testing.md b/docs/testing.md index c7b17213..4915a52c 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -1738,7 +1738,7 @@ mid-year, a refund, a loan, depreciation with a run reversed and caught up, a disposal that credits back part of a month's run, a distribution declared then paid, monthly closes with odd cents), checked on June 30, September 15 and December 31: the same fact from two pieces agrees, or -rules.md says why not. Mutation runs wait for P12 (D-33). +bookspec's rules / `docs/spec/claims/` say why not. Mutation runs wait for P12 (D-33). - **Engine** (`ledger-package/tests/p3_seams.rs`): `the_members_figures_agree_on_every_date` (members' equity, the K-1 @@ -2890,10 +2890,9 @@ adapter claims the rules the catalogue gives an example; a rule with no example is not claimed, never silently passed. Step 3 adds the rule identifiers: `BS--` for the eleven areas, -`bookspec/spec/rules-index.md` as the table from BS-entry-1 to BS-ledger-13, and each -stated rule's id under its heading in `docs/spec/rules.md`. `DECISION` +`bookspec/spec/rules-index.md` as the table covering all 45 rules in `docs/spec/rules.md`'s index. `DECISION` there is bookspec's `CHOICE`: the specification names the options, an -engine declares its pick (`Claims::with_choice`). BS-arap-3 to BS-ledger-13 are +engine declares its pick (`Claims::with_choice`). BS-arap-3, BS-arap-4, BS-arap-5, BS-arap-6, BS-entry-5, BS-ledger-12 and BS-ledger-13 are allocated (`plan/served.md` 8.0.3) and not yet stated; they carry an id and an area and no status. diff --git a/fuzz/fuzz_targets/fuzz_op_sequence.rs b/fuzz/fuzz_targets/fuzz_op_sequence.rs index e753faef..2b89489b 100644 --- a/fuzz/fuzz_targets/fuzz_op_sequence.rs +++ b/fuzz/fuzz_targets/fuzz_op_sequence.rs @@ -4,7 +4,7 @@ // are fine; panics, hangs, and broken books are not. After any sequence: // the trial balance balances, every posted entry validates, no draft sits // in a closed period (the Lean invariant Inv), and the control accounts -// equal their documents (control_check's difference is zero, B-38). +// equal their documents (control_check's difference is zero, BS-arap-2). // // The documents (invoices, bills), their settlements and payments, write-offs // and voids, and the draft-state ops (P12) run on the Ledger the store wraps: @@ -411,7 +411,7 @@ fuzz_target!(|ops: Vec| { e.id() ); } - // The control accounts equal their documents, at any day (B-38): too + // The control accounts equal their documents, at any day (BS-arap-2): too // large to compute is a refusal, never a difference. for d in [0u8, 60, 199] { if let Ok(checks) = l.control_check(day(d)) {