Skip to main content

AgentMemoryRuntimeInjector

Struct AgentMemoryRuntimeInjector 

Source
pub struct AgentMemoryRuntimeInjector { /* private fields */ }
Expand description

Ambient per-turn memory injection plus inbound defanging. Thin caller into the RecallCoordinator; cheap to clone, with per-session state shared across clones on purpose (budgets are per session, not per clone).

Implementations§

Source§

impl AgentMemoryRuntimeInjector

Source

pub fn new( provider: Arc<dyn AgentMemoryProvider>, config: AgentMemoryConfig, ) -> Self

Source

pub fn with_taint_tracker(self, taint: SessionTaintTracker) -> Self

Attach the §10.1 session taint tracker so the identity runtime’s delivery/reset hooks can keep session attribution authoritative.

Source

pub fn with_distiller(self, distiller: Arc<DistillerEngine>) -> Self

Attach the §8.4 Distiller so the identity runtime’s lifecycle paths can run pre-rotation extraction.

Source

pub fn with_steward(self, steward: Arc<StewardEngine>) -> Self

Attach the §8.5 Steward so the retire/delete paths can queue exit-interview harvests for the next dream.

Source

pub fn with_operator_resolver( self, resolver: Option<Arc<dyn OperatorResolver>>, ) -> Self

Install the §7.2 provisional operator resolver on the turn-path coordinator. Effective only with operator_scope = "provisional".

Source

pub fn with_mob_resolver( self, resolver: Option<Arc<dyn MobScopeResolver>>, ) -> Self

Install the §7.2 mob-scope resolver on the turn-path coordinator so injection and the selector compose the member’s bound mob scopes.

Source

pub fn on_session_compacted(&self, session_key: &str)

§9.1 as-built compaction reset: drops the session’s cross-turn dedup set, cumulative injection budget, and cached sweep. Driven by the gateway’s always-on member-event sink on CompactionCompleted.

Source

pub fn with_hygienist(self, hygienist: Arc<HygienistEngine>) -> Self

Attach the §8.6 Hygienist for the on-demand curation entry point.

Source

pub async fn hygiene_now( &self, identity: &AgentIdentity, session_key: &str, ) -> HygieneOutcome

§8.6 on-demand hygiene pass over session_key’s transcript. Never on a delivery path — callers treat it as an operator-initiated background action. No-op (Skipped) without a wired Hygienist.

Source

pub fn note_current_session(&self, identity: &AgentIdentity, session_key: &str)

Authoritative “identity is about to run in this session” hint from the delivery path — keeps taint attribution ahead of the async observe stream on runtime-mediated sends.

Source

pub fn note_session_generation( &self, identity: &AgentIdentity, session_key: &str, generation: u64, )

Bind the continuity generation to a session for the Distiller’s EvidenceRefs (§7.1 — reset boundaries are first-class; the generation is only knowable runtime-side).

Source

pub fn clear_taint_for_identity(&self, identity: &AgentIdentity)

Explicit taint clear for reset() — the deliberate clean-slate lifecycle path (§10.1 fresh-context boundary).

Source

pub fn note_reset_boundary(&self, session_key: &str)

Mark the outgoing session of a reset() so distillates over it land Quarantined (§8.4 reset boundary). Called before the detached reset distillation is spawned; the engine also marks defensively.

Source

pub async fn distill_before_rotation( &self, identity: &AgentIdentity, session_key: &str, cause: DistillCause, )

Pre-rotation distillation (§8.4 trigger (b)) for respawn/retire/ delete: bounded and best-effort — returns at the engine’s pre-rotation timeout so rotation never hangs on distillation. No-op without a wired Distiller.

Source

pub async fn drop_orphaned_session_scope( &self, session_key: &str, cause: DistillCause, )

Ask 2 GC: after distilling a permanently-orphaned session, reclaim its meerkat semantic-memory rows (respawn/reset mint a fresh id; delete discards it — the old scope is dead weight that every future build in the realm re-embeds). Best-effort; no-op without a wired distiller. MUST NOT be called for resumable retires.

Source

pub async fn note_identity_retired( &self, identity: &AgentIdentity, session_key: Option<&str>, cause: &str, )

§8.5 exit interviews: record a retired/deleted identity in the pending-harvest queue so the NEXT dream harvests its store. One fast local write, best-effort — rotation never fails on it. No-op without a wired Steward.

Source

pub fn spawn_rotation_distillation( &self, identity: &AgentIdentity, session_key: &str, cause: DistillCause, )

Detached distillation for the paths that must never wait on it (reset, resume fallback). The session store outlives the session, so the read stays valid after teardown.

Source

pub fn provider(&self) -> Arc<dyn AgentMemoryProvider>

Source

pub fn config(&self) -> AgentMemoryConfig

Source

pub async fn inject_for_turn( &self, identity: &AgentIdentity, session_key: Option<&str>, content: &ContentInput, ) -> Result<Vec<ContentInput>, AgentMemoryError>

Ambient per-turn injection. session_key scopes the cross-turn dedup and cumulative byte budget; without it only the per-assembly cap holds. Assemble the ambient per-turn recall as a separate injected_context body (meerkat 0.7.12 ask 1). Returns the vector to deliver alongside the user message; empty means inject nothing. See RecallCoordinator::inject_for_turn.

Source

pub fn defang_inbound( &self, identity: &AgentIdentity, content: &ContentInput, ) -> ContentInput

Neutralize reserved memory-envelope markers in inbound content (§9.1 anti-spoofing). The caller applies this to every non-Steer send before injection/delivery.

Trait Implementations§

Source§

impl Clone for AgentMemoryRuntimeInjector

Source§

fn clone(&self) -> AgentMemoryRuntimeInjector

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more