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:
Tom Boucher
2026-05-12 18:50:35 -04:00
committed by GitHub
parent 29b3e470f0
commit a4f94c87aa
5 changed files with 83 additions and 2 deletions

View File

@@ -278,6 +278,11 @@ export const phasePlanIndex: QueryHandler = async (args, projectDir, workstream)
const phaseFiles = await readdir(phaseDir);
const planFiles = phaseFiles.filter(f => f.endsWith('-PLAN.md') || f === 'PLAN.md').sort();
const summaryFiles = phaseFiles.filter(f => f.endsWith('-SUMMARY.md') || f === 'SUMMARY.md');
const nonCanonicalPlanFiles = phaseFiles.filter((f) => (
f.toLowerCase().endsWith('.md')
&& /(^|-)plan(-|\.)/i.test(f)
&& !(f.endsWith('-PLAN.md') || f === 'PLAN.md')
)).sort();
// Build set of plan IDs with summaries — match the planId derivation logic
const completedPlanIds = new Set(
@@ -433,6 +438,10 @@ export const phasePlanIndex: QueryHandler = async (args, projectDir, workstream)
let hasCheckpoints = false;
const warnings: string[] = [];
if (nonCanonicalPlanFiles.length > 0) {
warnings.push(`Ignored noncanonical plan files: ${nonCanonicalPlanFiles.join(', ')}`);
}
for (const raw of rawPlans) {
if (!raw.autonomous) {
hasCheckpoints = true;