refactor: rule references cite bookspec ids
Every B-n citation in crates/, docs/, deploy/, scripts/ and .github/ now names its bookspec id BS-<area>-<n> (D-68), via scripts/rewrite-rule-refs.py: the map is parsed from docs/spec/rules.md's index, rules.md-prefixed and bare forms are rewritten, sub-references (rule 11, item 7, INVARIANT 2) survive, and plan/, docs/spec/rules.md and docs/spec/claims/ are untouched. Program-output string literals that cited a rule were reverted by hand so user-visible output and its goldens are unchanged; DatedRule.catalog, metadata no output prints, now holds BS-1099-1. One SOURCE line that cited only 'R-?' now also cites BS-statement-5. Co-Authored-By: Muse Wonder 1.0
This commit is contained in:
1 parent
7a177a3cfc
commit
489360f598
221 files changed
+1706
-1580
No files matched your search
+14
-15
@@ -30,16 +30,16 @@ in CI that the floor never falls between commits.
|
||||
| Reversing entries | Reverse transaction | done | linked via `reversal_of`; dated on or after its original, every kind of entry (D-73) |
|
||||
| Canonical report snapshots (JSON) | — (our oracle format) | done | `reports::snapshot` |
|
||||
| Fixed-asset register + straight-line depreciation | Fixed Asset register | done | `assets.rs`; golden-covered schedule; idempotent runs; disposal with gain/loss; posted (the books') vs scheduled, in-service vs acquired dates, the §723, depreciable and §704(c) figures (P3) |
|
||||
| Cash flow statement (direct, with the reconciliation schedule and noncash disclosures) | Reports → Cash Flow | done | R-FUTURE-3; rules.md B-14 (P3 defect 1) |
|
||||
| Cash flow statement (direct, with the reconciliation schedule and noncash disclosures) | Reports → Cash Flow | done | R-FUTURE-3; BS-statement-3 (P3 defect 1) |
|
||||
| Foreign-currency lines (base + foreign stored) | Multi-currency accts | done | R-FUTURE-1 |
|
||||
| Period close (closing entry to Retained Earnings) | Close books | done | R-FUTURE-2 |
|
||||
| Bank reconciliation (cleared flags + report) | Reconcile | done | — |
|
||||
| QuickBooks CSV import (bank txns, chart of accounts) | Banking → Upload | done | R-FUTURE-4 |
|
||||
| QuickBooks IIF + XLSX export | Export / reports | done | R-FUTURE-4 |
|
||||
| A/R invoices + payments + aging | Business → Invoices | done | R-FUTURE-5; since P4b S1 (D-45) a document's paid, outstanding and status are read from its tagged ledger lines, hand lines on the receivables account are refused, `books.void_document` and `books.control_check` tie the subledger to the control account (rules.md B-38); S2 `books.documents`/`books.document` and the viewer pages; S3 the invoice PDF; S4.1-S4.3 terms, numbers, line accounts, the issued PDF filed at issue (behind `documents_v2`, the owner's next upgrade); numbers, terms, line accounts, the party snapshots and the issued PDF filed with the invoice, through `books.create_invoice`'s preview and confirm (P4b S4.4); S4.5 the issued PDF carries the number, terms, PO, quantity and price, the bill-to's contact block and ship-to, the ways to pay with QR codes, the memo and the footer, and the viewer shows the number, terms, bill-to and PO and saves the issued copy |
|
||||
| A/R invoices + payments + aging | Business → Invoices | done | R-FUTURE-5; since P4b S1 (D-45) a document's paid, outstanding and status are read from its tagged ledger lines, hand lines on the receivables account are refused, `books.void_document` and `books.control_check` tie the subledger to the control account (BS-arap-2); S2 `books.documents`/`books.document` and the viewer pages; S3 the invoice PDF; S4.1-S4.3 terms, numbers, line accounts, the issued PDF filed at issue (behind `documents_v2`, the owner's next upgrade); numbers, terms, line accounts, the party snapshots and the issued PDF filed with the invoice, through `books.create_invoice`'s preview and confirm (P4b S4.4); S4.5 the issued PDF carries the number, terms, PO, quantity and price, the bill-to's contact block and ship-to, the ways to pay with QR codes, the memo and the footer, and the viewer shows the number, terms, bill-to and PO and saves the issued copy |
|
||||
| A/P bills + payments + aging | Business → Bills | done | R-FUTURE-5; the same S1 derivation and control guard on the payables account; S4.1-S4.3 the vendor's invoice number, terms, every line on its own account (behind `documents_v2`); the vendor's own invoice number (a duplicate refused), terms, line accounts and the vendor's invoice filed as the bill's evidence, through `books.create_bill`'s preview and confirm (P4b S4.4); S4.5 the viewer shows the vendor's number, the day received, terms and memo, and the handbook's procedure (numbers, terms, line accounts) |
|
||||
| Payroll runs (accounting only, no tax tables) + tax remittance | Payroll | done | — |
|
||||
| Tracking classes (divisional P&L) | Class tracking | done | invoice and bill lines take a class too (projects, rules.md B-37 item 8; QBO/Xero class or tracking per line) |
|
||||
| Tracking classes (divisional P&L) | Class tracking | done | invoice and bill lines take a class too (projects, BS-statement-5 item 8; QBO/Xero class or tracking per line) |
|
||||
| CPA handoff package (TB + GL xlsx, P&L + BS pdf, zip) | Reports → export | done | — |
|
||||
| Budgets | Budgets | todo | R-FUTURE-6 (declined as bloat) |
|
||||
| Scheduled transactions (recurring entries → drafts) | Scheduled txns / Recurring transactions | partial | hand-verified fixture incl. month-end dates; drafts only, by design |
|
||||
@@ -48,7 +48,7 @@ in CI that the floor never falls between commits.
|
||||
| Prepaid expense + deferred revenue amortization | Amortization schedules (Xero/QBO add-ons) | done | hand-verified fixture, to the cent; golden-covered (`golden/amortization_plans.json`, `schedules.rs::golden_amortization_plans`: plan, posted, remaining, P&L and balance sheet; worksheet `plan/golden-worksheets/amortization-plans.md`) |
|
||||
| Automated cross-implementation diff harness (GnuCash first) | — (`just oracle`) | partial | live: `tests/oracle_gnucash.rs` runs 200 random books through GnuCash 5.10 in a pinned container, 15,800 exact comparisons, weekly in CI (docs/oracle.md Layer 5); open: fixture books diffed as `snapshot()` output, and the machine-readable catalog with CI enforcing this floor |
|
||||
| Invoice sent tracking (who, how, to whom, when, original or reminder, the channel's reference) | Business → Invoices (Xero's "Sent"; QBO's email) | done | P4b S5; records, never sends (A-4); a send changes no figure; `invoice.sent` under `documents_v2` (D-52) |
|
||||
| Multi-document settlements with early-payment discounts (gross method) | Business → Invoices/Bills; Receive payment | done | P4b S6: one entry, one party, one application per document (`kernel::settle`, B-42); a discount beyond the terms needs a reason; a bill with an asset line is refused (D-49); the bill and its payment tested, replay equal to live |
|
||||
| Multi-document settlements with early-payment discounts (gross method) | Business → Invoices/Bills; Receive payment | done | P4b S6: one entry, one party, one application per document (`kernel::settle`, BS-arap-6); a discount beyond the terms needs a reason; a bill with an asset line is refused (D-49); the bill and its payment tested, replay equal to live |
|
||||
| A processor's fee on a payment received (gross presentation) | Xero/QBO Stripe & Shopify deposits | done | P4b S6: Dr the deposit the net, Dr processing fees the fee, Cr A/R the gross (A-4); `a_fee_posts_gross_to_receivables_and_net_to_the_bank` |
|
||||
| Bills due, aging detail and tie-out, aging exports | Business → Bills; Reports → A/R and A/P Aging | done | P4b S6: `books.bills_due`, `detail`, `control`, `ar_aging.csv`/`ap_aging.csv` in `books.export` and the CPA package, each with its `TOTAL` tie-out (`the_aging_csvs_tie_to_the_control_check`) |
|
||||
|
||||
@@ -59,13 +59,12 @@ egui phase starts; semantics come first.
|
||||
|
||||
P0 (`plan/served.md`) changed no feature in the catalog above, so no
|
||||
status moved and the floor stands. It hardened what exists: an older
|
||||
version refuses books from a newer one as newer, not corrupt (rules.md
|
||||
B-27); the MCP server fails closed after an internal error, and no input
|
||||
reaches one (dates are four-digit years, amounts at most a line's, B-28);
|
||||
version refuses books from a newer one as newer, not corrupt (BS-format-1); the MCP server fails closed after an internal error, and no input
|
||||
reaches one (dates are four-digit years, amounts at most a line's, BS-entry-4);
|
||||
local files
|
||||
were read only from the import roots, never the books, the vault or its
|
||||
key (P2 slice 5 removed local paths: files now come in only as uploads,
|
||||
D-46); no file with a full TIN is filed into the books (B-26); the agent is
|
||||
D-46); no file with a full TIN is filed into the books (BS-partner-2); the agent is
|
||||
told the rules in force in a short connect text and a handbook, and no
|
||||
agent text points at the books' files, git or the repo.
|
||||
|
||||
@@ -109,7 +108,7 @@ P13 is a specification, not a feature, so no row of the semantic catalog
|
||||
moves and the floor stands. It adds the checker crate (`bookspec/checker`:
|
||||
the example schema, the rule identifiers `BS-<area>-<n>` and the `Engine`
|
||||
trait), the runner (`bookspec/runner`: pass, fail or not claimed per rule),
|
||||
and the rule index from B-1 to B-45 (`bookspec/spec/rules-index.md`). Every
|
||||
and the rule index from BS-entry-1 to BS-ledger-13 (`bookspec/spec/rules-index.md`). Every
|
||||
existing bookspec example still runs on every `cargo test`, through both
|
||||
the loader's own checks and the `Engine` trait.
|
||||
|
||||
@@ -122,7 +121,7 @@ number and due date it will take, the DRAFT or the discount, and nothing
|
||||
written) and post with it (A-1), which is what the workflow reference
|
||||
does before a document leaves the company. A bill in books that have
|
||||
declared `documents_v2` names each line's account and keeps the vendor's
|
||||
invoice (A-10, A-13); an invoice keeps the copy it issued (A-7, B-40) and
|
||||
invoice (A-10, A-13); an invoice keeps the copy it issued (A-7, BS-arap-4) and
|
||||
a `mailto` link for a human to send it, since the books never send (A-4).
|
||||
`books.update_party` takes the party's email and terms per side (A-13) and
|
||||
the owner's full contact block (D-55: phone, contact person, billing and
|
||||
@@ -144,7 +143,7 @@ saves the issued copy beside the re-created one; the Money in list names an
|
||||
invoice by its number. The handbook's invoices-and-bills procedure is
|
||||
complete (issue, collect, pay on terms, void or write off, the fee, the
|
||||
CPA's list) and says what waits for the owner's upgrade. rules.md gains
|
||||
B-39 (terms) and B-40 (numbers and the issued copy). No golden moved.
|
||||
BS-arap-3 (terms) and BS-arap-4 (numbers and the issued copy). No golden moved.
|
||||
|
||||
### P9a self-host deployment (2026-10-26)
|
||||
|
||||
@@ -188,7 +187,7 @@ A/R gained the direct write-off the owner chose (A-5; plan 8.2 S7): an
|
||||
invoice that will not be collected comes off 1200 with Dr 6990 Bad Debt
|
||||
Expense, its receivable line tagged `WriteOff` so the receipt's figures
|
||||
stay derived, and its evidence of worthlessness filed in the same call
|
||||
(rules.md B-41; IRC §166, §111; Treas. Reg. §1.166-1(e), (f), -2(a),
|
||||
(BS-arap-5; IRC §166, §111; Treas. Reg. §1.166-1(e), (f), -2(a),
|
||||
-3(a)). A same-year recovery is the reversal D-49 records, not a new
|
||||
movement; bills are never written off. No row above changed status (the
|
||||
A/R and A/P rows already say `done`), so the floor stands (10 done).
|
||||
@@ -207,7 +206,7 @@ hash `books.verify` checks), holds identical bytes as one live attachment
|
||||
annotation field list, engine receipt numbers running from the max) and
|
||||
what a payment settles (`entry.settles`, the only source of "reimbursed"),
|
||||
and gives company records four more homes (`notices`, `correspondence`,
|
||||
`plans`, `history`, D-20). Rules.md B-44 states it; `docs/testing.md`'s P6
|
||||
`plans`, `history`, D-20). Rules.md BS-ledger-12 states it; `docs/testing.md`'s P6
|
||||
section lists its tests and the P12 mutation targets.
|
||||
|
||||
### P4: drafts, the evidence gate, the preview digest (2026-10-29)
|
||||
@@ -216,7 +215,7 @@ Three new rows, none above changed status, and the floor stands.
|
||||
|
||||
| Area | Counterpart (a cross-check, not the spec) | Status | Notes |
|
||||
|---|---|---|---|
|
||||
| Draft states and discard (`books.set_draft_state`, `books.discard_draft`, `books.list_drafts`; Lean `Step.discard`) | Draft/pending transactions (QBO "pending"), voiding an unposted entry | done | `entry.draft_state_set` and `entry.draft_discarded` under `drafts_v2`; B-43; tests `discard_unblocks_close`, `draft_states_replay_and_project`, `a_draft_waits_for_its_receipt_and_posts`; the fixture `p4_before` was written by the version before and opens to the same figures; golden-covered (`ledger-store` `golden/draft_states_and_evidence_gate.json`, `golden_drafts.rs::golden_draft_states_and_evidence_gate`; worksheet `plan/golden-worksheets/draft-states-and-evidence-gate.md`) |
|
||||
| Draft states and discard (`books.set_draft_state`, `books.discard_draft`, `books.list_drafts`; Lean `Step.discard`) | Draft/pending transactions (QBO "pending"), voiding an unposted entry | done | `entry.draft_state_set` and `entry.draft_discarded` under `drafts_v2`; BS-entry-5; tests `discard_unblocks_close`, `draft_states_replay_and_project`, `a_draft_waits_for_its_receipt_and_posts`; the fixture `p4_before` was written by the version before and opens to the same figures; golden-covered (`ledger-store` `golden/draft_states_and_evidence_gate.json`, `golden_drafts.rs::golden_draft_states_and_evidence_gate`; worksheet `plan/golden-worksheets/draft-states-and-evidence-gate.md`) |
|
||||
| One evidence gate (`evidence::requirement`) | Attach-required rules on posting | done | the store, the previews, the digest, the viewer and Needs attention call one function; `gui_and_server_gate_agree`, `a_reversal_needs_no_receipt_of_its_own` (D-47); golden-covered by the same file as the row above (every entry's `evidence::requirement`, the gate's refusals, a reversal exempt by origin) |
|
||||
| Preview digest on every confirm (D-50) | Confirm dialogs | partial | `stale_preview_refused`, `every_confirm_tool_takes_a_preview`; detects drift, not a human's look |
|
||||
|
||||
@@ -246,7 +245,7 @@ Three new rows, none above changed status, and the floor stands.
|
||||
|
||||
| Area | Counterpart (a cross-check, not the spec) | Status | Notes |
|
||||
|---|---|---|---|
|
||||
| Audit run: one programme of checks over the statements, the control accounts, closes, schedules, assets, evidence, drafts, tax categories, 1099 decisions, settings and the store's integrity (`books.audit`, `books.workpaper`) | An auditor's workpaper; QBO "Audit log"/"Review" and Xero's "Reports review" are a cross-check only | done | rules.md B-45; `ledger_core::audit`, `ledger_store::audit`; tests `audit_detects_each_seeded_defect` (every code seeded), `audit_is_deterministic`, `workpaper_pdf_is_deterministic`; the fixture `p8_before` was written by the version before; golden-covered (`golden/audit_workpaper.json`, `golden_audit.rs::golden_audit_workpaper`: five findings in five areas, the 1099 and cash-flow inputs derived from the books; severities are the `CODES` table's CONVENTION; worksheet `plan/golden-worksheets/audit-workpaper.md`) |
|
||||
| Audit run: one programme of checks over the statements, the control accounts, closes, schedules, assets, evidence, drafts, tax categories, 1099 decisions, settings and the store's integrity (`books.audit`, `books.workpaper`) | An auditor's workpaper; QBO "Audit log"/"Review" and Xero's "Reports review" are a cross-check only | done | BS-ledger-13; `ledger_core::audit`, `ledger_store::audit`; tests `audit_detects_each_seeded_defect` (every code seeded), `audit_is_deterministic`, `workpaper_pdf_is_deterministic`; the fixture `p8_before` was written by the version before; golden-covered (`golden/audit_workpaper.json`, `golden_audit.rs::golden_audit_workpaper`: five findings in five areas, the 1099 and cash-flow inputs derived from the books; severities are the `CODES` table's CONVENTION; worksheet `plan/golden-worksheets/audit-workpaper.md`) |
|
||||
| Attestations of receipts, entries and periods, weighed against `policy.attestation_bar` when asked (`books.attest_receipt`, `books.review_entry`, `books.attest_period`, `books.attestations`) | An accountant's sign-off on a month | partial | `below_bar_not_counted`, `amount_mismatch_never_counts`, `stale_head_period_attestation_refused`; the method is the client's own claim, and the books say so |
|
||||
| The CPA package waits for a counted audit (`policy.cpa_package_requires_audit`) | A close checklist before handoff | partial | `cpa_package_refuses_without_a_counted_audit_unless_a_reason_is_given`; behind the feature `audits` |
|
||||
|
||||
|
||||
Reference in new issue
Block a user