pub struct NativeMemoryStore { /* private fields */ }Implementations§
Source§impl NativeMemoryStore
impl NativeMemoryStore
pub fn new(root: impl Into<PathBuf>) -> Self
pub fn root(&self) -> &Path
pub fn global_path(&self) -> PathBuf
pub fn index_path(&self) -> PathBuf
pub fn from_global_path(path: &Path) -> Option<Self>
pub fn from_memory_anchor(path: &Path) -> Self
pub fn owner_scope() -> Scope
pub fn workspace_scope(id: &str) -> Result<Scope>
pub fn workspace_id(workspace: &Path) -> Result<Option<String>>
pub fn open_structured(&self) -> Result<Store>
pub fn remember( &self, scope: MemoryScope, workspace_id: Option<&str>, note: &str, ) -> Result<MemoryHit>
Sourcepub fn remember_reviewed(
&self,
scope: MemoryScope,
workspace_id: Option<&str>,
note: &str,
) -> Result<MemoryHit>
pub fn remember_reviewed( &self, scope: MemoryScope, workspace_id: Option<&str>, note: &str, ) -> Result<MemoryHit>
Authenticated operator surfaces (POST /v1/memory, the Lens remember
action): the explicit request IS the review, so the capture is promoted
in the same call, exactly as Action::Remember does. Model-reachable
paths must keep using remember, which can only propose a candidate.
pub fn revise( &self, scope: MemoryScope, workspace_id: Option<&str>, from: &str, to: &str, evidence: &str, ) -> Result<MemoryHit>
pub fn prompt_block( &self, workspace: &Path, max_entries: usize, max_chars: usize, ) -> Result<Option<String>>
Sourcepub fn prompt_block_traced(
&self,
workspace: &Path,
session_id: &str,
max_entries: usize,
max_chars: usize,
) -> Result<Option<String>>
pub fn prompt_block_traced( &self, workspace: &Path, session_id: &str, max_entries: usize, max_chars: usize, ) -> Result<Option<String>>
Like prompt_block, but the packet is prepared through the engine’s
durable receipt path: memory_contexts records which bytes and memory
revisions were assembled, under this session’s trace. The request key is
bound to the recall inputs, so an identical rebuild is idempotent while
changed inputs mint a new receipt. A receipt records preparation only —
append/dispatch acknowledgements remain the engine’s to make.
Receipt failure falls back to the same packet bytes without one: the receipt is observability, never a precondition for shipping context.
Sourcepub fn session_start(&self, workspace: &Path, session_id: &str) -> Result<usize>
pub fn session_start(&self, workspace: &Path, session_id: &str) -> Result<usize>
Run the session-start boundary for session_id. The hook plan maps it
to ReconcilePendingOperations, realized here as detection — contexts
this session prepared but never saw dispatch-acknowledged — because the
store owns the receipts and only a host can replay them. Completion is
recorded durably, so a restarted session reconciles once.
Returns the number of interrupted contexts found.
pub fn search(&self, query: &str, limit: usize) -> Result<Vec<MemoryHit>>
pub fn search_for_workspace( &self, workspace: &Path, query: &str, limit: usize, ) -> Result<Vec<MemoryHit>>
Sourcepub fn search_in_workspace(
&self,
workspace_id: Option<&str>,
workspace: &Path,
query: &str,
limit: usize,
) -> Result<Vec<MemoryHit>>
pub fn search_in_workspace( &self, workspace_id: Option<&str>, workspace: &Path, query: &str, limit: usize, ) -> Result<Vec<MemoryHit>>
Self::search_for_workspace for a caller that already resolved the
workspace’s memory identity.