Commit Graph
283 Commits
Author SHA1 Message Date
swaitsandMuse Wonder 1.0 fd1c4ae018 docs(spec): prepaid claims reduced to wanderbooks' picks and product rules
B-16's accounting text moved to bookspec (BS-prepaid-1). What stays:
the daily pick (D-11/D-37), the equal-months-from-the-first pick
(D-37), the minor-unit rounding pick for new monthly-even schedules
(D-72), Enforced/Checked evidence, and WB-prepaid-1..2: the
books.schedule_convention setting and D-72's versioning (schedules
written before the change replay the cent rule; the engine change is
unit K-U5's).

Co-Authored-By: Muse Wonder 1.0
2026-11-08 11:45:32 -07:00
swaitsandMuse Wonder 1.0 3344c9cf60 docs(spec): period claims reduced to wanderbooks' picks and product rules
B-11, B-12 and B-30's accounting text moved to bookspec
(BS-period-1..3). What stays: the nesting pick (2026-10-13), the
fiscal-year-to-date default pick (2026-10-20), Enforced/Checked
evidence, and WB-period-1..4: refused commands never reach the journal,
the surfaces the one default binds, the package and viewer presets
that do not follow the default, and the surfaces with no default.

Co-Authored-By: Muse Wonder 1.0
2026-11-08 11:45:32 -07:00
swaitsandMuse Wonder 1.0 79291c6927 docs(spec): statement claims reduced to wanderbooks' picks and product rules
The accounting text of B-6, B-7, B-14, B-33 and B-37 moved to bookspec
(BS-statement-1..5). What stays: B-14's picks (direct method, the
operating/investing/financing allocation order, constructive on-behalf
cash per D-42, the government split rounding, payroll's class), B-33's
pick (the 1099 worksheet stops at as_of, D-36) and B-37's picks
(project-is-a-class; document lines name one project or none, D-43),
each rule's Enforced/Checked evidence, and WB-statement-1..7: the
account designation settings and role refusal, the statement warnings
and printed layout, rule 11's bookkeeping limits, the CPA package, the
project facts, the link and notice behaviour, and the snapshot
presentation.

Co-Authored-By: Muse Wonder 1.0
2026-11-08 11:45:32 -07:00
swaitsandClaude Opus 5.5 05702b5a34 merge: verify/lean requires bookspec's Lean; the laws live once (L-F2; branch t3/lean-laws-bookspec-dependency, 4d9c73de)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
The ten Lean files were code-identical to bookspec's (checked per file);
wanderbooks keeps a thin Wanderbooks.lean importing Bookspec and audits
the same 151 theorems. The Lean pin moves to 62c0bf26 at the merge,
the rev the Rust checker was pinned to after S-B (the new pin test
caught the difference), and lake-manifest.json is regenerated. Conflicts
with K-U0 and S-D0 resolved: the proofs/ path and the bookspec Lean path
both kept, L-F2's Deductible path fix applied to the claims file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:37:48 -07:00
swaitsandDeepSeek V4.1 Flash 4d9c73deef docs: the Lean laws, and their paths, are bookspec's
The laws are proved once in bookspec (D-69), so the documents that said
"put the new theorem in `verify/lean`" or cited
`verify/lean/Wanderbooks/<File>.lean` now say otherwise:

- AGENTS.md's formal-methods bar: a new law is written in bookspec's
  `lean/Bookspec/`; wanderbooks requires it and moves its pin (the lakefile,
  the manifest, and the crates' Cargo.toml together; the pin test fails if
  they drift). `Audit.lean` lists every theorem.
- docs/verification.md: the model and every cited Lean file are
  `bookspec/lean/Bookspec/<File>.lean`; "Running it" says the dependency is
  fetched and that all 151 theorems are audited.
- docs/testing.md and docs/spec/rules.md: the same paths, and the apportion
  row records where its law moved.
- README's repo map and the two test comments that named the Lean peer.

No accounting behavior changes; only where the proofs and their names live.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 11:36:00 -07:00
swaitsandClaude Opus 5.5 75c666a7ce merge: the kernel and its proofs become modules, one file per sweep unit (K-U0; branch t3/kernel-modules-scaffold, 0cf013b5; same 1,096 tests, 27 bridge properties, 53 harnesses, 118 theorems)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Conflicts with X-H0 and S-D0 resolved: both new paths kept
(tests/bookspec/, tests/kernel_bridge/, src/proofs/); K-U0's two path
fixes in rules.md applied to the claims file the rule moved to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:32:32 -07:00
swaitsandDeepSeek V4.1 Flash 0cf013b578 refactor(core): the kernel and its proofs become modules, one file per sweep unit
kernel.rs is now kernel/: mod.rs keeps the laws and re-exports entries
(the old file, unchanged) plus one file per kernel-sweep unit (U1 fx, U2
round, U3 allocate, U4 total, U5 schedule, U6 ratio, U7 payroll, U8
control). proofs.rs is proofs/: mod.rs holds the original 63 harnesses and
each unit gets a file of its own. tests/kernel_bridge.rs is now
tests/kernel_bridge/main.rs plus one file per unit; Cargo still builds the
single test target named kernel_bridge.

`_kani` now scans proofs/mod.rs and proofs/*.rs and passes the fully
qualified name each file gives its harness (Kani's --exact matches only a
fully qualified name), so a harness resolves wherever it lives. It fails
when kani_slow names no harness, or when two harnesses share a name and
would make the slow list ambiguous; `just prove-list` prints every harness
with its module path and set, showing the slow list resolved without
running it.

Nothing moves in the books: the same 53 fast Kani harnesses and 118 Lean
theorems verify, and the same 1096 tests pass (27 in the bridge).

Docs: verification.md gains the kernel-sweep policy (each unit writes
docs/proofs/<unit>.md; the integrator folds the notes into
verification.md and Audit.lean in one edit per batch), and the file
references in AGENTS.md, testing.md, architecture.md, oracle.md and
spec/rules.md follow the new paths.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 11:30:47 -07:00
swaitsandDeepSeek V4.1 Flash ca8d676d53 docs(spec): rules.md splits into one claims file per bookspec area
P14 unit S-D0 (plan/bookspec-audit.md D0) is a mechanical split, no
content change. bookspec is becoming the definitive spec, and later
units move each rule's accounting text there and reduce wanderbooks'
copy to the engine's claim (the pick, where it is enforced, which
tests check it) plus product rules. Several workers reduce different
areas in parallel; one 3,696-line file blocks them, so the file is
split first by bookspec area (the B -> area map is bookspec's
spec/rules-index.md).

Every `## B-n` section moves verbatim, in B order, into
docs/spec/claims/<area>.md: entry 5, ledger 13, statement 5, period 3,
partner 4, asset 4, prepaid 1, arap 6, revenue 1, 1099 1, format 2.
docs/spec/rules.md keeps its preamble and becomes the index (B,
bookspec id, area, link to the claims heading), so the existing
"rules.md B-n" references still resolve until S-E rewrites them. The
bookspec test now reads every claims file and the index, so every
stated rule's id is still verified where it is carried.

The split is proved lossless: the preamble plus the 45 claims sections
concatenated in B order is byte-identical to the old rules.md. No WB-n
product rules exist in rules.md, so no docs/spec/product.md is created
(D0's other half) until product rules are written.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 11:10:16 -07:00
swaitsandDeepSeek V4.1 Flash f9cdf4d718 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>
2026-11-08 10:49:03 -07:00
swaitsandClaude Sonnet 5.5 aa1331c8bd docs: law 39 names its Lean theorems
Law 39 said no Lean theorem was needed because the Books model has no
tax categories. That reasoning was wrong: the law is pure kernel
arithmetic, like Prorate's roundUnit laws, and needs no Books model.
verify/lean/Wanderbooks/Deductible.lean now proves it at any size.

verification.md law 39 lists the Lean theorems in the usual format and
states the split plainly: Lean proves the law on integers over a common
denominator (one rounding, Prorate.roundUnit on the magnitude, signed
after); Kani proves the code on i64; the bridge and exact-reference
properties carry it to Decimal; overflow stays outside the model.
rules.md B-32's Checked line and plan/STATUS.md name the Lean file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 08:14:49 -07:00
swaitsandMuse Wonder 1.0 9f5ff9d0bf docs: law 39 names the Decimal coverage and the no-x100 rounding
Say which part of the Decimal path the new exact-reference property covers (decimal percents, sub-cent books, multi-share categories) beside deductible_amount_agrees, note the negative-tie cover, and record that Decimal checked_div_round_cent now rounds from mantissa and scale by exact i128 arithmetic with None left for a product or sum overflow or a quotient Decimal cannot hold. That is the spec change the overflow fix makes in law 39's text.

Co-Authored-By: Muse Wonder 1.0
2026-11-08 06:41:05 -07:00
swaitsandDeepSeek V4.1 Flash 96a4c4a3b4 docs: the deductible share's percent may carry decimals; measured times
The kernel function's doc now says a percent is a deductible percentage
in 0..=100 and that an override may carry decimals (33.33 is exact), the
fact the tax API allows. docs/verification.md's harness table records the
new harness at 992 s alone and 1,207 s inside the 2026-11-08 prove-slow
run, both under the 1,800 s cap.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 06:13:26 -07:00
swaitsandDeepSeek V4.1 Flash be98b99abb docs: B-32 and verification name the kernel's deductible rounding
B-32's CHOICE now says the category rounding is
`kernel::deductible_amount`, and its Enforced/Checked lines name the two
Kani harnesses and the bridge property. docs/verification.md adds law 39
(the exact sum, rounded once to the cent, never share by share), its
harnesses, the bridge, and the harness table row and the new prove /
prove-slow counts. It records why this law has no Lean model: it is a
report figure's arithmetic, like `discount_max` and `unrecovered_cost`,
not a `Ledger` command or a law about posted entries; the model's Books
has no tax categories, and the arithmetic it would restate is the kernel
function's own definition.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 05:44:59 -07:00
swaitsandClaude Opus 5.5 4551566767 fix(just): p12-night counts a mutation run with survivors as finished, not failed
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
cargo-mutants exits 2 when mutants were missed and 3 when some timed out.
The runner treated every non-zero exit as a failure, and a failed step
starts fresh, so a crate with even one equivalent mutant would have been
mutated from scratch every night and never marked done. Exits 2 and 3 now
record the counts as findings to triage and mark the step done; any other
exit (a usage error, a failing baseline) still fails. A resumed run's
failure note now says its counts are this run's (cargo-mutants rotates
earlier catches into previously_caught.txt). Review of 3b989916 (Muse),
F1 and F2; checked with a stand-in just exiting 2 and 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 12:26:01 -07:00
swaitsandDeepSeek V4.1 Flash 3b9899167c feat(just): p12-night resumes a cut-off mutation step with --iterate
A mutation step stopped at P12_STOP (or by `just p12-stop`) is marked
partial and used to restart from scratch the next night: run_mutants
rm -rf'd the crate's output directory and the recipes did not pass
cargo-mutants' --iterate. A crate whose run takes longer than one night
could never finish.

cargo-mutants 27.1.0 writes caught.txt, unviable.txt, timeout.txt and
missed.txt incrementally, and --iterate reads caught.txt, unviable.txt
and previously_caught.txt before rotating the output directory. A killed
run therefore resumes: mutants already caught or found unviable are
skipped, while missed, timed-out and never-reached mutants are retested.
Verified on a scratch crate: a run killed after 19 of 42 mutants; the
--iterate rerun found 23 to test, excluded the 19, retested the mutant
killed mid-test and the unreached ones; a third run excluded 38 and
retested only the 4 missed.

A partial mutation step now keeps its output directory and the runner
sets P12_MUTANTS_ITERATE=--iterate; every mutation recipe forwards that
variable to cargo-mutants. Fresh and failed steps still rm -rf and start
over, and the empty-name guard stays before the rm. The step result
records that it resumed and how many mutants were already tested.

Also resolve cargo-mutants' output layout while here: -o NAME puts the
files in NAME/mutants.out, so the state copy, the counts and the resume
skip count now use that inner directory instead of counting zero. The
core recipe's default output is already the repo's mutants.out.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-07 12:18:52 -07:00
swaitsandClaude Opus 5.5 30bbf9a1ba docs: B-32 names D-67 and its tests; the tax worksheet notes the rounding is decided
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Review notes on the round-once change: B-32's Status line now lists the
owner's 2026-11-07 CHOICE and its Checked line the two tests that pin
it; the Form 1065 worksheet's two remarks that no rule stated the
rounding now say D-67 settled it (the golden, one account per
category, is unchanged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 12:10:52 -07:00
swaitsandClaude Opus 5.5 107571fd5e merge: the tax summary rounds a category's deductible amount once (D-67; branch t3/tax-summary-round-once, 5b1f9d02; reviewed)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 12:10:39 -07:00
swaitsandMuse Wonder 1.0 5b1f9d0232 docs: D-67, the tax summary rounds once per category
Record the owner's 2026-11-07 decision in rules.md B-32 and as D-67 in plan/served.md 10.1: a category's deductible amount is the exact sum of its accounts' shares, rounded once to the cent, following B-21's 'round off only the total'.

Co-Authored-By: Muse Wonder 1.0
2026-11-07 12:03:43 -07:00
swaitsandClaude Opus 5.5 8934bef8a2 docs(parity): the audit run is done, floor 36
It waited on a hand-verified golden covering a workpaper. One small book
seeds five findings in five check areas (a missing receipt, an open
draft, a schedule three months behind, an uncategorized account, an
undecided 1099 vendor paid 900.00), with the 1099 and cash-flow inputs
derived from the books as the MCP tool derives them. A second model
(Sonnet) recomputed every finding; its review moved the 1099 input from
a hand-fed string to a posted payment and corrected the worksheet: B-45
fixes a deterministic, ordered list, and the severities are the code's
own CODES table, a CONVENTION the golden pins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 11:59:44 -07:00
swaitsandClaude Opus 5.5 0162ee436e docs(parity): draft states and discard, and the one evidence gate, are done, floor 35
Both rows waited on a hand-verified golden covering a discard. One store
fixture now pins every draft's state, each entry's evidence requirement
(a reversal exempt by origin above the threshold, D-47), the gate's two
refusals, a discard that moves no balance and spends no id, and a close
refused while a draft holds the period and accepted after its discard.
A second model (Muse) recomputed every value independently from B-43
and D-47 and showed a wrong balance, a flipped exemption and a bypassed
gate each fail the test. Worksheet: the closing entry is pinned under
close_after_discard, not posted_entries (review note).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 11:57:14 -07:00
swaitsandClaude Opus 5.5 3ac3e8b1b4 docs(parity): the 1099 worksheet and prepaid/deferred amortization are done, floor 33
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Both rows lacked only a golden file. Each now has one computed by hand
before the engine's output was read; a second model (Sonnet) recomputed
both independently. The review found the 1099 golden pinned no card
exclusion (the fixture never records its card, so by B-19 the charge
counted for no one); the golden test now records the card as a business
card, so Sam's 5,000 is excluded and listed, and the unrecorded case is
asserted in cash_paid_per_vendor_and_who_is_reportable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 10:31:21 -07:00
swaitsandClaude Opus 5.5 671ccac733 docs(parity): date-range P&L, as-of balance sheet and trial balance, general ledger are done, floor 31
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
The four rows lacked only a golden file. One fixture (the fixture
company plus a three-leg purchase, the engine's own January close and a
February entry) now backs four goldens computed by hand before the
engine's output was read; a second model (Sonnet) recomputed all four
independently, confirmed the P&L drops the close by its closing-entry
id and not by date, and showed a cent, a missing line or a reordered
posting fails each test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 10:05:25 -07:00
swaitsandClaude Opus 5.5 e2c16f01ed docs(parity): members' equity and tax summary are done, floor 27
Both rows lacked only a golden file. Each now has one whose every
number was computed by hand from the fixture before the engine's output
was read, and a second model recomputed both independently (Muse) and
showed a 0.01 change to the golden fails the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 10:04:55 -07:00
swaitsandClaude Opus 5.5 f030157c87 merge: just p12-night, the resumable overnight run (P12 step 2, D-66; branch t3/placeholder, 78ef6006)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:51:59 -07:00
swaitsandClaude Opus 5.5 78ef6006d2 test(just): p12-night, the resumable overnight run (P12 step 2, D-66)
One detached command walks fuzzing, the proofs, the GnuCash oracle, the property maxima and the nine mutation recipes. Each step's status, timing, log and key result live under ${XDG_CACHE_HOME:-$HOME/.cache}/wanderbooks/p12; done markers make the next night resume, and P12_STOP stops the running process group at the deadline so the machine is free in the morning.

The property maxima are the env-controlled ones docs/testing.md names: STORE_CASES=5000, WB_ORDERS_DEPTH=6 (plan 8.2/STATUS), CF_CASES=5000, PROPTEST_CASES=5000 for spec_party_totals and 2000 for settings_replay_is_pure. The form1099 property's documented 2,000 has no env knob (it hard-codes 256) and is recorded as a gap rather than guessed at. Mutation runs do not use --iterate because the recipes as written do not pass it, so a cut-off crate restarts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:51:02 -07:00
swaitsandClaude Opus 5.5 76b64f99c2 test(parity): machine-check the catalog's statuses and floor
docs/parity.md was only review-checked. `parity_floor.rs` now parses every
table with a `Status` column and fails unless each status is exactly
`done`, `partial` or `todo`, and unless the count of `done` rows equals
the floor line exactly. Equal, not at least: adding a done row raises the
line in the same commit, so a later drop cannot pass unnoticed. The
parser's own cases (a bad status, an empty status, a missing floor line)
are unit-tested inline.

The catalog said 21 done but held 25. The floor line was stale, not the
rows: P4b S5 added one done row (invoice sent tracking) and S6 added three
(multi-document settlements, the processor's fee, bills due and aging),
all four named in the notes with their tests. Raising the line to 25
fixes the discrepancy without demoting anything; the history sentence is
kept and the reason is added to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:45:18 -07:00
swaits 3aa1206afc merge: P12 step 1, the fuzz targets, the op-sequence extension and the mutation recipes (branch P12, 48062b89)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
2026-11-05 08:49:36 -07:00
swaitsandClaude Fable 5.1 4b0196e416 docs(testing): P12 checklists, one per crate (P12 step 1)
The For P12 paragraphs, each left where its unit wrote it with a pointer,
consolidated into one mutation checklist per crate, each item keeping its
origin unit in brackets, so the run walks a crate at a time.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-11-05 08:36:15 -07:00
swaits 7b1774512b docs: record the in-app accept, the update notice and translocation (P11a)
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
The interface spec gains `books.start`'s allocated `update_waiting` field
and says only the owner can accept it. The packaging and architecture
notes now describe the lease intent, the viewer's notice and "Check for
updates", and the translocated-app refusal instead of listing them as not
built. The testing record names each new test and the mutation targets it
gives P12. The plan's P11a status and As-built block record what landed
and what still waits: the Mac trial, the Windows installer (P11c's) and
signing (D-64).
2026-11-05 08:29:20 -07:00
swaitsandClaude Fable 5.1 b96735da01 fix(store): truncating an append-only log goes through a write handle on Windows (P11c)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
std's append(true) opens without FILE_WRITE_DATA, so SetEndOfFile on that
handle is refused (PermissionDenied) on Windows: the torn-line cut on open
(chain::tests::an_unfinished_last_line_is_cut_away_on_open) and the
roll-back of a failed append (chain and journal) could not truncate. Not a
rename/share-delete problem: std already opens with all three sharing
flags. chain::truncate cuts through a short-lived write handle on Windows
and the handle itself elsewhere; the journal's roll-back uses it too.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-30 07:49:03 -06:00
swaitsandClaude Fable 5.1 84cbe0359c merge: main into P11c (P11b's dock and books homes, the macOS harness root fix)
One conflict, ledger-host commands.rs: main moved the agent-program lookup
into find_agent_in; kept that and carried the Windows parts into it
(.exe/.cmd/.bat, npm's global folder). The harness already used
default_root, so main's fix and ours agree.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 17:26:43 -06:00
swaitsandClaude Fable 5.1 8f2e3378e8 feat(viewer): the agent dock and the first-run page (P11b)
D-27: a terminal panel along the bottom of the viewer (alacritty_terminal over
a PTY) runs Claude Code (default) or Codex in the book's books home, resizable,
collapsible, the choice remembered. The agent is an ordinary child process the
owner describes (agent_start); the viewer stays read-only: the agent writes
through the server like any other. A missing agent is offered through its
vendor's installer (a command to copy), never bundled; no folder is marked
trusted (Q-7, recommended answer: let Codex ask). Windows is not offered until
its ConPTY checks are recorded.

P11a found that onboarding with no terminal was false: the viewer opened only an
existing book. With no books and an owner, wanderbooks gui now shows a first-run
page: the private folder, the owner passphrase (typed in the viewer, optional),
the first books, an agent, then the books open. connect and New books... make
the books home. Tests: dock.rs, welcome.rs, books_home.rs (host and cli).
Docs: testing.md record and For P12, architecture, parity, gui.md, README.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 17:06:14 -06:00
swaitsandClaude Fable 5.1 7749afc557 fix: Windows reads of lock files, update paths cfg(unix), merge main again (P11c)
check / check (push) Canceled after 0s
check / portable (macos-latest) (push) Canceled after 0s
check / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
spec_vault swept every file under a book, lock files included; on Windows
a held LockFileEx lock is mandatory and the read failed. The locks are
already dedicated files (never data), so the test skips *.lock. Merged
main (P13 step 6, the macOS server.log assert, P11a's AppImage identity):
host.rs keeps main's five-field identity on Unix and size/last-write on
Windows; the update poll and set_program_version are Unix-only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 17:03:30 -06:00
swaitsandClaude Fable 5.1 b77a25fd7b refactor(bookspec): the specification lives in its own repository (P13 step 6)
bookspec/ (spec, examples, checker, runner, Lean, GnuCash adapter) moves to
https://git.swaits.com/swaits/bookspec, history kept by git subtree split
(public home; CC BY 4.0 for spec/ and examples/, MIT OR Apache-2.0 for the
code). ledger-core and ledger-package depend on bookspec-checker and
bookspec-runner as git dev-dependencies pinned to
74f2853d5f0db0066147c17fed8033cfe3d83a24, and read the examples through
bookspec_checker::examples(). just check still runs every example via
cargo test --workspace. The pin check against docs/spec/sources and the
rules.md id check move into tests/bookspec.rs (they need this repository's
files). The accounting is unchanged: no example or rule moved.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 16:51:18 -06:00
swaitsandClaude Fable 5.1 6f948592f6 merge: P11a, the AppImage restart, the daily staged update, the unsigned macOS bundle in CI (branch P11a, 310fa105)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 16:29:21 -06:00
swaitsandClaude Fable 5.1 bc9aa57380 feat(packaging): the unsigned macOS .dmg built in CI, and the docs for steps 3 and 4 (P11a step 6, macOS half)
cargo-packager's dmg format (it makes the .app first) from
deploy/packaging/packager-macos.toml, an Info.plist merged into the
generated one, build-macos.sh in portable shell (BSD sed) and a
package-macos recipe; the release workflow gets a macos job on
macos-latest that uploads the .dmg as a run artifact and attaches it on a
tag. Unsigned and not notarized: that is step 5 (the owner's Developer ID,
Q-4). The config was parsed under cargo-packager 0.11.8's strict schema on
Linux; the build itself needs the CI run. No new dependency.
docs/packaging.md (macOS rows, finding 7 resolved, the staged update),
architecture.md and testing.md describe steps 3 and 4.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 16:25:34 -06:00
swaitsandClaude Fable 5.1 01aff4c04e test(audit): every defect keeps a named regression test (P10)
The audit's 24 defects must not lose their reproductions quietly; the table
names the test guarding each, checks the runbook names only tools that
exist, and records the mirror and its For-P12 targets in docs/testing.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 16:16:28 -06:00
swaitsandClaude Fable 5.1 a2f013955c docs(audit): the re-audit runbook (P10)
A re-audit is only worth its name if every figure is traced and every
receipt and entry carries an attestation that counts, so the runbook drives
the audit tools in the order the books need: audit, correct by reversal
(never edit), attest at the bar, attest the periods, then compare both CPA
packages and sign off in the journal. D-12's evidence link uses
link_attachment: the books have no inherit_evidence tool.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 16:16:28 -06:00
swaitsandClaude Fable 5.1 4774bd9abd feat(audit): fit the audit tools into the agent surface (P8)
After P5 merged first: a close leads to the audit and the period's
attestation, an audit run to its workpaper and the claims behind it, the
attest tools to the attestations and the CPA package; a refusal for want of
a standing audit is the guard audit_required with books.audit as its
remedy; the audit prompt runs the audit tools. policy.cpa_package_requires_audit,
unset, refuses once the books hold an audit run and warns before, so a
book that has not begun the programme is not stopped from its first handoff
by a rule it has not met; set to refuse, it holds from the start.
bookspec states B-45 (convention) in its checker.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 16:03:53 -06:00
swaitsandClaude Fable 5.1 45bcce679b feat(audit): books.audit, the attestation tools and the CPA gate (P8)
The whole re-audit through the tools: books.audit previews its checks, then
with the preview's digest runs them, files the workpaper and journals the
run; the same books, day and scope return the run that exists.
books.attest_receipt, books.review_entry and books.attest_period record a
named client's claim with its self-reported method; books.attestations
weighs each against policy.attestation_bar as it stands. Under
policy.cpa_package_requires_audit = refuse, books that declared audits
cannot export the CPA package without a counted audit for the handoff at the
current head unless a reason is given, which is journaled as a decision
(D-9). Needs attention asks for the month-end attestation, the annual audit
and the audit before the handoff. Rules B-45, the handbook section, the
interface, parity, receipt-store and testing records, and the As-built
block. Merge needs no go-ahead: the live books refuse the new writes until
the owner gives it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:54:26 -06:00
swaitsandClaude Fable 5.1 ad1afb478d fix(mcp): a read says only what follows; a success adds no empty warnings (P5)
Two existing contracts the envelope broke when every result got every field:
a resource and its tool say the same (books://settings is books.settings,
checked by the_kept_resources_read), and a tool with no warnings has no
warnings key (books.add_account, defect 8). So head and next_steps are on
every tool that can change the books, next_steps is on a read only when
something follows it, guards is on a refusal, and the envelope adds no
warnings of its own (a tool's stay as they are).

The happy-path spec test now exercises books.journal_history (it fails on
a tool it never called), the demo company gets its books.start size check
(Done when 3), and the As-built block of P5 is written.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:48:42 -06:00
swaitsandClaude Fable 5.1 7bac25496e test(agent): scripted evals follow only next_steps; the surface over the wire (P5)
Agent reason: the envelope is only worth having if an agent can do its work
by following it. crates/ledger-cli/tests/agent_evals/ holds six scripted
transcripts, no model: onboarding to a first post, a receipt-backed post, a
draft that waits for its receipt and posts when it arrives, a reversal, a
reconciliation, a month-end close. agent_evals_follow_only_next_steps plays
each against a real books server: after books.start a step may call only a
tool (or fetch only a prompt) the previous result's next_steps named, with
the arguments the step gave and the ones the agent decides; setup calls (the
chart and the books an agent finds) are not the agent's moves.

agent_surface.rs holds the over-the-wire tests of the rest: the journal in
words (order, subject and type filters, paging, a bad subject refused),
source corrections through the three tools, the prompts rendered against
their files and refused when malformed, the resource templates advertised
and read, books.start v2 whole and under 8 KiB with the self-report in the
access log only, a new book told to onboard, and a mutating call answering
with the head the journal has and a refusal naming its remedy.

Docs: testing.md's P5 section (every test, and the For-P12 paragraph naming
what a mutant would flip), parity.md (no feature moved; one row), and
architecture.md (the envelope and the guards); mcp-interface.md's overview
sections now describe the surface as built.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:48:42 -06:00
swaitsandClaude Fable 5.1 a319a64c3a refactor(mcp): the party_id, document_id and cash_account aliases are removed (P5)
Agent reason: one name for one thing. S4 and S6 kept the old spellings "until
P5" so an agent that learned them did not break; P5 removes them, so the
schema an agent reads has one parameter for each fact and a call cannot name
the same thing twice with different answers.

books.create_invoice takes customer and books.create_bill vendor (a record's
id, its party's id or its name; required), no party_id.
books.receive_payment and books.pay_bill take invoice or bill and
deposit_to or paid_from, no document_id or cash_account; a payment names its
document and its account or is refused saying which to pass. A number that is
one record's id and another's name is still refused, never guessed (INVARIANT
6).

The over-the-wire tests that used the old spellings now use the new
(document_id becomes invoice or bill, cash_account becomes deposit_to or
paid_from, party_id becomes customer or vendor given as the id's text); the
one test that named the alias, party_id_alias_still_works, is now
a_customer_by_id_and_by_name_is_one_record and checks the same two spellings
of a customer, by id and by name, name one record.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:48:27 -06:00
swaitsandClaude Fable 5.1 453abb62ea feat(mcp): books.start v2 and the agent's self-report (P5)
Agent reason: the first call of a session should say who is asking, what is
waiting and what to do, in under 8 KiB, from the same lists the viewer
draws. books.start now carries book.id and book.url (the book's path on the
server, never a path on a disk), you {principal, kind, scopes, client_id},
drafts {building, awaiting_evidence}, reconciliation {tracked,
never_reconciled, behind}, backup {last_at, through_seq, stale}, the
prompts, and needs_attention (the twelve most urgent items, problems first,
with every item counted by kind), beside next_steps now in the envelope's
shape (tool or prompt, why, required; attention problems are required). A
new book is told to run the onboard prompt first, then to record the
company's facts and set up the chart; an active one is offered a draft
entry. The tool carries _meta anthropic/alwaysLoad, so a client that defers
tools loads it up front. The size fit shortens attention items and waiting
drafts after the convention summaries and before the lists, as before.

agent {model, reasoning_effort, harness} is accepted and written to the
call's access record (the access log shows it as agent), self-reported and
never checked, and used for nothing else: not in the answer, not in any
decision. Who asked is the request's alone: it is cleared when the request
ends, so a later resource read on the same thread cannot see it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:48:27 -06:00
swaitsandClaude Fable 5.1 996c5f40f4 feat(mcp): prompts, resource templates and report dates on resources (P5)
Agent reason: the procedures an agent follows (onboarding, reconciling a
month, closing a month, the CPA hand-off, the year's compliance, an audit)
should be one name away, written against this server's own tools, instead of
rebuilt from the handbook each session. The server now advertises the
prompts capability (also in the bridge's cold-start initialize, which uses
the same capabilities function) and serves prompts/list and prompts/get to a
token that may read: onboard, reconcile {account, month}, month_end_close
{month}, cpa_handoff {year}, annual_compliance {year}, audit {scope}. Each
text is a file in crates/ledger-mcp/prompts/ with the company's name and the
arguments filled in. migrate, process_inbox and receipts_from_email are not
built (D-46, D-28, D-17). audit points at books.verify, books.control_check
and the digest; P8 fills in its own tools.

An argument is one token (letters, digits, - _ . :, at most 40) of the shape
the prompt asks for (a month, a year, a word from a list), so what a caller
passes can never rewrite the text; an unknown prompt, a missing, extra or
malformed argument is refused. A test checks every prompt names only tools
that exist.

The five resource templates of plan 4.5 are advertised (resources/templates/
list): books://entries/{id}, books://attachments/{id}, books://journal/{seq},
books://reports/{kind}{?start,end,as_of} and
books://digest{?since,since_seq,as_of}; the reports now take their dates
from the query (they read only today's or the year to date before), and the
digest reads since_seq (what was posted since a journal line, backdated
entries included).

Tests: the_prompts_name_only_tools_that_exist,
an_argument_is_one_token_of_the_right_shape.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:48:27 -06:00
swaitsandClaude Fable 5.1 61da9e57cd feat(mcp): books.journal_history, the journal in words (P5)
Agent reason: an agent traces a figure back to what produced it by reading
the journal, but it must never read the file. books.journal_history is the
one way: each line in order with its seq, time, type, a sentence saying what
it did to what, its subject and the entry it belongs to, filtered by
after_seq, type (exact, or a group like entry.) and subject (entry:12,
invoice:3, bill:3, account:10, party:5, asset:2), paged with more, with the
torn tails set aside on open listed beside them. It reads the verified
journal through read_journal_and_format, so a damaged chain is an error, not
a story.

The sentences come from ledger-store's describe.rs, which quotes only
identifiers, dates, amounts and the short names a person typed: never a
setting's value (settings.set names its keys) and never a full TIN (masked,
B-26). Every event type the store writes has a sentence (tested against
EVENT_TYPES). The tool is read-only (books:read); the books://journal/{seq}
and books://entries/{id} resources read through it.

Departure from the plan: the viewer's own sentences (its describe arms in
ledger-gui, which carry icons, routes and today's party and account names)
stay where they are; moving a thousand lines of egui text behind a
formatting trait was not worth the risk to the viewer's tests, so the server
has the shared describer and the viewer keeps its own.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:48:27 -06:00
swaitsandClaude Fable 5.1 4236f03744 feat(store): a record's source can be corrected without touching its words (P5)
Accounting reason: a convention, a decision or an open item carries who
decided it, when and on what authority. When that is recorded wrongly the
honest fix is to say so on the record, not to restate the policy: a policy
revision bumps the convention's revision and reads as a change of the rule,
and a new decision supersedes the old one. A source correction changes only
the authority and says why, so the audit trail shows the words were never
altered.

New event types convention.source_revised, decision.source_revised and
open_item.source_revised {id, source, reason} under the journal feature
source_revisions: an older version would refuse the types, or show the old
source as the record's authority, so it stops at the declaration instead
(rules.md B-27) and books that have not had the owner's upgrade refuse the
write with format_upgrade_pending, journaling nothing. Replay sets the
source and nothing else (the text, the revision and the journal line stay);
the projection updates the rows' existing source columns, so no schema
changed. A correction must be one: other words, the same source, no reason
or an unknown record is refused.

books.set_convention takes reason (the text exactly as it stands),
books.record_decision and books.raise_item take revises with reason. Without
reason the old refusal stands and now says how to correct only the source.

8.0.6: the hand-written lines of the three shapes in
books_written_under_older_rules_still_open; fixture old-books/p5_before,
written by b97234ac (a revised convention, two decisions, two open items, a
draft) through old-books-writer/src/bin/p5_before.rs, opens to that
version's figures, so no figure moved; books_p2_served_cut_over_whole
refuses the correction before consent and takes it after; the fuzzer and the
viewer's journal know the types. The live books refuse the new write until
the owner gives the go-ahead; merging does not need it.

Tests: a_source_only_revision_is_journaled,
a_source_revision_must_change_only_the_source,
source_revisions_wait_for_the_upgrade, source_revisions_is_its_own_feature.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:48:27 -06:00
swaitsandClaude Fable 5.1 cf73d0bda5 feat(mcp): every result carries the envelope (P5)
Agent reason: an agent should never have to guess what follows a call. One
place (call_tool, after the tool answers) now gives every tool result the
same four fields: next_steps (what to do next, each with why and whether it
is required), guards (the named refusal and the tool that remedies it),
warnings, and, on any tool that is not read-only, head (where the journal
ends after the call's last write). A tool's own field of the same name is
kept, never overwritten; the text block says what the structured content
says.

Next steps come from the tool's own result (a preview gets its confirm step
with the digest; a post is followed by showing the entry and, only if it
was in error, its reversal; a draft by its lines; a statement by marking
its lines and reconciling; a period list by the close) and, after a change
to an entry or an invoice, from the viewer's own Needs-attention items about
that subject, so the agent and the human read one list.

guards.rs is the registry of refusals (stale_preview,
format_upgrade_pending, receipt_required, approval_required, party_shares,
party_required, open_drafts, untagged_control_line, duplicate_vendor_ref,
first_number_locked), each naming a tool that exists. A refusal whose text
carries a guard gets it as structuredContent.guards; its text is unchanged.

Tests: every_mutating_result_has_head_and_next_steps (the whole router),
the_envelope_keeps_what_a_tool_said_and_carries_a_refusal_guard,
every_guard_names_an_existing_tool, a_refusal_becomes_its_guard,
every_step_a_tool_names_exists.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:48:27 -06:00
swaitsandClaude Fable 5.1 211d2dbbdb merge: main into P11c (P11a's update/rollback, the bare-launch path, the Linux-only SOCK_CLOEXEC test)
check / check (push) Canceled after 0s
check / portable (macos-latest) (push) Canceled after 0s
check / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Conflicts: ledger-cli main.rs (kept P11a's is_bare_launch; dropped the
"comes with P11" stubs), ledger-mcp local.rs (main's Linux gate on the
no-other-end test), docs/testing.md (both sections kept). `update` and
`rollback` are cfg(unix) in ledger-host (a running program's file cannot
be replaced on Windows), so main.rs says so on Windows (P11a step 5).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:36:19 -06:00
swaitsandClaude Fable 5.1 169b914e1f fix: what wave 1's gate found: B-43 speaks CHOICE, a Linux-only socket test is Linux-only
check / check (push) Canceled after 0s
check / portable (macos-latest) (push) Canceled after 0s
check / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
GitHub's check on f043db35: bookspec's `rules_md_carries_every_id`
refuses "DECISION" in docs/spec/rules.md (bookspec's word is CHOICE,
P13 step 3); P4's B-43 wrote "DECISION D-47" twice. The portable
macOS job: `a_socket_with_no_other_end_names_no_process_and_isnt_us`
uses `SOCK_CLOEXEC` and Linux's answer for a peerless socket; it is
gated to Linux, which is what it tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:25:37 -06:00