docs: sub-references name bookspec's statements, invariants and scenarios
Unit S-E rewrote each `B-n` citation to its bookspec id but kept the
sub-reference after it ("item 7", "rule 11", "INVARIANT 2"). Those
numbers counted parts of the retired rules.md text, so `BS-statement-5
item 7` pointed at finished and abandoned projects, not at the snapshot
it meant. Bookspec numbers a record's parts from 1 as `statement`,
`invariant` and `scenario`; every sub-reference now says so.
The map was built by content, not by position: each old item,
INVARIANT or SCENARIO was read in `git show ca8d676d5^:docs/spec/rules.md`
(the last full rule text), found in the pinned records
(bookspec bc92cf3) and in docs/spec/claims/, and each reference was
read in its context before it was mapped. Where the old numbering still
survives as the "Rule n" labels inside bookspec's statements (the cash
flow, party totals) the new number is that statement's position; where
a record carries the whole rule differently (the asset depreciation, the
IIF file, the arap invariants) the reference follows the content. Where
bookspec keeps no counterpart, the product rule that states it is cited
instead: WB-statement-5 (a project's facts and names), -7 (the snapshot),
WB-arap-4 (the document_standing feature), -8 (the issued PDF), -15 (a
payment event names its line), WB-ledger-15 (BS-ledger-12 is retired).
A reference that had pointed at the wrong part is corrected, for example
the discount-reason references that said BS-arap-6 INVARIANT 2 (a
bound) now say invariant 6 (the discount cap and date).
Only the reference tokens and their sentence change; no paragraph is
reflowed. A reference wrapped across a comment prefix keeps its wrap.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
609e4e6b26
commit
e41cc3a161
78 files changed
+298
-302
No files matched your search
@@ -505,7 +505,7 @@ pub enum LedgerError {
|
||||
end: String,
|
||||
},
|
||||
|
||||
/// The statement of cash flows would not foot (BS-statement-3 rule 9):
|
||||
/// The statement of cash flows would not foot (BS-statement-3 statement 14):
|
||||
/// an engine error, never output. It cannot happen on balanced books
|
||||
/// (Lean `cashflow_sections_sum_to_cash_change`); if it does, the
|
||||
/// engine is wrong, and nothing is shown rather than a wrong figure.
|
||||
@@ -523,7 +523,7 @@ pub enum LedgerError {
|
||||
},
|
||||
|
||||
/// The cash flow statement's account roles (cash, financing, investing)
|
||||
/// contradict each other or the chart (BS-statement-3 rule 2). The text
|
||||
/// contradict each other or the chart (BS-statement-3 statement 3). The text
|
||||
/// names the setting and says what to change.
|
||||
#[error("cash flow account roles: {0}")]
|
||||
CashFlowRoles(String),
|
||||
@@ -695,13 +695,13 @@ pub enum LedgerError {
|
||||
SettlementMixedKinds(String),
|
||||
|
||||
/// A settlement's documents don't all belong to the one party it
|
||||
/// names (BS-arap-6 INVARIANT 1).
|
||||
/// names (BS-arap-6 invariant 4).
|
||||
#[error("{0} is not {1}'s: a settlement covers one party only")]
|
||||
SettlementPartiesDiffer(String, u64),
|
||||
|
||||
/// A discount needs a reason: none is stated in the document's terms,
|
||||
/// or it is larger than its terms allow, or it is taken after the
|
||||
/// discount date (BS-arap-6 INVARIANT 2).
|
||||
/// discount date (BS-arap-6 invariant 6).
|
||||
#[error(
|
||||
"{doc}: the discount of {discount} needs a reason ({because}); pass discount_reason with the payment"
|
||||
)]
|
||||
@@ -763,7 +763,7 @@ pub enum LedgerError {
|
||||
cash: Decimal,
|
||||
},
|
||||
|
||||
/// A settlement's figures can't be exact (BS-arap-6 INVARIANT 1): an
|
||||
/// A settlement's figures can't be exact (BS-arap-6 invariant 3): an
|
||||
/// amount too large to add, a negative fee, or a fee that leaves
|
||||
/// nothing to deposit; a fee above the cash is
|
||||
/// [`LedgerError::FeeAboveCash`].
|
||||
@@ -796,7 +796,7 @@ pub enum LedgerError {
|
||||
},
|
||||
|
||||
/// Receivables or payables can't move to an account holding lines
|
||||
/// that are no document's (BS-arap-2 INVARIANT 1): they would
|
||||
/// that are no document's (BS-arap-2 statement 12): they would
|
||||
/// become hand lines on a control account.
|
||||
#[error(
|
||||
"account {code} \"{name}\" holds lines no invoice or bill carries (entry {entry} first), \
|
||||
@@ -843,7 +843,7 @@ pub enum LedgerError {
|
||||
},
|
||||
|
||||
/// A reversal or payment would leave a document owing less than nothing
|
||||
/// or more than its total at some date (BS-arap-2 INVARIANT 2): the
|
||||
/// or more than its total at some date (BS-arap-2 invariant 6): the
|
||||
/// message says which document, when, and what to reverse first.
|
||||
#[error("{0}")]
|
||||
DocumentBounds(String),
|
||||
@@ -882,7 +882,7 @@ pub enum LedgerError {
|
||||
#[error("{0}")]
|
||||
InvalidSend(String),
|
||||
/// A bad debt can't be written off on cash-basis books (
|
||||
/// BS-arap-5 INVARIANT 3; IRC §166(a); Treas. Reg. §1.166-1(e)): the
|
||||
/// BS-arap-5 statement 6; IRC §166(a); Treas. Reg. §1.166-1(e)): the
|
||||
/// invoice was never counted as income, so there is no basis to
|
||||
/// deduct.
|
||||
#[error(
|
||||
|
||||
Reference in new issue
Block a user