Repository navigation
fix(workflow): fail a step that never prints the verdict its gate reads (#1773) - #1802
Conversation
|
Review request for this tip: |
…owLab#1773) A live step's reply advances the run without checking the OUTPUT the next edge gates on, so a step that never prints its verdict closes the run as done and the gate is skipped. Pin the run status, the node status, the recorded failure and the stage line before fixing the engine.
…nkFlowLab#1773) A live run advanced on the reply alone: a step that declared the OUTPUT its next edge gates on, but never printed it, was recorded as done and the run closed as "✓ 完成" while the gate was skipped. Silence was then read the same way as a non-PASS verdict. The engine now asks which outputs the node's own `when`/`else` and `until` edges read, and a completion that leaves one of them blank fails the step instead of settling it. The gate therefore never sees a missing verdict, onFail recovery still applies, and the run record's `failure` names the node and the OUTPUT it never printed.
|
Verdict: PASS at 0df93d7 Ran at this tip: Not run: the full Review points:
Metadata fix in the same pass: the body's |
Written-by: Dev4
Owner: Dev4
Reviewer: Reviewer
Fixes #1773
What changed
A Workflow step that declares the OUTPUT its next edge gates on, and then ends its reply without printing it, is no longer recorded as a completed step.
missingVerdicts()inplugins/workflow/src/graph.jsnames the outputs that the node's ownwhen/elseanduntiledges read;commitAdvance()inplugins/workflow/src/service.jsturns a completion that leaves one of them blank into a failed step. The gate is then never evaluated on silence,onFailrecovery still applies (a recovery edge can retry the step), and the run cannot close✓ 完成.The run record carries both facts the issue asked for:
failure.nodeNamenames the step andfailure.textisMissing OUTPUT verdict.codestaysstep-failed, which the stage already renders as{node} failed · {text}, so no client change was needed.Three behaviours are deliberate: an output no gate reads stays optional (a text output that only feeds a successor's input is not a verdict); a delivered value that does not equal
eqstill completes the step and skips the untaken branch; and a step that produced no gate output at all never reaches the gate.Red first
plugins/workflow/test/missing-verdict.test.jswas added infbb05b06on base7b8f81e1and run against that base before the fix:The two green tests are the pair that keeps the fix narrow: a delivered verdict still opens the gate, and a non-matching verdict is still a legitimate skip.
The change at this tip
0df93d7d4e13a4b456ca0369dc8c482b54982f625f1274db0d7acdc211297c49350d883a285265427b8f81e15a803d54a13fe32d2c0bc2119e7f9333plugins/workflow/src/graph.jsplugins/workflow/src/service.jsplugins/workflow/test/missing-verdict.test.jsdocs/subsystems/workflow.mdchangelog.d/1773-workflow-missing-verdict.fixed.mdSource 26 lines, tests 117, docs 2, changelog 1: 144 added / 2 removed. Generated files: none —
plugins/is outside thepatches/ds-bot/chain, so nonpm run buildand nogeneratewere needed or run.Checks at the tip
TZ=UTC npm run verify→ exit 0:.github/scripts/*.test.mjs549/549 · interop 37/37 · live-e2e 24/24 · lint 0 errors / 70 warnings ·arch-docs: OK (5 changed file(s))node scripts/ds-bot-patches.mjs check:ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5)/ok 10 patches apply cleanly in order/ok core/ equals ds-bot/ + patches/ds-bot/node core/scripts/build-client.mjs --check→ exit 0Not run here:
node .github/scripts/enqueue-guard.mjs --pr 1802— this box has nogh, and the script shells out to it; the Lead reads that line at this tip. No review was requested from a Bot by me: the tip is named once, by the Lead.Checkpoint
{ "pr": 1802, "claim": "Dev4", "issue": 1773, "summary": "A Workflow step that declares the OUTPUT its next edge gates on, but ends its reply without printing it, is now a failed step rather than a completed one. The engine asks the node's own when/else and until edges which outputs are verdicts and fails the step before the gate is read, so the run no longer closes as done while its gate is skipped. onFail recovery still applies, and the run record names the step and the OUTPUT it never printed.", "files": [ "plugins/workflow/src/graph.js", "plugins/workflow/src/service.js", "plugins/workflow/test/missing-verdict.test.js", "docs/subsystems/workflow.md", "changelog.d/1773-workflow-missing-verdict.fixed.md" ], "checks": { "ran": "TZ=UTC npm run verify; node scripts/ds-bot-patches.mjs check; node core/scripts/build-client.mjs --check", "result": "green", "at": "0df93d7d4e13a4b456ca0369dc8c482b54982f62" }, "next": "none — ready for review" }