pub struct RollbackPolicy {
pub guard_every: u32,
pub steer_window: u32,
pub soft_threshold: SafetyScore,
pub hard_threshold: SafetyScore,
pub max_rollbacks: u8,
pub max_checkpoints: u8,
}Expand description
Cadence and bounds for the checkpointed-rollback control loop (ADR-012), chosen per device tier so cost scales with the hardware budget (ADR-003).
steer_window is the ADR-012 stage-1 early-token soft-steering window
(ADR-013): model-backed steering applies for the first steer_window output
tokens, then decode falls back to hard-bans-only unless the guard
re-escalates. Hard bans still apply every step regardless. Checkpoint spacing
is guard_every — checkpoints are only taken at guard-verified-safe
boundaries, so there is no separate checkpoint cadence to misconfigure.
Fields§
§guard_every: u32Score the output every guard_every tokens (0 = never); also the
spacing of safe-prefix checkpoints.
steer_window: u32Apply model-backed (soft) steering for the first steer_window output
tokens (0 = never — token-only/hard-ban steering at every step).
soft_threshold: SafetyScoreAt/above this score, escalate; do not advance the safe checkpoint.
hard_threshold: SafetyScoreAt/above this score, roll back (or fail closed).
max_rollbacks: u8Hard cap on rollbacks before a deterministic refusal (DoS bound).
max_checkpoints: u8Bounded checkpoint ring size — fixed memory (ADR-003).
Implementations§
Source§impl RollbackPolicy
impl RollbackPolicy
Sourcepub fn for_device(device: DeviceTarget, mode: SafetyMode) -> RollbackPolicy
pub fn for_device(device: DeviceTarget, mode: SafetyMode) -> RollbackPolicy
Tier-aware policy. SafetyMode::Off disables the loop entirely.
Sourcepub fn disabled() -> RollbackPolicy
pub fn disabled() -> RollbackPolicy
A policy that performs no steering, checkpointing, or guarding.
Trait Implementations§
Source§impl Clone for RollbackPolicy
impl Clone for RollbackPolicy
Source§fn clone(&self) -> RollbackPolicy
fn clone(&self) -> RollbackPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RollbackPolicy
Source§impl Debug for RollbackPolicy
impl Debug for RollbackPolicy
impl Eq for RollbackPolicy
Source§impl PartialEq for RollbackPolicy
impl PartialEq for RollbackPolicy
Source§fn eq(&self, other: &RollbackPolicy) -> bool
fn eq(&self, other: &RollbackPolicy) -> bool
self and other values to be equal, and is used by ==.