pub struct Features {
pub score: f32,
pub loop_mode: f32,
pub is_failure_pattern: f32,
pub novelty: f32,
pub repeat_count: f32,
pub recovery: f32,
pub evidence: f32,
}Expand description
What the hook knows at the moment it decides whether to speak.
Fields§
§score: f32Composite broker score of the best candidate capsule, in [0, 1].
loop_mode: f321.0 when the agent is visibly repeating a failing command. A stuck agent should be interrupted sooner — this is the signal the old rule expressed by dropping the threshold.
is_failure_pattern: f321.0 when the capsule is a failure_pattern — the kind most likely to
prevent a wasted attempt rather than merely inform one.
novelty: f321.0 when nothing has been injected yet this session, falling towards 0 as the session accumulates injections. Encodes “the tenth interruption is worth less than the first”.
repeat_count: f32How many times this exact command has already been observed failing,
normalized: min(count, 5) / 5.
recovery: f32Time since the last injection, normalized against the refractory window: 0 immediately after one, 1 once well clear of it.
evidence: f32How strong the evidence was that something failed: 0 for a substring guess, 0.5 for a toolchain summary line, 1 for a real exit code. A guess should have to clear a higher bar than a fact.
Implementations§
Source§impl Features
impl Features
Sourcepub const NAMES: [&'static str; 7]
pub const NAMES: [&'static str; 7]
Human-readable names, aligned with Self::to_vec. Used by
brain policy --status so the weights mean something on screen.
Sourcepub fn to_vec(self) -> [f32; 7]
pub fn to_vec(self) -> [f32; 7]
Feature vector in weight order. Order is part of the persisted format.
Sourcepub fn from_slice(v: &[f32]) -> Option<Self>
pub fn from_slice(v: &[f32]) -> Option<Self>
Reconstruct from a persisted vector (event payloads, training data).