pub struct ContextBackoff { /* private fields */ }Expand description
Per-fingerprint exponential backoff for context mutations whose post-apply measurement falsified them (kernel review S5, applied to Context).
The unattended cadence re-diagnoses from live signals every tick. A falsified mutation restores the knob it moved, so the next tick sees the same signals, mints the same fingerprint, matches the same standing approval, and applies-measures-reverts again — forever, each round paying for a full compaction pass under the engine lock. This is that loop’s brake. It is deliberately keyed on the fingerprint (the change), not the component: a different proposal for the same pillar is not the thing that failed.
Only the unattended path uses it. evolution.run on a session is a person
asking for the check to run now, and there is no reason to answer that with
“in backoff” (see run_context_evolution’s backoff argument).
Implementations§
Source§impl ContextBackoff
impl ContextBackoff
Sourcepub fn is_due(&self, fingerprint: &str, tick: u64) -> bool
pub fn is_due(&self, fingerprint: &str, tick: u64) -> bool
True when fingerprint has never been falsified, or its backoff window
has elapsed.
Sourcepub fn note_falsified(&mut self, fingerprint: &str, tick: u64)
pub fn note_falsified(&mut self, fingerprint: &str, tick: u64)
Record a falsified apply at tick: the next attempt is allowed
2^attempts ticks later, exponent capped at [BACKOFF_MAX_EXPONENT].
Trait Implementations§
Source§impl Debug for ContextBackoff
impl Debug for ContextBackoff
Auto Trait Implementations§
impl Freeze for ContextBackoff
impl RefUnwindSafe for ContextBackoff
impl Send for ContextBackoff
impl Sync for ContextBackoff
impl Unpin for ContextBackoff
impl UnsafeUnpin for ContextBackoff
impl UnwindSafe for ContextBackoff
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more