Repository navigation
Offer optional worktree isolation when another task uses the repo - #10
Merged
Merged
Conversation
Detect other in-flight work at plan start and record continue, wait, or isolate for a cold-start implement. Keep the procedure in one shared reference so review, correction, and reconcile follow that checkout. Co-authored-by: Dennis Geldmacher <geldmacher.dennis@outlook.de>
Count only in-flight worktrees, let wait win on mid-edit files, and create a worktree at the first implementation step when a reviewer can read that checkout. Co-authored-by: Dennis Geldmacher <geldmacher.dennis@outlook.de>
…ktree. Count another worktree only for uncommitted work or a named handoff, and treat an unclear reviewer workspace or a missing clarity field as a pause. Co-authored-by: Dennis Geldmacher <geldmacher.dennis@outlook.de>
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.
Why
Two Workflow tasks that plan or implement in the same checkout step on each other. One agent’s edits land in the other’s dirty tree, branches get mixed, and the merge is harder than the product change. A hard lock would also block intentional parallel work, and forcing a git worktree for every plan would add ceremony to the common case: one clean checkout, one task.
The check is a soft warning at the start of planning (and before the first edit of a sequence that does not already have a choice). The human can continue carefully, wait, or isolate. A clean sole checkout, including a clean idle worktree, stays put: no question, no worktree. Commits that only exist on another branch do not count as overlap.
A worktree avoids the checkout clash now. It does not merge itself. Folding the branch back, or throwing the attempt away, stays an explicit request so unrelated dirt and other people’s worktrees are not swept up at the end.
How
The procedure lives in one shared reference,
references/concurrent-work.md, loaded only when detection finds overlap or the plan already records a checkout choice. That keeps it out of the default plan, review, correction, and Auto-Work context. A separateworktree-isolationorreconcile-worktreeskill would repeat the same steps at discovery time; the phases already have entrypoints, so they cross-link instead.Detection uses git (common directory,
git worktree list, this checkout’s uncommitted changes) plus plans and reports already in the task, and host-visible sessions when the host already exposes them. Another worktree counts only when that checkout has uncommitted changes, or a handoff or host-visible task names both this repository and that checkout. Commits that only exist on its branch do not. A clean idle worktree does not. Stale local branches with no worktree and no unfinished handoff do not either. Nothing is written to a new lock file or plan registry. The native plan is the cold-start record Implement already uses: choice, base, branch, path, what must be preserved, and whether the other owner and the overlapping files are clear.One recommendation, first match wins:
git worktree addruns only as the first implementation step, for the branch and path named in the plan, and only when the plan says the other owner and the overlapping files are clear. A missing clarity field pauses and does not create the worktree. Light approval covers that step. Dark may take it only with that clear field. The step still does not authorize commit, push, or merge.Agent-facing behavior:
Context: default phase scenarios omit the reference. The sharper rules stayed in
references/concurrent-work.md.plan-work,reviewer.md, andimplementation-work.mdwere not lengthened.Checks
npm run context-budgetandnpm run link-checkpassed.node --test tests/concurrent-work.test.mjspassed.npm teston the first revision: 78 passed. The 24 GitHub release tests fail in this environment becauseoriginis rewritten to an authenticated URL (repository must identify one GitHub repository). That check is unchanged by this diff.