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):
| Phase | Hook event(s) |
|---|---|
| Observe | OnProviderError (objective error), BeforeProviderCall (user-correction heuristic) |
| Accumulate | Handler-internal Mutex<TurnObserver> (reset on TurnStart) |
| Extract | PatternExtractor::extract_from_observation at flush time |
| Apply | OnSystemPromptBuilt + HookResult::Modify returns augmented prompt |
| Ingest | Flush in TurnComplete (overridden timeout = 5s for SQLite write) |
Structs§
- Evolution
Hook Handler - Hook handler implementing the I008 self-evolution loop. Registered per-Agent
in the
HookRegistryalongsideLoggingHandler.