fix(#280): anchor execute-phase subagent reads to project root (#286)

This commit is contained in:
Tom Boucher
2026-05-26 12:09:26 -04:00
committed by GitHub
parent c66705d6ba
commit e08fea7ef2
3 changed files with 31 additions and 10 deletions

View File

@@ -84,6 +84,20 @@ describe('bug #3099: absolute-path safety guidance in gsd-executor.md', () => {
);
});
test('execute-phase prompt anchors subagent file paths to project_root before files_to_read (#280)', () => {
const filesIdx = executePhaseSrc.indexOf('<files_to_read>');
assert.ok(filesIdx !== -1, 'files_to_read block not found in execute-phase.md');
const dispatchSnippet = executePhaseSrc.slice(filesIdx, filesIdx + 1800);
assert.ok(
dispatchSnippet.includes('PROJECT_ROOT=$(git rev-parse --show-toplevel'),
'executor dispatch must compute PROJECT_ROOT in the prompt before file reads',
);
assert.ok(
dispatchSnippet.includes('${PROJECT_ROOT}/'),
'executor files_to_read paths must be anchored to ${PROJECT_ROOT}/',
);
});
test('worktree-path-safety.md reference file exists', () => {
assert.ok(
fs.existsSync(path.join(ROOT, 'get-shit-done', 'references', 'worktree-path-safety.md')),