Bundle WorktreeCreationService I/O collaborators so createWithLock forwards without restatement #442

Open
opened 2026-08-23 19:29:31 +00:00 by mph · 1 comment
Owner

dashboard/jvm/src/application/WorktreeCreationService.scala:48-61 and :158-171.

create and createWithLock take the identical nine parameters, and the ~35-line @param block is copied verbatim onto both. createWithLock uses none of them — it acquires a lock, forwards every argument unchanged to create, and releases.

Adding IW-423's attachHint parameter therefore meant editing two signatures and two docstrings to say the same thing, and every test call site supplies the same bag twice.

Lesson: a pass-through wrapper that restates its callee's whole parameter list makes every later parameter addition a two-site edit, and the duplication grows with each one.

Fix

Bundle the I/O collaborators into one record so createWithLock forwards it without restatement.

Not done in IW-423 because bundling is a design change to signatures that phase had just settled, and folding a refactoring into the de-tmuxing sweep would have made the sweep unreviewable.


Recorded during IW-423; see project-management/issues/IW-423/LESSONS.md entry 18.

`dashboard/jvm/src/application/WorktreeCreationService.scala:48-61` and `:158-171`. `create` and `createWithLock` take the identical nine parameters, and the ~35-line `@param` block is copied verbatim onto both. `createWithLock` uses none of them — it acquires a lock, forwards every argument unchanged to `create`, and releases. Adding IW-423's `attachHint` parameter therefore meant editing two signatures and two docstrings to say the same thing, and every test call site supplies the same bag twice. **Lesson:** a pass-through wrapper that restates its callee's whole parameter list makes every later parameter addition a two-site edit, and the duplication grows with each one. ## Fix Bundle the I/O collaborators into one record so `createWithLock` forwards it without restatement. Not done in IW-423 because bundling is a design change to signatures that phase had just settled, and folding a refactoring into the de-tmuxing sweep would have made the sweep unreviewable. --- Recorded during IW-423; see `project-management/issues/IW-423/LESSONS.md` entry 18.
Member

Intake: needs-input
Workflow: waterfall
Reason: G1 (1 CLARIFY marker)
Analysis: project-management/issues/IW-442/analysis.md on branch IW-442

1. Should IW-442 build the collaborator bundle now, or close as superseded by IW-477? (G1)

IW-442 asks for one record that holds the I/O collaborators of the dashboard's worktree-creation service. With it, createWithLock would forward one value and stop repeating the nine parameters of create (analysis). IW-477 is open and waits for a human decision. Its plan makes the same service a thin adapter and rewrites its tests, so this record would be deleted (IW-477 analysis):

WorktreeCreationService becomes a thin adapter: take the lock, call CreateWorktree.run, release the lock

  • a) Build it now. Cost: 2.5-3.5h. When IW-477 lands, all of this work is deleted.
  • b) Close IW-442 as superseded by IW-477. Link lesson entry 18 there. Cost: 0h. The repeated parameter list stays until IW-477 lands. No new parameter is planned before then.
  • c) Keep IW-442 open and blocked on the IW-477 decision. Build it only if IW-477 is deferred. Cost: 0h now. The decision moves to the triage of IW-477.

Recommended: b): IW-477 removes the whole repeated parameter list, so this record would have no value after IW-477 lands.

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.

Intake: needs-input Workflow: waterfall Reason: G1 (1 CLARIFY marker) Analysis: project-management/issues/IW-442/analysis.md on branch IW-442 ### 1. Should IW-442 build the collaborator bundle now, or close as superseded by IW-477? (G1) IW-442 asks for one record that holds the I/O collaborators of the dashboard's worktree-creation service. With it, `createWithLock` would forward one value and stop repeating the nine parameters of `create` ([analysis](https://code.iterative.works/iterative-works/iw-cli/src/branch/IW-442/project-management/issues/IW-442/analysis.md#L140-L148)). IW-477 is open and waits for a human decision. Its plan makes the same service a thin adapter and rewrites its tests, so this record would be deleted ([IW-477 analysis](https://code.iterative.works/iterative-works/iw-cli/src/branch/IW-477/project-management/issues/IW-477/analysis.md#L141)): > `WorktreeCreationService` becomes a thin adapter: take the lock, call `CreateWorktree.run`, release the lock - **a) Build it now.** Cost: 2.5-3.5h. When IW-477 lands, all of this work is deleted. - **b) Close IW-442 as superseded by IW-477.** Link lesson entry 18 there. Cost: 0h. The repeated parameter list stays until IW-477 lands. No new parameter is planned before then. - **c) Keep IW-442 open and blocked on the IW-477 decision.** Build it only if IW-477 is deferred. Cost: 0h now. The decision moves to the triage of IW-477. **Recommended: b)**: IW-477 removes the whole repeated parameter list, so this record would have no value after IW-477 lands. 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.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#442
No description provided.