Expand description
Operator Config seed engine: keeps AgentMux’s own shipped Global Memory
entries (is_system=1 rows — see docs/specs/SPEC_GLOBAL_MEMORY_
SYSTEM_TIER_2026_08_24.md for the isolation, docs/specs/SPEC_SYSTEM_
TIER_GLOBAL_MEMORY_SEEDING_2026_09_15.md for this module’s own design)
in sync with a compiled-in manifest, every startup — not a one-time
seed like mcp_seed.rs, because stale Operator Config
(describing a since-changed MuxAPI) would actively mislead an agent
rather than merely being absent.
The reseed decision (§3.3 of the spec above) is ownership-based, not a
field diff like agent_seed.rs’s own reseed_if_needed: a human can
edit an Operator Config entry today via Memory → Global’s
editor (GlobalMemoryFullView), and the entire value of an entry is
its content, so
there is no separate “identity field” to diff against safely. Instead
Store::bundle_reseed_system_if_owned looks at the latest db_bundle_ versions row for each manifest id — if written_by is this module’s
own reserved identity (WRITTEN_BY), it’s safe to overwrite; if it’s
anything else (an armory-ui human edit), the manifest update is
skipped and logged rather than clobbering it. That check-and-write
happens atomically at the Store layer, not as two separate calls
composed here — see that method’s own doc comment (ReAgent P1, PR
#3244, a check-then-act race in an earlier version of this module).
“In sync” also covers removal: prune_entries_removed_from_manifest
deletes any seeder-owned row whose manifest entry a later AgentMux
release dropped or renamed, so a retired Operator Config note doesn’t
keep being injected into every future agent forever (Codex P2, PR
#3244) — mirroring agent_seed.rs’s own “remove a seeded agent not in
the manifest” behavior. A human-edited row meets the same fate as
everywhere else in this module: left alone, never deleted out from
under the human who edited it.
Constants§
- WRITTEN_
BY - The reserved
written_byidentity this seeder stamps on every version it writes. Never used by any other caller — an agent’s own write stamps its realAGENTMUX_AGENT_ID, a human edit in Memory stamps"armory-ui"(bundle.rs’supsertsystemmemoryhandler, viabundle_ upsert_system_with_version) — so seeing this exact value on the latest version is what tellsbundle_reseed_system_if_ownedthat nothing but AgentMux itself has touched the row since.
Functions§
- agent_
kind - The kind of agent a Global Memory entry can be targeted at:
"container"for a Docker agent,"host"for everything else (agent_typeis"host","standalone"or"container"; the block’sagentModecarries the same value, defaulting to"host"). - agent_
kind_ of_ block - The
agent_kindof the agent onblock_id, orNonewhen the block can’t be read, for a caller that would rather say nothing than guess (the LAN fleet feed’sagent_kinds). - agent_
mode_ of_ block - The
agentModeof the agent onblock_id, for the delivery paths that know only the block (the SessionStart hook,globalmemory:sections)."host"when the block or the key is missing — srv’s default foragentModeeverywhere else. - auto_
seed_ on_ startup - Run Operator Config seeding on startup. Unconditional, every boot, no
feature flag — called from
bootstrap/stores.rsnext toagent_seed’s own call. - global_
bundles_ for_ agent - Global Memory narrowed to what an agent of
agent_modeis given: drops a system entry whose manifest entry targets other agent kinds. Workspace entries and system entries this build’s manifest doesn’t know always stay.