fix(workflow): reject field-condition edges the producing kind cannot satisfy

Live repro: architect emitted a verify stage with kind=analysis and a
verdict-equals edge. The kind schema doubles as the LLM response format,
so 'verdict' was never emitted and the workflow failed at its final hop
at runtime. The compiler now requires artifact_field_equals fields to be
declared by the producing stage's kind schema, failing the plan at lock
time with a pointer at review_report. Architect prompt rule added;
reachability check extracted alongside the new validation.
This commit is contained in:
2026-06-12 13:42:13 +04:00
parent a455762dd5
commit 1a7eb05945
6 changed files with 91 additions and 1 deletions
@@ -70,6 +70,10 @@ Emit a JSON object that validates against the `execution_plan` schema:
- Chain sequential stages: stage N's edge goes `to` stage N+1, not to `"done"`. Only the
final stage's edge points to `"done"`. A plan where an intermediate stage jumps to
`"done"` ends the whole workflow there and never runs the remaining stages.
- An `artifact_field_equals` edge may only check a field that the producing stage's
`kind` schema declares. A verdict-checking stage must use a kind with a `verdict`
field (`review_report`) — a plan that checks a field its kind cannot emit fails to
compile.
- For a review loop (implementer ↔ reviewer): emit two conditional edges from the
reviewer stage:
- `"type": "artifact_field_equals"`, `artifact_id`: reviewer's produces id,