Skip to main content

enforce

Function enforce 

Source
pub fn enforce(
    outcome: Result<CustomerState, CleanLibraryError>,
) -> Result<(), GateError>
Expand description

enforce() — RAISES style for gate use. Ok(()) iff clean-to-proceed.

  • a non-clean COMPLETED assessment → Err(GateError::Blocked) (the same outcome verdict returns as a value, re-expressed as a raise so a gate can ?-propagate it);
  • a couldn’t-assess → Err(GateError::NotAssessed), carrying the original error.

Fail-closed by construction: because Assessment::is_allowed is true only for the Clean tier, a NotYetAssessed / RangeNotResolved refuses here just like a Malicious does — “not assessed” can never pass the gate.