Repository navigation
feat(#1199): configurable worktree root - #1226
Merged
admarble merged 6 commits intoSep 30, 2026
Merged
Conversation
Entire-Checkpoint: 16f7fd2ac03d
Entire-Checkpoint: 012056b4b7d2
Entire-Checkpoint: e3ad69ffa738
Entire-Checkpoint: 5f97cfc65cbf
Entire-Checkpoint: 71edacfb1811
…ktree-configurable-worktree-root
2 tasks
admarble
deleted the
feature/1199-feat-worktree-configurable-worktree-root
branch
September 30, 2026 06:10
This was referenced Sep 30, 2026
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
run.worktreeRoot(settings) andSEQUANT_WORKTREE_ROOT(env, which wins) set where issue worktrees go. Without either, the default is still<parent of repo>/worktrees. A relative value resolves against the main repo root.~is not expanded, and a blank env var counts as unset.resolveWorktreeRoot()inworktree-manager.ts, threaded throughensureWorktree/ensureWorktrees/ensureWorktreesChainfromsettings.run.worktreeRootinrun-orchestrator.ts.templates/scripts/new-feature.shuses the same precedence, andscripts/new-feature.shis a symlink to it. Thegit worktree addhint and theSEQUANT_NPM_CACHEdir follow the root.new-feature.sh: a JSONC-tolerant text match, not env-only. Nothing in TS invokesnew-feature.sh; users and skills call it directly. With env-only, the setting half of AC-1 would silently do nothing for the script. Lines starting with//are dropped, newlines are collapsed, and the first"worktreeRoot": "…"is taken. Known trade-off: a key inside a/* */block would still match. ThepackageManagerread makes the same trade-off.pre-tool.shWORKTREE_WARNINGcheck andquality-checks.sh'sverify_build_against_mainnow compare the absolutegit rev-parse --git-dirwith--git-common-dirinstead of matchingworktrees/feature//*"/worktrees/"*. The hook also checks the command's own directory now: a resolvablecdtarget, else the payloadcwd. Before, it checked the hook process'spwd. All 3 copies of each file are byte-identical..exec-agents/sub-worktrees and other tools' worktrees. That is correct for a warn-only commit check and a find-the-main-repo lookup.docs/guides/git-workflows.md(Worktree Locations), the generated settings reference row, and CHANGELOG.Hook rollout: the repo's
pre-tool.shand the plugin-cache copy both fire. Plugin users get the AC-2 change only after a plugin version bump.Hook verdicts changed: none (
npx tsx scripts/hook-corpus.ts --diff origin/main→0 verdict changes)Possible follow-up (out of scope per owner): these still print
../worktrees/feature/<issue>-*/, but they are guidance text only:src/lib/locks/checkout-lock.ts:182,187,pre-tool.sh:1057, theworktree-resolver.tsprose, and theSKILL.mdtext. Also,quality-checks.shcould derivemain_repo_dirfrom--git-common-dirinstead of thegrep [main]heuristic.AC verification
resolveWorktreeRoot+ call site;src/lib/workflow/worktree-manager.test.ts(precedence unit cases +ensureWorktreerun in a scratch repo via a child process)hooks/pre-tool.shin_linked_worktree;__tests__/pre-tool-hook.integration.test.ts#1199 block (×3 copies)__tests__/new-feature-worktree-root.integration.test.ts: env root, JSONC setting with a//decoy, default__tests__/quality-checks-worktree-root.integration.test.ts: function extracted from each copy, run from a custom-root worktreeMutation record
Mutation-verified: AC-1 — call site reverted to
path.join(path.dirname(gitRoot), "worktrees"); both ensureWorktree cases failed; restored.Mutation-verified: AC-2 — hook check reverted to
grep -qE 'worktrees/feature/'; the two no-warn cases failed; restored.Mutation-verified: AC-3 — setting read in new-feature.sh replaced with an empty value; JSONC case failed; restored.
Mutation-verified: AC-4 — quality-checks condition reverted to
*"/worktrees/"*; custom-root case failed; restored.Test plan
npm run build,npm run lint: cleanSEQUANT_*unset: 20 files, 1640 tests passed. They cover worktree-manager, pre-tool-hook, new-feature-{worktree-root,checkout-guard,frozen-install}, quality-checks-worktree-root, settings*, run-orchestrator*, hook-corpus, tautology-detector-cli and skill-sync.npm testwas not run, per the owner's standard block for this issue. CI runs it.Closes #1199
Refs #1203
🤖 Generated with Claude Code