Summary
--worktree is currently exposed in CLI/API but does not create or run loops in a dedicated git worktree. For Phase 4/S5 parallel loops (and outcomes expected from #39 / #59), real worktree isolation is a prerequisite.
Part of #59.
Supports #39, #71, #72.
Problem
Current behavior indicates a gap between contract and implementation:
wiggum run --worktree forwards the flag, but loop execution stays in the project root working tree.
feature-loop.sh parses --worktree and logs it, but does not git worktree add or switch APP_DIR to a per-feature worktree.
- TUI run path does not pass
--worktree today, so interactive runs cannot use isolation.
- Review prompt text still references worktree cleanup despite no guaranteed worktree creation in the flow.
This weakens reliability for parallelism and can cause branch/working-tree contention.
Scope
- Implement true per-feature worktree provisioning in loop runtime.
- Route all execution contexts consistently:
- CLI
wiggum run --worktree
- Agent
runLoop(worktree=true)
- TUI run path (configurable or default policy)
- Standardize worktree path strategy and lifecycle:
- create if missing
- reuse on
--resume
- deterministic cleanup policy after completion/merge/failure
- Ensure commands run against worktree app dir (tests, build, diff, PR/review gates).
- Align prompt instructions with actual harness ownership (no phantom cleanup steps in prompts).
- Add tests covering flag plumbing + runtime behavior.
Acceptance Criteria
Suggested Labels / Priority
- Type:
bug (contract says isolation exists, runtime does not honor it)
- Domains:
cli, infrastructure
- Meta:
loop, user-facing
- Priority: P1
- Size: M/L
Summary
--worktreeis currently exposed in CLI/API but does not create or run loops in a dedicated git worktree. For Phase 4/S5 parallel loops (and outcomes expected from #39 / #59), real worktree isolation is a prerequisite.Part of #59.
Supports #39, #71, #72.
Problem
Current behavior indicates a gap between contract and implementation:
wiggum run --worktreeforwards the flag, but loop execution stays in the project root working tree.feature-loop.shparses--worktreeand logs it, but does notgit worktree addor switchAPP_DIRto a per-feature worktree.--worktreetoday, so interactive runs cannot use isolation.This weakens reliability for parallelism and can cause branch/working-tree contention.
Scope
wiggum run --worktreerunLoop(worktree=true)--resumeAcceptance Criteria
--worktreecreates/uses a dedicated worktree path for the feature branch--resumereattaches to the same worktree for that featureSuggested Labels / Priority
bug(contract says isolation exists, runtime does not honor it)cli,infrastructureloop,user-facing