docs: rules.md is an index; the rules are in bookspec

Pointers that said the rule text lives in docs/spec/rules.md now point at bookspec's rules and/or wanderbooks' claims in docs/spec/claims/: the dated-rule catalog doc, the kernel module header, a payout doc, the spec-derived and model and GnuCash tests (including its panic message), the MCP interface crate table and the spec README. Same treatment for the other stale mentions the grep found in attention, the P3 seams test and the store schema. AGENTS.md gains a Docs index row for docs/spec/claims/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-11-08 20:02:13 -07:00
1 parent b63fbf8847
commit b131bdded8
13 files changed
+25 -17

No files matched your search

+1
View File
@@ -218,6 +218,7 @@ clone, with status. Rules:
| `docs/architecture.md` | Crate layout, command pattern, dependency rules |
| `docs/oracle.md` | How we check correctness: golden files, property tests, fuzzing, cross-checks against other implementations (and who is right) |
| `docs/spec/` | Wanderbooks' layer over bookspec: `claims/` (its picks, enforcement, product rules `WB-…`), `rules.md` (the B-n → bookspec-id index only), `sources/` (public-domain authorities vendored verbatim) |
| `docs/spec/claims/` | Wanderbooks' claims on each bookspec rule: the CHOICE picked, where the engine enforces it, which tests check it, and product rules `WB-<area>-<n>` |
| https://git.swaits.com/swaits/bookspec | Where the rules live (D-68): `rules/` records, `spec/rules/` reading pages, `spec/rules-index.md`; every rule is `BS-<area>-<n>` |
| `docs/verification.md` | The formal proofs: every accounting law, its Kani harness and Lean theorem, what they found |
| `docs/parity.md` | Feature catalog and the non-regression floor |
+2 -2
View File
@@ -8,8 +8,8 @@
//! laws it implements hold for books of any size. See
//! `docs/verification.md` for which proof covers which law.
//!
//! The laws, in the order they appear (each traced to its authority in
//! `docs/spec/rules.md`):
//! The laws, in the order they appear (each traced to its bookspec rule
//! and to wanderbooks' claim in `docs/spec/claims/`):
//!
//! * a line's signed amount is `+amount` for a debit, `-amount` for a credit
//! (BS-entry-2);
+1 -1
View File
@@ -86,7 +86,7 @@ pub type PayoutPlanLine = (AccountId, Side, Decimal, Option<ClassId>);
/// collected; fees debit expense accounts), and the payout reconciles to
/// the cent.
/// A zero deposit (fees and adjustments ate the sales exactly) has no
/// deposit line: every planned line is positive (BS-entry-2, docs/spec/rules.md).
/// deposit line: every planned line is positive (BS-entry-2).
pub fn payout_plan(
payout: &Payout,
chart: &ChartOfAccounts,
+2 -1
View File
@@ -30,7 +30,8 @@ use chrono::NaiveDate;
pub struct DatedRule {
/// Plain name, e.g. "1099 reporting threshold".
pub name: &'static str,
/// Its entry in docs/spec/rules.md, e.g. "BS-1099-1".
/// Its bookspec rule id, e.g. "BS-1099-1" (indexed in docs/spec/rules.md;
/// wanderbooks' claim is in docs/spec/claims/1099.md).
pub catalog: &'static str,
/// The vendored official text it comes from (a path in this repo,
/// for the people who update the rule).
+2 -1
View File
@@ -4,7 +4,8 @@
//! transcribed into the simplest Rust that has the same observable
//! behavior: a list of accounts, a list of drafts, an append-only list of
//! posted entries, a list of periods, and loops. It is written from the
//! spec (rules.md, the Ledger doc comments), not from ledger.rs.
//! spec (bookspec's rules and `docs/spec/claims/`, the Ledger doc
//! comments), not from ledger.rs.
//!
//! Random command sequences, weighted toward commands that interact (post
//! a draft, reverse a posted entry, close a period with drafts in it,
+3 -2
View File
@@ -7,7 +7,8 @@
//! pinned container (bookspec's `gnucash/oracle/`, image
//! `bookspec-gnucash-oracle`), and compares every account's
//! balance at month ends and random dates, exactly. A difference is a
//! finding to adjudicate from principles (rules.md), never a reason to
//! finding to adjudicate from principles (bookspec's rules and
//! `docs/spec/claims/`), never a reason to
//! change wanderbooks to match.
//!
//! Needs Docker: `just oracle` builds the image and runs this.
@@ -283,7 +284,7 @@ fn balances_match_gnucash_on_generated_books() {
);
assert!(
diffs.is_empty(),
"{} difference(s) with GnuCash; adjudicate each from rules.md:\n{}",
"{} difference(s) with GnuCash; adjudicate each from bookspec's rules (docs/spec/claims/):\n{}",
diffs.len(),
diffs.join("\n")
);
+2 -1
View File
@@ -1,7 +1,8 @@
//! Spec-derived tests for the `Ledger` command surface.
//!
//! Written from the spec blocks (GOAL / SOURCE / INVARIANTS / SCENARIOS) in
//! the public interface and from `docs/spec/rules.md`, never from the
//! the public interface and from bookspec's rules (wanderbooks' claims
//! in `docs/spec/claims/`), never from the
//! implementation. Every expected value is a literal computed by hand from
//! the spec, or a law (a model kept by the test itself). A test whose name
//! does not already say its oracle says it in its doc comment.
+2 -1
View File
@@ -1,7 +1,8 @@
//! Spec-derived tests for the reports (`reports.rs`).
//!
//! Written from the spec blocks (GOAL / SOURCE / INVARIANTS / SCENARIOS) and
//! `docs/spec/rules.md` / `docs/requirements.md` only, never from the
//! bookspec's rules and wanderbooks' claims in `docs/spec/claims/` /
//! `docs/requirements.md` only, never from the
//! implementation. Every expected value is either a literal computed by hand
//! from the spec or a law (property) that pins the answer without calling the
//! function under test to compute it. Where the random-book tests need a
+2 -2
View File
@@ -510,8 +510,8 @@ pub fn find_with(
});
}
// Rules set by law that wanderbooks may no longer know (rules.md;
// owner, 2026-10-13): the agent finds the figure from the authority
// Rules set by law that wanderbooks may no longer know (bookspec's
// rules and `docs/spec/claims/`; owner, 2026-10-13): the agent finds the figure from the authority
// or asks, confirms it, and passes it explicitly (the handbook's
// "Rules that change with the law"); the human reports it upstream.
for rule in ledger_core::rules::stale_rules(today) {
+1 -1
View File
@@ -1,5 +1,5 @@
//! P3's seams: the same economic fact, computed by two pieces of the
//! engine, agrees (or rules.md says exactly why not).
//! engine, agrees (or bookspec's rules / `docs/spec/claims/` say exactly why not).
//!
//! One year of fictional books for a two-member LLC (Ana Example and Ben
//! Example, 50/50), built through the real [`Store`]: cash and property
+1 -1
View File
@@ -387,7 +387,7 @@ DROP TABLE asset_depreciation;
ALTER TABLE asset_depreciation_v13 RENAME TO asset_depreciation;
"#,
r#"
-- v15: a document keeps no figure of its own (plan P4b S1, D-45; rules.md
-- v15: a document keeps no figure of its own (plan P4b S1, D-45;
-- BS-arap-2): what an invoice or bill has been paid, and its status, are read
-- from the ledger lines tagged with it, as of any date, and a reversed
-- payment no longer counts. The columns that summed its payment events
+1 -1
View File
@@ -12,7 +12,7 @@ locked to one assistant.
| Crate | Role | Spec |
|---|---|---|
| `ledger-core` | the engine: money, entries, the laws; every rule the tools enforce | `docs/spec/rules.md`, `docs/verification.md` |
| `ledger-core` | the engine: money, entries, the laws; every rule the tools enforce | bookspec's rules (`BS-<area>-<n>`), `docs/spec/claims/`, `docs/verification.md` |
| `ledger-package` | the read-only views shared with the viewer: reports, aging, the CPA package, Needs attention (the one list `books.start` and the viewer both draw) | `docs/architecture.md` |
| `ledger-store` | the hash-chained journal (the source of truth), the SQLite projection, the blob store | `docs/receipt-store.md` |
| `ledger-mcp` | the books server: the tools, resources and handbook over store + core | this document |
+5 -3
View File
@@ -1,8 +1,10 @@
# Specification sources
wanderbooks' rules come from documents, not from anyone's memory. This
directory holds the authorities the engine's specs cite (`docs/spec/rules.md`
is the rule catalog), and every spec block in the code carries a `SOURCE:`
directory holds the authorities the engine's specs cite (the rules are
bookspec's `BS-<area>-<n>` records; `docs/spec/rules.md` is only the
B-n to bookspec-id index and `docs/spec/claims/` holds wanderbooks'
claims), and every spec block in the code carries a `SOURCE:`
line pointing into it.
## The authority stack
@@ -15,7 +17,7 @@ layers differ in what they cover and in whether we may copy them:
| **Pacioli (1494), Geijsbeek translation (1914)** | The mechanics of double entry: debits equal credits, the trial balance, one money, writing only forward, correcting by opposite entry, closing into capital. No modern standard restates these; they predate every regulator. | Public domain | Vendored verbatim: `sources/pacioli-1494.md` |
| **IRS: Internal Revenue Code, Treasury Regulations, publications, form instructions** | Records and supporting documents, retention, accounting periods and methods, information returns (1099), capitalization (de minimis, 12-month rule), partners' capital, tax basis of purchased and contributed property (`sources/irs-partnership-basis.md`), payroll taxes, rounding on returns, return line items for tax categories (`sources/irs-tax-lines.md`) | Public domain (17 U.S.C. §105; IRS.gov's content policy) | Vendored verbatim: `sources/irs-*.md`, `sources/us-public-domain-status.md` |
| **File formats: Intuit (QuickBooks Online bank CSV, QuickBooks Desktop IIF), ECMA-376 Office Open XML, Microsoft Excel limits, Avery label sheets** | What `ledger-import` reads and writes: bank/card CSV layouts and signs, IIF journal entries, how XLSX stores numbers and Excel's 15-digit precision, asset-label sheet geometry (Avery 5160) | © Intuit Inc.; © Ecma International; © Microsoft; © Avery Products Corporation | Cited with short quotes, URLs, and hashes: `sources/intuit-bank-csv.md`, `sources/intuit-iif.md`, `sources/xlsx-numbers.md`, `sources/avery-5160.md` |
| **FASB Accounting Standards Codification (ASC)** | Authoritative US GAAP: cash flows (ASC 230), revenue and principal vs agent (ASC 606), foreign currency (ASC 830), credit losses and aging (ASC 326), property and depreciation (ASC 360) | © Financial Accounting Foundation | Cited by paragraph with short quotes only (in `rules.md`; the paragraphs read, with where and when, in `sources/fasb-asc.md` and below) |
| **FASB Accounting Standards Codification (ASC)** | Authoritative US GAAP: cash flows (ASC 230), revenue and principal vs agent (ASC 606), foreign currency (ASC 830), credit losses and aging (ASC 326), property and depreciation (ASC 360) | © Financial Accounting Foundation | Cited by paragraph with short quotes only (in bookspec's rules and `docs/spec/claims/`; the paragraphs read, with where and when, in `sources/fasb-asc.md` and below) |
| **FASB Concepts Statement No. 8, Chapter 4 (2021)** | Definitions of the five elements (it replaced Concepts Statement 6) | © Financial Accounting Foundation; non-authoritative | Cited with short quotes only |
| **Textbooks (OpenStax *Principles of Accounting, Vol. 1*)** | Conventions no standard states: normal balances, closing-entry mechanics, straight-line depreciation arithmetic | CC BY-NC-SA 4.0 (incompatible with this repo's license) | Cited with short quotes and attribution only |
| **Convention or decision** | Where no authority speaks: aging bucket edges, cent rounding among members, closed-period locks | — | Stated as CONVENTION or CHOICE, with who decided and when |