Expand description
Triggers (plan piece 3 / Phase B) — the substrate of dependencies, branches, and DAGs.
A trigger is a condition that, once satisfied, fires an Action
(submit / start a task). DAGs emerge from tasks arming triggers
on each other — after_task is a dependency edge, if_result is a
branch — with no DAG DSL, no controller loop, no engine. The
TriggerEngine is a pure, indexed predicate evaluator: it is
driven by events (a task changed status, the logical clock ticked),
and a fired event touches only the triggers keyed to it — the
plan’s O(relevant)-not-O(all) index (perf note).
Determinism is preserved exactly as in the fold: there is no
now(). The clock is an explicit tick input and results are an
explicit map, so the same event sequence fires the same triggers on
replay.
Structs§
- Trigger
Engine - An indexed set of armed triggers. Driven by events: when a task
changes status call
Self::on_task_change; when the clock advances callSelf::on_tick. Each evaluates only the triggers keyed to that event and returns theActions of the satisfied ones, disarming them (fire-once). - Trigger
World - The deterministic world a trigger evaluates against. No
now(): the clock is the explicittick, results are an explicit map.