fix: have executor self-report worktree metadata (#1349)
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
"gsd-domain-researcher.md": 6938,
|
||||
"gsd-eval-auditor.md": 7761,
|
||||
"gsd-eval-planner.md": 7008,
|
||||
"gsd-executor.md": 42519,
|
||||
"gsd-executor.md": 43343,
|
||||
"gsd-framework-selector.md": 6778,
|
||||
"gsd-integration-checker.md": 15148,
|
||||
"gsd-intel-updater.md": 18122,
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"docs-update.md": 54770,
|
||||
"edit-phase.md": 12883,
|
||||
"eval-review.md": 9923,
|
||||
"execute-phase.md": 93122,
|
||||
"execute-phase.md": 93157,
|
||||
"execute-plan.md": 31365,
|
||||
"explore.md": 10497,
|
||||
"extract-learnings.md": 12849,
|
||||
|
||||
@@ -684,6 +684,29 @@ describe('bug #3384: worktree cleanup workflow contracts', () => {
|
||||
assert.doesNotMatch(content, /done < <\(git worktree list --porcelain \| grep "\^worktree " \| grep "\\\.claude\/worktrees\/agent-"/);
|
||||
});
|
||||
|
||||
test('#1297 gsd-executor self-reports authoritative worktree metadata', () => {
|
||||
const content = fs.readFileSync(EXECUTOR_AGENT_PATH, 'utf8');
|
||||
assert.match(content, /<worktree_metadata_capture>/);
|
||||
assert.match(content, /git rev-parse --show-toplevel/);
|
||||
assert.match(content, /git rev-parse --abbrev-ref HEAD/);
|
||||
assert.match(content, /GSD_WORKTREE_EXPECTED_BASE=\$\(git rev-parse HEAD\)/);
|
||||
assert.match(content, /<worktree_metadata>/);
|
||||
assert.match(content, /"worktree_path":/);
|
||||
assert.match(content, /"branch":/);
|
||||
assert.match(content, /"expected_base":/);
|
||||
});
|
||||
|
||||
test('#1297 execute-phase consumes executor-returned worktree metadata before harness metadata', () => {
|
||||
const content = fs.readFileSync(EXECUTE_PHASE_PATH, 'utf8');
|
||||
assert.match(content, /<worktree_metadata>/);
|
||||
assert.match(content, /executor-returned worktree metadata/i);
|
||||
assert.match(content, /harness metadata/i);
|
||||
assert.ok(
|
||||
content.indexOf('executor-returned worktree metadata') < content.indexOf('harness metadata'),
|
||||
'execute-phase must prefer executor-returned worktree metadata before runtime harness metadata (#1297)'
|
||||
);
|
||||
});
|
||||
|
||||
test('quick contract requires a cleanup manifest instead of global worktree discovery', () => {
|
||||
const content = fs.readFileSync(QUICK_PATH, 'utf8');
|
||||
assert.match(content, /WAVE_WORKTREE_MANIFEST|QUICK_WORKTREE_MANIFEST/);
|
||||
|
||||
Reference in New Issue
Block a user