Skip to main content

Module guard

Module guard 

Source
Expand description

Guardrail state: outcome windows, demotion, and cooldown (ADR 0009 D3).

firstpass_core::guardrail decides whether a window has breached. This holds the state that decision runs against: a trailing window of resolved outcomes per (tenant, route), and whether that route is currently demoted.

Demotion is deliberately sticky. A guardrail that re-promotes the moment its window recovers oscillates, and every oscillation is a visible behaviour change for real users — models switching under them for reasons nobody can explain. So a demoted route stays demoted for a cooldown, and re-promotion is a separate, conservative decision rather than an automatic consequence of one good window.

Structs§

GuardrailRegistry
Per-(tenant, route) guardrail state.

Enums§

Reaction
What happened when an outcome was recorded.