pub struct EntropyTracker { /* private fields */ }Expand description
Sliding-window state feeding EntropySample. Owned by the state machine; fed at the
completed-turn boundary (ToolResults) and by rollback(). Deliberately NOT part of
the turn checkpoint: a rollback must not launder the disorder it just evidenced —
the same reasoning as the RepeatFuse streak.
Implementations§
Source§impl EntropyTracker
impl EntropyTracker
Sourcepub fn note_rollback(&mut self)
pub fn note_rollback(&mut self)
Record a rollback (any reason). Called from the state machine’s rollback().
Sourcepub fn sample(
&mut self,
turn: u32,
rho: f64,
repeat_streak: u32,
repeat_deny_after: u32,
errored_results: u32,
total_results: u32,
) -> EntropySample
pub fn sample( &mut self, turn: u32, rho: f64, repeat_streak: u32, repeat_deny_after: u32, errored_results: u32, total_results: u32, ) -> EntropySample
Fold this boundary’s outcomes into the window and produce the turn’s sample.
repeat_streak is the RepeatFuse consecutive-signature count (0/1 ⇒ no repetition).
Sourcepub fn should_alert(
&mut self,
config: &EntropyWatchConfig,
sample: &EntropySample,
) -> bool
pub fn should_alert( &mut self, config: &EntropyWatchConfig, sample: &EntropySample, ) -> bool
③ threshold decision for this sample: hysteresis re-arm + cooldown. Mutates the
watch state; returns true when an alert should fire.
Trait Implementations§
Source§impl Debug for EntropyTracker
impl Debug for EntropyTracker
Source§impl Default for EntropyTracker
impl Default for EntropyTracker
Source§fn default() -> EntropyTracker
fn default() -> EntropyTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EntropyTracker
impl RefUnwindSafe for EntropyTracker
impl Send for EntropyTracker
impl Sync for EntropyTracker
impl Unpin for EntropyTracker
impl UnsafeUnpin for EntropyTracker
impl UnwindSafe for EntropyTracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more