Skip to main content

Store

Struct Store 

Source
pub struct Store { /* private fields */ }

Implementations§

Source§

impl Store

Source

pub fn record_completed_hook( &self, access: &Access, scope: &Scope, event: &HookEvent, ) -> Result<bool>

Durable deduplication of COMPLETED host hooks. This does not execute the plan, promise exactly-once external effects, or install an OS observer.

Source§

impl Store

Source

pub fn preferences(&self, access: &Access, id: &str) -> Result<Preferences>

Source

pub fn set_preferences( &self, access: &Access, id: &str, expected: i64, pinned: bool, suppressed: bool, ) -> Result<Preferences>

A pin affects context packing; it never bypasses validity, scope or review. Suppression affects future recall only, not context already sent.

Source

pub fn lens_snapshot( &self, access: &Access, trace: Option<&str>, after: Option<&str>, limit: usize, snapshot: &Snapshot, ) -> Result<LensSnapshot>

Source

pub fn memory_as_of( &self, access: &Access, id: &str, known_at: i64, valid_at: i64, ) -> Result<HistoricalMemory>

Two clocks: status known by known_at, fact valid at valid_at. Later supersession is not leaked into historical status. Forgotten content is unavailable at every cutoff. Migrated stores expose only known history.

Source

pub fn context_packet( &self, access: &Access, query: &Recall, counter: &dyn TokenCounter, budget: &ContextBudget, ) -> Result<(RecallReport, ContextPacket)>

The read-only half of prepare_context: filtered recall plus explicit pins, compiled into a packet — with no receipt recorded. Host surfaces that assemble the same bytes but have no session scope to attest (previews, reports, frozen prompts) must use this so the traced and untraced paths can never diverge on pin membership or packet shape.

Source

pub fn prepare_context( &self, access: &Access, context_scope: &Scope, trace: &str, request_key: &str, query: &Recall, counter: &dyn TokenCounter, budget: &ContextBudget, ) -> Result<PreparedContext>

Called by the host at a meaningful retrieval boundary, not every token. Idempotent within a trace + host request key. Text is returned, not logged.

Source

pub fn preflight_context( &self, access: &Access, id: &str, packet_hash: &str, snapshot: &Snapshot, ) -> Result<()>

Before-action gate. The host must serialize this check and append/dispatch against mutations within its single owner. The acknowledgement is separate.

Source

pub fn acknowledge_append( &self, access: &Access, id: &str, packet_hash: &str, history_sequence: i64, snapshot: &Snapshot, ) -> Result<()>

Invoke ONLY after the engine has durably appended these exact packet bytes. An error means missing acknowledgement, not permission to append twice.

Source

pub fn acknowledge_dispatch( &self, access: &Access, id: &str, packet_hash: &str, transport_key: &str, snapshot: &Snapshot, ) -> Result<()>

Invoke after a transport dispatch. Does not claim provider acceptance, successful execution, useful recall, or causal attribution of an outcome.

Source

pub fn context_receipts( &self, access: &Access, trace: Option<&str>, snapshot: &Snapshot, ) -> Result<Vec<ContextReceipt>>

Source

pub fn event_page( &self, access: &Access, after: i64, limit: usize, ) -> Result<EventPage>

Metadata-only Whalesong event-v1 export. UUIDs/hashes/timing are linkable, not anonymous. No body/title/evidence URI/query/embedding enters the feed.

Source§

impl Store

Source

pub fn numeric_id(&self, access: &Access, id: &str) -> Result<i64>

Source

pub fn get_numeric(&self, access: &Access, id: i64) -> Result<Memory>

Source

pub fn replacement_of( &self, access: &Access, id: &str, ) -> Result<Option<Memory>>

Source

pub fn local_scope_inventory(&self, access: &Access) -> Result<Vec<Scope>>

Explicit local-maintenance inventory, not a model-facing cross-repo read. Requires the user scope plus Maintenance and returns no source text.

Source§

impl Store

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self>

Source

pub fn in_memory() -> Result<Self>

Source

pub fn in_memory_with_clock( clock: impl Fn() -> i64 + Send + Sync + 'static, ) -> Result<Self>

Source

pub fn timestamp(&self) -> i64

Source

pub fn freshness( &self, access: &Access, memory: &Memory, snapshot: &Snapshot, ) -> Result<Freshness>

Validate the complete provenance chain, not just this record’s own hashes.

Source

pub fn list( &self, access: &Access, after: Option<&str>, limit: usize, ) -> Result<Vec<Memory>>

Source

pub fn dependency_paths(&self, access: &Access) -> Result<Vec<String>>

Source

pub fn status(&self, access: &Access) -> Result<Value>

Source

pub fn set_embedding( &mut self, access: &Access, id: &str, expected_hash: &str, embedding: &Embedding, ) -> Result<()>

Source

pub fn reindex(&mut self, access: &Access) -> Result<()>

Source

pub fn export_jsonl(&self, access: &Access, output: impl Write) -> Result<usize>

Source

pub fn expire(&mut self, access: &Access) -> Result<usize>

Mark active expired records and their dependents stale. Expiry is already enforced in recall; correctness does not depend on scheduling this sweep.

Trait Implementations§

Source§

impl MemoryBackend for Store

Source§

fn capture( &mut self, access: &Access, request: &str, draft: Draft, ) -> Result<CaptureReceipt>

Source§

fn get(&self, access: &Access, id: &str) -> Result<Memory>

Source§

fn approve( &mut self, access: &Access, id: &str, revision: i64, validation: Option<&ValidationReceipt>, snapshot: &Snapshot, ) -> Result<Memory>

Source§

fn reject(&mut self, access: &Access, id: &str, revision: i64) -> Result<Memory>

Source§

fn supersede( &mut self, access: &Access, old: (&str, i64), new: (&str, i64), validation: Option<&ValidationReceipt>, snapshot: &Snapshot, ) -> Result<Memory>

Source§

fn forget( &mut self, access: &Access, id: &str, revision: i64, ) -> Result<ForgetReport>

Source§

fn recall(&self, access: &Access, query: &Recall) -> Result<RecallReport>

Source§

fn save_checkpoint( &mut self, access: &Access, draft: CheckpointDraft, expected_revision: Option<i64>, snapshot: &Snapshot, ) -> Result<Checkpoint>

Source§

fn resume( &self, access: &Access, scope: &Scope, key: &str, snapshot: &Snapshot, ) -> Result<Resume>

Auto Trait Implementations§

§

impl !Freeze for Store

§

impl !RefUnwindSafe for Store

§

impl !Sync for Store

§

impl !UnwindSafe for Store

§

impl Send for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.