aether_core/observer.rs
1use crate::provider::{GenerationRequest, GenerationResponse};
2use std::sync::Arc;
3
4/// Trait for observing engine events (logging, metrics, UI).
5pub trait EngineObserver: Send + Sync {
6 /// Called when a generation starts.
7 fn on_start(&self, id: &str, template: &str, slot: &str, request: &GenerationRequest);
8
9 /// Called when a generation succeeds.
10 fn on_success(&self, id: &str, response: &GenerationResponse);
11
12 /// Called when a validation/healing attempt occurs.
13 fn on_healing_step(&self, id: &str, attempt: u32, error: &str);
14
15 /// Called when a generation fails permanently.
16 fn on_failure(&self, id: &str, error: &str);
17}
18
19pub type ObserverPtr = Arc<dyn EngineObserver>;