From 076ff8a286a71654fabb8b2bbf511a8186eedd70 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 7 Oct 2026 09:15:33 -0400 Subject: [PATCH] docs(storage): describe native offline helpers --- README.md | 5 ++++- robot-docs/migrations.md | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 224572ef4..00d885857 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,10 @@ Session IDs can be shortened to any unique prefix. Run `albedo --help` or `albedo COMMAND --help` for command options. To inspect disk usage without starting the daemon, run `albedo storage --json` -or `albedo storage --sessions`. To clean up local files, stop the daemon first: +or `albedo storage --sessions`. Offline database inspection and cleanup use the +local daemon executable without starting its server. Set `ALBEDO_DAEMON` to a +packaged executable or `ALBEDO_ROOT` to a source checkout. These storage commands +do not require Python. To clean up local files, stop the daemon first: ```sh albedo daemon --stop diff --git a/robot-docs/migrations.md b/robot-docs/migrations.md index a467ff751..ee02ae3e2 100644 --- a/robot-docs/migrations.md +++ b/robot-docs/migrations.md @@ -15,7 +15,7 @@ decision to stop supporting that upgrade path. | Legacy item-count compaction state | Rolling's lazy compatibility reader | [rolling tests](../test/harness/rolling_test.gleam) | | Older Python namespace snapshots | Kernel snapshot reader | [kernel state scenarios](../test/e2e/kernel_state_test.py) | | Flat provider configuration and relocated credentials | Provider configuration and credential migration | [settings scenarios](../test/e2e/settings_test.py), [startup integration](../test/e2e/integration_test.py), [credential migration](../test/e2e/credentials_test.py) | -| Older layouts inspected offline | Client storage diagnostic reader | [storage compatibility scenarios](../test/e2e/storage_test.py) | +| Older layouts inspected offline | Daemon storage helper compatibility reader | [storage compatibility scenarios](../test/e2e/storage_test.py) | These are groups within feature suites, not a separate test lane. The normal gate runs them. Compatibility with another running daemon build and provider @@ -31,7 +31,7 @@ extension-specific migration modules. `server.main` first claims `ALBEDO_HOME/daemon.lock` with `BEGIN EXCLUSIVE`. Offline cleanup in `cli/internal/storage` takes the same lock after confirmation, -before it revalidates candidates. Its Python helper holds ownership through file +before it revalidates candidates. Its Gleam helper holds ownership through file deletion and vacuum. Daemon startup refuses while maintenance owns the home, before it touches application storage. Neither owner commits the lock transaction, changes its journal mode, or replaces the lock file. Cleanup checks health for @@ -39,6 +39,23 @@ diagnostics; only exclusive ownership permits offline mutation. CLI cancellation or death stops the helper and releases ownership. Completed deletions remain deleted if later deletion or vacuum fails. +The client invokes `albedo-daemon storage inspect ` +and `albedo-daemon storage maintain ` through the same local executable +selection as daemon startup. `daemon/storage_cli` owns both helper modes and +dispatches before server startup. Inspection copies the database and WAL into +the client's private scratch directory, compares native file identities before +and after copying, then reads the snapshot without schema initialization or +migrations. It supports older layouts independently of the live projection. +The client removes scratch files and retains its filesystem accounting and +cleanup revalidation. Helper metadata uses the native timestamp resolution. + +Maintenance exchanges newline-delimited JSON with the client. It captures +candidate identities under the home lock, reports readiness, and waits for the +client's authorization after revalidation. An EOF watcher terminates the helper +VM during authorized work, including vacuum. Go keeps the pipe open until the +helper exits and accepts a result only with a successful exit. These helper +modes do not require Python or create a daemon discovery record. + `runtime.start` installs the extension registry before `server.prepare_storage`. for each installed extension, `extension.install` first calls its table initialiser, then applies its contributed `SchemaMigration` callbacks on the -- knotmirror 0.0.1