diff --git a/test/skill-e2e-design.test.ts b/test/skill-e2e-design.test.ts index 123d522b5..ec2b83728 100644 --- a/test/skill-e2e-design.test.ts +++ b/test/skill-e2e-design.test.ts @@ -326,6 +326,7 @@ describeIfSelected('Plan Design Review E2E', ['plan-design-review-plan-mode', 'p path.join(ROOT, 'plan-design-review', 'SKILL.md'), path.join(dir, 'plan-design-review', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'plan-design-review', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(dir, 'plan-design-review', 'sections'), { recursive: true }); } return dir; } diff --git a/test/skill-e2e-office-hours-brain-writeback.test.ts b/test/skill-e2e-office-hours-brain-writeback.test.ts index 330d9a27f..74fbe0af6 100644 --- a/test/skill-e2e-office-hours-brain-writeback.test.ts +++ b/test/skill-e2e-office-hours-brain-writeback.test.ts @@ -104,6 +104,13 @@ describeIfSelected( ); const skillPath = join(ROOT, 'office-hours', 'SKILL.md'); const originalSkill = readFileSync(skillPath, 'utf-8'); + // office-hours is carved (v2 plan T9): GBRAIN_SAVE_RESULTS moved into + // sections/design-and-handoff.md. Regen rewrites BOTH the skeleton and the + // section, so we snapshot + restore + ship both, and check the UNION for + // the gbrain put block. + const sectionPath = join(ROOT, 'office-hours', 'sections', 'design-and-handoff.md'); + const hasSection = existsSync(sectionPath); + const originalSection = hasSection ? readFileSync(sectionPath, 'utf-8') : null; try { execFileSync( 'bun', @@ -122,17 +129,23 @@ describeIfSelected( }, ); const brainAwareSkill = readFileSync(skillPath, 'utf-8'); - if (!brainAwareSkill.includes('gbrain put "office-hours/')) { + const brainAwareSection = hasSection ? readFileSync(sectionPath, 'utf-8') : ''; + if (!(brainAwareSkill + brainAwareSection).includes('gbrain put "office-hours/')) { throw new Error( - 'Regenerated office-hours/SKILL.md does not contain gbrain put block. ' + + 'Regenerated office-hours skeleton+section does not contain gbrain put block. ' + 'Detection override may be broken — see test/gbrain-detection-override.test.ts.', ); } mkdirSync(join(workDir, 'office-hours'), { recursive: true }); writeFileSync(join(workDir, 'office-hours', 'SKILL.md'), brainAwareSkill); + if (hasSection) { + mkdirSync(join(workDir, 'office-hours', 'sections'), { recursive: true }); + writeFileSync(join(workDir, 'office-hours', 'sections', 'design-and-handoff.md'), brainAwareSection); + } } finally { - // Always restore the canonical SKILL.md so the working tree stays clean. + // Always restore the canonical skeleton + section so the working tree stays clean. writeFileSync(skillPath, originalSkill); + if (hasSection && originalSection !== null) writeFileSync(sectionPath, originalSection); rmSync(tmpHome, { recursive: true, force: true }); } diff --git a/test/skill-e2e-office-hours.test.ts b/test/skill-e2e-office-hours.test.ts index b5f4f6b1f..d2e7700a9 100644 --- a/test/skill-e2e-office-hours.test.ts +++ b/test/skill-e2e-office-hours.test.ts @@ -53,6 +53,7 @@ describeIfSelected('Office Hours Forcing Energy E2E', ['office-hours-forcing-ene path.join(ROOT, 'office-hours', 'SKILL.md'), path.join(workDir, 'office-hours', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'office-hours', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(workDir, 'office-hours', 'sections'), { recursive: true }); } }); afterAll(() => { @@ -124,6 +125,7 @@ describeIfSelected('Office Hours Builder Wildness E2E', ['office-hours-builder-w path.join(ROOT, 'office-hours', 'SKILL.md'), path.join(workDir, 'office-hours', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'office-hours', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(workDir, 'office-hours', 'sections'), { recursive: true }); } }); afterAll(() => { diff --git a/test/skill-e2e-plan.test.ts b/test/skill-e2e-plan.test.ts index 6cfd3e322..98fded4bb 100644 --- a/test/skill-e2e-plan.test.ts +++ b/test/skill-e2e-plan.test.ts @@ -530,6 +530,7 @@ describeIfSelected('Office Hours Spec Review E2E', ['office-hours-spec-review'], path.join(ROOT, 'office-hours', 'SKILL.md'), path.join(ohDir, 'office-hours', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'office-hours', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(ohDir, 'office-hours', 'sections'), { recursive: true }); } }); afterAll(() => { @@ -590,6 +591,7 @@ describeIfSelected('Plan CEO Review Benefits-From E2E', ['plan-ceo-review-benefi path.join(ROOT, 'plan-ceo-review', 'SKILL.md'), path.join(benefitsDir, 'plan-ceo-review', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'plan-ceo-review', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(benefitsDir, 'plan-ceo-review', 'sections'), { recursive: true }); } }); afterAll(() => { @@ -772,6 +774,10 @@ describeIfSelected('Codex Offering E2E', [ path.join(ROOT, skill, 'SKILL.md'), path.join(testDir, skill, 'SKILL.md'), ); + // Carved skills (v2 plan T9): copy sections/ so codex/outside-voice content + // (carved into review-sections.md) is present for the search. + const _sec = path.join(ROOT, skill, 'sections'); + if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(testDir, skill, 'sections'), { recursive: true }); } }); diff --git a/test/skill-e2e.test.ts b/test/skill-e2e.test.ts index 9c314cb39..312a609cc 100644 --- a/test/skill-e2e.test.ts +++ b/test/skill-e2e.test.ts @@ -890,6 +890,7 @@ We're building a new user dashboard that shows recent activity, notifications, a path.join(ROOT, 'plan-ceo-review', 'SKILL.md'), path.join(planDir, 'plan-ceo-review', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'plan-ceo-review', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(planDir, 'plan-ceo-review', 'sections'), { recursive: true }); } }); afterAll(() => { @@ -974,6 +975,7 @@ We're building a new user dashboard that shows recent activity, notifications, a path.join(ROOT, 'plan-ceo-review', 'SKILL.md'), path.join(planDir, 'plan-ceo-review', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'plan-ceo-review', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(planDir, 'plan-ceo-review', 'sections'), { recursive: true }); } }); afterAll(() => { @@ -1068,6 +1070,7 @@ Replace session-cookie auth with JWT tokens. Currently using express-session + R path.join(ROOT, 'plan-eng-review', 'SKILL.md'), path.join(planDir, 'plan-eng-review', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'plan-eng-review', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(planDir, 'plan-eng-review', 'sections'), { recursive: true }); } }); afterAll(() => { @@ -1450,6 +1453,7 @@ export function main() { return Dashboard(); } path.join(ROOT, 'plan-eng-review', 'SKILL.md'), path.join(planDir, 'plan-eng-review', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'plan-eng-review', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(planDir, 'plan-eng-review', 'sections'), { recursive: true }); } // Set up remote-slug shim and browse shims (plan-eng-review uses remote-slug for artifact path) setupBrowseShims(planDir); @@ -2256,6 +2260,7 @@ describeIfSelected('Plan Design Review E2E', ['plan-design-review-plan-mode', 'p path.join(ROOT, 'plan-design-review', 'SKILL.md'), path.join(reviewDir, 'plan-design-review', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'plan-design-review', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(reviewDir, 'plan-design-review', 'sections'), { recursive: true }); } // Create a plan file with intentional design gaps fs.writeFileSync(path.join(reviewDir, 'plan.md'), `# Plan: User Dashboard @@ -3158,6 +3163,7 @@ describeIfSelected('Office Hours Spec Review E2E', ['office-hours-spec-review'], path.join(ROOT, 'office-hours', 'SKILL.md'), path.join(ohDir, 'office-hours', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'office-hours', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(ohDir, 'office-hours', 'sections'), { recursive: true }); } }); afterAll(() => { @@ -3220,6 +3226,7 @@ describeIfSelected('Plan CEO Review Benefits-From E2E', ['plan-ceo-review-benefi path.join(ROOT, 'plan-ceo-review', 'SKILL.md'), path.join(benefitsDir, 'plan-ceo-review', 'SKILL.md'), ); + { const _sec = path.join(ROOT, 'plan-ceo-review', 'sections'); if (fs.existsSync(_sec)) fs.cpSync(_sec, path.join(benefitsDir, 'plan-ceo-review', 'sections'), { recursive: true }); } }); afterAll(() => {