StepGuard
AR-727 — a named guard the runtime reads at execution time. Distinct from ``HaltCondition`` (a post-execution output check): a guard is a NAMED invariant over the resolved step parameters (``{{ params.<name> }}``) and the step's outputs (``{{ outputs.<field> }}``) evaluated AFTER the step's work runs. Violating a guard fails closed — the step is downgraded to ``success=False`` / ``disposition="halted"`` and the failure NAMES the guard — so an operator knows which named contract was breached, not merely that "a check failed". ``when`` is a Jinja2 boolean expression evaluated against a ``{params, outputs}`` namespace. A guard is a contract the step ASSERTS must hold to proceed; it FIRES — fails closed — when ``when`` evaluates FALSY (the invariant does NOT hold / is violated). The declared default is what makes the common case pass (e.g. ``when="{{ outputs.diff <= params.pay_date_tolerance_days }}"`` with default 7 holds for a diff of 3 and fires only for a tie outside the window). A blank/missing ``when`` never fires (a named guard with no predicate is a no-op annotation, not a fail-closed trap — fail-closed applies to a stated invariant that does not hold, not to a guard that expresses nothing). A ``when`` that raises at evaluation time fails closed (the contract could not be verified).
| Field | Type | Description |
|---|---|---|
namerequired | string | Named contract that is violated. |
whenrequired | string | Jinja2 boolean expression over {{ params.<name> }} / {{ outputs.<field> }}. The guard FIRES (halts) when this is FALSY — i.e. the asserted invariant does NOT hold. |
message | string | null | Human reason; surfaced as the step's error_message. |