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 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-11-08 20:02:08 -07:00
1 parent d45cb8687b
commit 9aeee94fd2
6 files changed
+18 -16

No files matched your search

+4 -2
View File
@@ -7,8 +7,10 @@
//! reproducible and its workpaper hashes the same twice. //! reproducible and its workpaper hashes the same twice.
//! SOURCE: IRS Pub. 583 (records that support entries); Rev. Proc. 98-25 //! SOURCE: IRS Pub. 583 (records that support entries); Rev. Proc. 98-25
//! §5.01 (the relationship between the records and the books must //! §5.01 (the relationship between the records and the books must
//! be demonstrable); BS-statement-1 to BS-statement-3 (the //! be demonstrable); BS-statement-1, BS-statement-2, BS-ledger-4, BS-ledger-5,
//! statements), BS-arap-2 (control accounts), BS-entry-5 (evidence); //! 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). //! DECISION D-9 (the audit and its bar), D-53 (a run, not a job).
//! INVARIANTS: //! INVARIANTS:
//! 1. Pure: reads the ledger and the facts [`AuditInput`] hands in, //! 1. Pure: reads the ledger and the facts [`AuditInput`] hands in,
+3 -3
View File
@@ -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 /// 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 /// `as_of`, on an omitted date without `setup.today`, and on a period the
/// rule refuses. /// rule refuses.
pub(crate) fn period(ex: &Example, x: &Expect) -> (NaiveDate, NaiveDate) { pub(crate) fn period(ex: &Example, x: &Expect) -> (NaiveDate, NaiveDate) {
@@ -83,12 +83,12 @@ pub(crate) trait Pipe: Sized {
} }
} }
impl<T> Pipe for T {} impl<T> 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. /// on `setup.today`, which `query` needs.
pub(crate) fn defaults(ex: &Example, query: &str) -> PeriodDefaults { pub(crate) fn defaults(ex: &Example, query: &str) -> PeriodDefaults {
let today = ex.setup.today.as_deref().unwrap_or_else(|| { let today = ex.setup.today.as_deref().unwrap_or_else(|| {
panic!( 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 ex.id
) )
}); });
+3 -2
View File
@@ -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 per rule: pass, fail or not claimed. It compares the engine's answers
with the examples' exact expected values; it never asks the engine with the examples' exact expected values; it never asks the engine
whether its own answer is right. whether its own answer is right.
- `bookspec/spec/rules-index.md` maps BS-entry-1 to BS-ledger-13 to the bookspec ids; - `bookspec/spec/rules-index.md` maps all 45 rules in `docs/spec/rules.md`'s index to the bookspec ids;
`docs/spec/rules.md` carries each stated rule's id under its heading. 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 - `crates/ledger-core/tests/bookspec/` is the wanderbooks adapter: it
implements `Engine` over `Store` (a dev-dependency only, so no engine implements `Engine` over `Store` (a dev-dependency only, so no engine
crate depends on the specification) and remains the loader that checks crate depends on the specification) and remains the loader that checks
+3 -3
View File
@@ -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`: moves and the floor stands. It adds the checker crate (`bookspec/checker`:
the example schema, the rule identifiers `BS-<area>-<n>` and the `Engine` the example schema, the rule identifiers `BS-<area>-<n>` and the `Engine`
trait), the runner (`bookspec/runner`: pass, fail or not claimed per rule), 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 existing bookspec example still runs on every `cargo test`, through both
the loader's own checks and the `Engine` trait. 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 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 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 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 CPA's list) and says what waits for the owner's upgrade. `docs/spec/claims/arap.md` gains
BS-arap-3 (terms) and BS-arap-4 (numbers and the issued copy). No golden moved. 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) ### P9a self-host deployment (2026-10-26)
+3 -4
View File
@@ -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 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, 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 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`): - **Engine** (`ledger-package/tests/p3_seams.rs`):
`the_members_figures_agree_on_every_date` (members' equity, the K-1 `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. example is not claimed, never silently passed.
Step 3 adds the rule identifiers: `BS-<area>-<n>` for the eleven areas, Step 3 adds the rule identifiers: `BS-<area>-<n>` for the eleven areas,
`bookspec/spec/rules-index.md` as the table from BS-entry-1 to BS-ledger-13, and each `bookspec/spec/rules-index.md` as the table covering all 45 rules in `docs/spec/rules.md`'s index. `DECISION`
stated rule's id under its heading in `docs/spec/rules.md`. `DECISION`
there is bookspec's `CHOICE`: the specification names the options, an 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 allocated (`plan/served.md` 8.0.3) and not yet stated; they carry an id and
an area and no status. an area and no status.
+2 -2
View File
@@ -4,7 +4,7 @@
// are fine; panics, hangs, and broken books are not. After any sequence: // are fine; panics, hangs, and broken books are not. After any sequence:
// the trial balance balances, every posted entry validates, no draft sits // the trial balance balances, every posted entry validates, no draft sits
// in a closed period (the Lean invariant Inv), and the control accounts // 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 // 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: // and voids, and the draft-state ops (P12) run on the Ledger the store wraps:
@@ -411,7 +411,7 @@ fuzz_target!(|ops: Vec<Op>| {
e.id() 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. // large to compute is a refusal, never a difference.
for d in [0u8, 60, 199] { for d in [0u8, 60, 199] {
if let Ok(checks) = l.control_check(day(d)) { if let Ok(checks) = l.control_check(day(d)) {