Skip to main content

Module store

Module store 

Source

Structs§

MemoryDescriptor
Bounded search result: descriptor + snippet, NEVER the full body (full content requires an exact fetch_exact_in).
MemoryProvenance
Provenance of a memory record (spec §9.5).
MemoryQuery
MemoryRecord
NewMemoryRecord
Input for store_record_in — explicit provenance, sensitivity, and retention (spec §9.5: nothing is stored with implicit metadata).
ProjectMemoryQuery
Project-scoped search query. Limits clamp to the hard caps.
ProjectScope
Host-resolved project identity: the canonical workspace root, digested into a stable scope key. The HOST constructs this from trusted execution context — it is never accepted solely from model-authored arguments.

Enums§

MemoryError
MemoryRetention
Retention class of a memory record (consumed by spec §9.7 retention).
MemorySensitivity
Sensitivity class of a memory record (spec §9.5). Enforcement at the model-visibility boundary lives in the memory tools: Secret bodies are never returned to model context.

Constants§

DEFAULT_LIMIT
Default per-query record cap.
DEFAULT_SEARCH_LIMIT
Default search result count.
DEFAULT_SNIPPET_BYTES
Default snippet bytes per descriptor.
MAX_CONTENT_BYTES
Maximum content length per record (UTF-8 byte length).
MAX_SEARCH_LIMIT
Hard cap on search results per call.
MAX_SNIPPET_BYTES
Hard cap on snippet bytes per descriptor.

Functions§

append
Append one record. Validates namespace, content size. Atomic per-line via O_APPEND.
append_to
fetch_exact_in
Fetch exact record ids within a project scope. EVERY id must resolve in this scope or the whole call fails closed with MemoryError::NotFound — other projects’ ids are indistinguishable from unknown ids.
forget_in
Tombstone one record in a project scope (append-only forget). Fails closed with MemoryError::NotFound for unknown, already-tombstoned, or other-project ids.
list_namespaces
List existing namespaces under the memory dir.
memory_dir
Path to the memory directory under base. Caller creates dirs lazily.
memory_dir_in
Memory directory under an explicit base (test/tool seam).
new_record
Build a record with now_ms() timestamp.
now_ms
Current Unix epoch in milliseconds.
query
Query records in a namespace, applying filters, returning most-recent-first up to limit.
query_in
search_project_in
Project-scoped bounded search: descriptors + snippets, most recent first, hard-capped result count and snippet bytes.
store_record_in
Store one record in a project scope: assigns a stable mem-<uuid> id, binds the scope key, and appends to the project namespace.