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

+1 -1
View File
@@ -51,7 +51,7 @@
//! the tax table with its note's number.
//! ```
//!
//! SOURCE (7-9): docs/spec/rules.md B-25;
//! SOURCE (7-9): BS-asset-4;
//! docs/spec/sources/irs-partnership-basis.md.
use crate::pdf::PdfError;
+2 -2
View File
@@ -7,7 +7,7 @@
//! saying so.
//! SOURCE: docs/spec/sources/intuit-iif.md (Intuit's IIF Overview, the IIF
//! Import Kit's header help and its 2007+ General Journal example);
//! rules.md B-34; Intuit's "Character limitations for fields in
//! BS-format-2; Intuit's "Character limitations for fields in
//! QuickBooks" (account name 31, account number 7, memo 4,095);
//! DECISION (owner, 2026-10-20, plan D-36: plain ASCII,
//! transliterated and listed; CR LF line endings); the kit's
@@ -348,7 +348,7 @@ impl fmt::Display for IifChange {
}
}
/// `text` as a warning may show it (rules.md B-26: no full TIN): each run
/// `text` as a warning may show it (BS-partner-2: no full TIN): each run
/// of nine digits `ledger_core::parties::has_full_tin` finds masked (in
/// any script's digits and separators: "123-45-6789"), and if the
/// text still holds one once written as a field, every numeral in it
+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.
+1 -1
View File
@@ -1,4 +1,4 @@
//! The audit workpaper as a PDF (plan P8; rules.md B-45).
//! The audit workpaper as a PDF (plan P8; BS-ledger-13).
//!
//! ```text
//! GOAL: one document a CPA or the owner can read that says what was