refactor(core): the bookspec adapter becomes modules by area

The bookspec adapter was one 4,647-line test file, and every later unit
that adds a query or an event touches it. Split it by its own sections,
with no behaviour change: `main` keeps the crate doc, the shared imports
and the module list; `common` holds the shared vocabulary (dates,
refusals, exact decimals, figure formatting); `books` the example's
books and setup; `events` the application of each event; `queries/` the
answers and checks per query family (statements, parties, tax, assets,
formats, commands, dates); `engine` the `Engine` impl; `check` and `run`
the drivers; and `examples`, `loader_tests`, `sources` and `rules_md`
the tests by area. Every `#[test]` keeps its function name (52 tests,
same names), and Cargo still builds one test target named `bookspec`.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
This commit is contained in:
swaitsandDeepSeek V4.1 Flash committed 2026-11-08 10:49:03 -07:00
1 parent 66d9b7ac54
commit f9cdf4d718
24 files changed
+4764 -4663

No files matched your search

+2 -2
View File
@@ -80,7 +80,7 @@ harnesses), `reports`, `cashflow`, `analysis`, `periods`, `assets`,
`classes`, `parties`, `arap`, `settings`, `conventions`, `calendar`,
`shares`, `tax_capital`, `rules`, `audit` (the audit programme's pure checks, P8), `error`; its tests in `tests/`
(`invariants.rs`, `properties.rs`, `spec_*.rs`, `kernel_bridge.rs`,
`model.rs`, `bookspec.rs`, `golden/`).
`model.rs`, `bookspec/`, `golden/`).
## Dependency rules
@@ -330,7 +330,7 @@ to move to its own repository (P13 step 6, D-34, Z-17):
whether its own answer is right.
- `bookspec/spec/rules-index.md` maps B-1 to B-45 to the bookspec ids;
`docs/spec/rules.md` carries each stated rule's id under its heading.
- `crates/ledger-core/tests/bookspec.rs` is the wanderbooks adapter: it
- `crates/ledger-core/tests/bookspec/` is the wanderbooks adapter: it
implements `Engine` over `Store` (a dev-dependency only, so no engine
crate depends on the specification) and remains the loader that checks
every figure. `ledger-package` answers the formats appendix's IIF