review-state: --git-sha is documented on 'write' and silently ignored there #495
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#495
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found triaging IW-436 (LESSONS.md entry 6).
docs/commands/review-state.md:104lists--git-sha <value>in thewriteflag table (Override auto-detected git SHA), and:153extends that same table toupdate("All flags fromwritecommand, plus:").But
parseWriteArgs'syieldsetsgitSha = defaults.gitSha(core/model/ReviewStateCliParser.scala:182), anddefaultsis built entirely fromWriteDefaultsincore/commands/ReviewState.scala:132-136, whosegitShacomes fromenv.git.getHeadSha(env.cwd).toOption(:135). The flag list passed toparseWriteArgsis never consulted for--git-sha. OnlyparseUpdateArgs:229reads the flag.Observed
writes the actual HEAD SHA, not
1234567, with no warning and exit 0. The documented override does nothing onwrite; it works only onupdate.Wanted
Either honour
--git-shainparseWriteArgs, or drop the row from thewriteflag table.Scope note
This is the opposite shape to IW-436 defect 5 (which was
updatefailing to refreshgit_shawhen no flag is given); this is a flag given and dropped. IW-436 RESOLVED 3 confined that phase toapplyUpdate, so this code was left as it is.Intake: fixed by
8cea0acb8cea0acb("Generated docs and skill") generatesdocs/commands/review-state.mdfrom the declaration registry. Its diff removes the--git-sharow from thewriteflag table and the line "All flags fromwritecommand, plus:". This is the second option in "Wanted": drop the row from thewritetable. Now onlyupdatelists--git-sha(docs/commands/review-state.md:23), andupdatehonours it.Also,
7f1a97fe(#500) makeswriterefuse flags that it does not declare. On origin/main,./iw review-state write --git-sha 1234567 ...now stops withError: Unknown flag: --git-shaand exit 1, and writes no file. The flag is no longer dropped silently.