WorktreePortSlots: follow git pointers with the HEAD check, and share the Either-sequence fold #754
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#754
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 during IW-682 (port allocation for worktrees). Both items touch
core/adapters/WorktreePortSlots.scala. Follow-ups, verbatim:.git/commondirpointers without theHEADcheck that GitDirReader.stateRoot does — a hostile checkout could make claim create the lock/slot file outside a git dirsequence, core/model/CommandIndexFile.scala:423traverse, core/model/ReviewStateCliParser.scala:350sequenceIntake: needs-input
Workflow: waterfall
Reason: G7 (1 [human] finding)
Analysis: project-management/issues/IW-754/analysis.md on branch IW-754
1. Should this issue replace only the three fold copies the issue names, or all eleven copies the analysis found? (G7)
The issue names three copies of the same loop. The loop turns a list of results that can fail into one result, at WorktreePortSlots.scala:239, CommandIndexFile.scala:423 and ReviewStateCliParser.scala:347. The analysis found 8 more copies (see the table and the decision). It plans to replace all 11 with one shared function that reports the first bad entry. Four of the extra sites report the last bad entry now: HerdrReply, ServiceDeclaration, LinearClient and YouTrackClient. With all 11, users of these sites see a different error message.
Recommended: b) — The issue asks for one shared fold, and if we keep 8 copies, the duplication that the issue is about stays in the code.
Answer in a comment on this issue, per number, for example "1: a", or in your own words; intake reads it on its next iteration.