IW-548: a non-repeatable valued flag given twice takes the last value everywhere #786
No reviewers
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli!786
Loading…
Reference in a new issue
No description provided.
Delete branch "IW-548"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
A valued flag that is not declared repeatable and is given twice now resolves by one rule everywhere: the last value wins (decision on the issue: "1: a, 2: yes, same rules").
Defects fixed
CommandArgParseralready kept the last value, but no test pinned it and no document stated it. Tests inCommandArgParserTestnow pin last-wins forFlag.Required,Flag.ValuedandFlag.Resolved; theparsedoc comment anddocs/api/CommandArgParser.mdstate the rule.review-state writeandreview-state updateread scalar flags withReviewStateCliParser.extractFlag, which took the first occurrence, while the gate validated the last. So--version abc --version 3wrote version 2, and--issue-id IW-1 --issue-id IW-2updated the IW-1 card.extractFlagnow takes the last occurrence;docs/api/ReviewStateCliParser.mdis updated.Repeatable flags and presence switches are unchanged.
Testing
CommandArgParserTest,ReviewStateCliParserTest,ReviewStateHarnessTest.test/review-state.bats(a flag given twice onupdatestores the last value).Follow-up
The stale
resolveIssueIdexample indocs/api/ReviewStateCliParser.mdis filed on #440.Release notes
See
project-management/issues/IW-548/release-notes.md.🤖 Generated with Claude Code
Closes #548
Issue: IW-548 Phase: 1 - The last-wins rule for a non-repeatable valued flag is not pinned by a test or stated in a document This commit marks the checkpoint for phase 1 context generation. Use dx-fix IW-548 to return to this point. 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>The last-wins rule for a non-repeatable valued flag is not pinned by a test or stated in a document Artifacts: - phase-01-tasks.md 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Issue: IW-548 Phase: 2 - review-state write/update take the first occurrence of a scalar flag This commit marks the checkpoint for phase 2 context generation. Use dx-fix IW-548 to return to this point. 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>review-state write/update take the first occurrence of a scalar flag Artifacts: - phase-02-tasks.md 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>