pub struct Episode {
pub start_ts: u64,
pub end_ts: Option<u64>,
pub grammar_state: GrammarState,
pub reason_code: ReasonCode,
pub primary_source: ResidualSource,
pub max_drift: f64,
pub max_slew: f64,
pub max_residual: f64,
pub sample_count: u32,
}Expand description
A structural episode: a contiguous period of a specific grammar state.
This is the operator-facing output of the DSFB engine. Each episode carries the full audit context needed to understand why the classification was made and what structural pattern was detected.
Fields§
§start_ts: u64Monotonic timestamp when this episode began (nanoseconds).
end_ts: Option<u64>Monotonic timestamp when this episode ended (nanoseconds).
None if the episode is still open.
grammar_state: GrammarStateGrammar state during this episode.
reason_code: ReasonCodeReason code from the heuristics bank match.
primary_source: ResidualSourceWhich residual source(s) contributed to this classification.
max_drift: f64Maximum absolute drift observed during this episode.
max_slew: f64Maximum absolute slew observed during this episode.
max_residual: f64Maximum absolute residual observed during this episode.
sample_count: u32Number of observation samples in this episode.
Implementations§
Source§impl Episode
impl Episode
Sourcepub fn duration_ns(&self) -> Option<u64>
pub fn duration_ns(&self) -> Option<u64>
Duration of this episode in nanoseconds, or None if still open.
Sourcepub fn is_anomalous(&self) -> bool
pub fn is_anomalous(&self) -> bool
Whether this episode represents a structural anomaly (Boundary or Violation).