Expand description
Split out of the single-file bootstrap module unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md §4.3).
Structs§
- Stores
- Output of
open_stores_and_migrate— every store/log handle the rest of bootstrap andAppStateneed.
Functions§
- carry_
forward_ 🔒or_ exit carry_forward_or_stopfor the start path: a copy that failed while an older version has data is NOT a fresh start. With no launcher to show a dialog (this path is the headless and hosted one), the person would see an empty workspace while the previous version’s folder still holds their data. srv stops, says why, and leaves that folder as it was.- carry_
forward_ 🔒or_ stop - The copy-forward of the previous version’s data before this version’s first start:
Ok(true)when it was copied,Ok(false)when there was nothing to copy (a first start, or this version already has data: a fresh start on purpose), andErrwith the message to stop with when an older version has data and copying it failed. - load_
config - Step 2: Parse CLI args and build config. Dispatches the
migratesubcommand (and exits) before touching AUTH_KEY-gated config. - migrate_
data_ 🔒dir - The data folder
migrateworks on: the one the daemon opens given the same environment. The daemon turns its data folder intoAGENTMUX_DATA_HOMEand opensbase::get_mux_db_dir(), which resolves throughagentmux_root(), whereAGENTMUX_HOME_OVERRIDEcomes first, except for a data folder inside it (an isolated instance’s version folder, task #3569). Without the same resolution, the launcher’smigrate --prepareunder a home override migrated the version’s folder while srv’s boot check read<override>/db, and srv never started (Korp@narko, after #5252). - open_
stores_ and_ migrate - Step 4: Initialize backend (matching Go cmd/server/main-server.go:374-590). Sets up the data directory, runs in-process migrations, opens every SQLite-backed store, attaches the shared/global registries, and performs the various one-time startup seed/repair passes.
- open_
work_ 🔒store - The stores the work queue and scheduled jobs use. Installed and
task packagebuilds share the host’s (the identity store and the shared store, as before); atask devbuild gets awork-store.dbof its own, so it never reads or changes the operator’s real queue or jobs. If that store can’t be opened srv exits, as it does forobjects.db: falling back to the host’s files would be the leak this exists to close. - prepare_
in_ 🔒process - What an unsupervised srv does before opening its stores: copy a previous
version’s data forward, snapshot, and run pending migrations (the same
work
agentmux-srv migrate --preparedoes for the launcher). - restore_
repaired_ 🔒history - After a repair of the shared store (
filestore::repair): put back, from the per-channel copies of it, the conversation of each agent whose zone lost rows. Runs inside the repair, before the store is opened for use.