fix(workflows): fan-in validate() rejects non-mapping output#3349
Open
jawwad-ali wants to merge 1 commit into
Open
fix(workflows): fan-in validate() rejects non-mapping output#3349jawwad-ali wants to merge 1 commit into
jawwad-ali wants to merge 1 commit into
Conversation
FanInStep.validate() only checked wait_for, so a non-mapping 'output'
(a list or scalar) validated clean; execute() then silently coerces it
to {}, so the author's declared aggregation keys vanish with COMPLETED
status and no diagnostic. Reject a non-mapping output at validation,
mirroring the command-step (github#3262) non-mapping fix. execute()'s
defensive coercion is left in place for unvalidated callers.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
FanInStep.validate()only validateswait_for— it never checksoutput. Butexecute()does:So a non-mapping
output(a YAML list or scalar) validates clean, then the author's declared aggregation keys are silently discarded at run time — the step returnsCOMPLETEDwith an empty aggregation and no diagnostic. Reproduced on main @bba473c:validate({'id':'j','wait_for':['a'],'output':['{{ x }}']})returns[].Fix
Reject a non-mapping
outputat validation, mirroring the command-step (#3262) non-mapping input/options fix.execute()'s defensive coercion is intentionally left in place for callers that skip validation.Testing
test_validate_rejects_non_mapping_outputparametrized over a list, a string, and an int → all report'output' must be a mapping. Fails before (validate returns[]— verified by source-stash), passes after.test_validate_accepts_mapping_or_absent_output: a mapping and an omittedoutputreturn[].TestFanInStep: 9 passed.uvx ruff checkclean.AI Disclosure
Found and fixed with Claude Code (Claude Fable 5) under my direction. AI flagged fan-in as the remaining step with a validate-vs-execute shape gap; I reproduced the silent key-drop, verified fail-before/pass-after, and reviewed the diff.