fix: the last rule citations in program output name bookspec ids

The engine's last program-output citations were the retired wanderbooks
numbers. Each moves to the bookspec id that states the rule:

- B-43 -> BS-entry-5, in the eight evidence-source strings of
  `Ledger::origin_exemption` and the two golden lines that record them.
- B-23 -> BS-ledger-8, in the CPA package README's aging tie-out.
- B-38 -> BS-arap-2, in `books.bills_due`'s description.
- B-37 -> BS-statement-5, in the project page's contribution note. The
  old "item 7" was the snapshot presentation in the retired numbering;
  in BS-statement-5 the figures are item 2 (a project's figures are
  exactly its tagged lines, net revenue less expenses) and item 4 (no
  cost is allocated), so the note cites those.

None of the strings is stored. The evidence source is computed on every
call by `evidence::requirement` from the ledger (`origin_exemption`);
the journal records only a draft state's note and a discard's reason
(`entry.draft_state_set`, `entry.draft_discarded`), never the gate's
source. The CPA README is built on request into the package's bytes and
exported for a token; it is never read back. Tool descriptions are
compiled into the router. The GUI note is a `const`. So an old book
replays unchanged and reports the new text; no compatibility layer is
needed.

Golden verification: `draft_states_and_evidence_gate.json` changes in
exactly two strings, the reversal's and the closing entry's evidence
sources. Both are recomputed from the same ledger by the test and
compared whole; after the change the test passes against the file, and
`git diff` shows no other line moved. The figures, decisions, journal
lines and trial balances are untouched, as the hand worksheet
`plan/golden-worksheets/draft-states-and-evidence-gate.md` derives.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
This commit is contained in:
swaitsandDeepSeek V4.1 Flash committed 2026-11-09 01:36:40 -07:00
1 parent 946777628f
commit 797c418184
5 files changed
+15 -13

No files matched your search

+10 -8
View File
@@ -2153,37 +2153,39 @@ impl Ledger {
pub(crate) fn origin_exemption(&self, entry: &JournalEntry) -> Option<&'static str> {
let id = entry.id();
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) {
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() {
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
.asset_runs
.values()
.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) {
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) => {
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 => {}
}
if (0..entry.lines().len()).any(|i| self.line_docs.contains_key(&(id, i))) {
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) {
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
}