Skip to main content

Module grammar

Module grammar 

Source
Expand description

Four-state grammar used by the episode collapser.

Modeled after the dsfb-debug grammar (Admissible / Boundary / Violation) plus a Recovery state we use specifically for the shock-and-recovery motif. The state machine is intentionally tiny and deterministic — there is no learned transition, no probability, just a closed-form function of the consensus cell’s axis values.

Enums§

GrammarState
The grammar’s discrete states. Ordering is meaningful: higher values indicate more severity, so a single max() over a window yields the peak grammar state for an interval.
ReasonCode
Reason codes attached to a grammar transition. Carried into the Episode so an operator audit can see why the grammar flagged a cell, not just that it did.