refactor: rule references cite bookspec ids
Every B-n citation in crates/, docs/, deploy/, scripts/ and .github/ now names its bookspec id BS-<area>-<n> (D-68), via scripts/rewrite-rule-refs.py: the map is parsed from docs/spec/rules.md's index, rules.md-prefixed and bare forms are rewritten, sub-references (rule 11, item 7, INVARIANT 2) survive, and plan/, docs/spec/rules.md and docs/spec/claims/ are untouched. Program-output string literals that cited a rule were reverted by hand so user-visible output and its goldens are unchanged; DatedRule.catalog, metadata no output prints, now holds BS-1099-1. One SOURCE line that cited only 'R-?' now also cites BS-statement-5. Co-Authored-By: Muse Wonder 1.0
This commit is contained in:
1 parent
7a177a3cfc
commit
489360f598
221 files changed
+1706
-1580
No files matched your search
@@ -55,7 +55,7 @@ struct MPeriod {
|
||||
struct Model {
|
||||
/// (id, code, type, placeholder, name). The name is outside the Lean
|
||||
/// model (its chart is code and type): kept here so the two agree on
|
||||
/// renames' refusals, and a rename moves nothing else (rules.md B-31).
|
||||
/// renames' refusals, and a rename moves nothing else (BS-ledger-10).
|
||||
accounts: Vec<(u64, String, AccountType, bool, String)>,
|
||||
drafts: Vec<MEntry>,
|
||||
posted: Vec<MEntry>,
|
||||
@@ -122,7 +122,7 @@ impl Model {
|
||||
self.next_account += 1;
|
||||
}
|
||||
|
||||
/// rules.md B-31: a name is free for `account` (None: a new one) when
|
||||
/// BS-ledger-10: a name is free for `account` (None: a new one) when
|
||||
/// it isn't blank, holds no nine digits in a row, and no other account
|
||||
/// (all are top-level here, so all are siblings) has it, ignoring
|
||||
/// capitals and surrounding space.
|
||||
@@ -140,7 +140,7 @@ impl Model {
|
||||
.any(|a| Some(a.0) != account && a.4.trim().to_lowercase() == key)
|
||||
}
|
||||
|
||||
/// rules.md B-31: rename an account that exists to a free name other
|
||||
/// BS-ledger-10: rename an account that exists to a free name other
|
||||
/// than its own; only the name changes.
|
||||
fn rename(&mut self, id: u64, name: &str) -> bool {
|
||||
let Some(i) = self.accounts.iter().position(|a| a.0 == id) else {
|
||||
@@ -363,7 +363,7 @@ impl Model {
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// No 1200 or 2000: a line by hand on a receivables or payables account is
|
||||
// refused (the control guard, rules.md B-38), which this model leaves to
|
||||
// refused (the control guard, BS-arap-2), which this model leaves to
|
||||
// spec_arap.rs.
|
||||
const CODES: [&str; 7] = ["1000", "2100", "3000", "3999", "4000", "6000", "1900"];
|
||||
/// New names: a free one, its own in other capitals and spacing, a
|
||||
@@ -400,7 +400,7 @@ enum Cmd {
|
||||
Reverse(usize, u32),
|
||||
CreatePeriod(u32, u32),
|
||||
Close(usize),
|
||||
/// Rename an account (rules.md B-31): `Step.record` in the Lean model,
|
||||
/// Rename an account (BS-ledger-10): `Step.record` in the Lean model,
|
||||
/// whose chart has no names.
|
||||
Rename(usize, usize),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user