Expand description
One-shot SQLite → file-registry migration for named instances.
Runs at most once per <registry_root>/.migrated_from_sqlite marker;
idempotent and read-only on every SQLite it touches.
P0.3 re-roots the registry to the GLOBAL ~/.agentmux/shared/agents/ registry/, so this scan is generalized from “the current channel’s
per-version DBs” to every channel and every dev branch on the machine:
<home>/channels/<ch>/versions/<v>/data/db/objects.db (installed/portable)
<home>/dev/<branch>[/<sub>]/data/db/objects.db (dev)Workspace anchoring. Agent workspaces live GLOBALLY at
<home>/agents/<name> (verified on disk: real working_directory values
are ~/.agentmux/agents/<name>, e.g. …/agents/mazs-0527n), independent of
channel/version. [row_to_record] therefore strips each row’s
working_directory against the global <home>/agents root FIRST, then
falls back to this row’s own source-channel agents dir (channels/<ch>/agents,
or <instance_dir>/agents for dev) for any legacy row that genuinely lived
in-channel — each source DB still carries that per-source dir. The two
subtrees are disjoint, so the fallback never mis-maps a global workspace.
The chosen base is stored absolute in the record, so a reader in ANY channel
round-trips source_agents_base.join(working_dir) back to the real
workspace. See docs/specs/SPEC_CROSS_CHANNEL_AGENT_PERSISTENCE_2026-06-13.md §11.5.
Structs§
- Migrate
Stats - Outcome stats — surfaced in the marker file + the srv log.
- Source
Backfill Stats - Outcome of
backfill_source_bases_once.
Functions§
- backfill_
source_ bases_ once - One-shot backfill of
source_agents_baseonto registry records written before schema v3 — i.e. by P0.3b’s global migration (#1389) or any pre-P0.4 live mirror. - enumerate_
objects_ dbs - Public variant of
enumerate_sourcesthat returns only theobjects.dbpaths, without the per-source agents-root pairing. Used bym0011_shared_store_backfillto seedstore.dbfrom all channels rather than just the current instance’s DB. - migrate_
from_ sqlite_ once - Scan every channel + dev
objects.dbunderhomeand populate the shared registry. Skipped if the marker file exists. Never overwrites an existing registry record (idempotency + respect for newer-written data). The SQLite files are opened read-only — never modified.