Repository navigation
feat: run build passes in per-branch git worktrees - #24
Merged
Merged
Conversation
Closes the checkout-location half of the loop: a build or repair pass now works in a dedicated git worktree at <repo>-worktrees/<flattened-branch> (sibling of the main tree) instead of checking its gsd/NNN-* branch out in the repository's main working tree. The main tree stays on the default branch across a pass and dependency installs never touch it. Open decisions in the issue resolved as follows: - O-9: detected fallback, no new config surface. A pass attempts `git worktree add`; if worktrees are unavailable or creation fails, it falls back to the current in-tree checkout behavior under the existing dirty-worktree guards and says so in the report and result `reason` (`worktree-fallback`). - O-4: cleanup rides a later pass's recovery sweep. "Pick up after a dead pass" now starts by listing gsd worktrees and removing any whose branch's PR is merged/closed or whose branch is gone from origin, followed by `git worktree prune`, before claiming new work. Passes never merge, so no pass removes its own worktree. Also updates the interrupted-pass recovery states to resolve against worktrees (same verdicts as today), reuses existing worktrees on resume, leaves a failed pass's worktree in place with its path named, clarifies the `dirty-worktree` result reason, and fixes the loose "worktree" wording (meaning "checkout") in README.md and docs/install.md. Review passes, issue selection, verdict semantics, branch naming, and the spec/discover playbooks are unchanged per X-1..X-5.
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.
Summary
Implements the O-1..O-9 outcomes of #22: a build or repair pass now works in a dedicated git worktree at
<repo>-worktrees/<flattened-branch>(sibling of the main tree) instead of checking itsgsd/NNN-*branch out in the repository's main working tree. The main tree stays on the default branch across a pass and dependency installs never touch it.The change is playbook prose (
loop/build.md) plus wording fixes inREADME.md/docs/install.md(which used "worktree" loosely to mean "checkout") — no code changes, since the loop is agent-executed andlib/process.mjsis not involved in checkout location.Open decisions in the issue resolved as:
git worktree add; on failure it falls back to the current in-tree checkout under the existing dirty-worktree guards and discloses it via theworktree-fallbackresult reason.Exclusions X-1..X-5 honored: no changes to review/spec/discover lanes, selection or verdict logic, branch naming, or merge semantics.
Closes #22
Test plan
bash tests/run.sh— all suites pass, including 9 new literal contract greps intests/playbook_contract_test.shpinning the new build.md prosenode tests/npm_package_test.mjs— passes