Commit Graph
1074 Commits
Author SHA1 Message Date
swaitsandClaude Fable 5.2 f218bf4552 test(cli): the roster and a key's revoke, through the real books server
A bridge session opened with a key is on the roster; revoking the key
takes the key and its session off, refuses the session's next call and
deletes the token file's copy.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 10:16:26 -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 1d1a2a5a88 feat(host,gui): the command that reaches a company's books is made in one place
The Connect page of P15 unit A4 shows an assistant the exact command it
must run to reach a company (`<this program> mcp --book ID`, with --root
when a root was named). `connect` already built that command, so it is
now one function (`bridge_serve_args`/`command_line`) used by both, and
the step `connect` does first (the company's default key exists and its
copy is in the token file) is `ensure_key`, which the page offers by
itself for assistants it has no button for.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 10:03:35 -07:00
swaitsandClaude Fable 5.2 016f1b2afc feat(host,gui): the window can ask the books server who is connected, and end a token
Unit A4 of plan P15 needs the window to read who is connected to each
open company and to end a token. Both go through admin requests the
server already answers (Sessions, TokenList, TokenRevoke): the window's
server handle gains a quick roster (an Err in words while the server is
starting, gone or slow; never a wait) and a revoke that does what
`wanderbooks token revoke` does, including removing the token file's
copy. The command that reaches a company's books is now made in one
place (`bridge_serve_args`) for `connect` and for the Connect page.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:28:50 -07:00
swaitsandClaude Fable 5.2 4c474ee1d9 docs(plan): A2's follow-ups and delegation lines
check / check (cli) (push) Canceled after 0s
check / check (gui-tests) (push) Canceled after 0s
check / check (gui-unit) (push) Canceled after 0s
check / check (lint) (push) Canceled after 0s
check / check (rest) (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
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:22:00 -07:00
swaitsandClaude Fable 5.2 02468a824d Merge branch 't3/p15-a2-app-hosts-books-server': the app starts and stops the books server (P15 A2)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:21:46 -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 9f3f292bf5 fix(gui): a failed start can be tried again, and a close that was not whole stays on screen
The window retries a failed server start when the next tab opens or when the
person asks, says a server still starting is starting, tells the person which
wanted companies did not open, and when the close reports an incomplete last
backup or a bad exit it stays up with a Close anyway button. ViewerOwner only
forwards to AppHost now, and the format upgrade goes to the window's own server.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:21:20 -07:00
swaitsandClaude Fable 5.2 acc17a7703 fix(host): the window's server is managed or stopped, its close and upgrade are said in words
AppHost holds what the window does with its books server, so what the tests
drive is what the window runs. A server that is alive but not ready is waited
for; a failed start, or a window closed before the child was stored, closes
the child's input and waits for it, so no server runs that nothing manages.
The close first closes each open company, so a closing backup that was not
whole, and a server that exited badly, come back as words. The format
upgrade goes to the server as an admin request (there is no host to ask),
and the companies the window wanted that the server did not open are told.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:21:20 -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 f476c95a64 feat(gui): a tab is a company open in the app's books server; closing the window closes it in view
The window starts the server with the companies it restores, a tab opened or
closed opens or closes that company in it (one queue per company, so one
company's backup at close delays no other), failures and incomplete backups are
notices under the tab bar, and asked to close the window waits, saying so, for
the server's bounded close (WB-app-2, WB-app-4). The viewer no longer starts a
detached host.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 08:58:51 -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 Fable 5.2 5682258f8d docs(delegation-log): the Mac, Windows and lint fix
check / check (cli) (push) Canceled after 0s
check / check (gui-tests) (push) Canceled after 0s
check / check (gui-unit) (push) Canceled after 0s
check / check (lint) (push) Canceled after 0s
check / check (rest) (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
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 08:41:48 -07:00
swaitsandClaude Fable 5.2 2cd67da1b1 Merge branch 't3/fix-ci-macos-windows-lint'
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 08:41:35 -07:00
swaitsandClaude Fable 5.2 7058fbd2b9 docs(plan): the first test release waits for the relay
The owner's decision, 2026-11-21: test users get nothing until web
assistants work, so every P15 unit is built before the first installer.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 08:40:24 -07:00
swaitsandClaude Fable 5.2 124be0afd8 test(cli): macOS refuses socket options on a cut connection; a failure names what it waited for
Raw::until_closed set a read timeout on a connection the server had already
cut. macOS answers EINVAL to setsockopt on a socket whose peer has closed,
where Linux accepts it, so five tests failed there before they could observe
the cut they wait for. Such a socket cannot block a read, so that refusal
alone is passed over (a zero bound is asserted against, and any other error
still fails); a read that reports NotConnected is the same cut. The timers
test now says which timer never held, and the hammer test how long each close
took, so a platform failure names its cause. The deaf shim flag (see the
store commit) is used by the lock test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 08:34:04 -07:00
swaitsandClaude Fable 5.2 b9ef35592c test(mcp): the tree digest names files with / on every system
handles_from_before_a_close_do_nothing_after_the_book_is_open_again adds the
planted stray file to the digest as uploads/stray.bin, but the walk keyed the
same file by the system's path, uploads\stray.bin on Windows, so the two
maps could never be equal there. The helper now keys with / everywhere; the
assertion (an old handle changes no file) is untouched.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 08:34:04 -07:00
swaitsandClaude Fable 5.2 e9dc03a44a test(store): a git that cannot end on SIGTERM is deaf to it, not stopped
On macOS a SIGTERM sent to a SIGSTOPped git ended it inside the grace and it
removed its own locks, so the three tests that need a git the kill must end
failed there (the grace was not waited, no lock was left). A blocked signal
stays pending on every system, and the mask is inherited through exec and
through git's own children: the test shim blocks SIGTERM for a git when a
deaf flag file exists. The program's stop (SIGTERM, grace, SIGKILL) is
unchanged. Checked here with the stop turned off: the tests still pass.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 08:27:50 -07:00
swaitsandClaude Fable 5.2 cf1644627f fix(deps): ignore RUSTSEC-2026-0543, chrono's unmaintained notice
Not a vulnerability and no upgrade is offered; replacing chrono with jiff
is the owner's decision.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 08:18:08 -07:00
swaitsandClaude Fable 5.2 232af014c4 docs(delegation-log): the two fix-ups after GitHub's run
check / check (cli) (push) Canceled after 0s
check / check (gui-tests) (push) Canceled after 0s
check / check (gui-unit) (push) Canceled after 0s
check / check (lint) (push) Canceled after 0s
check / check (rest) (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
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 22:44:09 -07:00
swaits 40d818fb5e Merge branch 't3/fix-linux-ci-failures' 2026-11-20 22:43:10 -07:00
swaitsandClaude Sonnet 5.5 ca57ac03cc docs(notices): regenerated for zip 9.8.1 and its zstd, lzma-rust2
The new zstd-sys carries the BSD 2-Clause text of its legacy decoders, so the
notices gain that licence. libc was already listed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 22:22:43 -07:00
swaitsandClaude Sonnet 5.5 70f24daf99 fix(deps): zip 9.0.2 to 9.8.1, for RUSTSEC-2026-0548
zip's reader extracted entries under local-header names that can differ from
the central directory (fixed in 9.0.5). ledger-package reads packages with
it. Lock file only; ledger-package builds and its unit tests pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 22:19:40 -07:00
swaitsandClaude Sonnet 5.5 e42c3909fa fix(gui): the tab strip's width is folded, not summed, so kernel-only passes
scripts/raw-decimal-arith.sh refuses an Iterator::sum of any type (it cannot
tell widths from money without types it does not have). The tab widths are f32
layout, no money; a fold says the same and the check reads 0 places.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 22:17:20 -07:00
swaitsandClaude Sonnet 5.5 13e676a101 fix(gui): the tab bar's pictures are compared as shapes, and no picture depends on a temporary name
The stored tab-bar images were compared pixel for pixel on every machine.
GitHub's software renderer rasterizes the same shapes differently from the
GPU that made them (thousands of faint pixels, dozens strong along glyph
edges); sidenav.rs already says so and compares shapes everywhere, pixels
only locally. The tab bar now does the same: a hash of the visible shapes
(tests/snapshots/<name>.shapes, TABS_BLESS=1 writes them), the pixels with
TABS_PIXELS=1. The images are unchanged and still pass locally.

The hash is of a description of each shape, not of its debug form, for
two things in the debug form depended on the run, not on the books: a
glyph's place in egui's font atlas changes with which tests ran in the
process before (the same view hashed differently alone and beside another
test), and the page under a short bar holds the current time, clipped
away, which no picture shows. Shapes whose clip is off the window are
left out.

A new test renders the same companies from two differently named
temporary folders, light and dark, and requires the same hue keys (the
book ids), the same shapes and the same pixels. The sidenav fixture's
copy outside a data root is in a folder of a fixed name, not the temporary
folder's random one, since that folder's name is its badge's hue key.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 21:48:18 -07:00
swaitsandClaude Fable 5.2 d9e0df7a70 docs(plan): one more follow-up, and the day's delegation records
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 21:37:30 -07:00
swaits c618ad4d84 Merge branch 't3/fix-book-close-open-race' 2026-11-20 21:37:30 -07:00
swaits 7801455336 fix(store): a store's writer lock is free when it is dropped, even with a child forked from another thread
Cause: a book's writer lock is a flock, which lasts as long as any copy of
its open file description does. A child forked by another thread of the
server (git, for another book's backup, on a timer) holds a copy of every
descriptor from its fork until its exec, so a close of book B, answered
after its Store was dropped, could be followed by an open of B that found
the lock still held: "another program has these books open". The open's
failed attempt left B failed, and the next close found it not open. This
broke the unit's rule that a close answers only once the lock is released,
and that closing book A never refuses a job on book B (the hammer's maker
thread saw it on GitHub's slower runner; with a 40 ms fork-to-exec delay in
the backup's git it fails on every cycle).

Fix: every child the crate starts goes through lock::spawn, which holds a
process-wide gate while it runs (it returns once the child has exec'd);
dropping the Store's WriterLock closes the file, waits for the gate to
empty of spawns begun before, then takes the lock afresh and lets it go
(the kernel lets go of a closed file's last copy a moment after the exec),
for 500 ms at most. A test with a child held between fork and exec fails
without it.
2026-11-20 21:36:57 -07:00
swaitsandClaude Sonnet 5.5 c072e68fda docs(store): the doc link to take_lock_notes is a method link
rustdoc -D warnings refused [`take_lock_notes`]: a method is linked as Self::take_lock_notes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 21:23:44 -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
swaitsandClaude Sonnet 5.5 5c9c980072 fix(gui): jobs.rs cites the plan, not a product rule no claims file defines
WB-GUI-2 was never written into docs/spec/claims/, so the source-line test
could not find it. What the module rests on is plan 3.2 (D-78: a tab's
threads end with it); the hold on a change an owner has begun is a
CONVENTION, named as one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 21:23:44 -07:00
swaitsandClaude Sonnet 5.5 15845f71c8 fix(gui): the dock compiles on Windows, where the agent ends when its pty drops
check / check (cli) (push) Canceled after 0s
check / check (gui-tests) (push) Canceled after 0s
check / check (gui-unit) (push) Canceled after 0s
check / check (lint) (push) Canceled after 0s
check / check (rest) (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
Pty::child exists only on Unix; the child's pid is now Some on Unix and
None on Windows, so the kill after the grace happens only where it can.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 20:50:41 -07:00
swaitsandClaude Fable 5.2 3fe6b2f9c9 docs(delegation-log): P15 A3a's last change, merged
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
check / check (cli) (push) Canceled after 0s
check / check (gui-tests) (push) Canceled after 0s
check / check (gui-unit) (push) Canceled after 0s
check / check (lint) (push) Canceled after 0s
check / check (rest) (push) Canceled after 0s
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:31:39 -07:00
swaitsandClaude Fable 5.2 b994a901bf merge: P15 A3a, the viewer is one window with a tab per open company
The viewer was a read-only window on one company per process. D-78 makes
a company reachable exactly while it has a tab, so the window now holds
one tab per open company, each with its own loader, navigation, page
state and assistant dock, and nothing shared between them. The company
is named once in the frame, on its tab; the status card at the foot of
the sidebar carries its badge and name with the live state; each company
has its own badge colour. A restore or a format upgrade in progress is
never abandoned by closing its tab or the window. The viewer still
writes nothing to the books.

docs/testing.md: both units added their test records at the end; both
are kept.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:30:01 -07:00
swaitsandClaude Sonnet 5.5 6f916f8bbd fix(gui): the status card's live word at its right edge, the event on hover, and no line ever wraps
The heading row is badge and name (elided) at the left, the live dot and word at the right edge; the event is the heading's hover and the live word's accessible label, not a printed row. The check lines are as before, with no event. Every text elides to one line; a test lays the card out in every state with a very long name and event 1,234,567. The heading is its badge's height and the card's vertical padding 8, so the sidebar still fits at 1479x519.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 20:29:23 -07:00
swaitsandClaude Fable 5.2 1e49272243 docs(delegation-log): P15 A1's last round, merged
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:25:09 -07:00
swaitsandClaude Fable 5.2 a19473b282 merge: P15 A1, the server opens and closes one book while it runs
The books server could only open every book at start and close them all
at exit. The app is becoming one window with a tab per open company
(D-77, D-78), so a company must be reachable exactly while its tab is
open. The server now opens and closes one book on request, refuses calls
to a closed book in words an agent can relay, and lists who is connected.

Four independent reviews shaped it. After a close is answered nothing in
the server can write to that book; a call either ran and is journaled or
was refused, cut or stopped and left nothing; a close ends within a
stated bound; closing one book never stops another's work; and nothing
is ever deleted in a backup folder the owner chose.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:24:00 -07:00
swaitsandClaude Sonnet 5.5 ee58d1ab10 test(cli): a close's own backup is asserted without a timer's backup beside it
a_close_whose_backup_fails... asserted a plain Closed, but with the timers
looking every 20 ms a timer's open-time backup could be in flight at the
close. The close hurries it; under heavy load its git can miss the 5 s
terminate grace, be killed, and leave a lock in the target folder, and the
close's own backup then fails against it, so the close truthfully answers
ClosedBackupIncomplete. The timers now look once an hour in this test, so the
first look (at the server's start, before the book exists) is the only one
and no timer backup runs; the assertion stays exact.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 20:21:56 -07:00
swaitsandClaude Sonnet 5.5 49ae7c0d13 fix(store): a stopped heal leaves no copy and no rebuild, and the bound names the heal
verify_and_heal copied the database aside before looking at the stop, so a
verification or an open that was stopped right after finding a drift left a
.mismatch copy behind. The look now comes first (heal_drift), before anything
is done: a stopped heal leaves the database and the folder exactly as they
were. The rebuild and its verification stay unstoppable once begun, since
stopped half way the live ledger would be part replayed.

INVARIANT 10's close bound said that heal was one pass over the journal and
named no term for it. It is about six (three in the rebuild, three in the
verification) plus the copy and one hash of each stored file, so it is now the
fourth named exception to the bound, with that cost, and 'an open stops
anywhere' says where it cannot.

Test: a stop before the heal leaves no copy and no rebuild; the same drift
heals when not stopped. It fails with the look moved back after the copy.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 20:20:24 -07:00
swaitsandClaude Sonnet 5.5 30e5fcf6da fix(mcp): a CPA package the build will refuse leaves no decision on record
The override decisions (exporting without an audit, with open drafts) were
journaled once only the two named refusals were past, but build_package can
still refuse for what the books say, such as a member whose capital account
is not in the chart. That left 'was exported' on record with no package, and
a new decision on every retry.

When a decision is to be recorded, the build now runs once first, in memory:
it is read-only (the books by shared reference, written nowhere), so it
changes nothing, and it is left without the stored files and the vault, which
only a failing machine can refuse. Only if it succeeds is the decision
journaled and the package built for real. The spec block says what can still
fail after a decision (the machine) and that the decision then stands, with
the reason in the access log.

Test: a package refused for an unknown capital account, with an override
reason, journals nothing, on the first try and on the retry; it fails without
the dry run (the journal grows).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 20:18:39 -07:00
swaitsandClaude Sonnet 5.5 b70a8ab8eb fix(mcp): a close never waits behind a preview, and stops every job holding its book's turn
A restore preview changes nothing, yet it took the book's turn and then
queued on books.lock and cloned, so a close of that book (which waits for
the turn) waited for the whole preview, and behind it for any adoption
holding books.lock. An adoption held the turn through its preview and
placement on the server's stop alone, so the comment saying a close of the
id stops its opening was not true.

A preview (restore, unconfirmed adopt) now takes no turn, and only the
server's close stops it. Every job that does hold an id's turn (adopt,
create, a confirmed restore, open) listens to that id's stop, which a close
raises before it waits for the turn, and which the server's close raises
too. A close of X stops the work making or replacing X before its point of
no return and never waits behind it; a close of another book still touches
nothing.

Tests: a close is answered while a preview of its book is held; a close of
an id stops the adoption making it. Each fails with the fix disabled.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 20:16:13 -07:00
swaitsandClaude Fable 5.2 3a8e652ceb docs(plan): P15's follow-ups from the reviews of A1 and A3a, written down
The last rounds of both units fix what blocks a merge and no more. What
was left out on purpose is listed in the plan so it is not lost.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:07:12 -07:00
swaitsandClaude Fable 5.2 80e08291b8 docs(routing): long runs go to Haiku, short ones to Ember
Ember twice ended its turn while a long command ran, and the command
died with it; it was exact on short runs and on one hour-long single
command. The table now splits run-only work by length.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 20:04:08 -07:00
swaitsandClaude Sonnet 5.5 a66b56c5c7 fix(mcp): a close stops only the work on its own book; each book has its own turn
Closing or opening book A must never block, fail, stop or delay anything on
book B. Two things were server-wide: the stop a close raised for the admin
jobs (a close of one book stopped another's restore, create and adopt, and
refused opens of others while it ran), and the one lifecycle lock a close
held for its whole length (an open of another book waited out the close's
last backup).

Each book now has its own turn and its own stop (Books::lives). A close of X
stops the work on X only: an open of X and a restore that replaces X. A
create, an adoption and a restore that replaces nothing make a new book, which
no close of a book is the close of; only the server's own close stops them
(and every other job: stop_every_job). The stop is lowered while the book's
turn is still held, so an open queued behind a close is not told it was
stopped by a close that is over. The server's close no longer takes a lock:
every admin job has ended by then. "One at a time" remains for making books
(run/books.lock, ledger_store::root INVARIANT 5), where a queued job leaves at
once when stopped.

INVARIANT 10 now names the calls that are neither stoppable nor bounded by one
request, with their worst cases, so the close's bound as written is true:
books.import_bank_csv (a full import of the largest file accepted), a report
over the whole book, and a package after its decision is journaled (one build
over the whole book).

Tests: a restore over beta, a create and an adoption in flight while acme is
closed and opened over and over, its close slow, with another book opened and
closed during each close (mutations: a server-wide stop; one global lock);
a close stops the restore and open of its own book, and the server's close
stops every job; the hammer also makes books and cycles a third book; a close
before a package's decision journals nothing and one after it does not stop it
(mutations: no look before; a stoppable build after). Spec blocks,
docs/mcp-interface.md and docs/testing.md updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 19:57:16 -07:00
swaitsandClaude Sonnet 5.5 d05d1ed7ec fix(mcp): a package's decisions are journaled only once it will be made
books.export_cpa_package journals the reason given to export without an audit
or with open drafts as a decision, and did so before it knew the package
would be made: a later refusal (open drafts after an audit reason) or a close
that stopped the build left a decision on record for a package that was never
made.

Every refusal is now decided first, then the decisions are journaled. They stay
ahead of the build for a reason the code states: the package counts them (its
README and every report footer carry the journal's event count at the build),
so moving them after would change the package's contents. A close is looked
for once, immediately before the first decision is journaled; from there to the
hand-over nothing looks at the stop (the build is entered without the close's
cancel scope), so a decision on record is a package handed over. What is
journaled and what the package holds are unchanged.

Test: an open draft that refuses the package after an audit reason journals no
decision (mutation-checked: journaling before the refusal fails it).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 19:57:16 -07:00
swaitsandClaude Sonnet 5.5 6d7044c284 fix(store): an adoption that does not finish leaves no lock file in the source; a queued job leaves its turn when stopped
An adoption copies books in from a folder the owner names and promises the
original is left as it was. Taking the source's writer lock creates the lock
file when the source never had one, and a close that stopped the adoption (or
a refusal, or a panic) left that file behind. The lock is now a guard
(SourceLock): a lock file the adoption made is removed again on every way out
but success, exactly that file (on Unix, only while the path still names the
very file the guard holds), and one the source already had is never removed.
A success still leaves the one it made and reports it (source_lock_created),
as before; a restore's and a put-aside's locks are the root's own and are kept.

Books are made, adopted and restored one at a time across processes
(run/books.lock). A job queued for that turn blocked in flock with no look at
its stop, so a close that stopped it could not make it leave; the wait now
tries the lock every few milliseconds and gives up with Stopped when asked.

Tests: stopped at each of the seven phases, refused after the lock, panicking,
a lock swapped in by someone else, a source that had its lock, and a success;
a queued create stops when asked and otherwise waits its turn. Each was
mutation-checked (no removal; a blocking wait).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 19:57:16 -07:00
swaitsandClaude Sonnet 5.5 d8ff776a52 feat(gui): the status card's heading carries the live state; one row fewer, so the sidebar fits the owner's 519 again
The heading row is the badge and name with the live dot and word at the right; the event ends the journal chain line. Folded, the card is the heading alone (or the heading over the failure line). The rail's badge carries the dot. The four sidenav tests are at their original sizes, the minimum window height is 400, and the goldens and snapshots are regenerated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 19:39:01 -07:00
swaitsandClaude Sonnet 5.5 d3d5effafc docs: the tab threads, the kept-state keys and the review's tests
architecture.md says how a tab owns its threads and what is kept under
what key; testing.md lists the tests, how each fix was shown to matter,
and why the sidenav window sizes were not restored (15 and 11 points
short at 519).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 19:03:26 -07:00
swaitsandClaude Sonnet 5.5 ec436cfc02 feat(gui): a tab owns its threads; kept state belongs to its books; one dock layout
An independent review of the tab work found that closing a tab did not
end what the tab started, that what the viewer keeps was filed under the
book id alone, and a few smaller things. All of it is the viewer's own
state: nothing here writes the books.

Threads: every thread a tab starts (loader, receipts' workers, export,
owner job, the dock's start and its agent's reaper) is counted in one
per-view registry (jobs.rs). Dropping the view tells them to stop and the
registry says, on a condition, when the last has ended. An owner job that
changes something (restore, format upgrade, new books, connect, close the
books, check for updates, update) is never abandoned: its tab's close
control is off with a hover text saying what runs, App::close refuses, and
the window's close request is cancelled with a dialog that offers only to
wait. Read-only jobs (an export, a backup, the restore's check) stop with
the tab: an export checks at its phase boundaries and saves nothing (the
save is one atomic write of a new file; one the stop reaches too late is
removed). The dock's agent is hung up on and, if it ignores that for two
seconds, killed and reaped; the window's drop waits for that.

Release on close: the loader checks "gone" before every retry and between
the phases of a load, its retry wait is woken by the drop, and the viewer
presence is let go in the drop itself, not when a refresh in flight ends.
A thumbnail for a closed tab is not written.

Kept state: filed under a hash of the data root's canonical path and the
id (books outside any root: under their folder), with the books' identity,
the SHA-256 of the journal's first line, taken once they load. A stored
state whose identity differs from the loaded books' is discarded with the
remembered name. Old unkeyed keys are read without error and not used. A
start that names a company never writes the list of open companies.

The dock's height is the app's one layout in every tab (said in the spec
block and tested); the sidebar, rail and top bar panels now take ids made
from their view's, since egui keys a panel's size by the id as given.

Every new test was seen to fail with its fix switched off. The four
sidenav tests keep their BAR_H: at the owner's 519 they fail by 15 points
(sidebar) and 11 (rail) without it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 19:03:26 -07:00
swaitsandClaude Fable 5.2 606e2bb4f9 docs(delegation-log): the tabs review and fixes, Ember's runs, P15 A1 round four
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 18:52:56 -07:00