Skip to main content

Module risk

Module risk 

Source
Expand description

Risk direction + friction gate invariant (ADR-014).

Every operator-initiated command carries a RiskDirection. Risk-reducing actions (/kill, /flatten-all, /close, /pause-entries, /break) are always instant and friction-exempt. Risk-increasing actions (opening positions, composition changes) pass through FrictionGate, which is parameterized so that only Increases can ever be wrapped. Attempting to apply the gate to a Reduces or Neutral command is a compile error.

See also zero-operator-state::friction::FrictionGate, which uses the same sealed-trait pattern on the state-vector side.

Structs§

FrictionGate
Compile-time-checked friction wrapper. Construct via FrictionGate::new, which accepts only Increases-typed commands; the function signature prevents callers from accidentally friction-wrapping a risk-reducing action.
Increases
Phantom marker for compile-time direction checking.

Enums§

RiskDirection
The direction a command moves risk.

Traits§

Gateable
Sealed marker trait — only implemented by Increases below. External crates cannot implement it, which keeps the invariant “only risk-increasing commands are friction-gated” enforceable at compile time.