docs(spec): wanderbooks declares its picks for the new CHOICE records (entry, ledger, period, statement, prepaid)

Bookspect S-C7 split the CHOICEs embedded in these areas' AUTHORITY and CONVENTION rules into their own records, so an engine declares its pick by rule id. Each parent B-n section in docs/spec/claims/<area>.md now carries a **Pick (BS-<area>-<n>):** line naming wanderbooks' option with who decided it and when (the parents' **bookspec:** lines stand), and the bookspec adapter's claims() declares the same twenty picks with Claims::with_choice. The rules_md test now reads a born-after-B-n rule (b = 0 in the catalogue) by its **Pick (BS-...):** line instead of a B-n index row it cannot have.

No engine behaviour changes: every pick is the decision the claims already recorded in prose (for example check-when-line-added, D-73's on-or-after-the-original, D-67's round-once-on-the-total, D-72's minor-unit-for-new-schedules). Verified against the s-c7a bookspec branch with the documented patch override (not committed): cargo test -p ledger-core --test bookspec, 53 passed.

Co-Authored-By: Muse Wonder 1.0
This commit is contained in:
swaitsandMuse Wonder 1.0 committed 2026-11-08 13:49:15 -07:00
1 parent 8ecf177cb2
commit cb55787852
7 files changed
+90

No files matched your search

@@ -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",
)
}
}
@@ -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 {}",