Expand description
Carry what channels kept to themselves into the shared store.
Auth is shared by every channel now (SPEC_SHARED_AUTH_ACROSS_CHANNELS_2026_10_03.md),
but until 2026-10-03 every non-stable channel isolated it, so real data sits
in channels/<ch>/identity-store.db files the shared store has never seen. On
the first shared boot this pass copies it across, read-only on the source:
| What | From | Why |
|---|---|---|
| Global Memory (global, non-system bundles) and their versions | every channel store, newest wins | each channel kept its own; the same entry written twice is one entry |
| Native memory and its versions | every channel store, newest wins | the shared store has none; the entries are scattered over older channels |
| Accounts | this channel’s own isolated store and the newest same-branch predecessor | a login belongs to the build that made it; adopting every channel’s would flood Connectors → Accounts with test accounts |
Everything else is left alone. Non-global bundles in particular are mostly per-agent bundles each channel made for itself (4,740 distinct ones across the owner’s 46 stores).
Idempotent, and deletions stick. A ledger (adoption-ledger.json in the
shared dir; a file, because a schema change to the shared store would stop an
older build opening it) records the keys already considered and each source’s
stamp. An item deleted afterwards is not put back, and a source that has not
changed is not reopened. An account row keeps its stored OAuthConfigDir
pointing at the source channel’s folder: the spawn path uses the stored dir,
so the login works at once, with no copy of the credentials.
Structs§
- Copied 🔒
- Inputs 🔒
- Ledger 🔒
- Report 🔒
- Counts for the boot log and the tests.
- Sources 🔒
- The sources for one pass. The predecessor is the newest other build of this
branch (same
local-<branch>-<hash>-prefix) whose store holds an account. - Spec 🔒
- How one table is copied.
- Stamp 🔒
- What a source file looked like when it was last fully processed: the database and its write-ahead log (a WAL-mode database’s newest writes live there).
Constants§
- BOOT_
BUDGET 🔒 - Longest a boot waits for the pass; what is left is picked up next boot.
- LEDGER_
FILE 🔒
Statics§
Functions§
- adopt 🔒
- Run one pass into
target. Never fails the boot: a source that cannot be read is counted and skipped, and a pass out of budget resumes next boot. - adopt_
accounts 🔒 - Accounts, from one source. Per-agent cloud credentials are not adopted: they belong to the MuxBus account the source channel signed in as, which need not be this channel’s, and they are provisioned again on first use.
- adopt_
global_ 🔒memory - Global Memory and its versions, from one source.
- adopt_
native_ 🔒memory - Native memory and its versions, from one source.
- build_
prefix 🔒 local-<branch>-<hash6>-<8 hex>→ its prefix up to and including the last-. A per-build channel’s name ends in an 8-hex build suffix; the part before it names the branch, so another build of the same branch shares the prefix.- copy_
table 🔒 - Copy
spec’s rows fromsrcintodst. Only columns both tables have are copied, so a source from an older or newer schema works. - discover_
sources 🔒 - has_
accounts 🔒 - Whether the store at
pathholds at least one account. - in_list 🔒
- load_
ledger 🔒 - modified 🔒
- ms 🔒
- open_
source 🔒 - quote_
ident 🔒 - quote_
lit 🔒 - run_
at_ 🔒boot - The boot entry point, for a channel running with shared auth.
- same_
file 🔒 - save_
ledger 🔒 - Write the ledger. Several channels share one machine now, so two boots can run at once: the file on disk is read again and merged first (keys only ever get added, so a union loses nothing another boot recorded), and the temp file is unique so two writers never interleave in one file.
- stamp_
of 🔒 - table_
cols 🔒 - value_
text 🔒