feat(autoplan): carve the four review phases + tasks aggregator into sections

Phase bodies (CEO/Design/Eng/DX consensus flows) and the Implementation Tasks
aggregator load on demand; Design and DX stay separate sections because each
is independently conditional on scope. Skeleton 83.7KB -> 58.7KB (-30%
always-loaded); the 6 decision principles, classification, sequencing, and
explicit skip-condition dispatch stay always-loaded. The chain E2E's
phase-complete markers now live only in sections, so its assertions double as
section-read proof (behavioral: external).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-25 17:03:12 +00:00
co-authored by Claude Fable 5
parent 2877b63afe
commit c593c93268
17 changed files with 980 additions and 873 deletions
+11 -5
View File
@@ -67,10 +67,16 @@ describe('deprecated codex web-search flag is gone (#2525)', () => {
}
});
test('rendered autoplan skill resolves the token at every inline site', () => {
const rendered = fs.readFileSync(path.join(ROOT, 'autoplan', 'SKILL.md'), 'utf-8');
const count = rendered.split(CODEX_WEB_SEARCH_FLAG).length - 1;
expect(count).toBeGreaterThanOrEqual(4);
expect(rendered).not.toContain('{{CODEX_WEB_SEARCH_FLAG}}');
test('rendered autoplan phase sections resolve the token at every inline site', () => {
// The four phase bodies (and their codex invocations) are carved into
// autoplan/sections/*-phase.md — each generated section must carry the
// live flag, never the unresolved token.
for (const file of ['ceo-phase.md', 'design-phase.md', 'eng-phase.md', 'dx-phase.md']) {
const rendered = fs.readFileSync(path.join(ROOT, 'autoplan', 'sections', file), 'utf-8');
expect(rendered, `${file} lost the web-search flag`).toContain(CODEX_WEB_SEARCH_FLAG);
expect(rendered).not.toContain('{{CODEX_WEB_SEARCH_FLAG}}');
}
const skeleton = fs.readFileSync(path.join(ROOT, 'autoplan', 'SKILL.md'), 'utf-8');
expect(skeleton).not.toContain('{{CODEX_WEB_SEARCH_FLAG}}');
});
});
+4 -2
View File
@@ -18,8 +18,10 @@ import * as path from 'path';
const ROOT = path.resolve(import.meta.dir, '..');
// review's specialist-dispatch guidance lives in its carved Review Army section
// (Step 4.5 moved out of the skeleton), so the pin follows it there.
const GENERATED_WITH_GUIDANCE = ['review/sections/review-army.md', 'autoplan/SKILL.md'];
// (Step 4.5 moved out of the skeleton), so the pin follows it there. Same for
// autoplan: the dual-voice dispatch (Phase 1 override rules) lives in its
// carved CEO-phase section.
const GENERATED_WITH_GUIDANCE = ['review/sections/review-army.md', 'autoplan/sections/ceo-phase.md'];
// The inverted, post-2.1.198-inert phrasings. Checked across every generated
// SKILL.md so the regression can't migrate to another skill unnoticed.
+3 -1
View File
@@ -85,7 +85,9 @@ describeE2E('/autoplan chain ordering (periodic)', () => {
const budgetMs = 900_000; // 15 min
const start = Date.now();
// Phase markers in autoplan/SKILL.md (lines 1126, 1211, 1331, 1437):
// Phase markers live in autoplan's carved phase sections
// (autoplan/sections/{ceo,design,eng,dx}-phase.md — the skeleton
// STOP-Reads each one at its phase boundary):
// "**Phase 1 complete." / "**Phase 2 complete." / "**Phase 3 complete." / "**Phase 3.5 complete."
const phasePattern = /\*\*Phase\s+(\d+(?:\.\d+)?)\s+complete\.?\*\*/g;
+11 -2
View File
@@ -51,6 +51,14 @@ describeIfSelected('Autoplan dual-voice E2E', ['autoplan-dual-voice'], () => {
const dest = path.join(skillsBase, skill);
fs.mkdirSync(dest, { recursive: true });
fs.copyFileSync(path.join(ROOT, skill, 'SKILL.md'), path.join(dest, 'SKILL.md'));
// Carved skills (autoplan + the plan-* reviews) keep their phase/review
// bodies in on-demand sections/ that the skeleton STOP-Reads — mirror the
// real install (which links sections/ next to SKILL.md) so the registered
// skeleton's section reads resolve inside the fixture.
const sections = path.join(ROOT, skill, 'sections');
if (fs.existsSync(sections)) {
copyDirSync(sections, path.join(dest, 'sections'));
}
}
// Write a tiny plan file for /autoplan to review.
@@ -139,8 +147,9 @@ Add a new /greet skill that prints a welcome message.
// Full Phase 1 COMPLETION (three parallel review subagents, each loading a
// 25-35K-token skill) routinely exceeds 10 minutes on sonnet, so requiring
// the "Phase 1 complete" banner would force a 20-minute test for no extra
// dual-voice signal. Accept EITHER the completion banner (autoplan/SKILL.md
// "PHASE 1 COMPLETE" mandatory output) OR structural evidence that the
// dual-voice signal. Accept EITHER the completion banner (the "PHASE 1
// COMPLETE" mandatory output in autoplan/sections/ceo-phase.md, which the
// skeleton STOP-Reads) OR structural evidence that the
// Phase 1 review dispatch actually happened: an Agent tool_use whose input
// carries review instructions (execution artifact built by the skill, not
// an echo of our prompt).