phase-commit: --items splits commas inside bullet strings, mangling commit body #337
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#337
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?
Problem
./iw phase-commit --items "<bullet 1>,<bullet 2>,..."splits the--itemsvalue on every comma, including commas that appear inside a single bullet's text. This produces a mangled commit body where one logical bullet is broken into multiple half-sentences.Reproduction
Expected commit body:
Actual commit body (from
iterative-works/procedurescommit1dea03bb):The first bullet got split into three because the parser treated every comma as a separator.
Root cause hypothesis
--itemsis presumably parsed by a naivestring.split(","). This is unsafe whenever a bullet contains a comma — which is common in technical writing (lists of class names, qualified types, etc.).Fix options
--itemsmultiple times, one bullet per occurrence:--items "first" --items "second". CLI-idiomatic, no quoting tricks needed.;;or\n). Documented but ugly.Option 1 is the cleanest and matches how most CLI tools handle list-valued flags (
gh pr create --label foo --label bar).Impact
Cosmetic but visible: every multi-bullet phase commit produced by the agile workflow's
ag-implementorchestration with bullets containing commas will have a mangled commit body. PR descriptions are unaffected (they are generated separately), butgit logviews are noisy.Workaround until fixed
Avoid commas inside individual bullets when calling
phase-commit --items, or invokegit commitdirectly.Merging #471 into this issue as a duplicate. Everything #471 held that this issue did not:
Second sighting — triaging IW-437, committing phase 2.
./iw phase-commit --items "A, and not B,C,D"wrote three bullets, not two. One sentence came out as:Third sighting — IW-476 phase 1 (recorded as that issue's LESSONS.md entry 11). Same shape; the commit message was repaired with
git commit --amend.Why it is easy to miss — the command reports success and echoes the resulting message, so the damage is visible only if the caller reads back the
messagefield it printed.Fix options, as a design choice rather than a one-liner — an escape syntax, a repeatable
--itemflag, or a different separator.If the restriction is kept instead, it must at least be stated in the command's
--help. #463 covers giving every command a--helpthat can guide an agent. Note thatcommands/phase-commit.scala:2currently documents the flag as[--items ITEM1,ITEM2,...]and does not warn that the separator is a plain split.Fixed in PR #501 (merge
d1eba9c4).--itemsis now repeatable: each occurrence is exactly one bullet and a comma inside a value is literal. The flag name is unchanged.Two follow-ups, both outside this repo or this issue: the kanon workflow skills and the published
iw-cli-opsskill still comma-join and must be regenerated; and a value beginning with two dashes is silently dropped by the parser guard, which wants its own issue.