Expand description
Global Memory MuxAPI bodies, moved out of app_api/mod.rs unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md item 9).
Structs§
- Global
Memory 🔒Write Provenance - Caller-supplied provenance for a
globalmemory.writecall — same shape asMemoryWriteProvenanceabove; kept as a distinct type since callers are conceptually different (an agent writing to a workspace-wide list every other agent inherits, not its own private memory) even though the wire shape is identical.
Functions§
- append_
to_ 🔒global_ order append_to_orderon a store, for the window-side restore too.- append_
to_ 🔒order - Puts
bundle_idlast in the Global Memory order, as Memory → Global’s own “+ New section” does for a new entry and a restored one. A failed reorder is logged, not fatal: the entry is saved either way. - bundle_
version_ 🔒diff - The diff text
global_memory_diff_implreturns — a- name:/+ name:pair when the name changed (see that function’s doc comment for why), thenline_diffover the instructions. Shared with Memory → Global’sglobalmemory:diffWebSocket command (agent_handlers/bundle.rs) so the MCP tool and the UI can never render the same pair of versions two ways. - check_
reach 🔒 reachas a Global Memory write or the reach action takes it, or why not.- global_
memory_ 🔒diff_ impl - A line-based diff between two recorded versions of one Global Memory
entry (mirrors
memory_diff_impl). Both versions must belong toid— reagent P1 inmemory_diff_implfixed the identical “diff across two unrelated owners” gap for native memory; the same check applies here since aversion_idalone does not otherwise prove which bundle (and therefore whether a system-tier one) it came from. A name change is surfaced as its own two-line entry ahead of the instructions diff, sincecontent_hashis computed overname+instructionstogether (bundle_versions.rs’s owncontent_hashdoc comment) — a rename with unchanged body would otherwise produce a “no differences” instructions diff that silently hid the one thing that actually changed. Backs theGlobalMemoryDiffMCP tool. - global_
memory_ 🔒history_ impl - Version history for one Global Memory entry, newest first — metadata
only, no
name/instructions(mirrorsmemory_history_impl’s summary shape andglobal_memory_list_impl’s “no content” posture). Refuses a system-tier, blank, or non-global id viaload_ordinary_global_bundle— structurally the same exclusionlist/read/removealready apply, so there is no path here that can ever surface a system-tier row’s history. Backs theGlobalMemoryHistoryMCP tool. - global_
memory_ 🔒list_ impl - Every Global Memory entry Memory → Global shows — id/name/updated_at/system,
no content (mirrors
memory_list_impl’s summary shape), system rows first asbundle_list_globalorders them. System-tier rows are listed so an empty result means “nothing” and not “nothing you may touch” (the pane lists them too, and their content is already injected into every agent’s context); what stays structural is that read, write and remove refuse a system id.removedlists the entries taken out of Global Memory and not restored, most recent first, with when and by whom: each one’s id works withhistory,diffandrevert. Backs theGlobalMemoryListMCP tool. docs/specs/SPEC_GLOBAL_MEMORY_LIST_SYSTEM_ROWS_2026_10_02.md - global_
memory_ 🔒reach_ impl - Sets where an existing ordinary Global Memory entry goes, without touching its text:
fleet(pushed to every proven machine, last write wins) ormachine(stays here; a copy another machine pushes is skipped). Same ownership guards as write and remove. Backs thereachaction of the Memory tool. - global_
memory_ 🔒reaches - Every Global Memory entry’s reach, for the Memory pane. Backs
globalmemory:reach_list. - global_
memory_ 🔒read_ impl - Full content of one ordinary Global Memory entry by id. Refuses a
system-tier id, same reasoning as write. Backs the
GlobalMemoryReadMCP tool. - global_
memory_ 🔒remove_ impl - Demotes a Global Memory entry (clears
is_global) — matches Memory → Global’s own “Remove” semantics: the bundle row itself survives (still available in Memory → Bundles), only its Global Memory membership is cleared. Refuses a system-tier id, the blank singleton, or any id that wasn’t ALREADY a Global Memory entry before this call — same ownership guards asglobal_memory_write_impl, for the identical reason: bundle ids are enumerable viaPresetListregardless ofis_global. - global_
memory_ 🔒revert_ impl - Restores a Global Memory entry’s live
name/instructionsto a prior recorded version — same “revert never rewrites history, it records a new version” semantics asmemory_revert_impl(source: "revert", chained onto whatever the current latest version is). ReusesStore::bundle_upsert_with_version— the SAME primitiveglobal_memory_write_implalready uses — so the live row and its new version are written atomically, in one transaction, exactly as that method’s own doc comment requires (codex P2, PR #3237).agent_idis the TRUSTED caller identity (an agent’s realAGENTMUX_AGENT_ID, resolved byagentmux-mcpfrom its own env, never caller-suppliable) recorded aswritten_by— never inferred from anything in the request body.written_by_uidis recorded beside it: the request’sCallerUID (identity M4c-1),""when Unattributed. Backs theGlobalMemoryRevertMCP tool. - global_
memory_ 🔒write_ impl - Creates a new ordinary Global Memory entry, or updates an existing one
by
id. Backs theGlobalMemoryWriteMCP tool. - global_
memory_ 🔒write_ inner global_memory_write_impl, runningbefore_writewith the entry’s id (the existing one, or the new one) just before the entry is saved. If it fails, nothing is saved.- global_
memory_ 🔒write_ with_ reach_ impl global_memory_write_impl, with the entry’s reach set when the caller gave one. The reach is checked first, so a bad one writes nothing, and it is set before the entry is saved: an entry with no reach row counts asfleet, so setting it afterwards would leave amachineentry visible to the fleet in between, and for good if setting it then failed.- load_
ordinary_ 🔒global_ bundle - Loads
id’s bundle and refuses it unless it is (a) not the blank singleton, (b) not a system-tier entry, and (c) a Global Memory entry (is_global) or one removed from Global Memory and not restored since (its newest version is aremoveone, which only a removal writes) — the guardglobal_memory_write_impl/global_memory_remove_implapply, plus the removed case so a removal can be inspected and undone. Bundle ids for EVERY bundle in the system (not just global ones) are enumerable viaPresetList(reagent P0/P1, PR #3237) — without this, an agent could point any of these three new routes at another agent’s private preset, or at AgentMux’s own system-tier entries, and read/restore content that was never meant to be reachable through this API. - reach_
of 🔒 - Where an entry goes:
fleet(every proven machine, last write wins) ormachine(this one only). AgentMux’s own system entries never leave the machine. - recorded_
provenance 🔒 - What a write through the agent route records as its source and detail. srv names the source: the labels it uses
itself for who wrote (
human,armory-ui,revert,jekt,agent) are never taken from the caller, so a caller cannot have its write read as the person’s or as a revert. The caller’s own label stays what it is for a note (agent_inferredwhen it gives none), and one of those reserved words moves into the detail asclaimed_source. - removed_
global_ 🔒entries - The entries taken out of Global Memory and not restored, most recently
removed first, each with the
removeversion that records it: who removed it and when. Shared bylist’sremovedand the window’sglobalmemory:removed. - version_
meta_ 🔒json - A version’s metadata as JSON:
GlobalMemoryVersionMeta, the same shapeglobalmemory:historysends the pane, with noname/instructions. - with_
peers_ 🔒not_ in_ step - A write’s answer, with the machines the last sync did not bring up to date (one that could not be
reached, one that kept an entry back and why): this write may not reach them either. Said here,
not only in
list. Nothing is added when every machine is in step.
Type Aliases§
- Before
Write 🔒 - What a write does with the entry’s id once it is known and before the entry is saved.