Skip to main content

evaluate

Function evaluate 

Source
pub fn evaluate(trigger: &Trigger, ctx: &TriggerContext) -> bool
Expand description

Evaluate a Trigger against a TriggerContext. Deterministic, side-effect-free, and bounded by the size of the trigger tree (recursion depth = tree depth).

Semantics (ADR §7.1):

  • VerifiableEvent — the event id is present in ctx.occurred_events.
  • TemporalWindow — now_unix >= from_unix and (no upper bound, or now_unix <= to_unix).
  • DeadmanSwitch — a liveness signal exists and now_unix - last_liveness >= timeout_secs (saturating; a missing liveness signal never fires).
  • HumanConsensus — at least m signed attestations match the required capacity (n is advisory).
  • All — every child fires. Any — some child fires. Not — the inner trigger does not.