fix: add regression-test-presence gate + missing tests for #2429/#2279 (#2563)

lint-fix-has-regression-test.cjs: new gate that fails if a fix(#NNNN)
or feat(#NNNN) commit has zero behavioral test files (*.test.cjs,
excluding auto-generated fixtures/baselines) in its diff. Wired into
lint:ci so it runs before PR creation.

Missing regression tests added:
- #2429: codex local scope does not set $HOME/.agents skills home;
  global scope does (tests/runtime-artifact-layout.test.cjs)
- #2279: map-codebase instructions say to overwrite existing dates,
  not just replace [YYYY-MM-DD] placeholders (tests/commands.test.cjs)
This commit is contained in:
Tom Boucher
2026-07-23 12:13:12 -04:00
committed by GitHub
parent 7d298d6d4d
commit a5180d96a3
4 changed files with 180 additions and 1 deletions

View File

@@ -3585,3 +3585,33 @@ describe('query commit --files scoping (#2269)', () => {
assert.match(content.slice(idx, idx + 200), /ROADMAP\.md/);
});
});
describe('#2279: map-codebase date stamp instructions overwrite existing dates', () => {
const REPO_ROOT = path.join(__dirname, '..');
test('codebase-mapper agent says to SET date stamps, overwriting existing values', () => {
const content = fs.readFileSync(
path.join(REPO_ROOT, 'agents', 'gsd-codebase-mapper.md'), 'utf-8'
);
assert.match(content, /overwriting whatever date is already there/i,
'must instruct the agent to SET date stamps unconditionally, not just replace [YYYY-MM-DD] placeholders');
});
test('map-codebase workflow spawn prompts say to SET date stamps, not replace placeholders', () => {
const content = fs.readFileSync(
path.join(REPO_ROOT, 'gsd-core', 'workflows', 'map-codebase.md'), 'utf-8'
);
const stampLines = content.match(/Set all date stamps[^\r\n]*/g) || [];
assert.ok(stampLines.length >= 4,
`must have ≥4 "Set all date stamps" instructions (4 spawn prompts + 1 sequential); got ${stampLines.length}`);
});
test('map-codebase sequential path says to SET date stamps overwriting existing dates', () => {
const content = fs.readFileSync(
path.join(REPO_ROOT, 'gsd-core', 'workflows', 'map-codebase.md'), 'utf-8'
);
const idx = content.indexOf('overwriting any existing date');
assert.notEqual(idx, -1,
'workflow must instruct agents to overwrite existing dates, not just replace [YYYY-MM-DD] placeholders');
});
});