Fix: [Critical] while loop step type for dynamic iteration (#31) - #54
Merged
Conversation
The current for implementation snapshots its input before iteration, so workflows that create new planned items during the loop silently skip work and can produce incorrect results. Changes: - Added a first-class while step model with condition validation - Rendered while steps as stateful Bash loops that re-evaluate the condition each iteration - Documented while in the README - Added parser, render, and end-to-end tests Fixes #31
Owner
Author
🔍 Automated Code ReviewSummaryThe fix now addresses the root cause cleanly: Findings✅ Strengths
|
Owner
Author
PR 54 ReviewRecommendation: REQUEST CHANGES SummaryGood work on isolating FindingsHigh
Medium
Validation
Notes
|
Owner
Author
|
Created issue(s) for the blocking/high-priority review finding(s):\n- #31\n\nMerge status: merged successfully with squash. |
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.
Summary
forloops snapshot their input before iteration, so workflows that create new work during the loop do not pick it up in the same run.Root Cause
The workflow language had no condition-driven loop step, and the existing
forrenderer consumes a fixed newline-delimited snapshot.Changes
src/flowsh_cli/models.pyWhileStepand included it in the step unionsrc/flowsh_cli/render.pywhileas a stateful Bash loop and keptwhen:guards workingtests/test_workflow_to_harness.pyREADME.mdwhilestep typeTesting
make qapassesValidation
Issue
Fixes #31
📋 Implementation Details
Implementation followed artifact:
issue-31investigation comment from GitHubDeviations from plan:
.claude/PRPs/issues/issue-31.mdor.agents/issues/issue-31.md.Automated implementation from investigation artifact