docs: packages need nothing for backups; handbook, tools and install words without git

The Linux packages, the AUR recipe and the rpm metadata no longer depend on
another program for backups (WB-pkg-4 is replaced); the Windows host's PATH no
longer carries Git for Windows; the handbook an assistant reads, the
tool descriptions, the install notes and the site say plain folders. A test
adopts a clone of an old backup as the docs describe.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 17:54:32 -07:00
1 parent 4313464bd7
commit 91d88dcee7
21 files changed
+277 -208

No files matched your search

-2
View File
@@ -75,8 +75,6 @@ workspace = true
# program: `just package-linux`. Paths are relative to the workspace root. # program: `just package-linux`. Paths are relative to the workspace root.
[package.metadata.generate-rpm] [package.metadata.generate-rpm]
name = "wanderbooks" name = "wanderbooks"
# Backups run the system's git (WB-pkg-4): dnf fetches it.
requires = { git = "*" }
summary = "Double-entry bookkeeping your agent keeps and you can read" summary = "Double-entry bookkeeping your agent keeps and you can read"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
url = "https://wanderbooks.ai" url = "https://wanderbooks.ai"
+115
View File
@@ -1236,3 +1236,118 @@ async fn old_settings_and_an_old_backup_history_are_left_alone_and_said() {
drop(c); drop(c);
assert!(server.close().success()); assert!(server.close().success());
} }
/// docs/backups.md, "A backup made with an older version": a person who
/// still has a backup made with git clones it themselves (git is their own
/// tool now) and adopts the plain folder. This makes such a backup the way
/// an older version did (a repository whose one commit is the books'
/// files), clones it as the docs say, and adopts the clone with its vault
/// and key as the docs say.
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
async fn a_clone_of_an_old_git_backup_is_adopted_as_a_plain_folder() {
let git = |dir: &Path, args: &[&str]| {
let out = Command::new("git")
.arg("-C")
.arg(dir)
.args(["-c", "user.name=t", "-c", "user.email=t@t.invalid"])
.args(args)
.output();
match out {
Ok(o) => {
assert!(o.status.success(), "{args:?}: {o:?}");
true
}
// No git on this machine: the path is the person's own tool's.
Err(_) => false,
}
};
let home = Home::new("old-backup");
let server = Server::start(&home, Duration::from_secs(3600));
home.create("acme");
let c = connect(&home, "acme", home.token("acme", &ALL)).await;
call(
&c,
"books.add_party",
json!({"name": "Mo", "roles": ["member"]}),
)
.await
.unwrap();
call(
&c,
"books.set_tin",
json!({"party": "Mo", "tin": "12-3456789", "tin_type": "ein"}),
)
.await
.unwrap();
let (folder, want) = backed_up_acme(&home).await;
drop(c);
assert!(server.close().success());
// The old backup: the books' files, committed, in a bare repository.
let book = home.book_dir("acme");
let work = home.outside("old-work");
std::fs::create_dir_all(&work).unwrap();
for part in ["journal.jsonl", "blobs", "vault", "keys", "access.jsonl"] {
let from = book.join(part);
if from.is_dir() {
copy_dir(&from, &work.join(part));
} else if from.is_file() {
std::fs::copy(&from, work.join(part)).unwrap();
}
}
if !git(&work, &["init", "-q", "-b", "main"]) {
return;
}
git(&work, &["add", "-A", "-f"]);
git(&work, &["commit", "-q", "-m", "seq 1 head x\n\nbook acme"]);
let bare = home.outside("acme.git");
let out = Command::new("git")
.args(["clone", "-q", "--bare"])
.arg(&work)
.arg(&bare)
.output()
.unwrap();
assert!(out.status.success(), "{out:?}");
// The person's steps: clone it, then adopt the folder with its vault
// and key.
let clone = home.outside("acme-old");
let out = Command::new("git")
.args(["clone", "-q"])
.arg(&bare)
.arg(&clone)
.output()
.unwrap();
assert!(out.status.success(), "{out:?}");
let other = Home::new("old-backup-new");
let server = Server::start(&other, Duration::from_secs(3600));
let request = |confirmed: bool, expect_head: Option<(u64, String)>| Request::Adopt {
id: "acme".into(),
source: clone.clone(),
settings_toml: None,
config_json: None,
vault_dir: Some(clone.join("vault")),
vault_key: Some(clone.join("keys").join("legacy.key")),
confirmed,
expect_head,
skip_unknown: false,
};
let preview = match other.admin(request(false, None)) {
Response::Preview(p) => p,
r => panic!("{r:?}"),
};
match other.admin(request(true, Some(preview.source_head))) {
Response::Adopted(a) => {
assert!(a.problem.is_none(), "{a:?}");
assert_eq!(a.head, live_head(&home, "acme"));
}
r => panic!("{r:?}"),
}
let c = connect(&other, "acme", other.token("acme", &["read"])).await;
assert_eq!(figures(&c).await, want);
let party = call(&c, "books.party", json!({"party": "Mo"}))
.await
.unwrap();
assert_eq!(party["party"]["tin"]["in_vault"], true, "{party}");
drop(c);
assert!(server.close().success());
let _ = folder;
}
+20 -16
View File
@@ -684,26 +684,30 @@ fn only_a_person_runs_the_workflow_that_publishes_the_repositories() {
); );
} }
/// WB-pkg-4: on Linux git is a dependency of every package, so the package /// WB-pkg-4: a backup is plain files the program writes itself, so no
/// manager fetches it; nothing carries a git of its own. /// package depends on another program for it and none carries one.
#[test] #[test]
fn the_linux_packages_depend_on_git_and_none_carries_one() { fn no_package_depends_on_another_program_for_backups() {
let packager = read("deploy/packaging/packager.toml"); let word = |text: &str| {
assert_eq!( text.to_lowercase()
packager.matches("\"git\"").count(), .split(|c: char| !c.is_ascii_alphanumeric())
2, .any(|w| w == "git")
"the deb and the pacman package depend on git" };
);
assert!(read("crates/ledger-cli/Cargo.toml").contains("requires = { git = \"*\" }"));
assert!(read("deploy/packaging/aur/PKGBUILD").contains("'git'"));
for file in [ for file in [
"deploy/packaging/packager.toml",
"deploy/packaging/aur/PKGBUILD",
"crates/ledger-cli/Cargo.toml",
"deploy/packaging/windows/wanderbooks.nsi", "deploy/packaging/windows/wanderbooks.nsi",
"deploy/packaging/macos/build-macos.sh", "deploy/packaging/macos/build-macos.sh",
] { ] {
let text = read(file).to_lowercase(); let text = read(file);
assert!( // (Cargo.toml may name a git *dependency* of the build, never a
!text.contains("mingit") && !text.contains("git.exe"), // package requirement.)
"{file} bundles a git" let checked: String = text
); .lines()
.filter(|l| !l.contains("git ="))
.collect::<Vec<_>>()
.join("\n");
assert!(!word(&checked), "{file} depends on, or bundles, a git");
} }
} }
+2 -2
View File
@@ -770,7 +770,7 @@ fn books_usage(prog: &str) {
" back-up back the books up now to every backup their settings name (--new-disk: the backup folder's disk is new)" " back-up back the books up now to every backup their settings name (--new-disk: the backup folder's disk is new)"
); );
eprintln!( eprintln!(
" restore bring back a backup (a git repository's address, or BOOK.git in the backup folder), proven whole first: as new books, or replacing books (kept in legacy/)" " restore bring back a backup (your backup folder, the folder of one set of books in it, or a backup file), proven whole first: as new books, or replacing books (kept in legacy/)"
); );
eprintln!( eprintln!(
" upgrade give the go-ahead, with the owner passphrase, for books an older wanderbooks wrote to move to this version's journal format (a verified backup with the vault and keys first)" " upgrade give the go-ahead, with the owner passphrase, for books an older wanderbooks wrote to move to this version's journal format (a verified backup with the vault and keys first)"
@@ -779,7 +779,7 @@ fn books_usage(prog: &str) {
" extract read one attachment's text (a PDF, XLSX or text file) and journal it, one at a time; books an older version filed are read this way after an upgrade" " extract read one attachment's text (a PDF, XLSX or text file) and journal it, one at a time; books an older version filed are read this way after an upgrade"
); );
eprintln!( eprintln!(
" put-aside move the old copies of adopted books (their data folder, their vault and its key, and other paths given: settings file, git history) whole into the legacy folder, once the books hold everything they do, byte for byte; nothing is deleted" " put-aside move the old copies of adopted books (their data folder, their vault and its key, and other paths given: settings file, old history) whole into the legacy folder, once the books hold everything they do, byte for byte; nothing is deleted"
); );
} }
+6 -10
View File
@@ -12,7 +12,7 @@
//! and DBUS_SESSION_BUS_ADDRESS only when they point at this //! and DBUS_SESSION_BUS_ADDRESS only when they point at this
//! account's own private runtime folder, and SSH_AUTH_SOCK only when //! account's own private runtime folder, and SSH_AUTH_SOCK only when
//! it names a socket this account owns (the owner's ssh agent, so the //! it names a socket this account owns (the owner's ssh agent, so the
//! server's backups reach a private git repository, D-30). Nothing //! server's backups reach a folder on the network, D-91). Nothing
//! else passes (a scope's own identifiers, such as INVOCATION_ID, are //! else passes (a scope's own identifiers, such as INVOCATION_ID, are
//! systemd's). Two more: APPIMAGE and APPDIR, only when they are //! systemd's). Two more: APPIMAGE and APPDIR, only when they are
//! this program's own (INVARIANT 6), so the host knows its own //! this program's own (INVARIANT 6), so the host knows its own
@@ -441,9 +441,9 @@ fn scope_made(child: &mut std::process::Child, log: &std::fs::File, from: u64) -
/// The host's environment on Windows (INVARIANT 1's counterpart): the /// The host's environment on Windows (INVARIANT 1's counterpart): the
/// system's own variables, the account's profile, and a PATH fixed to the /// system's own variables, the account's profile, and a PATH fixed to the
/// system folders and Git for Windows (the backups run `git`). Nothing /// system folders. Nothing else of the opener's passes. (CHOICE, P11c: no
/// else of the opener's passes. (CHOICE, P11c: no authority states a /// authority states a Windows list; this is the least a Windows program
/// Windows list; this is the least a Windows program and `git` need.) /// needs.)
#[cfg(windows)] #[cfg(windows)]
fn host_env(home: &Path) -> Vec<(String, std::ffi::OsString)> { fn host_env(home: &Path) -> Vec<(String, std::ffi::OsString)> {
let var = |name: &str| std::env::var_os(name); let var = |name: &str| std::env::var_os(name);
@@ -452,12 +452,8 @@ fn host_env(home: &Path) -> Vec<(String, std::ffi::OsString)> {
.map_or_else(|| PathBuf::from(r"C:\Windows"), PathBuf::from); .map_or_else(|| PathBuf::from(r"C:\Windows"), PathBuf::from);
let program_files: PathBuf = let program_files: PathBuf =
var("ProgramFiles").map_or_else(|| PathBuf::from(r"C:\Program Files"), PathBuf::from); var("ProgramFiles").map_or_else(|| PathBuf::from(r"C:\Program Files"), PathBuf::from);
let path = std::env::join_paths([ let path = std::env::join_paths([system_root.join("System32"), system_root.clone()])
system_root.join("System32"), .unwrap_or_default();
system_root.clone(),
program_files.join("Git").join("cmd"),
])
.unwrap_or_default();
let mut env: Vec<(String, std::ffi::OsString)> = vec![ let mut env: Vec<(String, std::ffi::OsString)> = vec![
("PATH".into(), path), ("PATH".into(), path),
("SystemRoot".into(), system_root.clone().into_os_string()), ("SystemRoot".into(), system_root.clone().into_os_string()),
+8 -7
View File
@@ -1,9 +1,10 @@
# Backups # Backups
- The books back themselves up: a little after each change, when they open, before they close. Each backup goes to the targets the settings name: backup.git_remote, a private repository the human owns, and backup.folder, a folder on another disk. Both is best. The backups aren't encrypted: the human's repository host and disk keep them private. - The books back themselves up: a little after each change, when they open, before they close. The backup goes to the backup folder the settings name (backup.folder): a folder on another disk, or one that Dropbox, iCloud, OneDrive or Google Drive keeps in sync. It holds one folder for these books, made only of files that are added and never changed or deleted, so a sync service never sees one change under it.
- No targets set: books.start says so. Ask the human for the repository's address and the folder, then set them with books.set_setting (who decided, and when); choosing where backups go needs books:admin, as backing up does. - No backup folder set: books.start says so. Ask the human which folder, then set it with books.set_setting (who decided, and when); choosing where backups go needs books:admin, as backing up does. The window has a folder chooser for the same.
- books.backup says how each target stands: when it last took the books, through which journal seq, why the last try failed, and whether its weekly restore check passed. A target that is stale, failing, or failed its check: tell the human what it says, in plain words (a disk not connected, a repository that refused). - The human may protect the backups with a passphrase, set up in the window and off by default. Then every file in the folder is sealed and says no more than how many there are and how big. The passphrase is never in the books or in these tools, and a forgotten one can't be recovered: say so plainly if the human asks. books.backup says whether the backups are sealed.
- books.back_up_now backs up at once, for instance before the human changes computers. A backup never changes the books. - books.backup says how the folder stands: when it last took the books, through which journal seq, why the last try failed, and whether its weekly restore check passed. A folder that is stale, failing, or failed its check: tell the human what it says, in plain words (a disk not connected, another set of books in the folder).
- A backup folder that took these books' backups but holds none now is a disk not connected: ask the human to connect it. Only if they say the disk is new, back up now with new_disk: true to begin the books' backup there again. - books.back_up_now backs up at once, for instance before the human changes computers. A backup never changes the books. The window's Save a backup... makes the same backup as one file to keep or carry.
- Books restored as a copy of other books (under another name) don't back up to those books' repository (that would stop theirs): books.backup says so; ask the human for one of their own. - A backup folder that took these books' backups but holds none now is a disk not connected (disconnected: true): ask the human to connect it. Only if they say the disk is new, back up now with new_disk: true to begin the books' backup there again.
- Restoring is the human's to do, outside these tools: a backup comes back as new books, or replacing these (the old books are kept, never deleted), and each is proven whole before it is restored. - Books that still name a private repository in their settings (an older kind of backup) are told it is no longer used: ask the human for a backup folder instead. Nothing older is deleted.
- Restoring is the human's to do, outside these tools: a backup comes back as new books, or replacing these (the old books are kept, never deleted), from the backup folder or a backup file, and each is proven whole before it is restored.
+2 -2
View File
@@ -1038,11 +1038,11 @@ impl BooksServer {
// failing. // failing.
{ {
let st = self.backups.standing(store); let st = self.backups.standing(store);
if st.note.is_some() { if st.targets.is_empty() {
next_steps.push(step( next_steps.push(step(
"books.backup", "books.backup",
None, None,
"No backups are set up: ask the human for a private repository and a folder on another disk, then set backup.git_remote and backup.folder (books.set_setting).", "No backups are set up: ask the human which folder to back up to (a folder on another disk, or one a sync service keeps), then set backup.folder (books.set_setting).",
)); ));
} else if st.needs_attention() { } else if st.needs_attention() {
next_steps.push(step( next_steps.push(step(
+1 -1
View File
@@ -1124,7 +1124,7 @@ impl BooksServer {
/// ```text /// ```text
/// GOAL: everything the CPA needs for the return in one zip, the K-1s' /// GOAL: everything the CPA needs for the return in one zip, the K-1s'
/// and 1099s' TINs included, without a full TIN ever landing in /// and 1099s' TINs included, without a full TIN ever landing in
/// the books (a git repository) or the conversation. /// the books or the conversation.
/// SOURCE: docs/mcp-interface.md; BS-partner-2; DECISION (owner, /// SOURCE: docs/mcp-interface.md; BS-partner-2; DECISION (owner,
/// 2026-10-15): "it needs to be in the damn CPA package." /// 2026-10-15): "it needs to be in the damn CPA package."
/// INVARIANTS: /// INVARIANTS:
+1 -1
View File
@@ -1294,7 +1294,7 @@ pub fn find_with(
count(ids.len(), "stored file is", "stored files are") count(ids.len(), "stored file is", "stored files are")
), ),
detail: format!( detail: format!(
"Attachment {}: the bytes on disk don't match their recorded hash. Restore them from a backup (the books dir's git history).", "Attachment {}: the bytes on disk don't match their recorded hash. Restore them from a backup.",
ids.join(", ") ids.join(", ")
), ),
target: Target::Documents, target: Target::Documents,
+6 -12
View File
@@ -104,17 +104,11 @@ and `IPAddressDeny=any` with `IPAddressAllow=localhost`, and no seccomp or
Landlock lines (D-32, D-51). Landlock lines (D-32, D-51).
The loopback-only rule is deliberate: the server reaches nothing out. A The loopback-only rule is deliberate: the server reaches nothing out. A
book whose backup target is a **remote** git repository needs that host backup is a folder of plain files (docs/backups.md): a folder on this
allowed, or its backups fail: machine's disks needs nothing, and nothing else is installed for it. (A
folder on a network share the machine mounts is a disk to the server, and
```ini the mount, not the server, reaches the network.) The tunnel and Caddy run as
# /etc/systemd/system/wanderbooks-server.service.d/backup.conf their own services and reach 127.0.0.1:7411, which the rule allows.
[Service]
IPAddressAllow=203.0.113.10
```
A backup to a folder on this machine needs nothing. The tunnel and Caddy
run as their own services and reach 127.0.0.1:7411, which the rule allows.
## 5. A token for each client ## 5. A token for each client
@@ -221,7 +215,7 @@ a last backup and closes (3.9), so `TimeoutStopSec=600` is generous rather
than needed. than needed.
Backups still run on their own, from the books' settings, as on the Backups still run on their own, from the books' settings, as on the
desktop (3.7, D-30, D-31); this machine runs git itself. desktop (3.7, D-91): plain files in a folder, written by the server.
## 9. Prove the boundary (what CI runs) ## 9. Prove the boundary (what CI runs)
+1 -1
View File
@@ -9,7 +9,7 @@ pkgdesc="Double-entry bookkeeping your agent keeps and you can read"
arch=('x86_64') arch=('x86_64')
url="https://wanderbooks.ai" url="https://wanderbooks.ai"
license=('MIT' 'Apache-2.0') license=('MIT' 'Apache-2.0')
depends=('gcc-libs' 'glibc' 'git') depends=('gcc-libs' 'glibc')
provides=('wanderbooks') provides=('wanderbooks')
conflicts=('wanderbooks') conflicts=('wanderbooks')
options=('!lto' '!strip') options=('!lto' '!strip')
+4 -4
View File
@@ -5,13 +5,13 @@
The app is signed with the hardened runtime (codesign --options The app is signed with the hardened runtime (codesign --options
runtime), which Apple's notarization requires. It is NOT sandboxed runtime), which Apple's notarization requires. It is NOT sandboxed
(the App Sandbox would forbid what the product is: it starts a copy of (the App Sandbox would forbid what the product is: it starts a copy of
itself as the books server, runs the system's git for backups, and itself as the books server, and
reads and writes the person's data folder and the folders they pick reads and writes the person's data folder and the folders they pick
for backups). Outside the sandbox, none of that needs an entitlement: for backups). Outside the sandbox, none of that needs an entitlement:
* starting itself as a child process and git as another: none; * starting itself as a child process: none;
* outgoing network connections (the relay, the update look, a git * outgoing network connections (the relay, the update look): none
remote): none (com.apple.security.network.client is a SANDBOX (com.apple.security.network.client is a SANDBOX
entitlement); entitlement);
* reading and writing its data folder, Application Support/wanderbooks: * reading and writing its data folder, Application Support/wanderbooks:
none (the Documents folder is a privacy prompt, answered by none (the Documents folder is a privacy prompt, answered by
+3 -4
View File
@@ -24,9 +24,8 @@ section = "utils"
# A deb marks itself package-managed: `wanderbooks update` refuses on it # A deb marks itself package-managed: `wanderbooks update` refuses on it
# and says to use apt (plan 3.9). # and says to use apt (plan 3.9).
desktop-template = "deploy/packaging/wanderbooks.desktop" desktop-template = "deploy/packaging/wanderbooks.desktop"
# git: the backups run the system's git (WB-pkg-4); the package manager # Backups need nothing installed (WB-pkg-4): they are plain files.
# fetches it, so a Linux person never sees the missing-git words. depends = ["libc6", "libgcc-s1"]
depends = ["libc6", "libgcc-s1", "git"]
[deb.files] [deb.files]
"deploy/packaging/install-method-deb" = "usr/share/wanderbooks/install-method" "deploy/packaging/install-method-deb" = "usr/share/wanderbooks/install-method"
@@ -42,7 +41,7 @@ depends = ["libc6", "libgcc-s1", "git"]
"LICENSE-APACHE" = "usr/share/doc/wanderbooks/LICENSE-APACHE" "LICENSE-APACHE" = "usr/share/doc/wanderbooks/LICENSE-APACHE"
[pacman] [pacman]
depends = ["gcc-libs", "glibc", "git"] depends = ["gcc-libs", "glibc"]
[pacman.files] [pacman.files]
"deploy/packaging/install-method-aur" = "usr/share/wanderbooks/install-method" "deploy/packaging/install-method-aur" = "usr/share/wanderbooks/install-method"
+2 -3
View File
@@ -50,9 +50,8 @@ ProtectHome=yes
PrivateTmp=yes PrivateTmp=yes
PrivateDevices=yes PrivateDevices=yes
# No network but loopback: the tunnel reaches 127.0.0.1:7411, and the # No network but loopback: the tunnel reaches 127.0.0.1:7411, and the
# server reaches nothing out. A book whose backup target is a remote git # server reaches nothing out. Backups go to a folder on this machine's
# repository needs that host allowed here (`IPAddressAllow=` its address) # disks (see README.md), so they need no network.
# or its backups fail; see README.md.
IPAddressDeny=any IPAddressDeny=any
IPAddressAllow=localhost IPAddressAllow=localhost
+2 -3
View File
@@ -487,9 +487,8 @@ already running with other flags keeps them; on a self-host machine
`serve` is the unit's only holder. `serve` is the unit's only holder.
The unit sets `IPAddressDeny=any` and `IPAddressAllow=localhost`: the The unit sets `IPAddressDeny=any` and `IPAddressAllow=localhost`: the
server reaches nothing out. A book whose backup target is a remote git server reaches nothing out. Backups go to a folder on the machine's own
repository therefore needs that host allowed in a drop-in (D-31 backups disks and need no network (D-91). The recipe, the head check for the move and the
still run on the server). The recipe, the head check for the move and the
two-account CI job are in `deploy/README.md`, `deploy/wanderbooks-server.service` two-account CI job are in `deploy/README.md`, `deploy/wanderbooks-server.service`
and `.github/workflows/two-user.yml`; the checks are and `.github/workflows/two-user.yml`; the checks are
`crates/ledger-cli/tests/two_user.rs`. `crates/ledger-cli/tests/two_user.rs`.
+7 -6
View File
@@ -23,8 +23,8 @@ close the window: that quits Wanderbooks fully and closes your books.
Where things are: the program is in `%LOCALAPPDATA%\Programs\Wanderbooks`; your Where things are: the program is in `%LOCALAPPDATA%\Programs\Wanderbooks`; your
books, keys and backups are in `%LOCALAPPDATA%\wanderbooks`. books, keys and backups are in `%LOCALAPPDATA%\wanderbooks`.
Backups need Git for Windows (https://git-scm.com/download/win, or `winget Backups need nothing installed: choose a backup folder in Wanderbooks
install --id Git.Git -e`); without it Wanderbooks works and says so. (another disk, or a folder your cloud drive keeps in sync).
## macOS ## macOS
@@ -38,8 +38,9 @@ install --id Git.Git -e`); without it Wanderbooks works and says so.
remove it, drag it to the Trash. Neither touches your books. remove it, drag it to the Trash. Neither touches your books.
Your books, keys and backups are in `~/Library/Application Support/wanderbooks`. Your books, keys and backups are in `~/Library/Application Support/wanderbooks`.
Backups need git: run `xcode-select --install` in Terminal (or `brew install Backups need nothing installed: choose a backup folder in Wanderbooks
git`). (another disk, or a folder iCloud, Dropbox, OneDrive or Google Drive keeps in
sync).
## Linux ## Linux
@@ -48,8 +49,8 @@ Ubuntu), the `.rpm` (Fedora), the Arch package, or the AppImage (one file: mark
it executable, keep it where you put it, and run it). Open **Wanderbooks** from it executable, keep it where you put it, and run it). Open **Wanderbooks** from
the menu. To update, install the newer package, or replace the AppImage. Your the menu. To update, install the newer package, or replace the AppImage. Your
books are in `~/.local/share/wanderbooks` and are never touched by a package. books are in `~/.local/share/wanderbooks` and are never touched by a package.
Backups need git (`sudo apt install git`, `sudo dnf install git`, Backups need nothing installed: choose a backup folder in Wanderbooks
`sudo pacman -S git`). (another disk, or a folder your sync program keeps).
## After it is installed ## After it is installed
+71 -78
View File
@@ -378,27 +378,21 @@ didn't open, with why). Protocol version 1: the requests are new, the
(a drill, or a format upgrade not yet journaled, is stopped when the (a drill, or a format upgrade not yet journaled, is stopped when the
close begins, at its next look, so it never takes the last backup's close begins, at its next look, so it never takes the last backup's
turn; its scratch clone is removed and the books are unchanged): turn; its scratch clone is removed and the books are unchanged):
a backup still running after that is stopped (git is sent SIGTERM, which a backup still running after that is stopped (its copy of files
makes it remove its own lock files, and killed with all it started only stops at the next piece, or the next 64 KiB of one) and waited for to
if it hasn't ended after 5 seconds) and waited for to end. The program end. The program never rewrites or deletes anything in a backup folder
never writes to or deletes from a backup folder (it is the owner's, and (it is the owner's, and may be shared with other computers or a sync
may be shared with other computers or a sync program): a lock git left program): a backup stopped part way leaves pieces no manifest names and
there when it had to be killed is left in place, recorded in the folder proves whole at its previous manifest, so there is nothing to
`ops/backup.jsonl` as `lock_left` with its whole path, and the target's clean up and nothing to remove by hand.
backup is marked failed with words naming the file and saying to remove
it only when nothing else is using the backup folder (`books.backup`
and the close's answer say the same; the next backup that finds the
lock gone goes on). In the book's own archive (`archive.git`, private to
the program; running git by hand inside it is unsupported) it removes
only the locks its own stopped git made, and, at open and when a backup
begins, locks older than ten minutes, each recorded `lock_removed`;
**What a close stops, and what it waits for.** At its start a close **What a close stops, and what it waits for.** At its start a close
stops the calls and jobs that can do long I/O or loop over a book's stops the calls and jobs that can do long I/O or loop over a book's
whole journal or files, each at its next look: `books.back_up_now` and whole journal or files, each at its next look: `books.back_up_now` and
a backup a timer asked for (git is stopped; the call answers that it was a backup a timer asked for (its copy is stopped; the call answers that it
stopped because the books are closing, its access record says was stopped because the books are closing, its access record says
`refused: stopped_by_close`, and nothing it was doing is recorded as done; `refused: stopped_by_close`, and nothing it was doing is recorded as done;
a commit it had made stands), `books.verify` (once per journal line and what it had written stands, and the folder still proves whole at its
previous manifest), `books.verify` (once per journal line and
per stored file; a heal of a drifted database is begun only if no stop per stored file; a heal of a drifted database is begun only if no stop
was asked before it, then finishes), `books.export_cpa_package` (once per was asked before it, then finishes), `books.export_cpa_package` (once per
stored file, unless it has journaled a decision, below), a drill, and a stored file, unless it has journaled a decision, below), a drill, and a
@@ -1329,75 +1323,74 @@ through the policy.
## Tools — backups ## Tools — backups
Books back themselves up (plan 3.7, D-30, Books back themselves up (plan 3.7, D-91, D-92): to the folder the settings
D-31): each keeps `archive.git`, a bare repository whose commits are its name, `backup.folder` (a folder on another disk, or one a sync service
journal, stored files, vault, keys and access log as they were (one keeps), as plain files written once (docs/backups.md): a folder for the
commit per backup, made under the store's lock, its message books holding a read-me, a `manifests/` folder, and the pieces the manifests
`seq N head H` and, below, `book <id>`), pushed fast-forward only to the targets the settings name, the journal and the access log as numbered segments, an index of the
name: `backup.git_remote` (the owner's private repository) and stored files and the files themselves under their hash, the vault and keys
`backup.folder` (a repository `<book>.git` in a folder on another disk). by content hash. The manifest is written last and makes a backup complete;
Not encrypted: the destinations keep it private. Backups run a little nothing in the folder is ever rewritten or deleted. Taking a backup holds
after the books are last written (`--backup-quiet`, 30 s), when they the store's lock only to cut the books (the journal's length and head, the
open, before they close, and on request; a failed one is retried after vault, the keys); the files are written after it. With a passphrase (D-92,
15 minutes. Each target is drilled weekly: cloned, its chain replayed, set up in the window; off by default) every file is sealed with
every stored file re-hashed, every TIN record the books name there with XChaCha20-Poly1305, the key derived with Argon2id (64 MiB, 3 passes, 1
its key, its head the one its commit records, its journal a byte prefix lane), names say no more than counts and sizes, and the key is kept on this
of the live one (a failed drill is tried again at the server's next computer only. Backups run a little after the books are last written
hourly look, once 15 minutes have passed). A backup's tree is checked (`--backup-quiet`, 30 s), when they open, before they close, and on request;
before any of it is written out: plain files under the backed-up paths a failed one is retried after 15 minutes. The folder's backup is drilled
only, never a link or a submodule. git runs with no hooks (in a weekly: its books built and proven whole, every stored file re-hashed, every
repository on this computer it pushes to as well), no ignore or TIN record the books name there with its key, its head the one its manifest
attributes rules of anyone's (a `.gitattributes` in a book's folder records, its journal a byte prefix of the live one (a failed drill is tried
refuses the backup) and no command-running transports; a repository on again at the server's next hourly look, once 15 minutes have passed). A
this computer is used only if plain (a bare repository at that very backup is written only onto a folder whose newest whole manifest is a point
path, no settings of its own but where a copy came from, nothing sending on the live journal; one holding other books, another history, or more than
git elsewhere, no link where it or its parts are), and a backup folder that took backups and is gone is these books have is said, and nothing is written. A backup folder that took
reported as a disk not connected, never made again (restored books count backups and is gone is reported as a disk not connected, never made again
the backups of the books they were). Books restored beside the books they (restored books count the backups of the books they were). Books restored
were (under another id) don't push to those books' repository, which under another id back up to a folder of their own in the same place. A
would stop theirs: `books.backup` says it is paused for them until damaged backup record is set aside and begun again; it never keeps the books
another is named. A damaged backup record is set aside and begun again; shut. A folder whose write failed is left out of the backups after writes
it never keeps the books shut. One book's drill holds the others' for 15 minutes, then tried again. Every cut, write and drill is a record in
backups until it ends (a backup at close waits at most a minute for the book's `ops/backup.jsonl` (a chain log; a backup never moves the books'
it). A target head), the folder's records keyed by the folder and the passphrase. Setting
whose push failed is left out of the backups after writes for 15 `backup.*` (books.set_setting) needs books:admin, as backing up does: a
minutes, then tried again, written to or not; the other targets don't backup is the whole book, its vault and key included. Books that still name
wait for it. Every a private repository (`backup.git_remote`, an older kind of backup) work as
commit, push and drill is a record in the book's `ops/backup.jsonl` (a ever; `books.backup`'s `note` says it is no longer used, and an older backup
chain log; a backup never moves the books' head), each target's records history in the book's folder is left alone and said once.
keyed by the target itself. Setting `backup.*` (books.set_setting) needs
books:admin, as
backing up does: a backup is the whole book, its vault and key included.
- `books.backup {}` (books:read) → `{ head_seq, targets: [{ target: - `books.backup {}` (books:read) → `{ head_seq, targets: [{ target:
"repository" | "folder", at, last_ok_at, through_seq, stale, "folder", at, last_ok_at, through_seq, stale, last_error,
last_error, last_drill_at, drill_error, paused }], note }`. `paused`: last_drill_at, drill_error, sealed, disconnected }], note }`.
not backed up there, these books being restored as a copy of others `sealed`: protected by a passphrase. `disconnected`: its disk isn't
(its `last_error` says so). `stale`: the target there. `stale`: the target
lacks the head, and the first try to back up what it lacks (since its lacks the head, and the first try to back up what it lacks (since its
last good backup, or ever) is more than a day old. `last_error`: its last good backup, or ever) is more than a day old. `last_error`: its
last push's, or a later failed commit's. `note` last write's, or a later failed cut's. `note`
says what to set when no target is. `books.start` adds a next step when says what to set when no folder is, and what older settings or history are
none is set up, or one is stale, failing, paused or failed its drill. no longer used. `books.start` adds a next step when none is set up, or the
folder is stale, failing or failed its drill.
- `books.back_up_now { new_disk? }` (books:admin) → the same, after - `books.back_up_now { new_disk? }` (books:admin) → the same, after
backing up to every target now. `new_disk`: the backup folder's disk is backing up to the folder now. `new_disk`: the backup folder's disk is
new, so a folder that took these books' backups and holds none now is new, so a folder that took these books' backups and holds none now is
begun again (otherwise it is a disk not connected). The one tool whose begun again (otherwise it is a disk not connected). The one tool whose
`openWorldHint` is true. A target paused for books restored as a copy `openWorldHint` is true.
of others shows `paused` (and is no failure to retry).
Restoring is the owner's, from a terminal: `wanderbooks books restore Restoring is the owner's, in the window (Restore...) or from a terminal:
BACKUP [--id ID] [--replace] [--yes]` (the admin socket's `restore`, `wanderbooks books restore BACKUP [--id ID] [--replace] [--yes]` (the admin
previewed then confirmed against the previewed head; without `--id`, the socket's `restore`, previewed then confirmed against the previewed head;
books keep the id of the books the backup holds, which the preview names, without `--id`, the books keep the id of the books the backup holds, which the
else the repository's name; under another id they are a copy, and don't preview names). BACKUP is the backup folder, the folder of one set of books in
push to those books' repository). The backup is it, or a backup file (`.wbbackup`); a sealed one asks for its passphrase
cloned into the root, proven whole as a drill proves it (but for the (unechoed at a terminal, never on the command line). The backup is built in
live-journal check: there may be no live books), and built as an the root, proven whole as a drill proves it (but for the live-journal check:
adoption builds; it arrives as new books, or replaces books (`--replace`, there may be no live books), and built as an adoption builds; it arrives as
which are let go and moved whole into `legacy/<id>-<time>/`). The new books, or replaces books (`--replace`, which are let go and moved whole
restored books keep the backup's history, so their next backups carry into `legacy/<id>-<time>/`). If the newest backup in the folder is damaged,
on from it. the newest whole one is the one previewed, and the preview says so. A sealed
backup's restored books keep backing up sealed, to the same folder, from this
computer.
## Tools — payouts ## Tools — payouts
+2 -26
View File
@@ -280,7 +280,7 @@ entry, icon, licences).
| Books | `%LOCALAPPDATA%\wanderbooks` | `~/Library/Application Support/wanderbooks` | `~/.local/share/wanderbooks` (unchanged) | | Books | `%LOCALAPPDATA%\wanderbooks` | `~/Library/Application Support/wanderbooks` | `~/.local/share/wanderbooks` (unchanged) |
| Removal leaves the books | the uninstaller names no data folder | dragging to Trash runs nothing | no package script runs | | Removal leaves the books | the uninstaller names no data folder | dragging to Trash runs nothing | no package script runs |
| No console window | built for the GUI subsystem; attaches to a terminal for commands | n/a | n/a | | No console window | built for the GUI subsystem; attaches to a terminal for commands | n/a | n/a |
| Without git | says how to get Git for Windows | says `xcode-select --install`; the system's stub is not taken for git | says the package manager's command | | Backups | plain files; nothing to install | plain files; nothing to install | plain files; nothing to install |
**Why NSIS written by hand, not cargo-packager's.** The installer's rules **Why NSIS written by hand, not cargo-packager's.** The installer's rules
(per user, one program, an uninstaller that can never reach the books) are (per user, one program, an uninstaller that can never reach the books) are
@@ -320,30 +320,6 @@ icon);
`wanderbooks.cmd`/PATH setup so a terminal waits for a command on Windows (a `wanderbooks.cmd`/PATH setup so a terminal waits for a command on Windows (a
GUI-subsystem program returns the prompt at once); a macOS refusal for a program GUI-subsystem program returns the prompt at once); a macOS refusal for a program
run from a mounted disk image (a path under `/Volumes` may be a real install on run from a mounted disk image (a path under `/Volumes` may be a real install on
another disk); bundling git on Windows and macOS (the owner's decision, below); the signed `manifest.json` of the earlier self-update another disk); the signed `manifest.json` of the earlier self-update
(needs the release key, Q-4). (needs the release key, Q-4).
### Bundling git (an owner decision, not made here)
Backups run the system's git. **Linux:** the packages now depend on git, so the
package manager fetches it (nothing is bundled). **Windows and macOS:** the app
detects a missing git and says how to get it (WB-pkg-4); nothing is bundled.
What bundling would mean. Git is GPL-2.0-only free software. Shipping an
unmodified git as a separate file that our program starts as its own process
(never linked) is what the GPL calls aggregation: our MIT OR Apache-2.0 code is
unaffected, and AGENTS.md's clean-room rule (never copy GnuCash's code) is not
touched, since nothing of git is copied into ours; `deny.toml` governs Rust
crates only and does not see it. It still requires, for each release that
carries git: git's GPL text and copyright notices beside it (Git for Windows'
MinGit adds the notices of the components it carries: OpenSSL/curl, the MSYS2
runtime); the corresponding source of exactly that git, or a written offer for it
valid three years (GPLv2 section 3), most simply the git version's source
archive attached to the same release; no term of ours that forbids the
recipient what the GPL permits; and a note of any change if git were modified.
`THIRD-PARTY-NOTICES.txt` (cargo-about) covers Rust crates only, so it would
need an addition. On Windows the candidate is MinGit from Git for Windows
(about 40 MB, unpacked beside the program; `Git::find` would look there first);
on macOS Apple's command line tools' git is Apple's and cannot be bundled, so
it would be a build of our own (Homebrew's, or from source), universal, signed
inside the app, with the same obligations.
+14 -13
View File
@@ -28,19 +28,20 @@ easily backupable, journable":
journals a `journal.tail_repaired` line; `books.digest` reports it. journals a `journal.tail_repaired` line; `books.digest` reports it.
Damage before the last newline is corruption and refuses to open: that Damage before the last newline is corruption and refuses to open: that
is for a human, never repaired automatically. The server does better is for a human, never repaired automatically. The server does better
(plan 3.7): it commits the journal, the blobs, the vault, its key and (plan 3.7, D-91): it backs the journal, the stored files, the vault, its
the access log to each book's own git repository (the blobs staged key and the access log up to a folder the owner chooses, as plain files
ahead, the commit under the store's lock) and pushes it to the that are written once and never changed or deleted (docs/backups.md, and
owner's private repository and backup folder, versioned and docs/mcp-interface.md, "Tools — backups"): the journal and the access log
deduplicated, with full history (docs/mcp-interface.md, "Tools — as numbered segments, each stored file once under its hash, and a
backups"). The program stops its git gently (SIGTERM first, so git manifest, written last, that says which pieces make a backup whole. The
removes its own lock files, and a kill only after 5 seconds), and never books' lock is held only to take a cut of the journal's length and the
writes to or deletes from a backup folder, which is the owner's (shared, vault; the files are written after it. With a passphrase (D-92) every file
perhaps, with another computer or a sync program): a lock git left is sealed. Nothing is installed for it, and nothing in the backup folder
there after a kill is reported with its path, never removed. The book's is ever deleted or rewritten by the program, which is the owner's (shared,
own archive (`archive.git`) is private to the program; there it removes perhaps, with another computer or a sync program). The book's own
only the locks its own stopped git made, and locks older than ten folder keeps a local backup of the same form (`local-backup/`) made
minutes found when the books open or a backup begins. before a format upgrade. The old history older versions kept in the book's
folder is left where it is, unread and unwritten.
- **Journable.** It literally is a journal: `{seq, ts, type, payload, prev}`. - **Journable.** It literally is a journal: `{seq, ts, type, payload, prev}`.
Greppable, diffable, replayable. The audit trail isn't a feature bolted Greppable, diffable, replayable. The audit trail isn't a feature bolted
on — it's the storage format. on — it's the storage format.
+8 -15
View File
@@ -88,21 +88,14 @@ earlier staged update still works; no release key exists yet, so today none does
`update.rs` (`a_macos_app_is_never_updated_in_place`); `ledger-gui` `update.rs` (`a_macos_app_is_never_updated_in_place`); `ledger-gui`
`tests/update_notice.rs` (`a_newer_version_is_told_with_where_to_get_it`). `tests/update_notice.rs` (`a_newer_version_is_told_with_where_to_get_it`).
**WB-pkg-4 Without git, backups are off and the person is told how to get **WB-pkg-4 Backups need nothing installed.** A backup is a folder of plain files
it.** Backups run the system's git; the program carries none. With no git found, a the program writes itself (WB-backup-1), so no package depends on another program
backup says so in plain words for the system it runs on (Git for Windows or winget; Apple's for it, none carries one, and no backup asks the person to install anything. This
command line tools or Homebrew; the package manager) and the books work as replaces the rule that backups ran the system's git and said how to get it (D-91).
ever; the next backup looks again, so installing git needs no restart. On a Mac *Enforced:* `deploy/packaging/packager.toml`, `deploy/packaging/aur/PKGBUILD` and
without the developer tools, the stub at the system's git path is not taken for a `crates/ledger-cli/Cargo.toml` name no such dependency.
git. Whether to ship a git with the app is the owner's decision, since git is *Checked:* `ledger-cli` `tests/packaging.rs`
GPL-2.0-only free software and shipping it carries a source offer and notices. (`no_package_depends_on_another_program_for_backups`).
*Enforced:* `ledger_store::backup::how_to_get_git`,
`ledger_store::backup::Git::find`.
*Checked:* `ledger-store` unit tests in `backup.rs`
(`a_missing_git_says_how_to_get_it`,
`the_mac_stub_is_not_a_git_until_the_developer_tools_are_there`);
`ledger-cli` `tests/packaging.rs`
(`the_linux_packages_depend_on_git_and_none_carries_one`).
**WB-pkg-5 The Connect page can write a one-click Claude desktop extension **WB-pkg-5 The Connect page can write a one-click Claude desktop extension
for a company.** The "Claude desktop app" row has one button. It makes the for a company.** The "Claude desktop app" row has one button. It makes the
+2 -2
View File
@@ -211,7 +211,7 @@ footer { padding: 72px 0 48px; color: var(--faint); font-size: 14px; display: fl
<p class="sub">QuickBooks rents you access to your own financial history, raises the rent every year, and makes leaving painful. You still do the bookkeeping yourself, in forms. wanderbooks turns that around.</p> <p class="sub">QuickBooks rents you access to your own financial history, raises the rent every year, and makes leaving painful. You still do the bookkeeping yourself, in forms. wanderbooks turns that around.</p>
<table class="vs"> <table class="vs">
<tr><th></th><th>wanderbooks</th><th>QuickBooks Online</th></tr> <tr><th></th><th>wanderbooks</th><th>QuickBooks Online</th></tr>
<tr><td>Where your books live</td><td>A folder on your computer, under git. Plain, documented files.</td><td>Intuit's servers. You get access while you pay.</td></tr> <tr><td>Where your books live</td><td>A folder on your computer. Plain, documented files.</td><td>Intuit's servers. You get access while you pay.</td></tr>
<tr><td>What it costs</td><td>Nothing. Free and open source, forever. It runs on the Claude or ChatGPT plan you already have.</td><td>A monthly subscription per company, and the price keeps rising.</td></tr> <tr><td>What it costs</td><td>Nothing. Free and open source, forever. It runs on the Claude or ChatGPT plan you already have.</td><td>A monthly subscription per company, and the price keeps rising.</td></tr>
<tr><td>Who does the bookkeeping</td><td>An AI bookkeeper: receipts, entries, categories, fixes, closes.</td><td>You do, in screens and forms. Or you pay someone.</td></tr> <tr><td>Who does the bookkeeping</td><td>An AI bookkeeper: receipts, entries, categories, fixes, closes.</td><td>You do, in screens and forms. Or you pay someone.</td></tr>
<tr><td>Receipts</td><td>Required over a threshold you set, enforced on every entry, shown right beside it.</td><td>Optional attachments.</td></tr> <tr><td>Receipts</td><td>Required over a threshold you set, enforced on every entry, shown right beside it.</td><td>Optional attachments.</td></tr>
@@ -304,7 +304,7 @@ footer { padding: 72px 0 48px; color: var(--faint); font-size: 14px; display: fl
<details><summary>Wait, what's an MCP server?</summary><p>MCP is the standard way AI tools like Claude Code and Codex plug into other software. wanderbooks is an accounting engine that speaks it: your AI calls its tools to draft entries, attach receipts, and run reports, and the engine enforces the accounting rules. The one-line installer sets it up; you never have to touch it.</p></details> <details><summary>Wait, what's an MCP server?</summary><p>MCP is the standard way AI tools like Claude Code and Codex plug into other software. wanderbooks is an accounting engine that speaks it: your AI calls its tools to draft entries, attach receipts, and run reports, and the engine enforces the accounting rules. The one-line installer sets it up; you never have to touch it.</p></details>
<details><summary>Do I need to be technical?</summary><p>You need to paste one command into a terminal, once. After that you talk to your bookkeeper in plain English, in Claude Code or Codex, and look at your books in the viewer whenever you like.</p></details> <details><summary>Do I need to be technical?</summary><p>You need to paste one command into a terminal, once. After that you talk to your bookkeeper in plain English, in Claude Code or Codex, and look at your books in the viewer whenever you like.</p></details>
<details><summary>How does it find my receipts?</summary><p>Give your AI access to your email (in Claude, an email connector like Gmail's or the Claude browser extension with your mail open) and ask. It searches for the vendor and amount, files one clean PDF per receipt, and attaches it to the entry. It asks before downloading anything, and it never types passwords or account numbers.</p></details> <details><summary>How does it find my receipts?</summary><p>Give your AI access to your email (in Claude, an email connector like Gmail's or the Claude browser extension with your mail open) and ask. It searches for the vendor and amount, files one clean PDF per receipt, and attaches it to the entry. It asks before downloading anything, and it never types passwords or account numbers.</p></details>
<details><summary>Where's my data, and what does the AI see?</summary><p>Your books are files in a private folder on your computer: a journal and your receipts. They back themselves up to a private git repository and a folder you choose. Nothing is uploaded to wanderbooks; there is no wanderbooks server. What your bookkeeper reads to help you goes to your AI provider (Anthropic or OpenAI), like any other conversation with it.</p></details> <details><summary>Where's my data, and what does the AI see?</summary><p>Your books are files in a private folder on your computer: a journal and your receipts. They back themselves up to a folder you choose (another disk, or one your cloud drive keeps in sync), and you can protect that backup with a passphrase. Nothing is uploaded to wanderbooks; there is no wanderbooks server. What your bookkeeper reads to help you goes to your AI provider (Anthropic or OpenAI), like any other conversation with it.</p></details>
<details><summary>What if the AI gets something wrong?</summary><p>Every posting is previewed before it happens. If something slips through, it's corrected the way accountants do it, with a reversing entry, so the mistake and the fix are both on the record. The engine itself refuses anything that doesn't balance, anything without a required receipt, and anything in a closed period.</p></details> <details><summary>What if the AI gets something wrong?</summary><p>Every posting is previewed before it happens. If something slips through, it's corrected the way accountants do it, with a reversing entry, so the mistake and the fix are both on the record. The engine itself refuses anything that doesn't balance, anything without a required receipt, and anything in a closed period.</p></details>
<details><summary>Is this real accounting, or a spreadsheet with an AI on top?</summary><p>Real double-entry accounting, with the rules enforced in code: exact decimal money, balanced entries, immutable posting, closes, depreciation, accrual or cash basis. Its statements are tested against hand-computed numbers, golden files, and property tests.</p></details> <details><summary>Is this real accounting, or a spreadsheet with an AI on top?</summary><p>Real double-entry accounting, with the rules enforced in code: exact decimal money, balanced entries, immutable posting, closes, depreciation, accrual or cash basis. Its statements are tested against hand-computed numbers, golden files, and property tests.</p></details>
<details><summary>Can I bring my history from QuickBooks or a spreadsheet?</summary><p>Yes. Export your chart of accounts, journal, and reports, and ask your bookkeeper to move you over. It rebuilds the history and compares every statement against the old system, to the cent, before calling it done. Keep the old system read-only until you've closed a month in wanderbooks.</p></details> <details><summary>Can I bring my history from QuickBooks or a spreadsheet?</summary><p>Yes. Export your chart of accounts, journal, and reports, and ask your bookkeeper to move you over. It rebuilds the history and compares every statement against the old system, to the cent, before calling it done. Keep the old system read-only until you've closed a month in wanderbooks.</p></details>