feat: support named positional parameters in workflow harness (#19) - #20
Merged
Conversation
added 2 commits
June 2, 2026 13:25
Add WorkflowParam model and params field to Workflow so harnesses can accept positional CLI arguments instead of requiring env-var injection. Changes: - Add WorkflowParam Pydantic model (name, description, required) with uppercase env-var name validator to models.py - Add params: list[WorkflowParam] = [] field to Workflow (backward-compatible) - Replace hard-coded 8-line arg block in render_harness() with _render_arg_block() helper that emits a while-loop parser when params are declared, falling back to the original block when params is empty - Add 10 tests covering schema validation, positional binding, env-var override, required/optional enforcement, and --dry-run interop Fixes #19
Owner
Author
Self Code ReviewSummaryThe implementation correctly addresses the root cause: FindingsStrengths
Suggestions (non-blocking)
SecurityNo security concerns identified. Param names are validated to Checklist
Self-reviewed by Claude • Ready for human review |
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
The generated harness only accepted
--dry-runand rejected everything else withexit 2. Runtime values had to be passed via environment variables (ISSUE_NUMBER=42 bash .harness/foo.sh), making harnesses feel like internal implementation details rather than first-class CLI tools.Root Cause
The
WorkflowPydantic model had noparamsfield, and the harness generator hard-coded a simple if/elif block that only recognised--dry-run.Changes
src/flowsh_cli/models.pyWorkflowParammodel (name, description, required) +params: list[WorkflowParam] = []field onWorkflowsrc/flowsh_cli/render.py_render_arg_block()helper; emits while-loop positional parser when params declaredtests/test_workflow_to_harness.pyTesting
paramskey) produce byte-for-byte identical output (zero regression)Validation
Issue
Fixes #19
Implementation Details
Implementation followed artifact:
.claude/PRPs/issues/issue-19.mdDeviations from plan:
None
Automated implementation from investigation artifact