Commit Graph
130 Commits
Author SHA1 Message Date
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 aa64df9a25 fix(mcp,store): a close stops every call and job that can run long, and says so; an unrecorded refusal never ran
A close waited, unbounded, for a running books.back_up_now (git only Backups::shut
could cancel), for a restore, create or adopt (they hold the one lifecycle lock,
and at the server's close admin_jobs.wait() waited for them before anything was
released), and, through the store lock, for a verification or a package reading
every stored file. The bound's T_calls term was not finite.

Now a close calls hurry at its start, and the stoppable work looks at it:
books.back_up_now and timer-asked backups (git stopped, a stopped run records
'stopped' and no result of its own), books.verify (per journal line and file; a
heal of a drifted database is begun only if no stop came before it: stopped half
way it would leave the live ledger part replayed), books.export_cpa_package (per
stored file). Such a call answers that it was stopped because the books are
closing, and its access record says refused: stopped_by_close. On the admin
socket restore, adopt, create and open take a JobStop: asked at each phase and
file copied, they remove what they wrote and leave the root byte for byte as it
was; the renames that put the books in place are the point of no return, after
which they finish (two renames and two syncs). A close of any book, and the
server's own, raises the flag before it waits for the lifecycle lock.

A close whose last backup had to be killed in the owner's folder now says which
file was left, and the target's backup is marked failed by shut when the run's
future was dropped at its bound. INVARIANT 10 is rewritten so each term of the
bound is enforced by code, and lists the calls that can run long (and the one
known exception, books.import_bank_csv); INVARIANTS 8 and 9 say exactly which
refusals are recorded and why an unrecorded one never ran; the format upgrade's
wording says a stop is honoured up to its final look.

Tests: the close is held to the bound while a backup call, a verification, a
package and each admin job is running and would never end; the stopped job leaves
the root byte for byte as it was; a lock left in a backup folder is reported and
never removed. Sleeps that stood for 'the other side got there' now wait on the
condition (Expect: 100-continue for a half-sent body, a writable named pipe for a
fetch that is reading).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 17:15:36 -07:00
swaitsandClaude Sonnet 5.5 7e5b698c1c test(mcp): say what the running-call test proves; name the phase watcher's type
The running-call test passes even with a cut that marks every request inside
(mutation check): the call runs in the session's task, past the handler's own
check for a cut, so what it proves is that the close waits for the call and
does not kill it. The line of the cut (a body read to its end is never cut) is
proved at its seat by local::tests::a_body_read_to_its_end_is_never_cut_and_one_not_yet_is,
which fails when a later poll can cut a whole body. Also a type alias for
clippy's type_complexity.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 15:51:12 -07:00
swaitsandClaude Sonnet 5.5 f6daba558b fix(mcp): a close is bounded, the server's close is the book's close, and the tests prove what they claim
Close bound. A drill ran to its end however large the book, and a format
upgrade counted by the store's close held it, because only git was
cancellable. Now a close hurries them at its start (Backups::hurry): a drill
stops at its next look (git killed, journal line, file, chunk) and its
scratch clone is removed, nothing said of its target (it is due again at
open); a format upgrade is stopped before its journal.format_set line is
appended (reported not done, the books unchanged) and finishes once it is.
The close's last backup, and shut's stop of what is left of it, are not
hurried. INVARIANT 10 now states the bound as the sum of its named parts.
Lock files a stopped git left are removed by the store (previous commit) and
recorded here (lock_removed / lock_left, also those found at open).

Server's own close. It cut a stalled body only after admin jobs, store
closes and the serial 60 s backups, and never shut a gate or closed a log.
It is now Books::release for every open book (gates shut and the cut set for
one grace at the start, books released together, logs, uploads, exports,
backups and store closed), so there is one closing path; INVARIANT 15 says
what is true. A request that finds a shut door during the server's close is
refused as closing, not recorded.

Tests that passed with the fix removed. The timers test now holds a timer
between taking a book's handles and acting on them (--timer-hold), closes the
book in between and requires the tree not to move; the slow-upload test is
driven by conditions (a minute's grace) and has a mirror proving the cut of
an active upload; the line of the cut (a body read to its end is never cut)
has a unit test; a slow drill (--slow-steps) and a format upgrade are held by
the close test; REAL git killed inside init, a commit and a push by a close
leaves no lock and the next backup succeeds (this found that a killed init
left HEAD.lock, fixed in the store); the server's close with a stalled
upload and a stalled call exits 0 with both cut.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 13:10:41 -07:00
swaitsandClaude Sonnet 5.5 ca6f5aa982 fix(store,mcp): a type claims only what it does alone, and a restore never says 'no such books'
ledger-store: a file coming in (Uploads::receive) now writes each chunk under
the lock a close takes and stops at the first chunk after a close, removing
its part; an export fetch (Exports::get) reads under that lock, so a close
waits for it. The INVARIANTS say exactly this: after close() returns no byte
is written or kept and none is read for a caller; the one thing a request
begun before the close does after it is remove the part file only it made;
a request still waiting for its next bytes is not woken by the type (the
books server's gate waits for it and cuts one that never finishes).

ledger-mcp: a restore over an open book took the book out of the list
before it shut the door, so every call while the restore waited for what was
inside got 404 'no such books' for a book that exists. The door is shut
first and the book listed closed: such a call gets the closed refusal (503,
the words), as in a close. The drain test now requires 503 throughout.
(A refusal at a shut door is not written to the access log, as in a close:
INVARIANT 11.)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 12:22:19 -07:00
swaitsandClaude Sonnet 5.5 ce636adbb5 fix(mcp): a close cuts a request that never finishes arriving, so a stalled client can't hold a book open
A client that begins an upload or an MCP POST and stops sending is inside
the book's door, and the close waited for it with no bound. Now, when the
close's answer grace runs out, every request inside whose body has not been
read to its end is cut: connection closed, an upload's part file removed by
receive's read error, the access record (written before the answer) says
cut_by_close. A body read to its end is whole and never cut, so a running
call still finishes. Nothing of an MCP call can be journaled by a cut: rmcp
reads the whole body (expect_json) before any message reaches a session or
tool, and the handler checks for the cut again before binding a session.
Holds for a book's close, a restore over an open book (Books::release) and
the server's close. The restore-waits test now uses a grace longer than its
5 s watch: an upload finishing within the grace is still waited for.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 11:44:13 -07:00
swaitsandClaude Sonnet 5.5 1332c2a576 test(mcp): the sessions test waits for each client's name instead of assuming a notification was handled
initialized is a notification the server handles after its 202; on a loaded
machine the list was read first.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 11:29:13 -07:00
swaitsandClaude Sonnet 5.5 26b42c6d01 fix(mcp): after a close is answered nothing of this process can write to the book, and a close says when its last backup wasn't whole
A close ended with the process still alive, so the faults that process
exit used to bound now lived on: something of the server's own could
still write to a book that was reported closed, or, once the book was
opened again (here or by another process), to the new book's files. One
rule now: after a close is answered this process holds nothing that
writes to the book's folder, and every path that touches the book is
either counted by its gate or checks, under the lock of its own write,
that the book is still open. The close answers only when that is true.

 * A refusal's access record is written by a task that carries the
   request's place inside the door, so a client hanging up no longer
   leaves the record to land after the close; the access log, uploads,
   exports and backups are closed under their own locks by the close, so a
   record, sweep or run still on its way is refused, unwritten.
 * A restore over an open book lets go as a close does (drain, sessions,
   backups, closing the logs) before it moves the book to legacy/: an
   upload half received no longer leaves its part in legacy/ nor writes to
   the replaced book's log after.
 * The backup at a close is bounded, and a run past its bound is stopped
   (git killed with all it started) and waited for to end, instead of its
   future being dropped while its blocking task went on; the close answers
   closed_backup_incomplete, with why, when the last backup wasn't whole.
   The server's own close does the same.
 * Every timer (the sweep, the look for a backup due, the look for a drill
   due) works on handles closed with the book; the sweep also takes its
   place inside the door. They take --timers for tests.
 * A format upgrade, run, drill and record through a backup handle from
   before a close do nothing.
 * A call whose answer isn't read within the grace is the case of a
   connection dropped at any other moment: its record, written before its
   answer, says it ran. No journaled call carries a client key or a
   duplicate check, so a retry isn't made safe; said in INVARIANT 14, and
   left as an open design point.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 10:30:56 -07:00
swaitsandClaude Sonnet 5.5 8056e3bbc8 fix(mcp): a close doesn't wait on a client's open event stream
A standalone event stream (the GET an MCP client keeps open) is no answer on
its way out and ends only with its session, which a close ends after it has
waited for the answers: counting it as an answer made every close sit out the
whole grace (10 s) whenever an assistant was connected, and a bridge asking
meanwhile could stall for its own 60 s. Only POSTs are counted, as the
server's own close counts them. A hand demonstration found it; the new test
(an rmcp client with its stream open, the close answered within 5 s) fails
without the fix (12 s).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 09:50:06 -07:00
swaitsandClaude Sonnet 5.5 89403a7159 fix(mcp): a close waits for the answers on their way out, and test it under a hammer
The first run of the hammer (agents calling two books while one is closed and
reopened over and over) found a real race: an MCP request's handler returns
as soon as the session's task has the request, and the tool's answer streams
back afterwards. A close that waited only for handlers and running tools
could end the sessions while an answer was still on its way, so a call that
did not run (refused as closing) reached its client as neither answered nor
refused. The gate now also counts answers on their way out (Answering,
carried in the response body as the server's own close counts them), and a
close waits for them, for ANSWER_GRACE at most, before it ends the sessions.

The hammer (tests/book_open_close.rs) replays both journals afterwards:
every acknowledged draft is there exactly once under the id it was told, no
refused call left anything, the closed book's journal and access log never
moved between the close answer and its reopening, the other book never
refused a call and kept answering while the first was closed. Beside it: a
server started with --open, the sessions request over the real socket, the
doctor's lines, and the docs (mcp-interface, architecture, testing).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-20 09:23:39 -07:00
swaitsandClaude 3bc198594b fix(host): APPIMAGE is believed only when this program runs from that image
The AppImage launcher sets APPIMAGE (the image's file) and APPDIR (where
it is mounted) for the program it starts, and every program that one
starts inherits both: a terminal, an editor, an agent's app. The host's
start, the agent's pointer file, the host's check for a replaced program
and `update` each read APPIMAGE and believed it whenever it named a file.

So a wanderbooks run from inside another app's AppImage took that app's
image for its own:

- it started that image as the host, and the books never opened ("the
  books server keeps failing to start");
- `connect` would have written that image into the agent's pointer file;
- `wanderbooks update` replaced that app's file with wanderbooks.

Found by the batch's gate: the_host_outlives_the_app_scope_that_started_it
passes its own environment on (the other tests clear it), and this gate
ran in a session started from an AppImage app. The first and the third
are reproduced by two new tests, which fail without this change (the
update test read an ELF header where the other app's file had been).

The rule now (start.rs INVARIANT 6, from the AppImage documentation's
"Environment variables"): the image is this program's own only when
APPIMAGE is an absolute file, APPDIR an absolute folder, and the running
executable's file is inside APPDIR, compared as resolved paths. One
function decides (`own_appimage`), and all four readers ask it. The host
is handed APPDIR beside APPIMAGE, and neither unless both are its own.

No books and no figure are touched. The tests that pretend to be an
AppImage now set APPDIR as a launcher does; translocation.rs used a bare
APPIMAGE to stand in for a macOS path, the very thing this closes, and
names the program's folder as the mount.

The failing test's message now lists the lines that did arrive, which is
what showed the host was refused rather than slow.

Not checked against a built AppImage (none has been built with this
change): the first trial of one shows `update` and a restart find the
image.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-10 02:28:05 -07:00
swaitsandClaude 3bbef05cb7 build(packaging): the Linux packages carry the third-party notices as a file
The .deb, the .rpm and the Arch tarball install THIRD-PARTY-NOTICES.txt
under /usr/share/doc/wanderbooks/, where a distribution's reader looks
for it; the program prints the same text (`wanderbooks licenses`), and
the package test compares the two after the upgrade. The AppImage, the
.dmg and the Windows program carry the text compiled in.

Not checked by a package build: the first `just package-linux` and
`test-linux-packages.sh` run does that.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 22:00:44 -07:00
swaitsandClaude 7568bca7b0 build(notices): a crate's own licence file where the generator gave a placeholder
MIT, BSD and ISC ask that the copyright notice itself travel with a copy,
not only the licence's words. For 70 of the crates the program links,
cargo-about could give only the licence's standard text, whose copyright
line is a placeholder ("Copyright (c) <year> <copyright holders>"):
the crate's own licence file is a compound one it cannot match (chrono
and libm put two licences in one file, aws-lc's is 316 lines of several,
the windows crates indent theirs), or the crate was packaged with no
licence file at all (egui, objc2, wasmi and 32 more).

scripts/notices-packaged.py reads cargo-about's output, finds every
section with such a placeholder, and adds a part to the file: the licence
files those crates were packaged with, whole, each distinct text once
under the crates that carry it, and for the 35 packaged with none the
repository their manifest names. It reads the crates where cargo has them
(cargo metadata, locked and offline), so the text still depends on
Cargo.lock alone; two runs are byte-identical. The file grows from 551 KB
to 707 KB. The test for `wanderbooks licenses` now asks for a copyright
line that only a compound file holds.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 22:00:44 -07:00
swaitsandDeepSeek V4.1 Flash 9baf71b2a5 feat(cli): wanderbooks licenses prints the notices compiled into the program
The notices must reach the person holding the binary, not only the
repository: THIRD-PARTY-NOTICES.txt is compiled in with include_str!,
so `wanderbooks licenses` prints the program's version line and then
every crate's and font's licence without opening books or reading a
file. A closed pipe (`| head`) is ignored, not a panic.

Tests check the version line, the notices required in the output, that
the bytes after the header are exactly the repository's file, and that
the mode takes no arguments and must come first like every other.

Docs: the testing table says what `just notices` writes and how
`notices-check` fails on a stale file; the architecture's list of modes
names licenses.

Co-Authored-By: DeepSeek V4.1 Flash
2026-11-09 21:17:56 -07:00
swaitsandClaude 1726c8b6dd build(deny): a supply-chain gate: advisories, licences, sources (cargo-deny)
Nothing checked what the program is built from. `just deny` now does, in
the lint part of `just check` and weekly in scheduled.yml (an advisory
is published when it is, not when we push), from one file, deny.toml:

- advisories: no crate in the lock file with a known vulnerability
  (RustSec), none yanked; an unmaintained crate is refused when it is
  one of our own direct dependencies. Two advisories are lived with,
  each with its reason and date: the quick-xml 0.38 that typst's
  citation reader brings, which no XML from outside reaches.
- licences: the permissive ones, plus MPL-2.0 for one unchanged crate
  (option-ext) and CDLA-Permissive-2.0 for Mozilla's root certificates.
  No font licence is allowed, so a crate that carries fonts is refused
  and every font we ship is a file here beside its licence. A crate
  offering only a copyleft licence is refused.
- sources: crates.io and the bookspec repository, nothing else.
- bans: no dependency by wildcard version.

The crates are marked `publish = false` (one line in the workspace,
inherited by all eleven): they are parts of one program, not libraries
for crates.io, and with that cargo-deny accepts their path dependencies
on each other.

cargo-deny 0.20.2 is a build tool pinned in mise.toml, not a dependency
of the program.

Shown: `just deny` prints advisories ok, bans ok, licenses ok, sources
ok on this tree.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 20:03:51 -07:00
swaitsandClaude 9ad6f89816 fix(deps): 23 known vulnerabilities closed; the XLSX reader keeps & in a cell
The first run of cargo-deny on the lock file (2026-11-09) listed 23
RustSec advisories, one unsound crate and two yanked ones. This closes
all but two by upgrading; the two are a second copy of quick-xml that
typst brings and that reads nothing from outside (the gate's file,
next commit, says so with its reason and date).

A wrong answer found on the way. quick-xml 0.42 reports a character or
entity reference (`&amp;`, `&#38;`) as an event of its own, where 0.38
handed it over inside the text. The reader's first build on 0.42 took
only the text events, so a cell holding `AT&amp;T` read as `ATT`: a
payee's name, changed without a word, on its way into an import. The
reader now turns each reference into its character (the five XML names,
decimal and hexadecimal numbers) in shared strings and in inline cell
text, and refuses a file whose reference names no character rather than
dropping it. Two new tests: a reference in a cell is its character; a
reference to no character is refused.

What moved, and the advisory each closes:
- quick-xml 0.38 -> 0.42 in ledger-reader, the copy that parses files
  from outside (RUSTSEC-2026-0194, -0195: a slow or memory-hungry parse
  of hostile XML).
- rusqlite 0.32 -> 0.41, with `fallible_uint` so a u64 past i64::MAX
  is an error and never a wrapped number (libsqlite3-sys,
  RUSTSEC-2026-0459). One test's use of `column_names` follows the new
  signature.
- rust_xlsxwriter 0.90 -> 0.102, which drops the old zip 4
  (RUSTSEC-2026-0367, -0368, -0369, -0429).
- In the lock file only: rustls (-0346 to -0349), rustls-webpki
  (-0382), webpki-root-certs (-0383), ctutils (-0385), tokio (-0386),
  zstd, zstd-safe and zstd-sys (-0391, -0398, -0403, -0410),
  pulldown-cmark (-0433), rmcp 3.5 -> 3.9 (-0457, -0461, -0462), and the
  yanked async-executor and clipboard-win.
- fuzz/Cargo.lock in step, so the fuzz targets build what ships.

No new dependency of ours: rsqlite-vfs and sqlite-wasm-rs enter the
lock file as rusqlite's own, for a target (wasm) we do not build.

Shown: `cargo check --workspace --all-targets` clean; `cargo test` of
ledger-reader (4 passed), ledger-import (145 passed, 2 ignored) and
ledger-store (579 passed, 2 ignored, exit 0). The store run kept its
scratch files in memory (TMPDIR on tmpfs): on the loaded disk a synced
write took 30 ms and the refusal law alone ran past half an hour.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 20:03:28 -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 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 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
swaitsandClaude Sonnet 5.5 71a4e7e59d fix(core): custom terms are due on the date they give
BS-arap-3 statement 1: custom terms ("Due 2026-11-15") are due on the date
they give. Terms::due_date returned the document's own date for them, so
the MCP path (create_invoice / create_bill, from the terms given or a
party's default) stored an invoice dated 2026-11-01 on "Due 2026-11-15" as
due 2026-11-01: a document that read past due two weeks early in the aging.

Terms now keeps the agreed date (a new `agreed` field, Some exactly for
custom terms, with Terms::agreed_date), and due_date returns it, refusing
an agreed date before the document's like any due date before its document.
TermsKind keeps its shape, so stored kinds read as before. Terms read back
from storage fill `agreed` from their canonical text when it is missing, and
a custom terms with no readable date is refused rather than invented.

Stored books: the journal records each document's due_date itself
(invoice.created / bill.created payloads) and replay reads it, never
recomputing it from the terms, so a document already written keeps the due
date it recorded (posted is forever). New journal entries with custom terms
carry the extra "agreed" key; older ones read as before. No golden under
crates/*/tests/golden holds custom terms, so none changes; the live books
have no invoices or bills.

Through the tool, an invoice dated 2026-11-01 on "Due 2026-11-15": due
2026-11-01 before, 2026-11-15 after. Tests: ledger-core
custom_terms_are_due_on_the_date_they_give (Terms, the stored document, the
storage round trip incl. the older form, and the refusals) and the same
through books.create_invoice / create_bill / a party's default terms and the
refusal of a document dated after the agreed day (ledger-cli documents.rs).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 21:25:16 -07:00
swaitsandMuse Wonder 1.0 489360f598 refactor: rule references cite bookspec ids
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
2026-11-08 19:40:22 -07:00
swaitsandClaude Opus 5.5 e080f761a0 merge: every reversal is dated on or after its original (D-73; branch t3/reversal-dating-d73, bb5008ed; reviewed)
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>
2026-11-08 17:14:13 -07:00
swaitsandClaude Sonnet 5.5 bb5008edb5 fix(core): every reversal is dated on or after its original (D-73)
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>
2026-11-08 16:00:23 -07:00
swaitsandDeepSeek V4.1 Flash 45ea103283 fix(import): the IIF export refuses an entry on two A/R or A/P accounts
BS-format-2 item 7: QuickBooks Desktop records at most one A/R or A/P
account in a transaction (Intuit's own warning, sources/intuit-iif.md
and rules/format/BS-format-2.toml), so an entry with lines on two
receivable accounts, two payable accounts, or one of each cannot be
written as one IIF transaction. journal_to_iif used to write it and
merely list it in Iif::receivable_payable.

Now the export collects every entry whose lines touch more than one
distinct A/R/A/P account and returns
IifError::SeveralReceivablePayableAccounts, naming the entries and
saying why and what to do (reverse and post as two entries through a
clearing account; splitting one would change what it says). It never
splits an entry itself. ledger_package::export_iif and build_package
pass the refusal through, so books.export and books.export_cpa_package
return it before a file is handed over.

The README test's entry on both controls moved to its own refusal test;
the valid books it covers (one A/R entry, one A/P entry) are unchanged,
as are every IIF golden and every test of the file's bytes.

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

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:45:18 -07:00
swaits e2754898d8 fix: refuse to connect an agent from a translocated macOS app
A `.dmg` downloaded from the internet keeps its quarantine bit, so
Gatekeeper may run the app from a read-only copy under
`/private/var/folders/…/AppTranslocation/…` that vanishes when the app
closes. Connected from there, an agent would be pointed at a path that
will not exist the next time it runs. Connect refuses instead, before a
token is made or an agent's list is touched, and says to move the app out
of Downloads and open it again (P11a step 6).

The rule is on the path the program would give the agent
(`start::translocation_refusal` over `this_executable`), so the same check
covers the CLI's `connect` and the viewer's Connect. The test stands in
for Gatekeeper's copy on any Unix by naming a file under an
`AppTranslocation` path in `APPIMAGE`; the agent never runs and no books
home is made, while the same program at an ordinary path connects. A unit
test holds the marker to a whole path part, not letters in a name.
2026-11-05 08:29:16 -07:00
swaits 53a233d687 feat: accept a staged update in the app
The host has staged a downloaded, signature-checked update since step 4,
but the only way to apply it was `wanderbooks update` at a terminal, and
nothing in the viewer or on an agent's first call said one waited. The
owner's accept is the name plan 8.0.3 allocated for it: the lease socket
gains `Intent::ApplyUpdate`, and the host installs the staged copy from a
thread and lets its existing watch for a replaced program (host.rs
INVARIANT 7) restart onto it once no call runs, so the books stay open and
every holder's session carries on. With no host running there is no call
to cut off, so the viewer applies it itself.

The viewer reads `<root>/updates/staged/meta.json` every few seconds and
shows a standing notice with "Update now"; Books gains "Check for updates"
(which looks at the feed at once, whatever the daily look last did) and
"Update to X". `books.start` gains the allocated `update_waiting` field
and a next step telling the agent to tell the human; no tool can accept.

`apply_staged` waits up to five seconds for the update lock: running the
new tests showed the host's own look can hold it for a moment after it
writes `meta.json`, and the owner's accept should wait that out rather
than answer "nothing waits".

Tests: `books_start_says_an_update_waits` and
`the_owner_accepts_a_staged_update_in_the_app` in
`crates/ledger-cli/tests/update.rs` (a bridge writes all through the
restart, each account in the chart exactly once);
`the_menu_checks_for_updates_and_a_waiting_update_shows_a_notice_that_accepts`
and `books_outside_a_data_root_have_no_update_notice` in
`crates/ledger-gui/tests/update_notice.rs`.
2026-11-05 08:29:11 -07:00
swaits fa7c2805a6 Merge branch 'main' into P11c 2026-10-30 03:10:24 -06:00
swaitsandClaude Fable 5.1 ccc5d21941 test(cli): the staged-update test no longer asserts the staged folder is gone
The gate on d326894c (twice green before): after the apply, the new
host's next look staged 9.0.0 again within the test's window on the
runner, since the test's newer program is this binary with bytes
appended and its compiled version never catches up with the feed's.
The program in place and the kept previous copy are the apply.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-30 01:44:55 -06:00
swaits d3fe116bc5 Merge branch 'main' into P11c
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
2026-10-29 22:56:32 -06:00
swaitsandClaude Fable 5.1 659a426631 test(cli): the demo-books start test needs the viewer; not in the server-only build
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
The gate on 8ba104a1 passed every workspace test and failed only the
server-only build: P5's `books_start_fits_8_kib_on_the_demo_books`
builds the demo books with `ledger_gui`, which the no-viewer build
does not carry. Gated on the `gui` feature like its neighbours.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 22:55:59 -06:00
swaits a09008504d Merge branch 'main' into P11c 2026-10-29 21:55:54 -06:00
swaitsandClaude Fable 5.1 888742166b test(cli): the update tests wait for the host's asynchronous work, and compare programs by hash
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
Two tests raced the host: one asserted the staged copy was applied the
instant the books reopened, the other that a dropped tampered copy's
folder was gone, when the new host may look at the feed again and stage
a fresh, true copy in its place. Both wait for what they mean now (the
apply; the tampered bytes gone). Every whole-program comparison is on
the sha256, so a failure's message is a line, not two binaries (GitHub
kept nine lines of a step's log on one such message).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 20:42:59 -06:00
swaitsandClaude Fable 5.1 59ae40aac5 test(cli): the terminal helpers quote each word (a macOS root has a space)
The portable macOS job: the command line handed to `script` was the
words joined by spaces, and `Library/Application Support/wanderbooks`
split into two arguments ("unknown argument: Support/wanderbooks").
Each word is single-quoted now, on every OS; a word that is a shell
operator a test means as one (the consent test's `>`) stays bare.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 19:05:41 -06:00
swaitsandClaude Fable 5.1 4a2b327513 test: the servers two_user starts get a Windows environment (P11c)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
two_user.rs started its flagged servers with env_clear plus a Unix PATH
and HOME, no SystemRoot: on Windows Winsock cannot start without it, so
the --http door failed to bind (the server says so on stderr and serves
its pipes only, which is why "ready" still came). The tests now use the
harness's clean_env, as do evidence.rs's extract and the viewer's
command_line test. main (a8ce2e7d) merged in.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 18:56:46 -06:00
swaits af0c3e95ec Merge branch 'main' into P11c 2026-10-29 18:53:38 -06:00
swaitsandClaude Fable 5.1 a8ce2e7d6c test(cli): the script helper's two spellings share one type
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
932c0517 pushed a helper whose branches were arrays of different
lengths; the three test binaries did not compile. A slice now.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 18:37:38 -06:00
swaitsandClaude Fable 5.1 932c05177f test(cli): the terminal tests speak BSD script on macOS; a noted root is compared as the system spells it
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
The portable macOS job, now past the server start: `script -qefc` is
util-linux's spelling; macOS's BSD `script` has no -f and no -c, so the
three pseudo-terminal helpers choose the spelling for the OS. And the
root noted "for next time" is the canonical path (macOS writes /tmp as
/private/tmp); the test compares it canonically.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 18:36:34 -06:00
swaitsandClaude Fable 5.1 ef7e3be28c merge: main into P11c (the short socket link, P8's audit gate fix, the portable workflow's own file)
check / check (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
portable / portable (macos-latest) (push) Canceled after 0s
portable / portable (windows-latest) (push) Canceled after 0s
One conflict: main moved the portable job out of check.yml into
portable.yml; took that and carried experimental: false for windows-latest
into portable.yml. root.rs merged without conflict (short_link_for is
cfg(unix); the Windows arms are untouched).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 18:11:34 -06:00
swaitsandClaude Fable 5.1 1da01c3123 test(cli): the spec script's package export gives the audit override; macOS tests keep short paths
check / check (push) Canceled after 0s
portable / portable (macos-latest) (push) Canceled after 0s
portable / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
GitHub's check on 62d42b94: the spec script now runs `books.audit`
(P8), so the package gate is live when the script exports and the
run is behind the head; four tests failed on `audit_required`. The
script gives `without_audit_reason`, as a human would.

The portable macOS job, with the server's log in hand: "the books'
private folder's path is too long for its sockets". A Unix socket path
holds 104 bytes; the runner's temp folder plus a test home plus
`Library/Application Support/wanderbooks/run/` is longer. The job sets
TMPDIR=/tmp, so every test home is short there.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 17:49:11 -06:00
swaits 30c998bb4e Merge branch 'main' into P11c
check / check (push) Canceled after 0s
check / portable (macos-latest) (push) Canceled after 0s
check / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
2026-10-29 17:27:00 -06:00
swaitsandClaude Fable 5.1 84cbe0359c merge: main into P11c (P11b's dock and books homes, the macOS harness root fix)
One conflict, ledger-host commands.rs: main moved the agent-program lookup
into find_agent_in; kept that and carried the Windows parts into it
(.exe/.cmd/.bat, npm's global folder). The harness already used
default_root, so main's fix and ours agree.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 17:26:43 -06:00
swaitsandClaude Fable 5.1 62d42b9458 test(cli): every test asks the platform where the data root is
check / check (push) Canceled after 0s
check / portable (macos-latest) (push) Canceled after 0s
check / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
The four other test files that spelled out `.local/share/wanderbooks`
(setup, books_home, format_upgrade, backups) use `default_root` and
`platform_data_dir`, so they hold on macOS as on Linux.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 17:22:37 -06:00
swaitsandClaude Fable 5.1 2a6bac02d5 test(cli): the IIF warning count ignores P8's audit notice; the harness asks the platform where the root is
check / check (push) Canceled after 0s
check / portable (macos-latest) (push) Canceled after 0s
check / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
GitHub's check on 880278ea: `cpa_package_holds_the_year_and_its_evidence`
counts the IIF transliteration warnings, and P8's "No counted audit
stands behind this package" notice (a warning while the books hold no
audit run) made four into five; the count now excludes it.

The portable macOS job, now that the harness prints the server's log:
"there is no books' private folder yet: run `wanderbooks setup`
first". `Home::root()` spelled out `.local/share/wanderbooks`, the
Linux data folder; `setup --home` on macOS makes the root under
`Library/Application Support`. The harness asks `default_root` now,
the same answer on every OS.

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

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

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

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 17:03:30 -06:00
swaitsandClaude Fable 5.1 880278ea0e fix(mcp): a close still offers books.verify; the test harness says why a server didn't start
check / check (push) Canceled after 0s
check / portable (macos-latest) (push) Canceled after 0s
check / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s
GitHub's check on 794807ab: P8's fit-up replaced the step after
`books.close_period` (`books.verify`) with the audit and the
attestation, and P5's month_end_close eval, which follows only what
the books offer, lost the step it follows. The close now offers the
chain check first, then the audit the attestation rests on.

The portable macOS job failed every over-the-wire test with "the
server didn't say ready" and nothing else: the harness sent the
server's stderr to a file in the temp home and never showed it. It
now panics with that log, so the next run says what macOS refused.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 16:53:56 -06:00
swaitsandClaude Fable 5.1 6f948592f6 merge: P11a, the AppImage restart, the daily staged update, the unsigned macOS bundle in CI (branch P11a, 310fa105)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 16:29:21 -06:00
swaitsandClaude Fable 5.1 6e7deb15c7 feat(host): the daily update check and the staged update (P11a step 4)
While the books are open the host looks at the release feed at most once
a day (knob update_check, noted in updates/checked so a restart does not
look again), and only downloads and verifies a newer release into
<root>/updates/staged/ (sha256 AND minisign signature, as for update).
It never swaps: the staged program is applied (a) by an opener just
before it starts a host, when no host runs, so no call is cut off, after
a second check against the key (a staged file that fails or does not
start is dropped), and (b) by wanderbooks update, the owner's say-so,
which reuses the staged copy instead of downloading again. A local
release can be named in <root>/updates/feed (file:// only, with its key
file, same rule as --trusted-key). The program's version is set by main
since packages rewrite only the cli's. No new dependency.

Tests (crates/ledger-cli/tests/update.rs): the_host_stages_a_daily_update_and_the_next_start_applies_it,
a_daily_update_that_is_not_ours_is_not_staged,
update_installs_the_copy_the_host_staged_without_downloading_again,
a_staged_update_that_was_tampered_with_is_dropped_not_applied.

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