Skip to main content

Module mem

Module mem 

Source
Expand description

Multi-mem routing, visibility filtering, mem config.

Writable/visible mem tracking. The engine loads multiple mems; some may be read-only (from –read-mem paths or JSON imports).

The router is structured as a snapshot (MemRouterSnapshot) — a Clone-able value that the engine holds behind an Arc. Lifecycle operations mutate by cloning the snapshot, editing the clone, and swapping the Arc pointer on Engine. Readers that hold an Arc before the swap observe the pre-swap snapshot for their lifetime; no torn reads are possible. The MCP-level memstead_mem_create / memstead_mem_delete tools flip state at runtime.

Structs§

MemRouterSnapshot
Mem configuration for the engine runtime — cloneable snapshot.
WritableEntry
Per-writable-mem origin + directory payload held inside MemRouterSnapshot. Cloned along with the snapshot on every lifecycle mutation; clone cost is O(1).

Enums§

MemOrigin
Provenance record attached to every writable-mem registration.

Constants§

MEM_META_DIR
The per-mem engine-internal directory under a folder mem’s root (<mem_root>/.memstead/config.json, changes.jsonl). Defined in memstead-schema (mem-config loading lives there); re-exported here as the mem-level home for the concept. The per-mem engine-internal directory under a folder mem’s root — <mem_root>/.memstead/ holds config.json and changes.jsonl. Defined here (rather than in memstead-base) because mem-config loading lives in this crate and memstead-base depends on it; memstead-base re-exports the constant for downstream consumers. Distinct from the workspace store directory (memstead_base::WORKSPACE_STORE_DIR) and from the in-zip member paths inside sealed archives (ARCHIVE_META_DIR), which are a separate on-disk format and never use this constant.

Functions§

is_visible
Convenience: check if an entity is visible. Returns true if router is None (no filtering).
is_writable
Convenience: check if a mem is writable. Returns true if router is None.