pub struct EvolutionHookHandler { /* private fields */ }Expand description
Hook handler implementing the I008 self-evolution loop. Registered per-Agent
in the HookRegistry alongside LoggingHandler.
The same Arc<EvolutionHookHandler> instance is reused across all turns
for the Agent’s lifetime; accumulation is stateful via interior
mutability (Mutex<TurnObserver> + Mutex<KnowledgeStore>).
Implementations§
Source§impl EvolutionHookHandler
impl EvolutionHookHandler
Sourcepub fn new(
store: KnowledgeStore,
config: EvolutionConfig,
session_id: Option<String>,
) -> Self
pub fn new( store: KnowledgeStore, config: EvolutionConfig, session_id: Option<String>, ) -> Self
Build a handler backed by the given store, config, and session ID.
Sourcepub fn open_default(
config: EvolutionConfig,
session_id: Option<String>,
) -> EvolutionResult<Option<Self>>
pub fn open_default( config: EvolutionConfig, session_id: Option<String>, ) -> EvolutionResult<Option<Self>>
Open the default knowledge store at ~/.talos/index.db, creating the
.talos directory if it does not exist.
Returns Ok(None) when the home directory cannot be resolved, allowing
the caller to continue without evolution rather than aborting the run.
Trait Implementations§
Source§impl HookHandler for EvolutionHookHandler
impl HookHandler for EvolutionHookHandler
Source§fn subscribed(&self) -> &'static [HookEventKind]
fn subscribed(&self) -> &'static [HookEventKind]
Events this handler subscribes to.
Source§fn on_event<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 HookContext,
event: &'life2 mut HookEvent<'life3>,
) -> Pin<Box<dyn Future<Output = HookResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn on_event<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_ctx: &'life1 HookContext,
event: &'life2 mut HookEvent<'life3>,
) -> Pin<Box<dyn Future<Output = HookResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Handles a runtime event.
Auto Trait Implementations§
impl !Freeze for EvolutionHookHandler
impl RefUnwindSafe for EvolutionHookHandler
impl Send for EvolutionHookHandler
impl Sync for EvolutionHookHandler
impl Unpin for EvolutionHookHandler
impl UnsafeUnpin for EvolutionHookHandler
impl UnwindSafe for EvolutionHookHandler
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
Mutably borrows from an owned value. Read more