fix: align planner plan contract with phase index (#3436)
* test: add planner/query contract regressions (#3430) * fix: align planner plan contract with phase index (#3430) * docs: add changeset for #3430 * fix: keep planner contract docs within size budget (#3430) * docs: set changeset pr for #3430
This commit is contained in:
44
tests/bug-3430-planner-phase-contract.test.cjs
Normal file
44
tests/bug-3430-planner-phase-contract.test.cjs
Normal file
@@ -0,0 +1,44 @@
|
||||
// allow-test-rule: source-text-is-the-product
|
||||
// Planner markdown is the deployed planning contract; these checks lock the
|
||||
// exact canonical forms that downstream phase-plan-index accepts.
|
||||
|
||||
'use strict';
|
||||
|
||||
const { test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const PLANNER_PATH = path.join(__dirname, '..', 'agents', 'gsd-planner.md');
|
||||
|
||||
function readPlanner() {
|
||||
return fs.readFileSync(PLANNER_PATH, 'utf8');
|
||||
}
|
||||
|
||||
test('#3430: planner SUMMARY instruction uses canonical padded phase/plan form', () => {
|
||||
const content = readPlanner();
|
||||
assert.match(
|
||||
content,
|
||||
/Create `\.planning\/phases\/XX-name\/\{padded_phase\}-\{plan\}-SUMMARY\.md` when done/,
|
||||
'planner must instruct executors to write SUMMARY files in canonical padded-phase form'
|
||||
);
|
||||
assert.doesNotMatch(
|
||||
content,
|
||||
/After completion, create `\.planning\/phases\/XX-name\/\{phase\}-\{plan\}-SUMMARY\.md`/,
|
||||
'planner must not instruct the broken {phase}-{plan}-SUMMARY.md form'
|
||||
);
|
||||
});
|
||||
|
||||
test('#3430: planner depends_on docs show canonical in-phase plan ids', () => {
|
||||
const content = readPlanner();
|
||||
assert.match(
|
||||
content,
|
||||
/depends_on:[^\n]*Use `01-01`\/`01-01-auth-hardening`/,
|
||||
'planner must document canonical depends_on examples that phase-plan-index resolves'
|
||||
);
|
||||
assert.doesNotMatch(
|
||||
content,
|
||||
/depends_on:[^\n]*01-trust\/01/,
|
||||
'planner must not document phase-slug/plan-number depends_on examples as canonical'
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user