Merge branch 't3/s-c7a-resolve-embedded-choices' into t3/s-c7-split-embedded-choices

This commit is contained in:
swaits committed 2026-11-08 14:21:14 -07:00
commit df9f3164ab
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 {}",