feat: parallel IDD via git worktree isolation (#167) - #168
Merged
Merged
Conversation
Add idd-worktree.sh helper (create/cleanup/list) + a worktree-isolation convention so multiple IDD pipelines run concurrently (multi-window / Case B) without working-tree / branch / staging collision, riding the existing --cwd plumbing. A git worktree isolates working-tree, branch, and repo-relative .claude/.idd/ staging simultaneously. Convergence = N branches -> N PRs (no merge-back); single-cluster-PR work stays on sequential /idd-all-chain. Case A (within-window agent teams, merge-back) explicitly deferred to a future change. - scripts/idd-worktree.sh + 30-assertion fixture test suite - references/worktree-isolation.md (convention + lifecycle + convergence) - idd-implement Phase 0.5: slug-agnostic idd/<N>-* worktree-branch acceptance - idd-close: best-effort terminal worktree GC (never blocks close) - cross-repo-cwd.md cross-ref; CHANGELOG + plugin.json 2.74.0 -> 2.75.0 - Spectra change idd-worktree-isolation (proposal/design/spec/tasks) Refs #167
Two P2 correctness gaps surfaced by the verify ensemble (Codex caught the first; logic reviewer cross-confirmed the second): - Helper now anchors repo-root on the MAIN worktree (first `git worktree list` entry) instead of `rev-parse --show-toplevel`, so create/cleanup/ list are correct even when invoked from inside a linked worktree — fixes idd-close GC silently no-op'ing under --cwd. idd-close also passes --repo-root explicitly (defense in depth). - create refuses a canonical `.claude/worktrees/idd-<N>/` path registered on a wrong branch (exit 4) instead of misleading exit 0. Plus lower-severity hardening: ensure_gitignore refuses symlinked .gitignore (security LOW); design.md rationale no longer over-claims that N-PRs "deletes that entire problem" (DA — same-file parallel edits still conflict at 2nd PR merge; spec SHALL was already honest); spec gitignore wording aligned to the line-presence guard; idd-implement note clarifies the acceptance clause is intentionally not --cwd-gated. Tests: 30 -> 34 assertions (+wrong-branch refusal, +cleanup-from-linked- worktree). All GREEN. spectra validate clean. Refs #167
kiki830621
force-pushed
the
idd/167-worktree-isolation
branch
from
May 31, 2026 05:08
114f384 to
03b2b17
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #167
Summary
Parallel IDD via git worktree isolation (multi-window / Case B). A git worktree isolates the working tree, branch HEAD, and repo-relative
.claude/.idd/staging simultaneously, riding the existing--cwdplumbing — so N Claude Code windows can each run a full IDD pipeline on N issues without colliding.Convergence = N independent branches → N PRs (no merge-back); work that must land as one clustered PR stays on the existing sequential
/idd-all-chain. Case A (within-window agent teams, merge-back orchestration) is explicitly deferred to a future change.Implements Spectra change
idd-worktree-isolation(proposal / design / spec / tasks underopenspec/changes/).What's in it
scripts/idd-worktree.sh—create/cleanup/list; exit codes 0–5; stdout = worktree-path-only (feeds--cwd); strict-numericN(blocks path injection); anchors on the main worktree so it's correct from any linked worktree.scripts/tests/idd-worktree/test.sh— 34 assertions (throwaway-repo fixtures).references/worktree-isolation.md— the convention contract + deferred-Case-A boundary.idd-implementPhase 0.5 — slug-agnosticidd/<N>-*worktree-branch acceptance (composes a helper-created worktree end-to-end).idd-closeStep 6.7 — best-effort terminal worktree GC (never blocks close).cross-repo-cwd.mdcross-ref; CHANGELOG + plugin.json 2.74.0 → 2.75.0 (minor, additive).Verify
6-AI ensemble (5 Claude reviewers + Codex gpt-5.5 xhigh) on
1f34fcc→ 0 hard-blocking; 2 P2 + 4 minor → all fixed in-PR at114f384. Codex (cross-model) caught the main-worktree-anchoring bug the 5 same-family reviewers missed. Tests 34 GREEN,spectra validateclean.Checklist
/idd-close #167, then/spectra-archive idd-worktree-isolationDo NOT add a GitHub auto-close trailer — IDD requires a manual close after merge (checklist gate + closing summary). Worktree GC runs automatically during the close.