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
@@ -1,5 +1,4 @@
|
||||
//! Documents through the store, at random (BS-arap-2 INVARIANTS 1, 2,
|
||||
//! 4 and 6; plan P4b.15): histories of invoices, bills, payments (with a
|
||||
//! Documents through the store, at random (BS-arap-2 invariants 1, 6, 7 and 9; plan P4b.15): histories of invoices, bills, payments (with a
|
||||
//! payment method and a reference, or none), voids, reversals of any
|
||||
//! entry, closed months and refused hand lines, run through `Store`, then
|
||||
//! replayed (the books reopened) and read by a `Snapshot`.
|
||||
@@ -9,7 +8,7 @@
|
||||
//! the live books, their replay and a viewer's snapshot agree on
|
||||
//! every figure, at every date, and the control accounts equal
|
||||
//! their documents.
|
||||
//! SOURCE: BS-entry-4 (replay), BS-arap-2 INVARIANTS 1, 2, 4, 6.
|
||||
//! SOURCE: BS-entry-4 (replay), BS-arap-2 invariants 1, 6, 7 and 9.
|
||||
//! ```
|
||||
|
||||
use chrono::NaiveDate;
|
||||
@@ -417,7 +416,7 @@ fn agree(live: &Ledger, dir: &Path, docs: &[DocRef]) -> Result<(), TestCaseError
|
||||
proptest! {
|
||||
#![proptest_config(ProptestConfig::with_cases(32))]
|
||||
|
||||
/// BS-arap-2 INVARIANT 4 (and 1, 2, 6 through the store): a document's
|
||||
/// BS-arap-2 invariant 7 (and 1, 6, 9 through the store): a document's
|
||||
/// state is a function of the journal and the day. Half the history,
|
||||
/// then the books reopened and compared; the rest on the reopened
|
||||
/// books, compared again.
|
||||
|
||||
@@ -377,7 +377,7 @@ fn legacy_reversal_now_counts() {
|
||||
assert_eq!(trial_balance_json(&again), g["trial_balance"]);
|
||||
}
|
||||
|
||||
/// BS-arap-2 scenario 5 and item 7 in books an earlier version keeps: the
|
||||
/// BS-arap-2 scenario 5 and WB-arap-4 in books an earlier version keeps: the
|
||||
/// right payment after the wrong one was reversed waits for the journal
|
||||
/// feature document_standing (an older version would count both),
|
||||
/// refused and journaling nothing until the owner's upgrade; a payment
|
||||
@@ -831,7 +831,7 @@ fn no_new_fields_journals_byte_for_byte() {
|
||||
}
|
||||
|
||||
/// The issued copy is filed with the invoice or nothing is (plan P4b S4.3
|
||||
/// item 11, A-7; BS-arap-4 item 3): a refusal leaves the journal, the
|
||||
/// item 11, A-7; BS-arap-4 invariant 3 and WB-arap-8): a refusal leaves the journal, the
|
||||
/// ledger and the allocators exactly as they were; an issue journals the
|
||||
/// entry, `invoice.created`, `receipt.attached` on that entry
|
||||
/// (`INV-0007.pdf`, `application/pdf`, "Issued invoice") and
|
||||
@@ -1247,8 +1247,7 @@ fn mark_sent_on_void_refused() {
|
||||
|
||||
/// A settlement of two invoices, a discount and a processor's fee: one
|
||||
/// entry whose events name the lines they tag, every figure derived, and
|
||||
/// the books replaying to the same lines (plan P4b S6; BS-arap-6
|
||||
/// INVARIANTS 1 and 3).
|
||||
/// the books replaying to the same lines (plan P4b S6; BS-arap-6 invariant 3 and WB-arap-15).
|
||||
#[test]
|
||||
fn a_settlement_names_its_lines_and_replays() {
|
||||
use ledger_core::{Application, DocRef, Fee, SettleParams};
|
||||
@@ -1422,7 +1421,7 @@ fn settlement_waits_for_documents_v2() {
|
||||
|
||||
/// Legacy payment events carry no `line`, so replay keeps the positional
|
||||
/// rule: the first untagged control line for the payment's amount, in the
|
||||
/// order the events come (plan P4b S6; BS-arap-6 INVARIANT 3).
|
||||
/// order the events come (plan P4b S6; WB-arap-15).
|
||||
#[test]
|
||||
fn legacy_payment_events_keep_the_positional_rule() {
|
||||
use ledger_core::{DocRef, Movement};
|
||||
@@ -1582,7 +1581,7 @@ fn write_off_waits_for_documents_v2() {
|
||||
/// A write-off is journaled as its entry and one `invoice.written_off`,
|
||||
/// and replay derives the same figures and the projection agrees: the
|
||||
/// invoice reads Written off, the bad-debt expense is on 6990, and the
|
||||
/// control account still equals its documents (BS-arap-5, BS-arap-2 INVARIANT 1).
|
||||
/// control account still equals its documents (BS-arap-5, BS-arap-2 invariant 1).
|
||||
#[test]
|
||||
fn write_off_replays_and_projects() {
|
||||
let dir = test_dir("write-off-replay");
|
||||
@@ -1600,7 +1599,7 @@ fn write_off_replays_and_projects() {
|
||||
)
|
||||
.unwrap();
|
||||
// Half paid, the rest written off: the invoice reads Written off with
|
||||
// 50 paid and 50 written off (BS-arap-2 SCENARIO 7).
|
||||
// 50 paid and 50 written off (BS-arap-2 scenario 7).
|
||||
s.receive_payment(inv, d(2026, 4, 20), cents(5_000), bank)
|
||||
.unwrap();
|
||||
let from = journal_len(&dir.0);
|
||||
@@ -1683,7 +1682,7 @@ fn write_off_replays_and_projects() {
|
||||
s.verify().unwrap();
|
||||
}
|
||||
|
||||
/// No evidence, no write-off (BS-arap-5 INVARIANT 1; Treas. Reg.
|
||||
/// No evidence, no write-off (BS-arap-5 statement 10; Treas. Reg.
|
||||
/// §1.166-2(a)): refused, journaling nothing; an attachment already filed
|
||||
/// is linked instead, to the entry and the invoice.
|
||||
#[test]
|
||||
|
||||
@@ -1175,7 +1175,7 @@ fn reversing_a_linked_acquisition_still_opens_and_verifies() {
|
||||
Store::open(&dir).unwrap().verify().unwrap();
|
||||
}
|
||||
|
||||
// ------------------------------------------------- depreciation runs (BS-asset-1 rules 6 and 8)
|
||||
// ------------------------------------------------- depreciation runs (BS-asset-1 statements 14 and 28)
|
||||
|
||||
/// A run is the books' record of what they carry for an asset
|
||||
/// (Ledger::accumulated_posted): recorded live, replayed from the journal,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! An invoice's or bill's lines in the journal (BS-statement-5 item 8,
|
||||
//! An invoice's or bill's lines in the journal (BS-statement-5 statement 6,
|
||||
//! BS-format-1): a line naming its project carries `class_id` (journal feature
|
||||
//! `document_line_projects`), and the entry's revenue or expense line for
|
||||
//! that project is tagged by `entry.line_class_set` right after its
|
||||
@@ -9,7 +9,7 @@
|
||||
//! ```text
|
||||
//! GOAL: a document's projects are journaled once, replay exactly, and
|
||||
//! never reach books whose owner hasn't consented to the format.
|
||||
//! SOURCE: BS-statement-5 item 8, BS-format-1, BS-entry-4; plan/served.md
|
||||
//! SOURCE: BS-statement-5 statement 6, BS-format-1, BS-entry-4; plan/served.md
|
||||
//! D-39 (the owner's upgrade).
|
||||
//! ```
|
||||
|
||||
|
||||
@@ -2636,7 +2636,7 @@ fn every_figure_of(l: &ledger_core::Ledger) -> (usize, usize) {
|
||||
tally(reports::general_ledger(l, start, end).map(|_| ()));
|
||||
tally(reports::members_equity(l, start, end, &members).map(|_| ()));
|
||||
// The statement of cash flows foots on every book, or is refused
|
||||
// for a reason: never an engine error (BS-statement-3 rule 9).
|
||||
// for a reason: never an engine error (BS-statement-3 statement 14).
|
||||
let cf = reports::cash_flow(
|
||||
l,
|
||||
&reports::CashFlowParams {
|
||||
|
||||
Reference in new issue
Block a user