pub struct SupervisionPolicy {
pub restart: RestartPolicy,
pub intensity: u32,
pub period_ms: u64,
pub supervisor: Option<String>,
}Expand description
The supervision policy declared per agent in its
CapabilityManifest (R0.7 wave 2): the restart vocabulary plus the
intensity/period budget bounding how much failure the runtime tolerates
before escalating to the supervisor.
Policy is static and declared — no learned supervision in R0.7; the journaled decisions are the R0.10 policy plane’s training data.
Fields§
§restart: RestartPolicyWhen the agent is restarted after a failed turn.
intensity: u32The maximum restarts tolerated within period_ms before the
runtime stops restarting and escalates (OTP’s restart intensity).
period_ms: u64The sliding window intensity is counted over, in milliseconds
(OTP’s restart period). A quiet gap longer than this resets the
count.
supervisor: Option<String>The supervisor’s agent id (external, same tenant) whose mailbox
receives the EscalationNotice when the budget is exhausted.
None — a root agent — dead-letters its escalations for an
operator, per open question 2’s chosen default.
Implementations§
Source§impl SupervisionPolicy
impl SupervisionPolicy
Sourcepub fn new(restart: RestartPolicy, intensity: u32, period_ms: u64) -> Self
pub fn new(restart: RestartPolicy, intensity: u32, period_ms: u64) -> Self
A policy with no supervisor (a root agent): set the optional field directly; it is public.
Sourcepub fn allows_restart_after(&self, error_class: Option<ErrorClass>) -> bool
pub fn allows_restart_after(&self, error_class: Option<ErrorClass>) -> bool
Whether a turn ending with error_class (None = the agent’s
deadline breached, cancellation by clock) may be restarted under
this policy — OTP’s restart semantics mapped onto the shared
ErrorClass taxonomy: permanent restarts on any termination,
transient only on abnormal ones (a cancellation — operator or
clock — is control flow, not a crash), temporary never.