Commit Graph
97 Commits
Author SHA1 Message Date
swaitsandClaude Fable 5.2 27f9607434 docs(packaging): installing, the unit's claims, status, and the git decision; the Linux packages depend on git (P15 C1)
docs/install.md is three short sections for a person installing.
docs/packaging.md records what the installed app is on each system, why
NSIS and the macOS bundle are scripts of our own, how signing is wired
with the owner's secrets, what was left out, and what bundling git
would require (GPL-2.0, separate program, unmodified: notices, source
offer), which stays the owner's decision. WB-pkg-1 to WB-pkg-8 are the
product rules. The Linux packages, the AUR file and the rpm now depend
on git, so the package manager fetches it and a Linux person never meets
the missing-git words.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:48:26 -07:00
swaitsandClaude Fable 5.2 0759089790 Merge branch 't3/p15-b3-web-assistants': the app's side of the relay (P15 B3)
Buypass is left out of the compiled-in directory hosts: its directory
could not be confirmed from its own documentation.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:05:16 -07:00
swaitsandClaude Fable 5.2 b0fe3decdc docs(spec): the claims and the plan say what the B3 review changed
Adding a brand-new certificate authority needs a release of the app: it
contacts only directory hosts compiled into it, and believes only
certificates that chain to the public roots it ships, because a relay that
could name any host or authority could make every app send requests where
it likes. The secret label is seen by the relay, the vendor's resolvers and
the network path (the sign-in is the lock); the relay cannot read the
traffic, the assistant's own company reads what it is sent. Certificate
log watching is still not built, so a relay misusing its DNS control to get
a certificate for a name would not be detected.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:03:48 -07:00
swaitsandClaude Fable 5.2 14c1a26bfc docs(spec): WB-link-1 to 6, WB-assist-6, WB-app-6 for the app's side of the relay (P15 B3)
The claims for the identity, the line, TLS at the app, certificates, the states in
words and the per-company switch, the Connect page's web half and the first run;
parity.md, the architecture table and the plan's follow-ups (what B3 left out and
why: certificate-log watching, steps for products nobody tried, the key for
key-only products, a real relay and authority).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 13:40:00 -07:00
swaitsandClaude Fable 5.2 a9fec9ee27 fix(spec): WB-app-5 names a file and a test in words the claims check accepts
run/server.info is made at run time, so it is not a path in the tree;
the test is named by its file and what it shows.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 12:37:20 -07:00
swaitsandClaude Fable 5.2 610e41d1d1 Merge branch 't3/wanderbooks-app-hosted-bridge': nothing on the desktop starts a detached host (P15 A5)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 12:32:59 -07:00
swaitsandClaude Fable 5.2 bf977b1bc7 Merge branch 't3/mcp-refusals-write-nothing': a refused call writes nothing; four tools checked before writing
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 12:30:50 -07:00
swaitsandClaude Fable 5.2 a61df668ef docs: the holder of the books is read from what the server says (WB-app-1, 2, 3, 5)
Plan P15 unit A5, fix round. The claims for WB-app-2, 3 and 5 and the invariants
of opener.rs, app_server.rs, commands.rs, bridge.rs, serving.rs and ledger-mcp
local.rs say: a server says what started it and whether it is closing
(run/server.info), only the app's is "the app", a command's server and a closing
one are waited for in words inside one `open_wait`, a command racing a start joins
it, a command's own server starts clean (and why the app's own child does not),
a bridge that held a host follows the app, `books list` shows the upgrade pending,
and the app's notice for a host that holds the books has a button.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 12:30:26 -07:00
swaitsandClaude Fable 5.2 38612ab553 fix(mcp,store,core): four refusals are decided before the call's first line (P15 T1, D-88)
A refusal is decided before anything is written; a failed call on the
record is for a call that failed part way. Four tools wrote a line and then
refused, so under T1 each left a begun line, its lines and a failed closing
line in the journal for a plain "no":

- books.attach_receipt and books.file_document: bytes already filed are one
  file, so filing them again links the existing attachment; a link it
  already holds was refused after the earlier links were written. The store
  now asks first (Store::check_filing_links).
- books.draft_entry and books.draft_from_template: a no_party_reason that
  names a full tax id was refused by the mark, after the draft was made.
  Ledger::check_no_party_reason is asked first.
- books.dispose_asset: a receipt named twice was refused at its second
  link, after the disposal was posted. The ids are checked for repeats
  first.

Each has a test that the journal is byte for byte as it was. No journal
format or frame shape changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 12:30:25 -07:00
swaitsandClaude Fable 5.2 5a98e417a1 Merge branch 't3/remote-mcp-oauth-signin': the remote door and sign-in for web assistants (P15 B1, D-83, D-86, D-90)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 12:16:48 -07:00
swaitsandClaude Fable 5.2 afad9d1e14 docs: D-90 in the remote door's claims, interface and plan section 4 (P15 B1)
Rule 6 of section 4 now says every new sign-in is asked and an approval is
never reused; WB-remote-1, 5, 6, 7, 8 and the interface carry the matching
code, the neutral words, the per-start secret B3 must send first, and the
limits as built.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 12:16:15 -07:00
swaitsandClaude Fable 5.2 0a91656f14 docs: claims WB-remote-1 to 10 and WB-assist-5, the remote door in the interface, parity
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 11:39:39 -07:00
swaitsandClaude Fable 5.2 6b95ce59ad docs: how an assistant and a command reach the books under the app (WB-app-1, 3, 5)
WB-app-1 and WB-app-3 lose the permanent run/app-hosted marker; WB-app-5 is
new: a command finds what runs, never starts a host, and with nothing running
runs a server of its own for the work or says "Start Wanderbooks first", with
the table command by command. architecture.md, deploy/README.md and
mcp-interface.md say the app is the host and only serve keeps a detached one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 11:34:19 -07:00
swaitsandClaude Fable 5.2 d66cc98ee5 docs(verification): law 47, a write is one transaction, exactly once (P15 T1, D-88)
Ties WB-format-8 to 10, the calls.rs spec block, the command-steps map and
plan 2a to bookspec law 47 (Calls.lean): a call is a Steps run, no new Step.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 10:59:55 -07:00
swaitsandClaude Fable 5.2 38647e2143 Merge branch 't3/transactional-mcp-writes': every write through the tools is one transaction, exactly once (P15 T1, D-88, D-89)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 10:40:34 -07:00
swaitsandClaude Fable 5.2 b592aaf416 docs,test: claims WB-format-8 to 10, the interface, the handbook and the tests follow the review
WB-format-8 now says every reader applies the frame rule because ids are
reused after a failed call, and names the committed accessor and the labels;
WB-format-9 the keyed argument digest, the bounded answer, the in-memory
table for calls that wrote nothing and what a repeat of a long answer is
told; WB-format-10 the vault staged inside the transaction and the honest
words when the closing line is on disk. docs/mcp-interface.md, the receipt
store's frame paragraph and the handbook (contract, tracing figures) say the
same.

Tests follow the new shapes: a call that wrote nothing leaves no line, the
head a write answers is where its own lines end and its closing line follows,
the idempotency table compares events, and the checks that a refusal or a
preview wrote nothing compare the raw journal.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 10:40:00 -07:00
swaitsandClaude Fable 5.2 c3efb6b301 Merge branch 't3/p15-a4-connect-page': connection states, Ask your assistant, the Connect page (P15 A4)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 10:23:35 -07:00
swaitsandClaude Fable 5.2 022c0c642f feat(gui): each company's assistants: three states, Ask your assistant, the Connect page, a warning before closing
P15 unit A4, plan 3.3 and D-79. The window only reads the books, so it
now says so by what it offers. Each company is in one of three states
(no assistant, connected, working) read from the books server's own
sessions answer, never waited for, drawn as a shape on its tab and said
in words with the last thing done at the right of the top bar; the
sidebar gives up no height, because the links must all fit at 1479x519.
Where a button that edits would be there is "Ask your assistant", which
copies a ready sentence. The Connect page has a row per local tool with
exact commands, the keys with who is on each, and Revoke through the
existing command path. Closing the window or a tab with an assistant
connected warns first, before and never beside the server's own close.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 10:03:35 -07:00
swaitsandClaude Fable 5.2 5693390614 fix(spec): WB-app-1 names AppServer's drop in words, not as an item
The claims check reads a backticked word as a code item; Drop is a
trait, not an item of this workspace.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:55:38 -07:00
swaitsandClaude Fable 5.2 06daffea76 Merge branch 't3/p15-b2-relay-service': the relay service (P15 B2)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:53:38 -07:00
swaitsandClaude Fable 5.2 a4624c16bc docs(spec): the relay's claims after the security review
WB-relay-2 to 5 and 7 say what is now true: one refusal for a stranger,
the secret label's 128 bits, the word list's 1 427 words and 40-bit floor,
the claim ceiling and the certificate budget charged at first publish with
their per-prefix numbers, the block reaching a live line within 10 s, no
static binding secret, CAA from the list, and the limits in one table with
what stays unsolved.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:52:54 -07:00
swaitsandClaude Fable 5.2 e542319e63 feat(mcp): every write call is one transaction with a request key (P15 T1, D-88, D-89)
Accounting reasoning: these are financial books reached over the internet,
where a request is retried. A write whose answer is lost and then sent again
must not post twice, a call half done must not be left looking done, and a
failed write must be on the record.

Every tool that can change the books (83 of the 140: three that only read
what is sealed and may answer with a TIN are reads) takes a required
`request_key`, added to its schema in tools/list and taken out of the
arguments before the tool runs, so no tool, preview digest or check changes.
A write without a usable key is refused in words. Write calls take turns,
and each runs as one transaction of the store: opened (or answered from the
books if its key committed: the same tool and arguments return the first
answer and write nothing; other arguments are refused as a misuse of the
key; the access log says `repeat`), then closed with its answer if it
answered ok, or rolled back and closed `failed` if it errored, failed or was
stopped by a close. Books an older version wrote take no write at all until
the owner's go-ahead (D-89): every write is refused with the upgrade remedy;
reads work as ever. `books.import_bank_csv` is one transaction like the rest.

The handbook, docs/mcp-interface.md, the claims (WB-format-8 to 12, and
WB-format-3 amended for D-89) and docs/parity.md say so. Tests that wrote to
old books through the tools now assert the refusal and write after the
upgrade; the shared wire helpers add a fresh key to every tool call (the
journal helpers leave the call frames out, as they left out nothing before),
so no other test changed. The store-level `_waits_for_<feature>` tests still
check each feature's own gate. No figure and no golden moved.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:43:52 -07:00
swaitsandClaude Fable 5.2 5902580819 docs(spec): WB-relay-1 to WB-relay-7, the relay's product rules
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:33:03 -07:00
swaitsandClaude Fable 5.2 c6b3cb614b docs(spec): the app claims say what the fix round made true, and that app-hosted is permanent
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:21:21 -07:00
swaitsandClaude Fable 5.2 2633109d55 feat(store): a tool call is one journal transaction (P15 T1, D-88)
Accounting reasoning: a write that is retried after a lost answer must
happen once, and a call that dies between its journal lines must never be
replayed as if whole. The journal feature `call_transactions` frames a
call's lines with `call.begun` and `call.closed`; the lines between count
only when the closing line says `ok`. Every replay (open, the viewer,
verify, rebuild, the projection's catch-up) goes through one gate
(`CallGate`), so no state is built from half a call and a replay of any
prefix ending inside a call equals the replay of the prefix before it. A
call that never closed is closed `unfinished` at the next open; a call that
fails after writing lines is closed `failed`, its SQLite changes (one
transaction per call) rolled back and the live ledger rebuilt without them.
The closing line keeps the answer given, so a repeat of a request key
returns it; the key table is rebuilt from the journal alone.

The envelope is untouched. Lines outside a frame apply as ever, so every
journal written before the feature replays as it was. Books get a unique id
(`books_id`) at creation, and older books at the format upgrade, in the
`journal.format_set` that declares the feature. The frame lines never move
the audit's figure head. The upgrade's declaration now also carries the id,
so the three tests that pinned its exact payload compare it without the id.
No figure and no golden moved.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:16:03 -07:00
swaitsandClaude Fable 5.2 7357a30c73 test(app): the child's lifetime, tabs driving the server, and the bridge's two messages
The server child starts, closes on input close and on the window's death (a
killed stand-in window leaves no server and a whole book), a stop that runs out
of time leaves it closing and says so, a start is refused while a server or host
holds the books; a tab opened or closed opens or closes that company, in order,
with failures said in words; closing the window waits in view and asks the owner
once; the bridge answers 'Wanderbooks isn't running' and 'Company X isn't open'
in one running session, starting no host. Claims for WB-app-1 to WB-app-4 name
them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:07:34 -07:00
swaitsandClaude Fable 5.2 c8c0f5e0d9 feat(host): the app's books server is a child process; the bridge says in words when the app isn't running or a company isn't open
The desktop app is the host (D-77, D-84): AppServer starts the books server
from the program's own executable, closes it by closing its input, and never
signals it. A window that dies closes the same pipe, so the books close
cleanly. A start is refused in words when host.lock or server.lock is held.
Starting writes run/app-hosted; for such a root with no host the bridge holds
no lease and starts no host, and answers 'Wanderbooks isn't running' or
'Company X isn't open' (WB-app-1, WB-app-3). Owner commands and the viewer
take a lease-less hold on the app's server instead of starting a host beside
it; closing the books and wanderbooks serve say the app has them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 08:58:51 -07:00
swaitsandClaude Sonnet 5.5 62364fec62 docs(spec): WB-format-1 names the function that picks the newer-journal message
`verified` is a field of a StoreError::NewerJournal variant, which the claims
check does not read as an item; it passed before only because a doc comment
in gui app.rs quoted "verified" (a string literal, removed today). The claim
now names newer_journal_text, the function that reads the flag, and says in
words what the flag is.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 21:23:44 -07:00
swaitsandMuse Wonder 1.0 02087ef3fb fix(core): a legacy close's drift before its true-up is the rule's, not one unit
Before a count is trued up, check_split flagged any drift beyond one unit. BS-partner-1 statement 6 allows a legacy last-absorbs close more than that with four or more members, so the audit raised a false finding on legitimate legacy books.

The rule does not state an audit bound; this bound is DERIVED from statement 6's per-member facts, and the derivation is in check_split's spec block: with n members and unit u, each member but the last was rounded to within u/2, and the last absorbed the sum of those roundings, so |e_last| <= (n-1)*u/2. Floored at u (statement 6's allowance for each run break and each per-close close), the pre-true-up bound is B(n) = max(u, (n-1)*u/2): 1.5 units with four members, 2 with five. A drift of exactly B(n) is legitimate and not flagged; past it is. After the true-up, statement 5's strict bound still holds: a drift of a unit or more is flagged.

WB-ledger-16 invariant 8 now states B(n) and marks it derived.

Tests: a_legacy_last_absorbs_close_drifts_by_member_count_before_its_true_up (BS-partner-1 statement 6 before the true-up, statement 5 after it; WB-ledger-16 invariant 8): four- and five-member closes at their largest legitimate drift are not flagged, one unit past it they are, and after the true-up the strict >= unit bound holds.

Co-Authored-By: Muse Wonder 1.0
2026-11-09 14:50:38 -07:00
swaitsandMuse Wonder 1.0 5b1596f977 fix(core): the audit checks a close's split at the allocation's unit
audit::closes took its unit as minor_units().unwrap_or(2), while the members allocation splits at allocation_places() (minor_units().unwrap_or(MAX_LINE_SCALE)). For a currency code with no minor unit the audit therefore checked a split made at the finest a line carries against a cent: far looser than the split it checks, so real drift passed.

Add Currency::allocation_unit(), the one helper that turns allocation_places() into an amount, and take the audit's unit from it, so the split and its check cannot drift apart (BS-partner-1 statement 4: the allocation is the split to the base currency's smallest unit). A JPY close is now checked at a whole yen.

Test: a_jpy_close_is_checked_at_the_allocations_unit (BS-partner-1 statement 4, WB-ledger-16 invariant 8).

Co-Authored-By: Muse Wonder 1.0
2026-11-09 14:48:59 -07:00
swaitsandClaude Sonnet 5.5 3c78eb5bed docs(claims): the bookspec examples that check BS-revenue-1, BS-asset-3, BS-partner-15, -17, BS-1099-5 and BS-statement-9
Each claim's Checked line names the examples that now run it on the engine, and
the example for each option wanderbooks did not pick, which is skipped. Two
claims say what the engine does not: BS-partner-16's pick states what the books
do by convention at a close, since no command closes a period at a change of
shares, and BS-asset-9's is the books' convention, not an engine default (a
contributed asset's 704(c) method is unset until a command gives one), so no
example shows either pick apart.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 12:05:15 -07:00
swaitsandClaude Opus 5.5 1add7df419 merge: the adapter runs schedules that take the pick, yen schedules, the IIF's options and the books' own facts (X-H1e1's wanderbooks half; reviewed, re-checked)
Wanderbooks passes every bookspec example for its picks: 104 run, 104
passed, 22 for options it did not pick. A schedule plan is answered as
the engine holds it (a yen month 333, a dollar month 33.33); the IIF
line ending is cr-lf only when every line ends so; bookspec's setting
keys map to the engine's in one place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 11:18:25 -07:00
swaitsandClaude Sonnet 5.5 bab7ac72ca test(core): the adapter's line-ending answer needs every break to be CR LF
contains(CR LF) answered cr-lf for a file mixing CR LF and bare LF. Now the
count of LF must equal the count of CR LF for cr-lf, with none CR LF for lf,
and a mix is mixed. The claims say the engine has no host notion, so
host_line_ending is unused (BS-format-4).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 11:17:14 -07:00
swaitsandDeepSeek V4.1 Flash 695aee7a1e docs(claims): the new bookspec examples that check the picks
The Checked lines gain the examples that now exercise each pick: the
schedule examples with no convention and a mid-month start (BS-prepaid-2,
and the equal-months one under BS-prepaid-3's start-on-any-day), the yen
schedules under the minor unit and the cent rule (BS-prepaid-4), the two
IIF line endings, DOCNUMs, spans, closes and the nameless receivable line
(BS-format-4, -5, -6, -8, -9), the setting recorded in the books
(BS-ledger-9), the role assignment read back from them (BS-ledger-18) and
the category rounding once and per account (BS-ledger-21). Each names the
enforcement it goes through and the two tests that run it, so the
traceability gate keeps every claim backed.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 10:49:49 -07:00
swaitsandDeepSeek V4.1 Flash 409845e665 docs: the cash-flow and party citations name statements by position
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>
2026-11-09 10:21:04 -07:00
swaitsandClaude Opus 5.5 f5826d45a4 merge: the adapter runs refused dates, amounts, periods, roles, exports, 1099 years and returns (X-H1d's wanderbooks half; reviewed, re-checked)
Wanderbooks passes every bookspec example for its picks on refused
input: 95 run, 95 passed, 16 for options it did not pick. The IIF export
now keeps its typed refusal (an entry on two receivable or payable
accounts is BS-format-10's), where it had stringified it; the package and
the MCP tool still show the same text. A test walks every role the
schema lists through the engine's control_account, so the two lists
cannot drift apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 09:09:03 -07:00
swaitsandDeepSeek V4.1 Flash 9c2e586733 docs(claims): BS-ledger-19's example shows both refusals
The example is renamed to what it now shows, and it refuses two
assignments: the receivables role on a header account (not postable) and
the payables role on a postable revenue account (wrong type). The claims
entry names both and the new example id.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 08:58:25 -07:00
swaitsandDeepSeek V4.1 Flash ad55ede8e4 docs(claims): refused dates, amounts, periods, roles, exports, 1099 years and returns
Each rule's Checked line names the bookspec example that now shows it, the
enforcement site it goes through, and the test that runs it:

- B-28 (BS-entry-4, BS-entry-7): the date past 9999 and the line past the
  cap, through `try_create_entry` and `add_line`;
- B-12 (BS-period-4): the partly overlapping quarter, through
  `create_period`'s PeriodsOverlap;
- B-23 (BS-ledger-19): the role on a header, through `Store::assign_role`
  and `check_assign_role`;
- BS-format-10: the export refused through `IifError`;
- B-19 (BS-1099-2): the 2027 worksheet refused through `RuleNotKnown`;
- B-26 (BS-partner-8): the return taking 123-45-6789 from the vault.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 07:40:31 -07:00
swaitsandClaude Opus 5.5 045e70bb0d merge: tests where coverage was thinnest, the audit's strict close bound, WB-ledger-17 (V-D2; reviewed, fixes applied)
Ninety-six tests, each encoding the rule it covers, reach what the core
and store suites left untouched: the evidence requirement (34% to 100% of
its lines), the store's reconcilable accounts (0% to 100%), the command
steps' refusals, conventions, settings and the audit's branches. ledger-
core's line coverage rises from 89.79% to 95.49%, and the floor with it.

Found: the digest listed cash accounts found by name in hash order, so
the same books could list them differently; they come in ascending
account id now. The audit now holds a close's member split to under one
unit (BS-partner-1 statement 5) once the count has been trued up, a
close records its rule, and only drift beyond one unit before; the
reconciliations rule is written down as WB-ledger-17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 07:33:54 -07:00
swaitsandClaude Sonnet 5.5 ae32a83407 docs(spec): WB-ledger-17, the reconciliations rule, and the order the tests pin
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>
2026-11-09 06:15:39 -07:00
swaitsandClaude Sonnet 5.5 7ac1ef8c5a fix(core): the audit holds a close's split to under one unit once the count is trued up
BS-partner-1 statement 5 says that after a close that posts, each member's
running total MUST be under one smallest unit from its exact share. The audit
flagged drift only when it was greater than a unit, so exactly one unit passed.
The looser bound is right only until the first true-up (statement 6,
WB-partner-1): a count that still holds closes made under the older rules may
carry their rounding until a cumulative close posts.

A close records both facts replay needs: its rule (`MembersClosed.rule`) and
whether it posted (`closing_entry`). `Ledger::member_close_trued_up` says a
count has had a cumulative close that posted, at or before a given close, and
`audit::check_split` flags drift of a unit or more once it has, drift beyond a
unit before. Closes under the older rules are not read by the audit at all.

Tests: both regimes at the edge in either direction, and a count walked through
a per-close January, a non-posting February (not trued up), a posting March
(trued up) and a non-posting April (still trued up). WB-ledger-16 gains
invariant 8 for it. The same test file now cites WB-ledger-16 for the audit
(BS-ledger-13 is retired), and audit.rs's own invariant and scenario where
WB-ledger-16's numbering does not match.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 06:15:38 -07:00
swaits 5fd382450b Merge branch 'main' into t3/coverage-gap-tests-v-d2 2026-11-09 05:07:33 -07:00
swaits 5e4950697e Merge main into the K-U5 branch: X-H1b, K-U3, S-E2, S-E3, X-H1c 2026-11-09 04:35:21 -07:00
swaitsandClaude Opus 5.5 d47bc47508 fix(core): a zero plan prints 0 every month, as the cent rule always has
The K-U5 review's probe compared 1.5 million plans as printed text,
legacy against new, and found one difference: a zero total's last month
printed -0 (the kernel's 0 - 0), where the old plan printed 0. A zero
total is never registered, so no journaled schedule is touched, but the
promise is that the same plan prints the same, so the zero plan now
prints a bare 0 every month; a test pins it (and fails without the fix).

Also from the review: the kernel's GOAL said no month is more than a
rounding from the rest, which the last month need not be (INVARIANT 4
bounds it); and WB-prepaid-2's Checked list lacked the fifth harness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 04:30:35 -07:00
swaitsandClaude Opus 5.5 b8e9b3ea8e merge: the adapter runs drafts and evidence (X-H1c's wanderbooks half; reviewed, re-checked)
Wanderbooks passes every bookspec example for its picks on drafts and
their evidence: a draft waiting on its receipt, a discard that leaves the
books as they were, a draft holding its period open, the one evidence
decision answering for every entry. A refused hand entry is posted on a
rehearsal of the real store, so the refusal is the engine's own; payroll
postings are their own exemption source. No engine change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 04:25:01 -07:00
swaitsandClaude Sonnet 5.5 56461c1bb6 test(core): the adapter's refused hand entries go through a real Store, and payroll is its own source
A hand entry the example says is refused when posted at once was made on a
clone of the Ledger and the receipt-gate error hand-built from
`evidence::requirement`, as `Store::post_entry_checked` builds it: the
adapter, not the engine, produced the refusal. A store journals a draft the
moment it is made, so the entry is now made, lined and posted on a rehearsal:
the books replayed from their journal into a Store of their own (the journal
and blobs copied, opened as any store is), and posted through
`post_entry_checked` under a policy, `post_entry` otherwise. The refusal is the
engine's own (ReceiptRequired included) and the example's books keep nothing.

A payroll run or tax remittance is exempt by its own source, so the engine's
"a payroll ..." sentence now reads as bookspec's new `payroll_posting`, not
`document_entry`. A draft reversal, which wanderbooks has no path for, is
returned as an unsupported-operation error (reported as "another refusal"), not
a panic that takes the harness down with it.

The claims for B-43 name the new example, entry-only-a-draft-can-be-posted-or-
discarded (a posted entry or a discarded draft is no draft), and the rehearsal.
Needs bookspec's x-h1c commits (payroll_posting, the new example, the
25.00 threshold example); the pin moves when they land.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 04:23:10 -07:00
swaitsandClaude Sonnet 5.5 74fc553272 docs: the sub-references the review found land on the part that states the claim
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>
2026-11-09 04:01:09 -07:00
swaitsandClaude Sonnet 5.5 d889f2e7fb docs(claims): the draft and evidence examples are checked lines
B-1 (BS-entry-1, BS-entry-6), B-43 (BS-entry-5) and B-20 (BS-ledger-7,
BS-ledger-17) name the bookspec examples that now show their rules, the real
engine functions each runs through, and the examples for the options
wanderbooks did not pick, which are skipped.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:44:13 -07:00
swaitsandClaude Sonnet 5.5 09308d5528 feat(core): new schedules round to the currency's minor unit (D-72)
The owner's decision D-72: a new monthly-even schedule rounds each month
to its currency's minor unit (yen whole, dinar to the thousandth), where
the cent rule gave two places to every currency; a schedule written
earlier replays under the cent rule, so nothing journaled moves
(BS-prepaid-4, BS-entry-8).

The rule is the schedule's own flag, journaled on its schedule.registered
line ("rounding": "minor_unit", absent for the cent rule), not the
sequence position of the journal feature: a flag survives a snapshot, a
copy and a replay that starts mid-journal. The new feature
schedule_minor_unit gates it (KNOWN_FEATURES, ensure_feature in
Store::register_schedule): books that haven't declared it keep the cent
rule and write nothing new, and an older reader stops at the declaration
as newer books (BS-format-1); an unknown rounding is newer, never
corrupt. A dollar schedule plans the same under both rules.

Tests: a dinar schedule written before the feature replays to the same
plan and the same posted line after the owner's upgrade, while one written
after plans 0.333, 0.333, 0.334. WB-prepaid-2 becomes yes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:33:15 -07:00
swaitsandClaude Sonnet 5.5 e41cc3a161 docs: sub-references name bookspec's statements, invariants and scenarios
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>
2026-11-09 03:30:06 -07:00