Skip to main content

Module runtime

Module runtime 

Source
Expand description

RFC 1 (issue #20) dedup window + cycle suppression engine.

Pure logic, no IO. AgentHarness::handle_trigger (follow-up sub-PR) wraps this engine into the agent loop entrypoint, but the dedup / cycle decisions live here so they are independently testable.

Behaviour matches RFC 1 §5:

Structs§

TriggerRuntime
In-memory dedup + cycle registry shared across all NotificationHook sources for a single agent / daemon. Cloning is cheap; the actual state lives behind an Arc<Mutex>.
TriggerRuntimeConfig
Tunable knobs for TriggerRuntime. The runtime never mutates these; callers can swap them via TriggerRuntime::new or TriggerRuntime::with_config.
TriggerRuntimeSnapshot
Point-in-time view of the runtime’s dedup + cycle bookkeeping. Cheap to copy; surfaced via TriggerExecutor::notification_status_snapshot for status banners and /triggers rendering.

Enums§

EvaluationOutcome
Result of running a Trigger through TriggerRuntime::evaluate. Subsequent runtime state (state machine transitions, session audit, permission evaluator) consumes this.