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
@@ -78,7 +78,7 @@ fn document_lines(
|
||||
/// A document's notes, each project once, in the order first named: its
|
||||
/// late-tag note ([`projects::late_tag_note`]) for a finished or abandoned
|
||||
/// project, and on an invoice ([`projects::on_spec_invoice_note`]) one for
|
||||
/// an on-spec project (BS-statement-5 items 4, 5 and 8).
|
||||
/// an on-spec project (BS-statement-5 statements 5, 6 and 7).
|
||||
fn document_notes(
|
||||
ledger: &ledger_core::Ledger,
|
||||
lines: &[DocumentLine],
|
||||
|
||||
@@ -141,7 +141,7 @@ pub(crate) fn settings_problems(ledger: &Ledger, cfg: &Settings) -> Vec<String>
|
||||
let how = " with books.set_setting";
|
||||
// The cash flow roles: codes the chart lacks here; the rest is the
|
||||
// engine's own check, the one the statement refuses on (BS-statement-3
|
||||
// rule 2), so the two never disagree.
|
||||
// statement 3), so the two never disagree.
|
||||
let lists = [
|
||||
(
|
||||
ledger_core::RoleList::Cash,
|
||||
|
||||
@@ -144,7 +144,7 @@ fn party_document(
|
||||
}
|
||||
|
||||
/// A party-totals `basis` from a tool: "cash" (the default) or "all"
|
||||
/// (BS-partner-3 item 4); any other word is refused.
|
||||
/// (BS-partner-3 statement 5); any other word is refused.
|
||||
fn parse_basis(basis: Option<&str>) -> Result<ledger_core::parties::Basis, String> {
|
||||
match basis {
|
||||
None => Ok(ledger_core::parties::Basis::default()),
|
||||
|
||||
@@ -144,7 +144,7 @@ fn by_name(ledger: &Ledger) -> Vec<ClassId> {
|
||||
}
|
||||
|
||||
/// The note `books.add_line` and `books.record_payout` give for a line tagged to a finished or
|
||||
/// abandoned project (BS-statement-5 item 5).
|
||||
/// abandoned project (BS-statement-5 statement 7).
|
||||
pub(super) fn late_tag_note(ledger: &Ledger, id: ClassId) -> Option<String> {
|
||||
let f = ledger.project_facts(id)?;
|
||||
if !f.status.is_over() {
|
||||
@@ -162,7 +162,7 @@ pub(super) fn late_tag_note(ledger: &Ledger, id: ClassId) -> Option<String> {
|
||||
}
|
||||
|
||||
/// The note `books.create_invoice` gives for a line naming an on-spec
|
||||
/// project (BS-statement-5 items 4 and 8): on spec, a hoped-for payment is
|
||||
/// project (BS-statement-5 statements 5 and 6): on spec, a hoped-for payment is
|
||||
/// no receivable and no income until received, so an invoice for one
|
||||
/// means there is now an agreement, or it shouldn't be an invoice.
|
||||
pub(super) fn on_spec_invoice_note(ledger: &Ledger, id: ClassId) -> Option<String> {
|
||||
|
||||
@@ -729,7 +729,7 @@ impl BooksServer {
|
||||
checked.push(format!("{n} stored files match their SHA-256"));
|
||||
}
|
||||
// Receivables and payables equal their documents (BS-arap-2
|
||||
// INVARIANT 1): an identity, so a difference is an engine error.
|
||||
// invariant 1): an identity, so a difference is an engine error.
|
||||
let checks = store
|
||||
.ledger()
|
||||
.control_check(chrono::NaiveDate::MAX)
|
||||
|
||||
@@ -65,7 +65,7 @@ impl BooksServer {
|
||||
Some(a) => parse_amount(a)?,
|
||||
None => owed,
|
||||
};
|
||||
// The evidence is the point of a write-off (BS-arap-5 INVARIANT 1): one
|
||||
// The evidence is the point of a write-off (BS-arap-5 statement 9): one
|
||||
// of the two, and the preview says so too rather than posting
|
||||
// without it later.
|
||||
match (p.upload_id.is_some(), p.existing_attachment_id.is_some()) {
|
||||
|
||||
Reference in new issue
Block a user