diff --git a/crates/ledger-core/tests/bookspec/engine.rs b/crates/ledger-core/tests/bookspec/engine.rs index d83d769f..4daa9247 100644 --- a/crates/ledger-core/tests/bookspec/engine.rs +++ b/crates/ledger-core/tests/bookspec/engine.rs @@ -29,10 +29,47 @@ impl Engine for Books<'_> { } fn claims(&self) -> Claims { + // The picks for the CHOICE records split out of embedded choices + // (P14 unit S-C7a: entry, ledger, period, statement, prepaid). Claims::new( bookspec_checker::covered_rules() .into_iter() .map(|r| r.id.clone()), ) + .with_choice(RuleId::new(Area::Entry, 6), "check-when-line-added") + .with_choice(RuleId::new(Area::Entry, 7), "refuse-rather-than-crash") + .with_choice( + RuleId::new(Area::Entry, 8), + "bounds-bind-commands-never-replay", + ) + .with_choice(RuleId::new(Area::Ledger, 14), "book-in-the-smallest-unit") + .with_choice(RuleId::new(Area::Ledger, 15), "child-has-its-parents-type") + .with_choice(RuleId::new(Area::Ledger, 16), "on-or-after-the-original") + .with_choice( + RuleId::new(Area::Ledger, 17), + "reversal-evidence-is-originals", + ) + .with_choice( + RuleId::new(Area::Ledger, 18), + "assignment-is-a-fact-in-the-books", + ) + .with_choice(RuleId::new(Area::Ledger, 19), "refuse-rather-than-renumber") + .with_choice(RuleId::new(Area::Ledger, 20), "warn-by-default") + .with_choice(RuleId::new(Area::Ledger, 21), "round-once-on-the-total") + .with_choice(RuleId::new(Area::Period, 4), "nest-never-partially-overlap") + .with_choice( + RuleId::new(Area::Period, 5), + "fiscal-year-to-date-by-default", + ) + .with_choice(RuleId::new(Area::Statement, 6), "direct") + .with_choice(RuleId::new(Area::Statement, 7), "constructive") + .with_choice(RuleId::new(Area::Statement, 8), "year-through-as-of") + .with_choice(RuleId::new(Area::Statement, 9), "one-project-per-line") + .with_choice(RuleId::new(Area::Prepaid, 2), "daily") + .with_choice(RuleId::new(Area::Prepaid, 3), "start-on-the-first") + .with_choice( + RuleId::new(Area::Prepaid, 4), + "minor-unit-for-new-schedules", + ) } } diff --git a/crates/ledger-core/tests/bookspec/rules_md.rs b/crates/ledger-core/tests/bookspec/rules_md.rs index 91daa5e3..99baedb0 100644 --- a/crates/ledger-core/tests/bookspec/rules_md.rs +++ b/crates/ledger-core/tests/bookspec/rules_md.rs @@ -25,6 +25,17 @@ pub(crate) fn rules_md_carries_every_id() { } for rule in bookspec_checker::rules().iter() { + if rule.b == 0 { + // Born after the B-n numbering ended (P14 unit S-C7): no index + // row and no B-n section; its pick is recorded in the claims + // file of its parent. + assert!( + all.contains(&format!("**Pick ({}):**", rule.id)), + "{} carries its pick in its claims file", + rule.id + ); + continue; + } assert!( index.contains(&format!("| B-{} | `{}` |", rule.b, rule.id)), "rules.md indexes B-{} to {}", diff --git a/docs/spec/claims/entry.md b/docs/spec/claims/entry.md index fde6a60f..54c41888 100644 --- a/docs/spec/claims/entry.md +++ b/docs/spec/claims/entry.md @@ -10,6 +10,8 @@ Rules: B-1, B-2, B-21, B-28, B-43. **bookspec:** `BS-entry-1` +**Pick (BS-entry-6):** check-when-line-added, the owner, 2026-10-13 + **Claims:** yes **Pick:** a line's account must exist and take postings when the line is added to a draft, not only when the entry posts: CHOICE (the owner, 2026-10-13). @@ -60,6 +62,10 @@ None. **bookspec:** `BS-entry-4` +**Pick (BS-entry-7):** refuse-rather-than-crash, the owner, 2026-10-16 + +**Pick (BS-entry-8):** bounds-bind-commands-never-replay, the owner, 2026-10-17 + **Claims:** yes **Pick:** the bounds are bookspec's (dates 0001-01-01 through 9999-12-31, an amount at most `kernel::MAX_LINE_AMOUNT` = 1,000,000,000,000,000, scale at most `MAX_LINE_SCALE` = 10), and one run of the recurring entries creates at most 1,000 drafts (`MAX_RECURRING_RUN`). Provenance: CHOICE (P0 review round 3, 2026-10-16, finding S1: the @@ -178,6 +184,8 @@ pinned; every tool over every old book). **bookspec:** `BS-entry-5` +**Pick (BS-ledger-17):** reversal-evidence-is-originals, D-47, the owner, 2026-10-26 + **Claims:** partly (bookspec's record states the evidence gate's principle, the draft state as a note and the discard; the gate's function, the policy settings, the states' names and the surfaces are wanderbooks product, below) **Pick:** reversals stay posted and need no evidence of their own, their evidence being their original's: CHOICE D-47 (owner-adopted recommendation, 2026-10-26; stated in `BS-ledger-7`'s status note, and in B-20's claims). A draft's state as a note that moves no figure, and discarding a draft rather than posting and reversing it, are the CONVENTIONs of the record. diff --git a/docs/spec/claims/ledger.md b/docs/spec/claims/ledger.md index b1d30aed..dc41b90f 100644 --- a/docs/spec/claims/ledger.md +++ b/docs/spec/claims/ledger.md @@ -10,6 +10,8 @@ Rules: B-3, B-4, B-5, B-8, B-9, B-10, B-20, B-23, B-29, B-31, B-32, B-44, B-45. **bookspec:** `BS-ledger-1` +**Pick (BS-ledger-14):** book-in-the-smallest-unit, the owner, 2026-10-13 + **Claims:** yes **Pick:** a foreign line is booked in the base currency's smallest unit (ISO 4217 minor units, `sources/iso-4217.md`), half away from zero: CHOICE (the owner, 2026-10-13), after the GnuCash cross-check found wanderbooks kept $108.34567 where GnuCash booked $108.35. Lines booked before then replay as booked (WB-entry-1). @@ -38,6 +40,8 @@ None. **bookspec:** `BS-ledger-2` +**Pick (BS-ledger-15):** child-has-its-parents-type, the owner, 2026-10-13 + **Claims:** yes **Pick:** a child account has its parent's type: CHOICE (the owner, 2026-10-13). @@ -92,6 +96,8 @@ and never called corrupt (statement 4). **Checked:** Lean `Step.extends`, **bookspec:** `BS-ledger-5` +**Pick (BS-ledger-16):** on-or-after-the-original, the owner, 2026-11-08, wanderbooks D-73 + **Claims:** yes **Pick:** none (AUTHORITY). @@ -123,6 +129,8 @@ None. **bookspec:** `BS-ledger-7` +**Pick (BS-ledger-17):** reversal-evidence-is-originals, D-47, the owner, 2026-10-26 + **Claims:** partly (the engine does not enforce it; the receipt policy of the tool layer does) **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. @@ -137,6 +145,10 @@ None. **bookspec:** `BS-ledger-8` +**Pick (BS-ledger-18):** assignment-is-a-fact-in-the-books, the owner, 2026-10-15 + +**Pick (BS-ledger-19):** refuse-rather-than-renumber, the owner, 2026-10-13 + **Claims:** yes **Pick:** the assignment of a role to an account is journaled, so replay never depends on a setting outside the journal: CHOICE (the owner, 2026-10-15); the engine refuses a role account that is not postable or of the role's type rather than renumber the chart: CHOICE (the owner, 2026-10-13). Receivables and payables are different (B-38, 2026-10-23): their documents read their figures from their lines. @@ -245,6 +257,10 @@ bookspec `examples/rename-changes-no-amount.toml`. **bookspec:** `BS-ledger-11` +**Pick (BS-ledger-20):** warn-by-default, the owner, 2026-10-20 + +**Pick (BS-ledger-21):** round-once-on-the-total, the owner, 2026-11-07, D-67 + **Claims:** yes **Pick:** warn versus refuse: CHOICE (Pub. 583: "the law does not require any specific kind of records"; the owner, 2026-10-20: warn by default, header accounts exempt, the first company set to refuse at the P3 cutover). A category's deductible amount rounds once, on the category total: CHOICE (the owner, 2026-11-07, D-67). The arithmetic is `kernel::deductible_amount`, so Kani proves the one rounding and the bridge carries it to `Decimal`. diff --git a/docs/spec/claims/period.md b/docs/spec/claims/period.md index 682e81f4..b862c884 100644 --- a/docs/spec/claims/period.md +++ b/docs/spec/claims/period.md @@ -25,6 +25,8 @@ decision, D-73, 2026-11-08). **Checked:** Kani **bookspec:** `BS-period-2` +**Pick (BS-period-4):** nest-never-partially-overlap, the owner, 2026-10-13 + **Claims:** yes **Pick:** periods nest and never partially overlap (the owner, 2026-10-13). @@ -51,6 +53,8 @@ untouched. **bookspec:** `BS-period-3` +**Pick (BS-period-5):** fiscal-year-to-date-by-default, the owner, 2026-10-20 + **Claims:** partly (the bookspec record states the one default rule; the surfaces it binds are wanderbooks product, below) **Pick:** a report asked for without dates covers this fiscal year so far, everywhere (the owner, 2026-10-20, `plan/served.md` P3 "Settled in design": "a report asked for without dates covers this fiscal year so far, everywhere, and an account's register opens on it with 'Show all dates' one click away"). diff --git a/docs/spec/claims/prepaid.md b/docs/spec/claims/prepaid.md index 36c8f83c..5b0cdd09 100644 --- a/docs/spec/claims/prepaid.md +++ b/docs/spec/claims/prepaid.md @@ -10,6 +10,12 @@ Rules: B-16. **bookspec:** `BS-prepaid-1` +**Pick (BS-prepaid-2):** daily, the owner, 2026-10-20, D-11 and D-37 + +**Pick (BS-prepaid-3):** start-on-the-first, the owner, 2026-10-20, D-37 + +**Pick (BS-prepaid-4):** minor-unit-for-new-schedules, the owner, 2026-11-08, D-72 + **Claims:** yes **Pick:** new schedules spread by the day (`daily`), the owner, D-11 confirmed in D-37, 2026-10-20; an equal-months schedule starts on the 1st of a month for prepaid expenses and deferred revenue alike (the owner, D-37, 2026-10-20); new monthly-even schedules round to the currency's minor unit (the owner, D-72, 2026-11-08). diff --git a/docs/spec/claims/statement.md b/docs/spec/claims/statement.md index f3ffaa28..73ed65ac 100644 --- a/docs/spec/claims/statement.md +++ b/docs/spec/claims/statement.md @@ -30,6 +30,10 @@ Lean `trial_balance_iff`, `Reachable.trial_balance`, **bookspec:** `BS-statement-3` +**Pick (BS-statement-6):** direct, the owner, 2026-10-20 + +**Pick (BS-statement-7):** constructive, the owner, 2026-10-20, D-42 + **Claims:** partly (bookspec's record states rules 1-12; the picks and the product surface are below) **Pick:** the direct method; an entry's cash allocated to its sections in the order operating, investing, financing (CONVENTION, the ASC silent, disclosed); within a section, the cash split among its kinds in the order the rest of the section's kinds, interest received, interest paid (CONVENTION, as the engine splits it); what a member or a lender pays or receives for the company presented as constructive cash, borrowed (or contributed) and spent (the owner, D-42, 2026-10-20, revising D-35's first point); a payment shared between a government and others split by their resolved shares, the government's part rounded half to even to the base currency's places and the rest exact (CONVENTION); payroll entries keep their (d) class whoever they name (CONVENTION). @@ -152,6 +156,8 @@ with `books.close_period`, whose entries are never in the statement. **bookspec:** `BS-statement-4` +**Pick (BS-statement-8):** year-through-as-of, the owner, 2026-10-20, D-36 + **Claims:** partly (bookspec's record states the as-of principle and the calendar-year counting; the CPA package itself is wanderbooks product, below) **Pick:** the 1099 worksheet stops at as_of too (the owner, 2026-10-20, plan D-36). @@ -207,6 +213,8 @@ given no accounts, uses the settings', as a package given none does. **bookspec:** `BS-statement-5` +**Pick (BS-statement-9):** one-project-per-line, the owner, 2026-10-22, D-43 + **Claims:** partly (bookspec's record states the class, the figures, on-spec and document-line rules; the project facts and the snapshot presentation are wanderbooks product, below) **Pick:** a project is a class (the owner, 2026-10-21: "a Projects page that treats a class as a project ... Projects are entities too and can have name, description, whatever other metadata you think they should have"; the convention `link-to-projects` in the books: "whenever applicable, we link things to [projects]"); an invoice's or bill's lines take a project, each line one or none (the owner, 2026-10-22, plan D-43).