5544a3e66 split the `check` job into five parts on five runners; the
page still said one job runs `just check`. It now names the parts, how
to run one here, and that the lint part fails when the workflow's list
is not the justfile's.
Co-Authored-By: Claude <noreply@anthropic.com>
A failure a property test once found is kept as a seed and replayed on
every run: that is what makes a fixed bug stay fixed. Proptest finds
the seed file from the test's source path and says nothing when the
file is not there, so a seed file left behind by a moved test is never
read again, silently.
Four findings, one cause:
- The kernel bridge's three recorded failures (the constructive split
with a short remainder, and two cash-application cases) sat in
tests/kernel_bridge.proptest-regressions. Since 0cf013b57 the bridge
is a folder (tests/kernel_bridge/main.rs), and a folder test reads
tests/proptest-regressions/main.txt. The three had not been replayed
since. Moved there.
- K-U8 found a control-total case (a sum that touches Decimal's top,
f = [0, -1, -79228162514264337593543950335, 0, 5]) and the seed was
never checked in; it lay untracked in the unit's worktree. Added as
tests/proptest-regressions/control.txt, where control.rs reads it.
- ledger-mcp's proptest-regressions/local_files.txt recorded failures
of a module removed in b26c099a6 (files reach the books as uploads
by hash now). No test can read it. Removed.
- Nothing checked any of this. tests/seed_files.rs walks every crate
and fails when a seed file has no property test that reads it.
How the reading rule was established, not assumed: a marker line in
each candidate file, and proptest's "unparsable line" warning names
the file it really opens.
With the seeds back, the bridge passes whole (101 tests), so nothing
had regressed behind the gap. The guard was red before the move (it
named both orphans) and is green after: 21 seed files, each read by a
property test.
Co-Authored-By: Claude <noreply@anthropic.com>
bookspec unit S-C8 dropped BS-statement-3's and BS-partner-3's "Rule n"
labels: they had drifted from the statements' positions, and every
reference is now a position, "BS-statement-3 statement k". This rewrites
wanderbooks' citations from the old labels to the positions.
Method: the map was confirmed against the pinned records at b61fa50 by
reading each statement before use. BS-statement-3: Rule 1 -> statement 2,
2 -> 3, 3 -> 4, 4 -> 5; Rule 5 by the sentence's meaning (gross lines 6,
operating classes 7, governments 8, payroll 9, kinds 10, the family 6-10);
6 -> 11, 7 -> 12, 8 -> 13, 9 -> 14, 10 -> 15, 11 -> 16, 12 -> 17.
BS-partner-3: 1 -> 1, 2 -> 2, 3 -> 3-4, 4 -> 5-6, 5 -> 7, 6 -> 8, 7 -> 9,
8 -> 10, 9 -> 11. Each sentence was read against the statement it now
cites; a "rule n" meaning an IRS rule, an engine rule, or another
record's rule was left alone (odd_cent.rs's close true-up, the asset
register's note numbering, and testing.md's "run rule 0.02").
Rewritten: 44 references in src/cashflow.rs, 22 in
tests/spec_cash_flow.rs, 3 in tests/spec_reports.rs, 5 in
docs/spec/claims/statement.md (whose stale "rules 1-12" count is now
"18 statements"), 21 in the vendored ASC notes, 10 in docs/testing.md,
2 in docs/verification.md, 2 in kernel/entries.rs, and 1 in the CLI's
journey test.
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
`just coverage` on the tree after the review fixes and the merge of main:
ledger-core 95.49% lines (18,422 of 19,292), 93.09% regions, 88.98% branches;
ledger-store 92.45% lines (14,359 of 15,531), 85.86%, 81.72%. The store is 20
covered lines under the earlier run's 92.58% on the same 15,531 lines: main's
store changes are comments only and the fixes add no store code, so it is
run-to-run movement in the property and process tests, inside the 0.5 pp
tolerance. `just coverage-check` passes at both floors.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Which accounts the monthly close reconciles, and when each is due, was a
module's own spec block with no id. It is now WB-ledger-17 (product-only, a
CONVENTION sourced to docs/parties-and-attachments.md "Reconciliations"),
checked against the code: the cash accounts (configured ones in the order
given, else by name in ascending account id), the card accounts (ascending
id), then the other liabilities with a statement in the order the statements
are given (period end, then file; not ascending id), each once; and an account
is due through last month's end when it has a posted line on or before it and
no reconciliation not voided is dated on or after it. The module and the test
file cite it.
The order within the cash group is the account id's, as `card_accounts` sorts,
not the chart code's (`ChartOfAccounts::all` is unordered). The test is renamed
to say so and its codes are out of creation order, so a sort by code fails it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
V-D2's tests (94 of them: 85 in ledger-core, 9 in ledger-store) take the
core from 89.79% to 95.45% of lines (17,299 -> 18,391 of 19,267) and the
store from 92.09% to 92.58% (14,301 -> 14,379 of 15,531), from the full
`just coverage` run before and after on the same code and tools. The
recorded floors, 90.01% and 91.71%, rise to the new totals; coverage-check
reads them from the floor line of docs/coverage-floor.md and passes at
exactly the new numbers.
Per file: evidence.rs 33.85% -> 100%, conventions.rs 77.76% -> 97.24%,
audit.rs 80.33% -> 94.14%, settings.rs 91.05% -> 98.16%, ledger.rs 86.00%
-> 96.87%, reconcilable.rs 0% -> 100%. What is left is mostly arms no
posted book reaches (a sum past Decimal's range; a line is capped at 1e15)
and replay-only refusals. docs/testing.md gets V-D2's record: the tests by
area and rule, the finding, what was not reached and the P12 mutation
targets.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A review of S-E3 against the pinned bc92cf3 records found citations one
part off, and old vocabulary the test could not see. Each is checked
against the record's own text:
- BS-statement-5: the partition of the P&L is statement 3 (not 2, and
not BS-statement-3, the cash-flow statement); the ASC 340-40-25-7/-8
trail (a cost traceable to one job is that job's, several only by a
stated allocation) is statement 4, not 6.
- BS-asset-1: "one figure everywhere" is statement 31 (28 is the two
figures, schedule and books); "disposed only for a disposal dated by
then" is statement 30 (and 7 where the schedule stops).
- BS-arap-6: one receivable line per invoice, each tagged, is statements
1-2 and invariant 4 (one application per document).
- BS-asset-1 statements 8 and 9 for the true-up and the credit back.
- BS-arap-2: "nothing unattached, no command adds a hand line" is
invariants 2 and 3, beside 1, 6 and 9.
- BS-format-2: a class name written differently and reported adds 32.
- BS-arap-5: the cash-basis refusal is statement 6, everywhere.
- BS-partner-3: statement 3's cases are lettered (a)-(e), not numbered.
- BS-asset-1 "rules 23-24 / 25-26" in the claims, "BS-arap-3 SCENARIOS:"
and "WB-ledger-15 INVARIANT 3" are in the new vocabulary.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Unit S-E rewrote each `B-n` citation to its bookspec id but kept the
sub-reference after it ("item 7", "rule 11", "INVARIANT 2"). Those
numbers counted parts of the retired rules.md text, so `BS-statement-5
item 7` pointed at finished and abandoned projects, not at the snapshot
it meant. Bookspec numbers a record's parts from 1 as `statement`,
`invariant` and `scenario`; every sub-reference now says so.
The map was built by content, not by position: each old item,
INVARIANT or SCENARIO was read in `git show ca8d676d5^:docs/spec/rules.md`
(the last full rule text), found in the pinned records
(bookspec bc92cf3) and in docs/spec/claims/, and each reference was
read in its context before it was mapped. Where the old numbering still
survives as the "Rule n" labels inside bookspec's statements (the cash
flow, party totals) the new number is that statement's position; where
a record carries the whole rule differently (the asset depreciation, the
IIF file, the arap invariants) the reference follows the content. Where
bookspec keeps no counterpart, the product rule that states it is cited
instead: WB-statement-5 (a project's facts and names), -7 (the snapshot),
WB-arap-4 (the document_standing feature), -8 (the issued PDF), -15 (a
payment event names its line), WB-ledger-15 (BS-ledger-12 is retired).
A reference that had pointed at the wrong part is corrected, for example
the discount-reason references that said BS-arap-6 INVARIANT 2 (a
bound) now say invariant 6 (the discount cap and date).
Only the reference tokens and their sentence change; no paragraph is
reflowed. A reference wrapped across a comment prefix keeps its wrap.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
common.rs (two doc comments and a test-helper panic message) and the fuzz target still cited the retired numbering outside the script's roots; they now cite BS-period-3 and BS-arap-2. A repo-wide sweep of tracked files found no other real citations beyond the deliberately kept strings.
Bookspec ids are not ordered across areas, so ranges the script produced are nonsense: the three 'all rules' ranges now say all 45 rules in docs/spec/rules.md's index, the seven allocated ids and the nine statement-era ids are listed explicitly, taken from that index table.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
claims/ledger.md conflicted with the reduced B-9 section: the D-73 pick,
Enforced and Checked lines sit above its product rules; the check's
place corrected (after the schedule double-post check, not ahead of it)
and the citation completed (BS-ledger-16, the Lean model since L-G1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cargo.toml: both the dev-dependencies for decimal_exact and the bookspec
comment's new path kept.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coverage is a tripwire, not a correctness oracle: the proofs, the
property tests, the GnuCash cross-check and mutation testing answer
whether the books are right; a line/branch report answers whether a test
still reaches the code it used to. This adds that measurement, pinned in
mise.toml like every other tool: cargo-llvm-cov 0.9.1, and the
llvm-tools component on the pinned nightly because branch coverage is
nightly-only (-Zcoverage-options=branch).
`just coverage` runs each crate's own suite instrumented (core and
store separately, so one crate's dev-dependency code does not enter the
other's totals), writes HTML, the JSON and the plain per-file table under
target/coverage/<crate>/, and excludes src/proofs.rs (Kani-only,
cfg(kani)) plus test and bench files: it measures the library.
`just coverage-check` reads docs/coverage-floor.md and fails when a
crate's total line coverage is more than 0.5 pp below its floor; regions
and branches are recorded for context but not gated, since branch
coverage is the noisier number across compiler versions.
First measurement from the full run: ledger-core 90.01% lines (88.86%
regions, 82.65% branches), ledger-store 91.71% lines (85.27%, 80.73%).
The store measured 91.98% on an earlier run the same day; properties pick
random cases, so a few tenths move between runs and the 0.5 pp tolerance
absorbs it (the floor records the lower run). The largest holes are
findings, not fixes here: ledger-store/reconcilable.rs is 0% (the server
and viewer are its readers; the store suite never calls it), and
ledger.rs is mostly the document/payroll replay steps the store's replay
tests exercise rather than the core's own.
It is not a push gate (the instrumented suites are slow: the store alone
runs about a hundred minutes of tests once built); the weekly scheduled
workflow runs it beside the proofs. The store's tests start and kill
helper processes that inherit LLVM_PROFILE_FILE, so a killed child can
leave a truncated profraw; the run passes --failure-mode all, which
merges the test binaries' profiles and ignores such a file (it holds no
test coverage).
Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
A correction comes after what it corrects (Pacioli ch. 31; B-9). Until now
only document reversals and depreciation/schedule runs were held to it; a
plain posted entry could be reversed with an earlier date, leaving the
books carrying the opposite of an entry that doesn't exist yet at the
reversal's date. The owner's decision D-73 (2026-11-08) makes it one rule
for every kind of entry; bookspec BS-ledger-5 states it.
- Ledger::check_reversal refuses date < original.date() with one error,
ReversalBeforeOriginal (it replaces DocumentReversalBeforeOriginal,
which was the document-only wording). Same-day reversals are allowed.
- Not on replay (B-28): the check sits behind is_replaying(), so a journal
an earlier version wrote, holding a reversal dated before its original,
reopens with the same figures.
- The store's own date check for depreciation runs and schedule months
(InvalidSchedule / AssetEntryIrreversible wording) was the same rule
for a narrower case; it is removed so there is one variant for all.
Store::check_reverse_entry, books.reverse_entry (preview and post), and
the document voids all reach the refusal through check_reversal; the
only construction path for a reversal is reverse_entry_steps, which
calls it first.
Tests: store reversal_dates.rs (plain entry refused before it, nothing
journaled, same day and later taken; a journal with an earlier-dated
reversal written the old way opens with the same figures); ledger-cli
spec_mcp (preview, unconfirmed and confirmed post all refuse alike).
Existing tests changed: store assets.rs (three expectations move to the
new variant); core spec_asset_basis.rs (it backdated a reversal on
purpose to check the trial balance carries -100.00 between the dates; it
now replays one, as an old journal would); model.rs (the model oracle's
`reverse` requires the date, as the Lean/bookspec rule does); bookspec
common.rs (the pinned depreciation example words this refusal
"entry_irreversible"); spec_documents.rs (variant rename).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Review of S-K1: the recipe looked for cargo's checkout by the full
40-character rev, but cargo names the directory by its short rev, so
just oracle could never succeed. cargo metadata gives the dependency's
own manifest path, whatever the directory is called and however many
checkouts there are; jq (now pinned in mise.toml, as every recipe's
tool is) reads it. The error now says what to do when the pin predates
the oracle's move. Three docs still named the deleted oracle/gnucash/.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
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>
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>
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
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).
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
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
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
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
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
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
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
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
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
The Linux half of the packaging trial, run on this machine and in Debian,
Fedora and Arch containers, and the recipes it produced (docs/packaging.md
holds the table and what it found):
- mise.toml pins cargo-packager 0.11.8 and cargo-generate-rpm 0.21.1, now
that `just package-linux` calls them. cargo-packager-updater is a
library, not a tool, so it is not pinned (update.rs does the checking
with minisign-verify, which is what the updater uses).
- deploy/packaging/: packager.toml (.deb, AppImage, the pacman tarball and
its PKGBUILD), the rpm table in crates/ledger-cli/Cargo.toml, the AUR's
own PKGBUILD (repacks the release tarball), build-linux.sh,
repo-indexes.sh (the apt and dnf indexes, unsigned until the signing
step), local-release.sh (a throwaway-keyed feed to try `update`),
test-linux-packages.sh (linux_packages_install_and_upgrade: install
0.1.0, open books as an ordinary user, upgrade to 0.1.1, check the host
restarted onto the new file, the books' last journal line unchanged and
`update` refuses; passes on Debian trixie, Fedora and Arch). A package
marks itself package-managed with share/wanderbooks/install-method.
- The icon is a placeholder square (the AppImage cannot be built without
one).
- .github/workflows/release.yml: on a version tag, build on ubuntu-24.04
(the oldest glibc the packages claim: a program linked on this machine
needs GLIBC_2.43 and does not start on Debian 13), attach the packages to
the release, and add them to the apt and dnf repositories on gh-pages.
No signing and no macOS or Windows job yet.
- The release profile strips symbols.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
packaging.md: each row of the Unix-only inventory is struck with where it
landed. architecture.md: the local transport and the Windows arms.
testing.md: the P11c record with its For-P12 paragraph (R-G); every
Windows test is marked unrun until the first Windows job. README.md: the
Windows caveat is now "from a source build, not packaged". served.md: the
unit's As built block (field 8).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
Accounting reason: a confirm must act on the thing that was previewed.
Every tool with confirmed (post_entry, reverse_entry, run_schedules,
dispose_asset, reconcile, close_period, create_invoice, create_bill,
write_off_invoice, purge_tin, consolidate_duplicates, and the S6
settlement tools receive_payment and pay_bill, which gain confirmed and
preview on a clone of the ledger) returns preview (SHA-256 of the
canonical preview) and refuses a confirm whose preview is missing or
stale (stale_preview, before anything is written). A draft's digest is
its own state and the settings seq; an operation's is the tool, its
arguments as sent, the settings seq and the journal head seq, so another
session's write forces a re-preview (D-50).
New tools books.list_drafts, books.set_draft_state, books.discard_draft,
books.preview_entry; reports carry as_of_status (drafts open on or before
their end, unreconciled accounts, settings problems) and take strict; the
CPA package is refused while a draft dated in it is open unless
allow_open_drafts gives a reason, journaled as a decision;
books.digest takes since_seq (what was posted since a journal line,
backdated entries included: defect 6) and lists zero_net_accounts,
drafts_by_state and the reconciliation split. Needs attention gains
'draft awaiting receipt' beside 'draft not posted'; the drafts handbook
is rewritten. Every over-the-wire harness confirms the way an agent does.
Docs: mcp-interface, rules B-43, parity, testing (with the For-P12
paragraph), architecture, and the unit's As-built block.
Tests: drafts.rs (a_draft_waits_for_its_receipt_and_posts,
the_gate_moved_and_the_mcp_error_is_unchanged,
a_reversal_needs_no_receipt_of_its_own, discard_unblocks_the_close_over_the_wire,
report_warns_on_draft_before_as_of, cpa_package_refuses_open_draft,
stale_preview_refused, every_confirm_tool_takes_a_preview,
digest_since_seq_is_posting_time, legacy_reversed_replays_identically,
gui_and_server_gate_agree), attention_parity.rs, format_upgrade.rs.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
Deploy recipe loses its D-Bus dance, install.sh its macOS skip, README and
site their macOS caveat; packaging, architecture and testing records follow;
U0e As built filled in (D-63).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
Step 1 now covers the issue: preview first (nothing written, the DRAFT PDF,
an abandoned preview uses no number), confirm only after the human has
seen it, the filed issued copy that a later look never replaces,
quantities and prices, the PO, and the snapshot of the customer at issue.
Step 6 is the CPA's list: agings tied to 1200 and 2000, sequential numbers
with voids visible, bills on their real accounts with the vendor's number
and no duplicate, card payments identified for 1099-NEC, deposits as
liabilities, light governance by decision.
A {documents_v2} placeholder (handbook::section_with, the server's
documents_v2 feature test) says "your books have not declared documents_v2
yet" before the owner's upgrade and what is on after it; no other section
changes. Parity, testing (with the For-P12 paragraph) and mcp-interface
notes for S4.5.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
D-61 (Q-9): the writer sheds the typesetter and the crate map is layered
again. The PDF/XLSX reader (extract.rs, plan P6) is now the plain library
crate ledger-reader, moved whole with git mv and no behavior change.
ledger-store depends on it instead of ledger-import, so the store no
longer builds Typst or the fonts; ledger-import re-exports it as
ledger_import::extract so gui, mcp, host and the fuzz targets compile
unchanged, and still never depends on the store. New crate carries only
the dependencies extract.rs imports (hayro, hayro-interpret, kurbo, zip,
quick-xml, thiserror); fuzz/Cargo.lock gains the new package.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
The agent path was Linux-only because tokens had a keyring store only
there (every other OS hit NOT_YET, so `connect` and the bridge failed).
D-56's destination is one installation for macOS, Windows and Linux.
Both new stores sit behind the same Items trait as the Secret Service,
so INVARIANT 4 (one account, one item, locked is an error) is kept once
and tested once through the file keyring. Windows credentials have a
unique target name, so a probe stands in for a search.
New dependencies (ledger-host only, target-gated): apple-native-keyring-store
(feature keychain) and windows-native-keyring-store, the stores the
keyring-core 1 API we already use is published with. No ledger-core change.
The `portable` job builds and tests the workspace on macos-latest and
windows-latest. Windows is allowed to fail: the rest of the host is
Unix-only (inventory in docs/packaging.md). Not verified locally: no
macOS or Windows target is installed; CI is the evidence.
Also pins cargo-packager, cargo-packager-updater and cargo-generate-rpm
in mise.toml for the trial, and records that the trial is not yet run.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
The plan and the status documents say what is true after the merges
of 2026-10-29: served.md section 0, the 8.0.1 rows and unit Status
lines for S4.4, S5, S6, S7 and P6 (landed, with commits), the 8.0.2
resume paragraph turned into the record of what the merges found,
P6's At-merge bullet (the write-off and dedup interaction, the five
tests its interrupted gate never reached, schema 18), P9a's Done-when 1
verified by the green two-user job, D-58 and D-59 in order.
D-60 (the owner): per merge a compile and the unit's own tests; the
exhaustive gates once per batch, at the end. AGENTS.md's two gate
sentences, HANDOFF.md's merging procedure and the plan carry it, with
the reason: five full gates around five merges took twelve hours and
the one gate at the end found the same five tests.
Q-9 (open, for the owner): P6's `ledger-store` -> `ledger-import`
dependency, with the options and the recommendation; architecture.md
marks the arrow as under review. testing.md records the merge's test
changes under P6. STATUS.md gains "Now (2026-10-29)" with the gate
figures (170 suites, 2,944 tests, 77 minutes), the CI state and the
next steps; HANDOFF.md, roadmap.md, gui.md and the parties doc drop
the paused-branch wording; README counts 129 tools and about 2,950
tests.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
The last of the paused branches, from its "not for merge" checkpoint:
extraction in ledger-import (text, pages, page images; capped, caught),
journaled as attachment.text_extracted; dedup by hash with
books.find_attachment and books.consolidate_duplicates; annotations and
books.set_entry_settles; the company record categories; the two fuzz
targets; feature attachment_text. Nineteen files conflicted with the
four P4b merges, resolved as plan 8.0.2 says: P6 retakes schema 18 (it
had taken 16, which S4.3 holds; S5 holds 17); the tool table is 129 and
the destructive count 31; both sides' appends kept with their seams
restored; one B-27 paragraph naming every feature; in the old-books
fixture P6's hand-written reimbursement is entry 7 (its ids collided
with S4.3's invoice); the replay fuzzer's list gains S7's
invoice.written_off; S4.3's issued-PDF test expects the extraction
record P6 journals right after a filing.
One integration defect between S7 and P6, found by the arap property
test and fixed here: under P6's dedup, a write-off whose evidence bytes
were filed already (the same collection letter for a second write-off of
the same invoice) was refused only after its entry had been journaled,
at the final link to the invoice ("already linked"). The write-off now
resolves the dedup before anything is journaled and keeps a link the
record already has to the invoice instead of refusing it; an explicit
existing_attachment_id already on an entry is still refused (S7's
one-receipt-once rule). P6's gate never ran before the pause; it runs on
main after this merge, and its ledger-store -> ledger-import dependency
is the open review point (plan 8.0.1).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
The fourth of the paused branches: Ledger::write_off and the bad_debts
control role, invoice.written_off with its evidence filed in the same
store call, books.write_off_invoice, the write-off on the timeline and
in Needs attention, Lean writeOff_within_bounds, rules.md B-41 and the
bookspec examples. Twenty-eight files conflicted with the S4.4, S5 and
S6 merges; resolved as plan 8.0.2 says, keeping both sides' appends with
their seams restored, and: the scope table at 125; S7's law numbered 37;
B-41 placed before B-42; the handbook's step 4 and recovery procedures
folded into the one invoices-and-bills section; S7's wire tests in their
own module with the confirm S4.4's contract needs; S7's copy of the
payment steps dropped (S6 replaced them with Ledger::settle) and its
write-off journaled through S6's journal_auto_lines; in the old-books
fixture S7's hand-written write-off moved to a second invoice, since
S6's hand-written payment settles invoice 1 in full.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp