Skip to main content

Module native_memory

Module native_memory 

Source
Expand description

Structured replacement for the old Markdown-backed native memory store. All existing entry points share root/store.sqlite3 with the Context Lens. MEMORY.md paths are legacy anchors, NOT an alternative source of truth. Capture is candidate-only. Human review is through authenticated Lens routes.

Structs§

MemoryHit
NativeMemoryStore

Enums§

MemoryScope

Functions§

native_prompt_block
Compose the user-memory prompt block for the native store resolved from a memory path. Single seam used by the engine, the TUI system-prompt builder, and the context report so all three describe the same bytes. Returns None when memory is disabled, the path is not a native memory/global/MEMORY.md layout, or there is nothing worth injecting. The block is a codewhale.memory.context.v1 envelope: memory entries are untrusted evidence, never instructions.
native_prompt_block_traced
The engine’s session-boundary variant: identical bytes plus a durable prepared context receipt under the session’s trace, so the Context Lens can show what was assembled for it. Diagnostics and previews keep using native_prompt_block — a receipt is only meaningful when it names a real session. The receipt never gates the packet.