pub struct StopConditionSpec {
pub when: String,
pub each: Vec<ScopeLevel>,
pub trigger: Option<String>,
pub pulse: Option<PulseSpec>,
pub effect: Option<String>,
pub at: Option<ScopeLevel>,
}Expand description
SRD-83 — one stop condition declared on a shell. A polydat
condition:/when: predicate over runtime-state wires (op_count,
error_rate, elapsed_ms, children_failed, …); a per:/each:
detection distribution selector (which scope levels it is
evaluated at); a pulse: firing axis; an action:/effect:
(fail → Interrupted+Failed, stop → Interrupted+Succeeded); and an
at: action target scope (default = the innermost level of
per:). When the predicate trips it stops the at: scope with the
effect. Detection scope (per:) and action scope (at:) are
independent.
Fields§
§when: StringPolydat predicate over runtime-state wires, evaluating to bool.
Canonical key condition:; when: accepted as an alias.
each: Vec<ScopeLevel>Scope levels this predicate is DETECTED/evaluated at (the declared
fan-out; see ScopeLevel). Canonical key per:; each: accepted
as an alias. Defaults to the declaring scope (self).
trigger: Option<String>Firing trigger (legacy string form). None → a sensible default per
condition kind. Superseded by pulse:; retained for compatibility.
pulse: Option<PulseSpec>Firing pulse — WHEN the predicate is evaluated. None → default per
condition kind (attempt/rate wires → continuous; children_* →
phase_end).
effect: Option<String>Effect on fire: "fail" or "stop". Canonical key action:;
effect: accepted as an alias. None → fail.
at: Option<ScopeLevel>The ACTION target scope — where the effect lands, independent of
where it is detected (per:). None → the innermost (most
specific) level of per:, i.e. act in place (historical
behaviour). Set e.g. at: workload to route a phase-detected stop
out to the enclosing workload shell.
Implementations§
Source§impl StopConditionSpec
impl StopConditionSpec
Sourcepub const EFFECT_VOCABULARY: [&'static str; 3]
pub const EFFECT_VOCABULARY: [&'static str; 3]
SRD-83 Part 5 — the closed action:/effect: verb vocabulary.
stop = Interrupted+Succeeded (a clean early halt that keeps the
partial result); fail = Interrupted+Failed; abort = fail
plus cancelling in-flight ops.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate the semantic surface serde cannot: the effect verb.
The runtime’s verb→Outcome map resolves any unrecognized string
to the shell default, so before this check a typo’d
effect: sotp silently became fail — an authoring trap.
Rejected at workload load instead (“never ignore silently”).