Skip to main content

Module friction

Module friction 

Source
Expand description

Friction ladder — Addendum A §3 and §6.3.

§The invariant

Every command carries a RiskDirection. Only Increases is gated. Reduces is always instant. Neutral is passthrough. Applying a friction gate to a Reduces command is a compile error (see [FrictionGate::apply]). See ADR-014.

This is the single most important invariant in the crate graph. Violating it means a tired operator at 2 AM can’t kill their positions. That outcome is not allowed to be reachable from any code path in this repository.

Structs§

FrictionGate
A gate applied in front of a command. The generic D binds to RiskDirection at the type level so only risk-increasing commands can be gated.
Increases
Phantom marker type representing RiskDirection::Increases at the type level. Used to parameterize FrictionGate.
RiskContext
Engine-reported risk context the classifier/friction layer consults to escalate TILT → L3 or L4.

Enums§

FrictionLevel
The friction escalator’s current level.
RiskDirection
Classification of a command’s effect on operator risk.

Traits§

GateableDirection
Sealed marker trait that lists the directions a gate may apply to. Only Increases implements it. Attempting to parameterize FrictionGate with Reduces or Neutral fails at compile time.