fix(#4734): degrade worktree isolation when the root has no git repository (#4843)

* test(#4734): non-git root must degrade worktree isolation (failing first)

* fix(#4734): degrade worktree isolation when the root has no git repository

* fix(#4734): review fold-ins — 3972 ladder fixture, parity fixture, docs row, message wording

* chore(#4734): backfill changeset PR number (4843)

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-09-18 03:16:25 -04:00
committed by GitHub
parent 8d0b6868ae
commit c5629bbe74
8 changed files with 290 additions and 83 deletions

View File

@@ -577,9 +577,13 @@ describe('executor-identity parity: hooks/gsd-agent-isolation-guard.js (Claude)
let cursorProject; // harness-worktree GSD project, not an isolated worktree
before(() => {
claudeProject = createTempDir('gsd-cs-parity-claude-');
fs.mkdirSync(path.join(claudeProject, '.planning'), { recursive: true });
fs.writeFileSync(path.join(claudeProject, '.planning', 'config.json'), JSON.stringify({ runtime: 'claude' }));
// Must be a REAL git repo (not a bare mkdir'd directory) — same reason as
// cursorProject below, and load-bearing since #4734: the Claude guard's
// fallback degrades to 'none' on a repository-less root, so a non-git
// fixture would flip the Claude side to allow and the parity probe would
// compare Claude-allowing against Cursor-denying instead of comparing two
// ACTUALLY enforcing configurations.
claudeProject = makeGitProject('gsd-cs-parity-claude-', JSON.stringify({ runtime: 'claude' }));
// Must be a REAL git repo (not a bare mkdir'd directory): the Cursor hook's
// #3045 MAJOR 3 "not a git repo -> INERT" branch would otherwise short-circuit