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
@@ -533,7 +533,7 @@ fn profit_and_loss_counted(
|
||||
))
|
||||
}
|
||||
|
||||
/// A project's figures (BS-statement-5 item 3): the period's statement and
|
||||
/// A project's figures (BS-statement-5 statement 2): the period's statement and
|
||||
/// months, and its figures to date.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ProjectFigures {
|
||||
@@ -592,7 +592,7 @@ pub struct ProjectToDate {
|
||||
|
||||
impl ProjectToDate {
|
||||
/// Revenue less expenses: the project's contribution before overhead
|
||||
/// (BS-statement-5 item 7), since only its own tagged lines count.
|
||||
/// (WB-statement-7), since only its own tagged lines count.
|
||||
pub fn net(&self) -> Decimal {
|
||||
self.revenue - self.expenses
|
||||
}
|
||||
@@ -611,11 +611,11 @@ impl ProjectToDate {
|
||||
}
|
||||
|
||||
/// Contribution as a percent of revenue, to one place (half to even), or
|
||||
/// `None` without revenue to divide by (BS-statement-5 item 7).
|
||||
/// `None` without revenue to divide by (WB-statement-7).
|
||||
///
|
||||
/// ```text
|
||||
/// GOAL: one margin the tools and the viewer print alike.
|
||||
/// SOURCE: BS-statement-5 item 7 (revenue less the costs traced
|
||||
/// SOURCE: WB-statement-7 (revenue less the costs traced
|
||||
/// to the project, fixed and variable alike: Garrison's segment
|
||||
/// margin, as a ratio; not Horngren's variable-cost contribution
|
||||
/// margin; a presentation choice, not GAAP).
|
||||
@@ -650,7 +650,7 @@ pub const PROJECT_MONTHS: u32 = 240;
|
||||
/// ```text
|
||||
/// GOAL: what a project earned and cost, from one function the tools, the
|
||||
/// viewer and bookspec share, so their figures never drift.
|
||||
/// SOURCE: BS-statement-5 item 3 (job costing), BS-period-1, BS-statement-3.
|
||||
/// SOURCE: BS-statement-5 statement 2 (job costing), BS-period-1, BS-statement-3.
|
||||
/// INVARIANTS:
|
||||
/// 1. MUST be profit_and_loss_for_period with the project's class: only
|
||||
/// revenue and expense lines tagged to it, closing entries left out.
|
||||
@@ -748,7 +748,7 @@ pub fn project_to_date(
|
||||
/// Every entry with a line tagged to the project (drafts included),
|
||||
/// newest first (by date, then id), with its project amount: its tagged
|
||||
/// revenue lines less its tagged expense lines, each on its normal side.
|
||||
/// A tagged balance-sheet line counts zero (BS-statement-5 item 3).
|
||||
/// A tagged balance-sheet line counts zero (BS-statement-5 statement 2).
|
||||
pub fn project_entries(ledger: &Ledger, id: ClassId) -> Vec<(crate::EntryId, Decimal)> {
|
||||
let mut out: Vec<(NaiveDate, crate::EntryId, Decimal)> = Vec::new();
|
||||
for eid in 1..ledger.next_entry_id() {
|
||||
|
||||
Reference in new issue
Block a user