Expand description
One Global Memory for the fleet (task #12439, “agents operate other machines”, section 4.6).
A Global Memory entry with scope fleet (see storage::bundle_scope) is
pushed to every proven machine with the remote ops memory.global.put and
memory.global.remove, and a machine lists what it holds with
memory.global.list so the other side can catch it up. This module is the
machine-independent part: what an entry carries over the wire, which write
wins, and applying a received write to the local store. The transport that
carries the ops is server::remote_ops.
Last write wins. An entry’s updated_at is stamped by the machine that
wrote it and kept as is on every machine that applies it, so all machines
agree on it. The newer updated_at wins; on a tie the larger content hash
wins, so every machine picks the same side. A removal is a write too: it
carries the time it happened and wins or loses the same way, so an entry
removed on one machine and edited later on another comes back.
What is not carried. skills, provider and model name things that
exist per machine, sort_order is a position on one machine’s list, and
mcp_servers is always empty. AgentMux’s own entries (system tier, seed-
ids) and the blank bundle never leave or enter. A write for an entry that is
machine scope here is skipped, so a machine keeps what its owner kept. The
exception is an entry whose machine row is only the default the scope table
gave what existed when it was made (storage::bundle_scope): a newer write
replaces that one, the entry follows the fleet from then on, and the old text
stays in its history. The write is answered adopted so the sender, and this
machine’s sync state, can say which entries changed.
No echo. A write applied from another machine is recorded with source
FLEET_SOURCE; the push on change (a later PR) does not push those back.
Structs§
- Actor
- Who a write is attributed to on this machine: the remote agent as
slug@machine, and its uid when the transport knows it. Never the operator. - Fleet
Entry - A Global Memory entry as it travels between machines:
memory.global.put’s params. - Fleet
Meta - What a machine holds for one entry, without its text:
memory.global.list’s rows. - Fleet
Removal memory.global.remove’s params.
Enums§
- Applied
- Fleet
Error - Outcome
- Push
- One thing to send a machine that is behind.
- Skipped
Constants§
- FLEET_
SOURCE - The
db_bundle_versions.sourceof a write that came from another machine.
Functions§
- apply_
put - Apply a write received from another machine.
- apply_
remove - Apply a removal received from another machine.
- entry_
for_ push - One entry to send, if it follows the fleet and is still Global Memory.
- fingerprint
- A short fingerprint of what a machine lists: it changes when an entry is added, edited or removed, so the sync only talks to a peer when there is something new for it.
- list_
meta - The entries that follow the fleet, including those removed here since:
memory.global.list’s answer. - removal_
for_ push - The removal of
idto send, with who removed it here. - to_push
- What to send a machine, given what each side lists, so it catches up: the entries it lacks or holds an older copy of, and the removals it has not seen. Newest first. What the other machine holds newer is that machine’s to push when it sees this one.