pub struct RiskOverlay<'a> {
pub engine: &'a EngineState,
pub trigger: RiskOverlayTrigger,
pub theme: Theme,
pub now: DateTime<Utc>,
}Expand description
M2 §4 risk overlay. Surfaces the engine’s current Risk
block alongside the operator-state snapshot’s vector components
so a TILT + guardrail-proximity situation is unambiguous: the
operator sees exactly how close to the hard alert they are,
and why the classifier flagged the operator as TILT.
Design constraints (same spirit as StateOverlay):
- Context surface, not a gate — does not own a pending command, does not gate dispatch. Operator dismissal is any keypress; the auto-open hook will re-fire on the next tick if the guardrail signal is still live, subject to the 60 s cooldown.
- Descriptive, not judgmental. Numbers and distances only.
- L4 HardStop opens this overlay with a banner that says the
engine is halted — the ceremony is context, not a bypass.
Risk-reducing commands (
/kill,/flatten,/cancel) still proceed through dispatch without the overlay blocking them (seetwo_am_scenarios.rs).
Fields§
§engine: &'a EngineState§trigger: RiskOverlayTrigger§theme: Theme§now: DateTime<Utc>Trait Implementations§
Source§impl<'a> Debug for RiskOverlay<'a>
impl<'a> Debug for RiskOverlay<'a>
Auto Trait Implementations§
impl<'a> Freeze for RiskOverlay<'a>
impl<'a> RefUnwindSafe for RiskOverlay<'a>
impl<'a> Send for RiskOverlay<'a>
impl<'a> Sync for RiskOverlay<'a>
impl<'a> Unpin for RiskOverlay<'a>
impl<'a> UnsafeUnpin for RiskOverlay<'a>
impl<'a> UnwindSafe for RiskOverlay<'a>
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
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>
Converts
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>
Converts
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