Expand description
Steps: the closed 7-kind vocabulary (02 §4) plus the act-chain binding types (02 §5).
§Wire shape vs. Rust shape
On the wire, StepIR is a kind-discriminated union whose variants
compose StepBase (baseline schema: allOf + unevaluatedProperties: false). In Rust, each variant struct carries an explicit const kind
marker field and #[serde(flatten)]s StepBase; StepIR itself is
#[serde(untagged)]. This produces the exact same wire bytes as serde’s
internal tagging and lets a variant struct (e.g. HumanStepIR inside
HandlerAction::escalate) serialize standalone with its kind field, as
the baseline requires.
§Closedness caveat (documented divergence)
serde’s deny_unknown_fields cannot be combined with flatten, so the
step variant structs are serde-lenient about unknown fields at runtime.
The schema stays authoritative: #[schemars(deny_unknown_fields)]
(schema-only, no serde effect) closes each variant in the generated
schema, mirroring the baseline’s unevaluatedProperties: false. Golden
fixture behavioral equivalence is judged schema-vs-schema (02 §1.1), so
runtime leniency of the DTO loader is an implementation note, not a
contract change.
Structs§
- Action
Binding - Ordered, closed act-chain. No declared fallback ⇒ exactly one attempt (principle 6: the runner never improvises a downgrade).
- Action
StepIR - Action step (02 §4.1): fixed pipeline
preflight? → act → observe → assert. - Assert
StepIR - Assert step (02 §4.2): side-effect-free observation and judgment.
- Bound
Attempt - One fully bound attempt of the act-chain (02 §5.1).
- Call
StepIR - Call step (02 §6): subflow invocation. Callee pinned by content hash
(
flowRef.irHashmust appear inFlowIR.subflows). Call-by-value:inputsare evaluated in the caller scope and snapshotted. - Foreach
StepIR - Foreach step (02 §4.6): iteration container. The iteration variable is
referenced via
iter.<as>;RunPathdisambiguates rounds with{ kind: "iteration", index }frames, so body stepIds do not (and must not) vary per round. - Human
StepIR - Human step (02 §4.4): human collaboration is a formal node (principle 8).
- IfStepIR
- If step (02 §4.5): conditional container. Container hashes exclude the subtree — child steps carry their own identity and hashes (02 §12.3).
- LetStepIR
- Let step (02 §4.7): pure bindings into the
vars.*scope, SSA single assignment (rebinding an existing var name is a check-phase error). - Observation
From Step - The object branch of
ObservationSource(inline in the baseline). - Step
Base - Common step envelope (02 §3).
Enums§
- Action
Kind kind: "action".- Assert
Kind kind: "assert".- Call
Kind kind: "call".- Foreach
Kind kind: "foreach".- Fresh
Marker - The
"fresh"literal ofObservationSource. - Human
Kind kind: "human".- IfKind
kind: "if".- LetKind
kind: "let".- Observation
Source - Where an assert step’s observation comes from.
- StepIR
- The closed step union (7 kinds, spine A.4), discriminated by
kindon the wire. See the module docs for why this isuntaggedin serde while remaining akind-tagged union on the wire.