Skip to main content

Module roster

Module roster 

Source
Expand description

Mem membership follows reload-before-operation.

Content drift is probed per operation (super::Engine::reload_if_stale compares each mount’s branch tip with the head it last loaded). Membership used to be fixed at boot: a mem registered or unregistered by another process (the CLI, a sibling server) stayed invisible, or kept being served, until a restart — on 2026-09-02 a ui-api served a retired mem for hours. This module is the membership half of the same discipline: before each operation the engine compares a fingerprint of the mount roster (.memstead/state/mounts.json) with the one it booted or last reconciled on, and on a change mounts the new entries cold under the boot quarantine rules, unmounts the gone entries atomically, re-scans the schema sources, and reports the change (MEM_ROSTER_CHANGED) so an agent drops the cached hashes of the mems that left.

The probe is a stat plus, only when size or mtime moved, a hash of the file — the same cost band as the branch-tip probe, never a boot.

Structs§

RosterChange
One applied roster reconciliation.
RosterFingerprint
What the engine last saw of the roster file: size and mtime for the cheap comparison, the content hash for the decision.

Type Aliases§

RosterCallback
Callback shape for roster subscribers, mirroring super::events::EventCallback.
RosterChangedEvent
The event a roster subscriber receives — the applied change.