Skip to main content

Module store

Module store 

Source
Expand description

Registry — file-per-agent CRUD on <root>/<uuid>.json with a sibling retired/<uuid>.json tombstone tree.

Concurrency: cross-process safety comes from filesystem atomic rename. The internal Mutex only serializes partial-merge writes from threads inside the same srv so a v1 binary touching last_launched_at_ms doesn’t race itself.

Structs§

Registry

Enums§

RecordScope
Which records an operation is allowed to touch.
RegistryError
SessionWrite 🔒
Merge an in-memory record into an on-disk file’s raw JSON, preserving fields beyond this binary’s struct shape.

Functions§

merge_for_write 🔒
merge_known 🔒
Overwrite target‘s top-level keys with updates’ keys. Keys in target that aren’t in updates are preserved. Recurses into the data sub-object so future fields inside data also survive.
read_and_validate 🔒
records_for_agent 🔒
Paths of the *.json files under dir whose record belongs to agent_id — by file key (instance id) or by definition_id. A missing directory yields nothing (the retired/ tree is created on open, but a caller may point at a tree that predates it).
to_pretty 🔒