Skip to main content

Module hook

Module hook 

Source
Expand description

Evolution HookHandler — wires the I008 self-evolution engine (ADR-001) into any agent run path via the I009 hook system (see talos_plugin::handler::HookHandler).

One registered handler covers all three CLI run paths (print / interactive / tui) uniformly: the agent’s run_inner fires the subscribed events once per turn, the same way for every path, so per-Agent registration guarantees no double-firing. The pre-#I008 concern that “evolution must attach once at a future AppServerSession seam” is satisfied at the hook layer instead; see ADR-005 → “Hook-Driven Evolution”.

Capability mapping to the four-phase learning loop (ADR-001):

PhaseHook event(s)
ObserveOnProviderError (objective error), BeforeProviderCall (user-correction heuristic)
AccumulateHandler-internal Mutex<TurnObserver> (reset on TurnStart)
ExtractPatternExtractor::extract_from_observation at flush time
ApplyOnSystemPromptBuilt + HookResult::Modify returns augmented prompt
IngestFlush in TurnComplete (overridden timeout = 5s for SQLite write)

Structs§

EvolutionHookHandler
Hook handler implementing the I008 self-evolution loop. Registered per-Agent in the HookRegistry alongside LoggingHandler.