pub struct ConfidenceDaemon { /* private fields */ }Expand description
Background daemon that periodically revalidates tracked assets and
quarantines those whose confidence falls below MIN_REPLAY_CONFIDENCE.
Implementations§
Source§impl ConfidenceDaemon
impl ConfidenceDaemon
Sourcepub fn new(
evaluator: Arc<dyn ConfidenceEvaluator>,
config: ConfidenceDaemonConfig,
) -> Self
pub fn new( evaluator: Arc<dyn ConfidenceEvaluator>, config: ConfidenceDaemonConfig, ) -> Self
Create a new daemon with the given evaluator and configuration.
Sourcepub fn with_defaults(evaluator: Arc<dyn ConfidenceEvaluator>) -> Self
pub fn with_defaults(evaluator: Arc<dyn ConfidenceEvaluator>) -> Self
Convenience constructor with default configuration.
Sourcepub fn track(&self, asset: TrackedAsset)
pub fn track(&self, asset: TrackedAsset)
Register an asset for confidence tracking.
If the asset_id is already registered, its entry is updated.
Sourcepub fn snapshot(&self) -> Vec<TrackedAsset>
pub fn snapshot(&self) -> Vec<TrackedAsset>
Return a snapshot of all currently tracked assets.
Sourcepub fn run_cycle(&self)
pub fn run_cycle(&self)
Run one revalidation cycle synchronously.
For each tracked asset:
- Call
evaluate_confidence_revalidation(). - If failed, call
evaluate_asset_demotion(). - Transition to
Quarantined(orDemoted) and setreplay_eligible = falsefor quarantined assets.
Assets below demotion_confidence_threshold are treated as having an
implicit failure to trigger revalidation.
Sourcepub fn spawn(self) -> JoinHandle<()>
pub fn spawn(self) -> JoinHandle<()>
Spawn the daemon as a background task.
The returned JoinHandle runs indefinitely until the process
terminates or the handle is aborted. Callers may call
handle.abort() to stop the daemon cleanly.