feat(effort-worktrees): key worktrees on an issue or an effort slug #409
No reviewers
Labels
No labels
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
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!409
Loading…
Reference in a new issue
No description provided.
Delete branch "effort-worktrees"
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
iw startcould only create a worktree for a tracker issue. The interactive slice loop'ssl-define --local(iterative-works plugin v1.48.0) needs the opposite: a worktree keyed on aneffort — a human-named branch with no tracker issue, hosting N slices that ship as one PR.
Before this, that flow meant
git worktree addby hand, tmux by hand, no dashboard card, and — thereal cost —
iw rmcould not tear it down, so the build-tool cleanup hooks never ran.This adds
iw start --effort <slug>and carries the new key through the CLI and the dashboard.Design
Worktree identity and tracker issue were the same concept. They are now split:
EffortSlugrejects anythingIssueId.fromBranchaccepts, soiw-399-followupcannot silentlyresolve to issue
IW-399. The guard is single-sourced against the real parser rather than a secondregex that could drift from it.
Contract with the slice loop (plugin v1.48.0, already shipped)
project-management/efforts/<slug>/directory nameproject-management/.active-slice— untracked, holds the repo-relative path of the active slice directory<slice-dir>/review-state.jsonwithissue_id= the effort slugefforts/<slug>/slices/<NN>-<slice-slug>/{card.md,tracker.md,review-state.json}Issue-keyed worktrees and issue-keyed slices are untouched — this is additive.
What changed
Core — new
EffortSlugandWorktreeKey;WorktreePathkeyed on either.--effortonstart,grounded on the effort directory being committed on HEAD (a worktree is cut from HEAD, so an
uncommitted effort dir would produce a worktree where
sl-define --localimmediately fails).open/rm/statusaccept a slug.review-stateresolves its default path through.active-sliceand refuses to guess when the pointer is absent, instead of writing underproject-management/issues/.worktreesandregisterderive the parent project key-aware.Dashboard — registration carries the worktree kind; a state file without the field reads as an
issue worktree, so existing
state.jsonkeeps working. Effort worktrees are never polled for atracker issue and never probed for phase task files. Their review-state resolves via
.active-sliceand is cleared when
sl-close --localremoves the pointer. Both kinds render through shared cardchrome.
Verification
core.compile/dashboard.compile(forced fresh) ·core.test2051 assertions ·dashboard.test745 ·dashboard.itest.testForked· full 42-file BATS suite, 169 ok / 0 not ok ·scala-cli compile --scalac-option -Werror core/.Also hand-run in a throwaway repo with
HOME,IW_SERVER_DISABLED,IW_PLUGINS_DISABLEDandIW_TMUX_SOCKETredirected: worktree + branch + tmux session created; uncommitted effort rejectedwith no branch left behind;
iw worktreeslists the effort from inside its own worktree;review-statewith no--outputlands in the.active-slicedirectory carrying"issue_id": "<slug>"; and nothing is ever written underproject-management/issues/.Two commits here are unrelated to effort worktrees
Kept on this branch deliberately rather than split, but flagged so review can treat them separately:
23a6a3f—iw-runscanned installed plugins on every invocation, so a plugin on thedeveloper's machine leaked into the E2E suite and
start-prompt.batscould never observe thewarning it asserts. Adds
IW_PLUGINS_DISABLED=1to the BATS setups. The suite cannot passhermetically without it.
93b3ad1—buildFetchFunction/buildSearchFunctionhad noForgejobranch, so/api/issues/recentand/api/issues/searchanswered 500 with aMatchErroron aForgejo-configured project — i.e. on this repo's own dashboard. Forgejo now joins GitLab as a
tracker without recent/search support.
Follow-ups (not in this PR)
iw startexits 1 on success in a non-TTY because it ends intmux attach. Pre-existing andidentical for
iw start <issue>, but an automated caller cannot distinguish it from a realfailure by exit code.
iw-cli-opsskill needs regenerating for the new command surface(
build-iw-cli-skills).build.millsets noscalacOptions, so the Mill compile tasks do not enforce-Werror— onlythe pre-commit hook does, and only for
core/. The dashboard has no-Werrorpath at all.