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:
swaitsandMuse Wonder 1.0 committed 2026-11-08 19:40:22 -07:00
1 parent 7a177a3cfc
commit 489360f598
221 files changed
+1706 -1580

No files matched your search

+6 -6
View File
@@ -183,7 +183,7 @@ fn account_lines(lines: &[StatementLine]) -> impl Iterator<Item = Row> + '_ {
///
/// ```text
/// GOAL: the P&L as printed, footing.
/// SOURCE: docs/spec/rules.md B-14; footing (each column adds to its
/// SOURCE: BS-statement-3; footing (each column adds to its
/// printed totals) is the reader's check on any statement.
/// INVARIANTS:
/// 1. Revenue lines sum to "Total revenue"; expense lines to "Total
@@ -221,7 +221,7 @@ pub struct YearEarnings {
///
/// ```text
/// GOAL: the balance sheet as printed, footing and balancing.
/// SOURCE: rules.md B-7 (the accounting equation); footing.
/// SOURCE: BS-statement-2 (the accounting equation); footing.
/// INVARIANTS:
/// 1. Asset lines sum to "Total assets", liability lines to "Total
/// liabilities", equity lines (accounts and the earnings lines) to the
@@ -317,7 +317,7 @@ pub fn balance_sheet(
)
}
/// Lay out a statement of cash flows, direct method (rules.md B-14, D-35):
/// Lay out a statement of cash flows, direct method (BS-statement-3, D-35):
/// operating cash one row per class ASC 230-10-45-25 requires; investing
/// and financing one row per kind ("Contributions from members — Name"),
/// each with its total and its transactions listed under it; then the
@@ -326,7 +326,7 @@ pub fn balance_sheet(
///
/// ```text
/// GOAL: the statement of cash flows as printed, footing and reconciling.
/// SOURCE: rules.md B-14 (ASC 230-10-45-24, -25, -29, -30; 50-3, 50-6:
/// SOURCE: BS-statement-3 (ASC 230-10-45-24, -25, -29, -30; 50-3, 50-6:
/// the noncash schedule on the same page); D-35 (layout by kind).
/// INVARIANTS:
/// 1. The operating class rows sum to "Net cash from operating
@@ -425,7 +425,7 @@ pub fn cash_flow(cf: &CashFlowStatement) -> Statement {
///
/// ```text
/// GOAL: the trial balance as printed, footing.
/// SOURCE: rules.md B-6 (the trial balance balances; B-1); footing.
/// SOURCE: BS-statement-1 (the trial balance balances; BS-entry-1); footing.
/// INVARIANTS:
/// 1. Each column's lines sum to its total; the totals are equal for
/// balanced books.
@@ -462,7 +462,7 @@ pub fn trial_balance(tb: &TrialBalance, as_of: NaiveDate) -> Statement {
///
/// ```text
/// GOAL: each member's capital roll-forward as printed.
/// SOURCE: rules.md B-13 (Form 1065 Schedule K-1, Item L); footing.
/// SOURCE: BS-partner-1 (Form 1065 Schedule K-1, Item L); footing.
/// INVARIANTS:
/// 1. In every column, beginning + contributions + net income +
/// distributions (printed negative) + other = ending.