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
impl AgentMemoryRuntimeInjector
pub fn new( provider: Arc<dyn AgentMemoryProvider>, config: AgentMemoryConfig, ) -> Self
Sourcepub fn with_taint_tracker(self, taint: SessionTaintTracker) -> Self
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.
Sourcepub fn with_distiller(self, distiller: Arc<DistillerEngine>) -> Self
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.
Sourcepub fn with_steward(self, steward: Arc<StewardEngine>) -> Self
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.
Sourcepub fn with_operator_resolver(
self,
resolver: Option<Arc<dyn OperatorResolver>>,
) -> Self
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".
Sourcepub fn with_mob_resolver(
self,
resolver: Option<Arc<dyn MobScopeResolver>>,
) -> Self
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.
Sourcepub fn on_session_compacted(&self, session_key: &str)
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.
Sourcepub fn with_hygienist(self, hygienist: Arc<HygienistEngine>) -> Self
pub fn with_hygienist(self, hygienist: Arc<HygienistEngine>) -> Self
Attach the §8.6 Hygienist for the on-demand curation entry point.
Sourcepub async fn hygiene_now(
&self,
identity: &AgentIdentity,
session_key: &str,
) -> HygieneOutcome
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.
Sourcepub fn note_current_session(&self, identity: &AgentIdentity, session_key: &str)
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.
Sourcepub fn note_session_generation(
&self,
identity: &AgentIdentity,
session_key: &str,
generation: u64,
)
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).
Sourcepub fn clear_taint_for_identity(&self, identity: &AgentIdentity)
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).
Sourcepub fn note_reset_boundary(&self, session_key: &str)
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.
Sourcepub async fn distill_before_rotation(
&self,
identity: &AgentIdentity,
session_key: &str,
cause: DistillCause,
)
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.
Sourcepub async fn drop_orphaned_session_scope(
&self,
session_key: &str,
cause: DistillCause,
)
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.
Sourcepub async fn note_identity_retired(
&self,
identity: &AgentIdentity,
session_key: Option<&str>,
cause: &str,
)
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.
Sourcepub fn spawn_rotation_distillation(
&self,
identity: &AgentIdentity,
session_key: &str,
cause: DistillCause,
)
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.
pub fn provider(&self) -> Arc<dyn AgentMemoryProvider> ⓘ
pub fn config(&self) -> AgentMemoryConfig
Sourcepub async fn inject_for_turn(
&self,
identity: &AgentIdentity,
session_key: Option<&str>,
content: &ContentInput,
) -> Result<Vec<ContentInput>, AgentMemoryError>
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.
Sourcepub fn defang_inbound(
&self,
identity: &AgentIdentity,
content: &ContentInput,
) -> ContentInput
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
impl Clone for AgentMemoryRuntimeInjector
Source§fn clone(&self) -> AgentMemoryRuntimeInjector
fn clone(&self) -> AgentMemoryRuntimeInjector
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AgentMemoryRuntimeInjector
impl !UnwindSafe for AgentMemoryRuntimeInjector
impl Freeze for AgentMemoryRuntimeInjector
impl Send for AgentMemoryRuntimeInjector
impl Sync for AgentMemoryRuntimeInjector
impl Unpin for AgentMemoryRuntimeInjector
impl UnsafeUnpin for AgentMemoryRuntimeInjector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CoreExecutorTurnFinalizationGuard for Twhere
T: Send,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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