Skip to main content

Module adoption

Module adoption 

Source
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:

WhatFromWhy
Global Memory (global, non-system bundles) and their versionsevery channel store, newest winseach channel kept its own; the same entry written twice is one entry
Native memory and its versionsevery channel store, newest winsthe shared store has none; the entries are scattered over older channels
Accountsthis channel’s own isolated store and the newest same-branch predecessora 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§

TMP_COUNTER 🔒

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 from src into dst. 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 path holds 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 🔒