Commit Graph
89 Commits
Author SHA1 Message Date
swaitsandClaude Fable 5.2 20b2e759e0 test(fuzz): a target for reading a backup folder from bytes someone else wrote
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 18:38:30 -07:00
swaitsandClaude Fable 5.2 51a7607a82 feat: the window and the command line set up, save and show backups; the system's folder dialog
Admin requests set up the backup folder (journaled as the books' own
backup.folder setting, the owner the one who decided) and the passphrase, save
a backup as one file, and say how the backups stand; the Backups window, Save a
backup and Restore (a folder or a file, with the passphrase when it has one) use
them, and the command line has backup-setup, backup-status and backup-save
(the passphrase typed at a terminal, never on the command line).

New dependency: rfd (MIT) in ledger-gui, with pollster, for the system's own
folder and file dialogs (the portal on Linux, native on Windows and macOS). It
adds no other crate to the tree (zbus is already there through the window
toolkit); cargo deny passes and THIRD-PARTY-NOTICES.txt is regenerated.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 18:20:59 -07:00
swaitsandClaude Fable 5.2 9f4529b078 feat(store): backups in plain folders, written once (P15 section 9, D-91, D-92)
A backup is a folder holding one folder per set of books, made only of
files that are written once: the journal and the access log as immutable
segments, an index of stored files and the stored files under their hash,
the vault and keys by content hash, and a manifest, written last, that
makes a backup complete. It is built beside the git form for now.

Accounting reasoning: the journal is append-only and a stored file never
changes, so what the store's lock must fix is one look (its length, that
its last line is the head, the vault and keys); the rest is read after it.
A destination is written only when its newest whole manifest is a point on
the live journal (byte-identical prefix); otherwise nothing is written.
Two writers cannot corrupt it: pieces are named by what is in them, the
manifest number is taken by exclusive create, the loser looks again.

A passphrase (D-92) seals every piece with XChaCha20-Poly1305 in 1 MiB
chunks, the key derived by Argon2id at the owner passphrase's own cost
(64 MiB, 3 passes, 1 lane); names are made from the key and say nothing;
the derived key is kept in the book's local/ folder, owner-only.
"Save a backup..." is a zip of the same form (.wbbackup).

New dependencies: none new to the tree. chacha20poly1305, zeroize and zip
(deflate only) were already used by ledger-vault, the viewer and the
packages; ledger-store now names them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 17:19:12 -07:00
swaitsandClaude Fable 5.2 2bc442f795 feat(app): the Connect page's Claude desktop app row writes a one-click extension (P15 C1)
Claude's desktop extension format is the MCP Bundle: a .mcpb zip with a
manifest.json (manifest 0.3, github.com/anthropics/mcpb). The row's
button makes the company's agent key if there is none and writes
Documents/Wanderbooks/Extensions/wanderbooks-<id>.mcpb: a manifest whose
server is a binary running this program's own stable path as
mcp --book <id>, the 512 px icon and a short README as the entry point.
The package carries no program (the one executable is the installed
one), no key and no path of the data root. The page then says in plain
words where in Claude to pick the file and to keep Wanderbooks open, and
offers to show the file. The manifest is checked against Anthropic's
published schema (a test fixture) and its required fields. The blessed
Connect page pictures change by exactly the new row. The program's
version is now one value set by main for every platform, not only Unix.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:31:21 -07:00
swaitsandClaude Fable 5.2 3b02e70794 feat(app): the Windows program opens no console window; the window is named Wanderbooks (P15 C1)
The installed program is one executable that is the window, the books
server's child and the assistants' bridge. Built for the Windows GUI
subsystem, a Start Menu launch shows no console; console.rs gives a
command run in a terminal its words back and never replaces a pipe an
assistant handed the bridge. The two console programs the window starts
(the agent's own list, the system's opener) get CREATE_NO_WINDOW. The
window title is the product name; the storage id and the Linux app id
stay lowercase so nothing already kept moves.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 15:18:18 -07:00
swaitsandClaude Fable 5.2 861ed57d82 feat(host): web assistants per company, joined to the remote door (P15 B3)
WebAssistants is the switch per company: turning one on makes the link's address,
starts the books server's remote door at it (the door listens on 127.0.0.1 and
gives the app its per-start secret), offers the company, and hands the link the
door; turning off withdraws the company and, with none left, closes the line
first and then the door. A new address stops the door, makes a new label, and
restarts the door at the new issuer, so every token made at the old address is
refused. The switches are kept in a private file and put back for the companies
that are open at the next start. Nothing is half-on after a failed step.

The line runs in the window's process (the viewer owner holds it), so it ends
with the window and never outlives the books it offers. THIRD-PARTY-NOTICES.txt
is regenerated with scripts/notices.sh: the app now links instant-acme, the relay
crate's client side and hickory-proto.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 13:40:00 -07:00
swaitsandClaude Fable 5.2 9898e56950 feat(link): the app's side of the relay: identity, line, TLS at the app, certificates (P15 B3)
The app keeps one durable address https://<secret>.<four-words>.wanderbooks.link:
an Ed25519 key, a four-word name the app picks, and a 32-character base-36 secret
label (about 165 bits), all in private (0600 / owner-only) files in the data
root's link/ folder. One name per installation, as plan section 5 says; each
company is a path under it.

The line (yamux over TLS 1.3, the relay crate's own client) runs in the app's own
process, not in the books server child: a window that dies takes its sockets with
it, so the line can never keep a door open for books that closed. It reconnects
with full-jitter backoff, pings every 30 s (the relay drops a line silent for
180 s), re-dials at once after a wall-clock jump (a sleep), and says in words
what is wrong: no internet, the relay down, a busy relay, a wrong clock, a name
the relay lost.

TLS ends in the app with its own certificate (rustls, ALPN h2 and http/1.1),
served only for the app's exact host name, then the plain stream goes to the
remote door on 127.0.0.1 after the door's per-start secret and the relay's PROXY
header. The private keys are never sent to the relay.

Certificates are ordered by ACME DNS-01 (instant-acme, behind an Issuer trait so
tests use an in-process authority) for the wildcard under the app's name, from
the relay's authority list in its order (a not-usable one is skipped, a failing
one falls to the next), stored, reused across restarts, and renewed at the time
the authority's renewal information suggests, else two thirds through the life.

New dependencies: instant-acme 0.8 (Apache-2.0; ring, hyper-rustls, time and
x509-parser features, no aws-lc-rs), x509-parser 0.18 and webpki-root-certs 1
(already in the tree), time and async-trait for tests.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 12:57:51 -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 e00e52f2f3 feat(mcp): the remote door and the sign-in behind it (P15 B1, D-83, D-86)
A second HTTP listener in the books server, on 127.0.0.1 only, off until the
app's admin request (RemoteStart) names the one public address. Every
connection begins with the relay's PROXY v2 header, whose address is the
caller's (never an HTTP header); the door speaks stateless plain-JSON MCP for
one company per path, and is its own OAuth 2.1 server: metadata at every
place products look, client ID metadata documents, dynamic registration and
a typed client id and secret, PKCE S256, exact redirects, single-use short
codes, rotated refresh tokens (a reused one ends its family), short access
tokens, the issuer pinned. /authorize never approves: it parks the request
and only the owner-only admin socket turns it into a code. An approval is one
principals token (so A4's list and revoke see it) plus a record naming the
product, which survives the product registering again. Read and draft by
default; posting raised per approval. Every table is bounded and expires;
secrets are kept as SHA-256 only. A stranger's unsigned request is a 401 with
the metadata pointer and is counted, never written to the books' record.

The access record gains an optional 'from' (the caller's address), kept as an
IP when it is one (the TIN masking would turn it to dots).

The tools a model reaches for first now carry the company's name and 'call
books.start first' in their own descriptions (plan 3.4), local and remote.

Dependencies: none new to the tree. reqwest (client documents, as ledger-host
already uses it), subtle, getrandom and hyper-util (already pulled in by
ledger-store and axum) are now declared by ledger-mcp; cargo deny and the
notices check pass unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 11:15:26 -07:00
swaitsandClaude Fable 5.2 2d3250709b build: pin bookspec at 5127b5b, law 47 (a write is one transaction, exactly once)
Moves the checker, the runner and the Lean package together from 79cb439 so the pin test holds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 10:55:18 -07:00
swaitsandClaude Fable 5.2 31f706bd7e feat(relay): the relay service for wanderbooks.link (P15 unit B2)
A new crate, crates/relay (lib `relay`, binary wanderbooks-relay), with no
ledger-* dependency. Routes an assistant's TLS connection by the server name
in its ClientHello down the line an app holds open, forwarding encrypted
bytes only; the line is yamux over TLS 1.3 on 443, the app proving its key
with an Ed25519 signature bound to the session's TLS exporter and a fresh
nonce. One durable table (SQLite: name, key, created, blocked), four-word
names from a curated list of 1454 words (42.0 bits), a PROXY v2 header with
the caller's address, an authoritative DNS server that publishes an app's
ACME DNS-01 value for its own name only, and a list of certificate
authorities served as data. Every table, queue, buffer and time is bounded.

New dependencies, each permissive and passing cargo deny: yamux 0.14
(Apache-2.0 OR MIT; the multiplexer), hickory-proto 0.26 (MIT OR Apache-2.0;
DNS wire format, std only), rusqlite (already in the tree), rustls and
tokio-rustls (already in the tree, ring provider), ring (Ed25519, already in
the tree); dev only: rcgen 0.14 (MIT OR Apache-2.0), proptest, tempfile.
Added to the kernel-only lint list (no Decimal in the crate).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 09:33:03 -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 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 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
swaitsandClaude b66dff899d fix(viewer): every font the viewer ships is named, with its licence beside it
egui's default font set (the crate epaint_default_fonts, switched on by
the `default_fonts` feature) includes Ubuntu Light under the Ubuntu Font
Licence 1.0. Debian and Fedora class that licence as non-free, so a
package of wanderbooks carrying it could not go into either. The viewer
never drew a letter with it (all text is Inter), but the file was
compiled into the program all the same.

The feature is now off, on eframe and on egui, and epaint_default_fonts
leaves the lock file. The viewer names its whole font set in theme.rs:

- Inter (InterTab, as before) for all text: SIL OFL 1.1.
- Hack for fixed-width text: MIT, with the Bitstream Vera licence.
- Noto Emoji for symbols: SIL OFL 1.1.
- emoji-icon-font for the few symbols Noto Emoji lacks: MIT.

The last three are the files egui's set held, copied byte for byte
(SHA-256 in assets/fonts/README.md), each now beside its licence text.
They are files in this repository, not new dependencies. The OFL stays:
it is Inter's own licence, it allows bundling with software under any
licence, and Debian, Fedora, the FSF and the OSI accept it.

Without the default set a missing glyph is an empty box, and nothing
said so. A new test lays out every symbol the viewer's source draws and
fails on one no bundled font has. It compares what is drawn with what is
drawn for a code point no font has, since egui's `has_glyph` answers no
for every character of the font that holds the replacement glyph. The
test checks itself on a Cherokee letter, which no bundled font covers.

Shown: `cargo test -p ledger-gui --lib theme` 2 passed; the side
navigation's snapshot is unchanged (12 passed); the 33 screenshots of
the demo books (tests/screens.rs) show Inter, Hack in the journal's
hashes and JSON, and every arrow, check mark and icon drawn.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 19:50:19 -07:00
swaitsandClaude 0ef1ef2c22 build: pin bookspec at 79cb439, the payroll and control laws
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
K-U7 moved payroll's net pay into the kernel and K-U8 moved the control,
aging and reconciliation identities there. Their laws were written once,
in bookspec's Lean: law 45 (net pay is gross less every deduction, and a
payroll plan balances at any number of employees) and law 46 (the control
difference, the aging total and the reconciliation total). The checker and
the Lean package move to that rev together, so the pin test holds.

Proved at this pin: the Kani fast set, 97 harnesses, none failed and every
cover reached; Lean, 212 theorems on the standard axioms only. The Kani
set was verified in two runs (93, then the 4 the whole-set time cap cut
off on a loaded machine), and the Lean half in a shell of its own.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-09 15:48:40 -07:00
swaitsandClaude Opus 5.5 652f9da877 build: pin bookspec at ed6e379, payouts, tags, prepaid contributions
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 (push) Canceled after 0s
bookspec main now carries X-H1e2: the last examples slice, two rules left
without one (BS-asset-9, BS-partner-16, which the engine does not do).
112 of 139 examples run and pass, the other 27 are for options
wanderbooks did not pick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 12:51:31 -07:00
swaitsandClaude Opus 5.5 e45c62348a build: pin bookspec at 6d85d8b, schedules that take the pick and the books' own facts
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
bookspec main now carries X-H1e1: a schedule may leave its method to the
engine, yen schedules, the IIF export's choices, settings, role
assignments and the tax summary in the schema; eight rules remain
without an example. Lean audits standard axioms only; 104 of 126
examples run and pass, the other 22 are for options wanderbooks did not
pick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 11:23:56 -07:00
swaitsandClaude Opus 5.5 01acb159f0 build: pin bookspec at b61fa50, the percentage law
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
bookspec main now carries law 44 (K-U6): a percentage of a positive whole
within half a step of the exact ratio, a ratio split's sides summing to
the amount. Lean audits standard axioms only; the traceability gate
finds a law for all 62 kernel functions' harnesses it checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 09:50:06 -07:00
swaitsandClaude Opus 5.5 8d1d2ddeed build: pin bookspec at 22d02fe, refused input and records citing their own parts
bookspec main now carries X-H1d (refused dates, amounts, periods, roles,
exports, 1099 years and returns as examples; the role list is
BS-ledger-8's) and S-C8 (records cite their own statements by position).
Lean 188 theorems, standard axioms only; 95 of 111 examples run and
pass, the other 16 are for options wanderbooks did not pick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 09:25:38 -07:00
swaitsandDeepSeek V4.1 Flash 7ac1e644b2 test(core): the adapter runs refused dates, amounts, periods, roles, exports, 1099 years and returns
The bookspec examples now spell the input an engine has to refuse, and the
adapter takes each through the real books:

- a date past 9999 is refused by `Store::create_entry`'s own
  `try_create_entry` (DateOutOfRange), and a line past one quadrillion by
  `add_line` (AmountOutOfRange), each on a rehearsal so a refused entry
  leaves no draft;
- a close whose period partly overlaps another creates it through
  `Store::create_period` and reads PeriodsOverlap;
- `assign_role` is `Store::assign_role`, the journaled command, so a role
  on a header is refused by `check_assign_role` (ControlAccountMismatch)
  and the chart stays as it was;
- an IIF export with an entry on a receivable and a payable account is
  refused with BS-format-10's word, which is why `export_iif` keeps its
  typed error;
- a 2027 worksheet is refused through `RuleNotKnown` as
  `unknown_1099_year`, never guessed;
- `return_tin` reads the full number from the real `ledger_vault::Vault`
  the example's `setup.vault_tins` fills, and the books' own record keeps
  only the last four.

The adapter skips sixteen examples now (three more, each for an option
wanderbooks did not pick): allow-partial-overlap, carry-the-last-amount
and nowhere. Every one of the 95 it runs passes.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 07:40:26 -07:00
swaitsandClaude Opus 5.5 ee3c2b99c3 build: pin bookspec at 2b3b6c9, the even-parts law
bookspec main now carries law 43 (K-U5): a monthly-even schedule's parts
sum to its total, all but the last the same rounded share, at any size.
Lean 188 theorems, standard axioms only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 05:24:41 -07:00
swaitsandClaude Opus 5.5 f74eccddfc build: pin bookspec at c597c8f, drafts and evidence
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
bookspec main now carries X-H1c: drafts, receipts, discards and the
evidence decision as examples, BS-entry-1 without the choice it never
owned, payroll its own exemption source. Lean 179 theorems, standard
axioms only; 88 of 101 examples run and pass, the other 13 are for
options wanderbooks did not pick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 04:34:41 -07:00
swaitsandClaude Opus 5.5 609e4e6b26 build: pin bookspec at bc92cf3, settlements and the shares law
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
bookspec main now carries X-H1b (settlements, recoveries, invoice
numbers, vendor references and their examples; BS-arap-10 ignores
hyphens as plan P4b S4 decided) and K-U3's law 42. The checker and the
Lean move together (tests/bookspec/pin.rs): Lean 179 theorems, standard
axioms only; 80 of 91 examples run and pass, the other 11 are for
options wanderbooks did not pick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 03:09:18 -07:00
swaitsandDeepSeek V4.1 Flash d4440b6a4e build: pin bookspec at 6e1b99d, the shares law
Law 42 (the split's exact shares sum, and each part is near its exact
share) is merged in bookspec, so the Lean package and the Rust checker
move to the same rev. The two must name one spec version: the checker
runs the bookspec the Lean proves.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-09 01:06:36 -07:00
swaitsandClaude Opus 5.5 47502999d0 build: pin bookspec at 00b7c54, payments and the aging, and audit_lean
bookspec main now carries X-H1a (a payment event, terms, the aging and
due-date queries, their examples; an example names the option it rests
on, and a claimed CHOICE declares its pick) and X-J's half (audit_lean,
the audited theorem list an engine checks its claims against). The
checker and the Lean move together (tests/bookspec/pin.rs): Lean 177
theorems, standard axioms only; 71 of 76 examples run and pass, the five
others are for options wanderbooks did not pick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 23:14:01 -07:00
swaitsandClaude Opus 5.5 127d33fb0b build: pin bookspec at 51375ec, the spec floors and L-G2
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
bookspec main now carries L-G2 (documents run as a Lean step; the
example runner posts them) and X-I (per-rule coverage, and the floors
against the base commit: an issued id is never lost, an allow-list never
grows, no rule or option loses its example). The checker and the Lean
move together (tests/bookspec/pin.rs). Option names are now plain words
in bookspec; every pick named in docs/spec/claims/ already is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 20:09:12 -07:00
swaitsandClaude Opus 5.5 a27bdafde1 build: pin bookspec at aaa02ca, the FX law and D-75's bound
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
bookspec proves the FX law (law 41: whole unit, within half a unit,
positive from half a unit, the tie included), links BS-ledger-14's FX
invariants, and states D-75's ten-place bound in BS-entry-4. With the
K-U1 merge above: 1,198 core and package tests pass, just prove is
green (Lean 151 audited here, 174 in bookspec), the Lean-model test
agrees on 64 sequences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 19:14:24 -07:00
swaitsandClaude Opus 5.5 4de03c1eaa merge: a coverage report and floor; rust_decimal checked against exact rationals (V-D; branch t3/decimal-exact-coverage-floor, e6fe6e29; reviewed, fix applied)
Cargo.toml: both the dev-dependencies for decimal_exact and the bookspec
comment's new path kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:11:27 -07:00
swaitsandClaude Opus 5.5 72de6efec0 build: pin bookspec at 218b5c8, every CHOICE its own record
bookspec splits every CHOICE embedded in another rule into its own
record (S-C7), so an engine declares its pick for each by id; wanderbooks
declares its 65 picks (one list in the adapter, checked against each
record's options and the claims files). Lean builds and audits; adapter
and package tests pass on the new rev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 17:06:14 -07:00
swaitsandClaude Opus 5.5 c7c7ffd248 build: pin bookspec at c467093, the rounding law for every mode
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
bookspec's Lean now proves round_step's law (law 40) for every mode at
any step: multiple, near, ties, the directed modes' bounds, sign,
idempotent, odd, scale (K-U2). With the K-U2 kernel merge above: 1,155
ledger-core and package tests pass, and just prove (Kani 59+ fast
harnesses, Lean 151 audited) is green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 14:34:09 -07:00
swaitsandClaude Opus 5.5 4b295ee224 build: pin bookspec at d877bcf, every area's rules complete there
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
bookspec now states the format rules too (S-C6), so every accounting
rule is complete as a record, and the Lean model runs its examples
(L-G3: 8 whole, agreeing with the Rust derivation on all 25 figures both
answer). Lean builds and audits 151; adapter and package tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:34:55 -07:00
swaitsandClaude Opus 5.5 63b6001edd build: pin bookspec at 90d005a, A/R and A/P rules and the oracle there
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
bookspec now states the A/R and A/P rules and the draft rule completely
(S-C5) and is self-contained (S-K1): the GnuCash oracle's container
lives there and just oracle builds it from this pin. Lean builds and
audits 151; adapter 53, package 29 and the GnuCash oracle pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:25:33 -07:00
swaitsandClaude Opus 5.5 f7c245ac64 build: pin bookspec at 09b81b9, four areas of rules complete there
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
bookspec now states the entry, ledger, statement, period, prepaid,
revenue, partner, asset and 1099 rules completely as records (P14 units
S-C1 to S-C4, each reviewed by a second model and fixed), with the
executable Lean model (L-G1) and the owner's D-73 reversal-date rule;
the matching wanderbooks claims files are reduced to wanderbooks' picks,
enforcement sites and WB product rules (merged above). All four pins
move together; Lean builds and audits 151, the adapter (53) and the
package (29) pass on the new rev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:54:41 -07:00
swaitsandDeepSeek V4.1 Flash b10804fb07 test(core): rust_decimal checked against exact rationals
The engine trusts Decimal for every money path, and docs/verification.md
said so without checking it: Kani cannot explore Decimal arithmetic, and
the bridge tests only tie the Decimal kernel to the i64 one. This adds a
property test that compares the operations the books use against
num-rational/num-bigint, an independent exact reference: checked_add and
checked_sub over signed line amounts (1e15 at up to ten places),
1,000-line sums, checked_mul while the true product fits 28 digits
(including the top of the line range and FX-style rates),
round_dp_with_strategy for every strategy the workspace uses at every
scale 0..=28, rescale's half-away rounding, normalize, comparison and
equality across scales (1.0 = 1.00), and from_str/to_string round trips
at every scale.

It also pins the one inexact edge: when a product's scale does not fit,
checked_mul rounds to 28 decimal places, ties to even, rather than
failing; None comes only when the integer part cannot fit. That case is
reachable through Ledger::add_line_fx, whose foreign amount and rate are
unbounded positive Decimals (the base amount is then rounded to the
currency's minor unit). No property failed: 256 cases by default,
PROPTEST_CASES=5000 passed, plus hand cases at 28-digit mantissas, scale
28 and negative ties.

The two dev-dependencies are test-only and already in the lockfile
(through proptest and the PDF stack); they are the exact reference the
whole check rests on.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
2026-11-08 12:53:01 -07:00
swaitsandClaude Opus 5.5 e0e8b9c5fe build: pin bookspec at 62c0bf2, the sources vendored there with checked pins
bookspec now carries the 21 authorities its rules cite (IRS texts,
Pacioli, ISO 4217 facts, FASB and Intuit notes, each with an accurate
licence line) and checks every one of its 40 citations verbatim itself
(P14 unit S-B, reviewed, licence fixes applied). Adapter 52 and package
29 tests pass on the new rev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:32:07 -07:00
swaitsandClaude Opus 5.5 7a3860de73 build: pin bookspec at 77e04633, rule records and every law in its Lean
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
bookspec now keeps one structured record per rule (rules/, each with a
plain-English description, generated index and per-area pages, link
checks, ids never reused) and proves all 118 headline theorems plus 33
named laws in its own Lean (P14 units S-A and L-F1, reviewed, with the
review fixes). The checker's public API is unchanged: the adapter (52
tests) and the package tests (29) pass on the new rev.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:05:28 -07:00
swaitsandClaude Opus 5.5 54c710bc43 build: pin bookspec at 4eb99123, its history purged of build output
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
bookspec's first push committed 1,979 files of cargo build output
(target/). At the owner's request its history was rewritten to drop
them (git filter-branch, every commit) and force-pushed: the repository
went from 105 MB to under 400 KB. Every commit got a new hash, so the old
pin 74f2853d no longer exists upstream. Its rewritten twin is 6b309306,
with an identical tree apart from target/ (checked against a mirror
backup); the pin moves to the new tip 4eb99123, which only adds a
.gitignore. The bookspec adapter (52 tests) and the package tests (29)
pass on it. Older wanderbooks commits still name 74f2853d and will not
fetch bookspec from scratch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:11:32 -07: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 0442ab804e feat(host): books homes and starting an agent in one (P11b)
D-27: each book gets a visible folder, <Documents>/Wanderbooks/<id>, where an
agent works. It holds AGENTS.md and CLAUDE.md (three lines), the project-level
.mcp.json entry (wanderbooks mcp --book ID) and .claude/settings.json allowing
mcp__wanderbooks-ID__*, and nothing of the books: no data, key, token or path
into the data root (invariant I-1 stays: the books are hidden, not here). The
two JSON files are merged into and the text files written only when absent, so
a person's edits stay. Named by the book id, which never changes, not by the
company name, which is set after the books are made.

The viewer's New books... and wanderbooks connect make the home; connect_agent
is unchanged. start_agent says how to run Claude Code or Codex in it, or hands
back the vendor's installer (never bundled). Nothing is marked trusted for any
agent (Q-7: recommended answer, let Codex ask). First-run helpers (state, set
up the private folder, first owner passphrase) let the viewer onboard with no
terminal.

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

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

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

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:36:19 -06:00
swaitsandClaude Fable 5.1 23f9e9395b feat(cli): wanderbooks update and rollback (P11a step 2)
`wanderbooks update` reads a release manifest (default: GitHub Releases'
fixed address, D-26), refuses anything not higher than this version,
downloads the platform's file and accepts it only if its sha256 matches
the manifest AND its minisign signature verifies against the release key
compiled into the program (WANDERBOOKS_RELEASE_PUBKEY at build time;
a build without one updates from nothing but a file:// feed whose key the
owner names with --trusted-key, so a local release can be tried). The
verified file is staged under <root>/updates/<version>/, the running
version is kept under updates/previous/ with the journal format it
understood, and the program file is replaced by a rename of a complete
copy made beside it (a reader sees the old file or the new, never a
part). The new program must answer --help; if not, the old one is put
back. Nothing tells the books to stop: the host already notices a
replaced executable and restarts onto it, finishing calls in progress
(host.rs INVARIANT 7).

`wanderbooks rollback` swaps the kept version back, and refuses while any
book declares a journal format or feature the kept version does not know
(plan 3.9: after the owner consents to a newer format the only way back is
the pre-upgrade restore). A package-managed install (a package ships
share/wanderbooks/install-method beside bin/) refuses both and says to use
the package manager. An AppImage replaces the file named by $APPIMAGE.

Tests (crates/ledger-cli/tests/update.rs): update_is_atomic,
failed_update_rolls_back, unsigned_update_refused (another key, other
bytes, a sha that differs, no signature, not a signature),
bridge_survives_update, update_waits_for_a_running_call,
package_managed_install_refuses_update, the kept-version and format-gate
tests; unit tests in ledger-host/src/update.rs.

Dependencies: minisign-verify 0.3 in ledger-host (what cargo-packager's
updater uses to check release files; no dependencies of its own) and
minisign 0.10 as a ledger-cli dev-dependency (the tests sign with a key
they make). sha2 and the two minisign crates are built optimized in debug
and test builds: the tests hash a debug build's program. The release
profile strips symbols, for the packages (P11a step 3).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:12:18 -06:00
swaitsandClaude Fable 5.1 5f5dd8f7da feat(store): the data root under LOCALAPPDATA with an owner-only DACL, one lock seam, MoveFileEx (P11c)
Windows step 1 and 2 of D-62. Where Unix keeps the books' private folder
at mode 0700 and refuses one others can open, Windows now makes the same
promise with a DACL: `winsec::set_owner_only` gives the folder (and,
inherited, everything made in it) one protected allow entry for this
account's SID; `winsec::is_private` reads the effective DACL and owner
back and answers false for anything else (a missing DACL, an entry for
Everyone), so `Root::open` refuses a loosened root and `Root::setup`
makes it private again, exactly as the 0700 checks do. Every question the
system cannot answer is "not private". The root itself comes from the
shell's known folders (`SHGetKnownFolderPath`: the profile, and
LocalAppData wherever it was redirected), never from environment
variables the process that started us chose.

`rename_new` (the move that must never go over what is there, renameat2
RENAME_NOREPLACE on Linux) is `MoveFileExW` without the replace flag on
Windows, written through.

File locking sat behind `libc::flock` in ops.rs alone (the rest already
used std's File::try_lock, which is LockFileEx on Windows). It now goes
through `lock.rs`, which uses only std, so there is no second unsafe copy
of either call.

New dependency: windows-sys 0.61 behind cfg(windows), the raw bindings
only (no runtime), already in the lockfile through other crates; the
smallest Microsoft crate that covers SIDs, DACLs, the known-folder API,
pipe process ids and MoveFileExW. mise.toml adds the Windows target to
the pinned toolchain so `cargo check --target x86_64-pc-windows-msvc`
type-checks this arm on Linux.

CHOICE (P11c): nothing above the root is checked on Windows (the Unix
rule about folders above it being swappable has no Windows authority; the
profile's folders belong to the account and the Administrators).

Tests: tests/windows_root.rs (Windows job only), the cross-platform
`a_viewer_s_presence_is_a_shared_lock_others_can_see` in ops.rs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 14:38:29 -06:00
swaitsandClaude Fable 5.1 d703b68911 refactor(host): tokens live in a file under the data root (U0e)
D-63: the 0700 data root is the trust boundary already (I-1: hidden, not
locked), so the OS keyring added no wall and cost headless servers a D-Bus
session, CI a knob and every OS its own store. The file keeper is the only
store: run/tokens/, 0600, written atomically. The three keyring stores, the
file_keyring knob and their tests are removed; an unreadable token file is an
error, never no token.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 13:31:42 -06:00
swaitsandClaude Fable 5.1 5e220ccada merge: P11a step 0, the macOS and Windows keyring stores and the portable CI job (branch P11a, ee4f8cd5)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 12:47:08 -06:00
swaitsandClaude Fable 5.1 bb1eb84200 refactor(reader): extract.rs moves into ledger-reader (U0d)
D-61 (Q-9): the writer sheds the typesetter and the crate map is layered
again. The PDF/XLSX reader (extract.rs, plan P6) is now the plain library
crate ledger-reader, moved whole with git mv and no behavior change.
ledger-store depends on it instead of ledger-import, so the store no
longer builds Typst or the fonts; ledger-import re-exports it as
ledger_import::extract so gui, mcp, host and the fuzz targets compile
unchanged, and still never depends on the store. New crate carries only
the dependencies extract.rs imports (hayro, hayro-interpret, kurbo, zip,
quick-xml, thiserror); fuzz/Cargo.lock gains the new package.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 12:45:14 -06:00
swaitsandClaude Fable 5.1 ee4f8cd58a feat(host): Keychain and Credential Manager token stores, a macOS/Windows CI job (P11a step 0)
The agent path was Linux-only because tokens had a keyring store only
there (every other OS hit NOT_YET, so `connect` and the bridge failed).
D-56's destination is one installation for macOS, Windows and Linux.
Both new stores sit behind the same Items trait as the Secret Service,
so INVARIANT 4 (one account, one item, locked is an error) is kept once
and tested once through the file keyring. Windows credentials have a
unique target name, so a probe stands in for a search.

New dependencies (ledger-host only, target-gated): apple-native-keyring-store
(feature keychain) and windows-native-keyring-store, the stores the
keyring-core 1 API we already use is published with. No ledger-core change.

The `portable` job builds and tests the workspace on macos-latest and
windows-latest. Windows is allowed to fail: the rest of the host is
Unix-only (inventory in docs/packaging.md). Not verified locally: no
macOS or Windows target is installed; CI is the evidence.

Also pins cargo-packager, cargo-packager-updater and cargo-generate-rpm
in mise.toml for the trial, and records that the trial is not yet run.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 12:41:01 -06:00
swaits ce36640874 wip: pause checkpoint — P6 feature complete, gate interrupted (not for merge) 2026-10-27 14:41:34 -06:00