merge: the last rule citations in program output name bookspec ids (S-E2; re-checked)
S-E kept thirteen old B-n citations in program output and one golden, since output is a contract and a golden changes only when verified by hand. They now cite bookspec: the eight evidence sources BS-entry-5, the CPA package's aging tie-out BS-ledger-8, the bills-due tool BS-arap-2, and the projects note BS-statement-5 items 2 and 4 (the figures and that no cost is allocated). None is stored: each is computed when shown, so old books replay and show the new text. The golden moved in exactly those two strings. No retired number now remains anywhere outside the plan and the index. Found on the way: the sub-references S-E carried over keep the old numbering (S-E3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
3d026b6473
6 files changed
+27
-36
No files matched your search
@@ -2153,37 +2153,39 @@ impl Ledger {
|
|||||||
pub(crate) fn origin_exemption(&self, entry: &JournalEntry) -> Option<&'static str> {
|
pub(crate) fn origin_exemption(&self, entry: &JournalEntry) -> Option<&'static str> {
|
||||||
let id = entry.id();
|
let id = entry.id();
|
||||||
if entry.reversal_of().is_some() {
|
if entry.reversal_of().is_some() {
|
||||||
return Some("a reversal: its evidence is its original's (B-43, D-47, D-12)");
|
return Some("a reversal: its evidence is its original's (BS-entry-5, D-47, D-12)");
|
||||||
}
|
}
|
||||||
if self.is_closing_entry(id) {
|
if self.is_closing_entry(id) {
|
||||||
return Some("a period's closing entry: derived from the books (B-43)");
|
return Some("a period's closing entry: derived from the books (BS-entry-5)");
|
||||||
}
|
}
|
||||||
if self.schedule_month_of(id).is_some() {
|
if self.schedule_month_of(id).is_some() {
|
||||||
return Some("a schedule month's posting: the schedule is the evidence (B-43)");
|
return Some("a schedule month's posting: the schedule is the evidence (BS-entry-5)");
|
||||||
}
|
}
|
||||||
if self
|
if self
|
||||||
.asset_runs
|
.asset_runs
|
||||||
.values()
|
.values()
|
||||||
.any(|runs| runs.iter().any(|r| r.entry == id))
|
.any(|runs| runs.iter().any(|r| r.entry == id))
|
||||||
{
|
{
|
||||||
return Some("a depreciation run: the asset's schedule is the evidence (B-43)");
|
return Some("a depreciation run: the asset's schedule is the evidence (BS-entry-5)");
|
||||||
}
|
}
|
||||||
match self.entry_origins.get(&id) {
|
match self.entry_origins.get(&id) {
|
||||||
Some(crate::evidence::Origin::AssetDisposal) => {
|
Some(crate::evidence::Origin::AssetDisposal) => {
|
||||||
return Some("an asset's disposal: the register is the evidence (B-43)");
|
return Some("an asset's disposal: the register is the evidence (BS-entry-5)");
|
||||||
}
|
}
|
||||||
Some(crate::evidence::Origin::PayrollRemittance) => {
|
Some(crate::evidence::Origin::PayrollRemittance) => {
|
||||||
return Some("a payroll tax remittance: the payroll runs are the evidence (B-43)");
|
return Some(
|
||||||
|
"a payroll tax remittance: the payroll runs are the evidence (BS-entry-5)",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
None => {}
|
None => {}
|
||||||
}
|
}
|
||||||
if (0..entry.lines().len()).any(|i| self.line_docs.contains_key(&(id, i))) {
|
if (0..entry.lines().len()).any(|i| self.line_docs.contains_key(&(id, i))) {
|
||||||
return Some(
|
return Some(
|
||||||
"a document's entry (invoice, bill, payment, write-off): the document is the evidence (B-43)",
|
"a document's entry (invoice, bill, payment, write-off): the document is the evidence (BS-entry-5)",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if self.payroll_runs.values().any(|r| r.entry_id == id) {
|
if self.payroll_runs.values().any(|r| r.entry_id == id) {
|
||||||
return Some("a payroll run: the run is the evidence (B-43)");
|
return Some("a payroll run: the run is the evidence (BS-entry-5)");
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,13 @@
|
|||||||
//! The second check flags any retired rule number (the old wanderbooks
|
//! The second check flags any retired rule number (the old wanderbooks
|
||||||
//! numbering, a word-boundary capital letter, hyphen and a number from
|
//! numbering, a word-boundary capital letter, hyphen and a number from
|
||||||
//! 1 to 45) in every tracked text file, outside the excluded index and
|
//! 1 to 45) in every tracked text file, outside the excluded index and
|
||||||
//! claims files. A deliberately kept occurrence is allow-listed below
|
//! claims files. No occurrence is kept (unit S-E2, 2026-11-08: program
|
||||||
//! with its exact count per file; the count failing in either
|
//! output names bookspec ids too); a future deliberate keep is
|
||||||
//! direction means the list changes only on purpose. Scanning the
|
//! allow-listed below with its exact count per file, and the count
|
||||||
//! whole file text, not line by line, also catches a reference wrapped
|
//! failing in either direction means the list changes only on purpose.
|
||||||
//! across lines, filename at the end of one line and the number at the
|
//! Scanning the whole file text, not line by line, also catches a
|
||||||
//! start of the next behind a comment prefix.
|
//! reference wrapped across lines, filename at the end of one line and
|
||||||
|
//! the number at the start of the next behind a comment prefix.
|
||||||
|
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
|
||||||
@@ -407,23 +408,11 @@ fn retired_count(text: &str) -> usize {
|
|||||||
#[test]
|
#[test]
|
||||||
pub(crate) fn no_retired_rule_reference_remains() {
|
pub(crate) fn no_retired_rule_reference_remains() {
|
||||||
let root = repo_root();
|
let root = repo_root();
|
||||||
// Deliberately kept occurrences: path and exact count. Any change
|
// Deliberately kept occurrences: path and exact count. The list is
|
||||||
// in either direction edits this list, on purpose, in that commit.
|
// empty (unit S-E2): every citation, program output included, names
|
||||||
let allow: &[(&str, usize)] = &[
|
// a bookspec id. A future keep adds its path and count here, on
|
||||||
// Kept: user-visible evidence-source strings in program output.
|
// purpose, in that commit.
|
||||||
("crates/ledger-core/src/ledger.rs", 8),
|
let allow: &[(&str, usize)] = &[];
|
||||||
// Kept: goldens are hand-verified expected output.
|
|
||||||
(
|
|
||||||
"crates/ledger-store/tests/golden/draft_states_and_evidence_gate.json",
|
|
||||||
2,
|
|
||||||
),
|
|
||||||
// Kept: user-visible CPA package text in program output.
|
|
||||||
("crates/ledger-package/src/package.rs", 1),
|
|
||||||
// Kept: user-visible tool description text in program output.
|
|
||||||
("crates/ledger-mcp/src/tools/settlements.rs", 1),
|
|
||||||
// Kept: user-visible on-screen contribution note.
|
|
||||||
("crates/ledger-gui/src/pages/projects.rs", 1),
|
|
||||||
];
|
|
||||||
let output = std::process::Command::new("git")
|
let output = std::process::Command::new("git")
|
||||||
.args(["ls-files", "-z"])
|
.args(["ls-files", "-z"])
|
||||||
.current_dir(&root)
|
.current_dir(&root)
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ impl Snap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The note on contribution: what it counts and what it leaves out.
|
/// 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 (rules.md B-37 item 7), 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 (BS-statement-5 items 2 and 4), not a GAAP figure.";
|
||||||
|
|
||||||
/// The snapshot: a header with where it stands to date and the to date /
|
/// 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`,
|
/// fiscal year switch, then its tiles (`shown`: to date, or for `year`,
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ impl BooksServer {
|
|||||||
name = "books.bills_due",
|
name = "books.bills_due",
|
||||||
title = "Bills due",
|
title = "Bills due",
|
||||||
description = described(
|
description = described(
|
||||||
"What to pay and when: every open bill due on or before a day (through; omitted: today), due date first, with its vendor, the vendor's invoice number and what it still owes, and the early-payment discount each vendor's terms give (the last day it is open, the most off, and what to pay to take it). by_date is the running total of what falls due through each date, for planning. The figures are read from the bills' ledger lines that stand (B-38).",
|
"What to pay and when: every open bill due on or before a day (through; omitted: today), due date first, with its vendor, the vendor's invoice number and what it still owes, and the early-payment discount each vendor's terms give (the last day it is open, the most off, and what to pay to take it). by_date is the running total of what falls due through each date, for planning. The figures are read from the bills' ledger lines that stand (BS-arap-2).",
|
||||||
ledger_core::calendar::PeriodKind::AsOf
|
ledger_core::calendar::PeriodKind::AsOf
|
||||||
),
|
),
|
||||||
annotations(read_only_hint = true, open_world_hint = false)
|
annotations(read_only_hint = true, open_world_hint = false)
|
||||||
|
|||||||
@@ -575,7 +575,7 @@ pub fn build_package<B: PackageBooks + ?Sized>(
|
|||||||
let year_end = NaiveDate::from_ymd_opt(year, 12, 31) == Some(as_of);
|
let year_end = NaiveDate::from_ymd_opt(year, 12, 31) == Some(as_of);
|
||||||
let include_tins = tins.is_some();
|
let include_tins = tins.is_some();
|
||||||
let readme = format!(
|
let readme = format!(
|
||||||
"{name} — books package for the CPA\n\nFiscal year to date: {fy_start} through {as_of_s}. {basis} basis.\nKept in wanderbooks: double-entry books from an append-only, hash-chained journal ({seq} events, verified).\n\nStatements (PDF and XLSX): profit and loss, balance sheet, cash flow, {members}tax summary, trial balance.\nLedgers (XLSX): general ledger by account; general journal entry by entry.\nAgings (CSV): ar_aging.csv and ap_aging.csv, one row per open invoice or bill, each ending with a TOTAL line that ties to its control account (B-23). Early-payment discounts are taken by the gross method (A-8); bad debts are written off directly (A-5).\n{iif}{worksheet}{k1}{receipts}{tins}\nThe tax summary maps accounts to return categories; it's a worksheet, not a filing. Questions go to the owners, who can ask their bookkeeping agent to trace any number to its entries and receipts.\n",
|
"{name} — books package for the CPA\n\nFiscal year to date: {fy_start} through {as_of_s}. {basis} basis.\nKept in wanderbooks: double-entry books from an append-only, hash-chained journal ({seq} events, verified).\n\nStatements (PDF and XLSX): profit and loss, balance sheet, cash flow, {members}tax summary, trial balance.\nLedgers (XLSX): general ledger by account; general journal entry by entry.\nAgings (CSV): ar_aging.csv and ap_aging.csv, one row per open invoice or bill, each ending with a TOTAL line that ties to its control account (BS-ledger-8). Early-payment discounts are taken by the gross method (A-8); bad debts are written off directly (A-5).\n{iif}{worksheet}{k1}{receipts}{tins}\nThe tax summary maps accounts to return categories; it's a worksheet, not a filing. Questions go to the owners, who can ask their bookkeeping agent to trace any number to its entries and receipts.\n",
|
||||||
name = company.name,
|
name = company.name,
|
||||||
basis = company.basis,
|
basis = company.basis,
|
||||||
members = if company.members.is_empty() {
|
members = if company.members.is_empty() {
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
"receipts": 0,
|
"receipts": 0,
|
||||||
"requirement": {
|
"requirement": {
|
||||||
"decision": "exempt",
|
"decision": "exempt",
|
||||||
"source": "a reversal: its evidence is its original's (B-43, D-47, D-12)"
|
"source": "a reversal: its evidence is its original's (BS-entry-5, D-47, D-12)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -220,7 +220,7 @@
|
|||||||
"receipts": 0,
|
"receipts": 0,
|
||||||
"requirement": {
|
"requirement": {
|
||||||
"decision": "exempt",
|
"decision": "exempt",
|
||||||
"source": "a period's closing entry: derived from the books (B-43)"
|
"source": "a period's closing entry: derived from the books (BS-entry-5)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"after_close": {
|
"after_close": {
|
||||||
|
|||||||
Reference in new issue
Block a user