Merge pull request #3115 from gsd-build/fix/3053-sdk-ignores-multi-plan-phase-layout-plan
fix: count nested plans/ layout in phase status indexing
This commit is contained in:
@@ -131,6 +131,27 @@ describe('init manager', () => {
|
||||
assert.strictEqual(output.phases[4].disk_status, 'no_directory');
|
||||
});
|
||||
|
||||
test('treats plans/PLAN-NN.md layout as planned/complete counts (#3053)', () => {
|
||||
writeState(tmpDir);
|
||||
writeRoadmap(tmpDir, [
|
||||
{ number: '1', name: 'Nested Plans' },
|
||||
]);
|
||||
|
||||
const phaseDir = path.join(tmpDir, '.planning', 'phases', '01-nested-plans');
|
||||
fs.mkdirSync(path.join(phaseDir, 'plans'), { recursive: true });
|
||||
fs.writeFileSync(path.join(phaseDir, 'plans', 'PLAN-01.md'), '# Plan 1');
|
||||
fs.writeFileSync(path.join(phaseDir, 'plans', 'PLAN-02.md'), '# Plan 2');
|
||||
fs.writeFileSync(path.join(phaseDir, 'plans', 'SUMMARY-01.md'), '# Summary 1');
|
||||
|
||||
const result = runGsdTools('init manager', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
assert.strictEqual(output.phases[0].plan_count, 2);
|
||||
assert.strictEqual(output.phases[0].summary_count, 1);
|
||||
assert.strictEqual(output.phases[0].disk_status, 'partial');
|
||||
});
|
||||
|
||||
test('dependency satisfaction: deps on complete phases = satisfied', () => {
|
||||
writeState(tmpDir);
|
||||
writeRoadmap(tmpDir, [
|
||||
|
||||
@@ -706,6 +706,31 @@ describe('roadmap update-plan-progress command', () => {
|
||||
assert.ok(roadmapContent.includes('1/2'), 'roadmap should contain updated plan count');
|
||||
});
|
||||
|
||||
test('counts plans and summaries from plans/ subdirectory layout (#3053)', () => {
|
||||
fs.writeFileSync(
|
||||
path.join(tmpDir, '.planning', 'ROADMAP.md'),
|
||||
`# Roadmap
|
||||
|
||||
### Phase 1: Test
|
||||
**Goal:** Test goal
|
||||
`
|
||||
);
|
||||
|
||||
const p1 = path.join(tmpDir, '.planning', 'phases', '01-test', 'plans');
|
||||
fs.mkdirSync(p1, { recursive: true });
|
||||
fs.writeFileSync(path.join(p1, 'PLAN-01.md'), '# Plan 1');
|
||||
fs.writeFileSync(path.join(p1, 'PLAN-02.md'), '# Plan 2');
|
||||
fs.writeFileSync(path.join(p1, 'SUMMARY-01.md'), '# Summary 1');
|
||||
|
||||
const result = runGsdTools('roadmap analyze', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
const output = JSON.parse(result.output);
|
||||
assert.strictEqual(output.phases[0].plan_count, 2);
|
||||
assert.strictEqual(output.phases[0].summary_count, 1);
|
||||
assert.strictEqual(output.phases[0].disk_status, 'partial');
|
||||
});
|
||||
|
||||
test('updates progress and checks checkbox on completion', () => {
|
||||
fs.writeFileSync(
|
||||
path.join(tmpDir, '.planning', 'ROADMAP.md'),
|
||||
|
||||
Reference in New Issue
Block a user