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:
swaitsandClaude Sonnet 5.5 committed 2026-11-09 03:30:06 -07:00
1 parent 609e4e6b26
commit e41cc3a161
78 files changed
+298 -302

No files matched your search

+1 -1
View File
@@ -151,7 +151,7 @@ mod tests {
.unwrap()
}
/// INVARIANT 2's cash flow items (BS-statement-3 rule 12, D-35): a
/// INVARIANT 2's cash flow items (BS-statement-3 statement 17, D-35): a
/// sale of equipment for an IOU is a Todo naming the entry, with the
/// statement's fix; equipment bought on an operating card is Info; a
/// sale for cash asks nothing.
+2 -2
View File
@@ -247,7 +247,7 @@ pub fn build(dir: &Path, today: NaiveDate) -> Result<(), StoreError> {
"Client work",
&ledger_core::ProjectFacts {
// Its invoices' lines and the contractors it pays are tagged
// to it (BS-statement-5 item 8), so its snapshot is its
// to it (BS-statement-5 statement 6), so its snapshot is its
// revenue less its direct costs.
description: Some(
"Design work for the studio's clients: every client invoice, and the contractors who work on it."
@@ -306,7 +306,7 @@ pub fn build(dir: &Path, today: NaiveDate) -> Result<(), StoreError> {
.map(|n| s.add_customer(n))
.collect::<Result<_, _>>()?;
// Work on spec for a customer, hoping they adopt it: its costs are
// expenses, and nothing is receivable (BS-statement-5 item 4).
// expenses, and nothing is receivable (BS-statement-5 statement 5).
let tidepool_started = start + Months::new(13);
let tidepool = s.add_project(
"Tidepool app",
+2 -2
View File
@@ -302,7 +302,7 @@ pub fn detail(ui: &mut Ui, b: &Books, e: &EntryInfo, shell: &mut Shell<'_>) {
ui.add_space(18.0);
// The invoice or bill it records: its lines as the document
// gives them, each project a link (BS-statement-5 item 8).
// gives them, each project a link (BS-statement-5 statement 6).
if let Some(doc) = document_of(b, e.id) {
section(ui, &doc.title);
document_lines(ui, &doc, &class_names, total_w, amt_w, shell);
@@ -756,7 +756,7 @@ mod tests {
/// A tagged line keeps its project tag inside its cell, in a narrow
/// pane too: the name is cut to leave the tag room, so the amounts
/// stay in their columns (an invoice's revenue line and its document
/// line, each tagged; BS-statement-5 item 8).
/// line, each tagged; BS-statement-5 statement 6).
#[test]
fn a_tagged_line_keeps_its_amounts_in_their_column() {
use ledger_core::arap::DocumentLine;
+2 -2
View File
@@ -561,7 +561,7 @@ pub fn show_list(ui: &mut Ui, b: &Books, shell: &mut Shell<'_>) {
}
/// The party's totals with property in kind (basis all, BS-partner-3
/// item 4), when it gave or took any in the period: "With property
/// statement 5), when it gave or took any in the period: "With property
/// contributed or distributed: paid $X, received $Y". None when nothing
/// moved in kind (the cash totals are then the whole story).
pub fn in_kind_text(flow: &crate::books::PartyFlow) -> Option<String> {
@@ -775,7 +775,7 @@ pub fn show_party(ui: &mut Ui, b: &Books, id: PartyId, shell: &mut Shell<'_>) {
r.context_menu(|ui| widgets::copy_item(ui, "Copy amount", &v.to_string()));
}
});
// Basis all (BS-partner-3 item 4): property in kind, when any.
// Basis all (BS-partner-3 statement 5): property in kind, when any.
if let Some(text) = in_kind_text(&flow) {
ui.add_space(6.0);
ui.add(
+2 -2
View File
@@ -1,7 +1,7 @@
//! Projects: every class, with its facts (what it is, where it stands, who
//! it is for), and one project completely: its snapshot (revenue, direct
//! costs, contribution before overhead and its margin, to date or this
//! fiscal year, BS-statement-5 item 7), revenue and costs by month with the
//! fiscal year, WB-statement-7), revenue and costs by month with the
//! running net, costs by category and by account, its entries, documents,
//! decisions and history (BS-statement-5). Every figure is ledger-core's (`project_figures`,
//! `project_to_date`, `project_entries`), the same the server's
@@ -419,7 +419,7 @@ impl Snap {
}
/// The note on contribution: what it counts and what it leaves out.
pub const CONTRIBUTION_NOTE: &str = "Revenue less this project's direct costs: every expense line tagged to it, fixed and variable alike (what management accounting calls a segment margin, not a variable-cost contribution margin). Company overhead that isn't tagged to a project (rent, software, insurance, the owner's time) isn't counted, so a project in the black can still leave the company in the red. A management-accounting view (BS-statement-5 items 2 and 4), not a GAAP figure.";
pub const CONTRIBUTION_NOTE: &str = "Revenue less this project's direct costs: every expense line tagged to it, fixed and variable alike (what management accounting calls a segment margin, not a variable-cost contribution margin). Company overhead that isn't tagged to a project (rent, software, insurance, the owner's time) isn't counted, so a project in the black can still leave the company in the red. A management-accounting view (WB-statement-7), not a GAAP figure.";
/// The snapshot: a header with where it stands to date and the to date /
/// fiscal year switch, then its tiles (`shown`: to date, or for `year`,
+1 -1
View File
@@ -2719,7 +2719,7 @@ mod tests {
// The figures, by hand: the loan (not a financing setting) is an
// operating receipt, 2,500.00; what the members paid personally
// (85.00 and 216.40, 301.40) is borrowed from them through 2100
// and spent (D-42, BS-statement-3 rule 11); the members'
// and spent (D-42, BS-statement-3 statement 16); the members'
// contributions are financing, each named (1,200.00 and 800.00);
// the reimbursement repays 2100 (301.40); the tablet is disclosed
// (630.00), the reversed laptop gone.