feat(codex): carve the three mutually exclusive modes into sections

Review/Challenge/Consult mode bodies (34.7KB where at most one ever runs)
load on demand: skeleton 81.0KB -> 55.2KB, union 1.04x the monolith. The mode
dispatch, filesystem boundary, and a new always-loaded 'Synthesis
recommendation (REQUIRED) — all modes' block stay skeleton-side (the AUQ
per-skill pins pass unchanged); the plan-file report + exit gate render after
the last section pointer per the gateAfterStop pattern.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-25 16:36:02 +00:00
co-authored by Claude Fable 5
parent 3a78bf7c1d
commit 87589961a4
13 changed files with 1184 additions and 1044 deletions
+4 -2
View File
@@ -92,10 +92,12 @@ describe('#2091/#2370 bug 1: every mktemp template is BSD-safe (X placeholder at
test('scan sweep finds the known mktemp call sites (not vacuous)', () => {
// Guards against the walker silently matching nothing after a refactor.
// codex's mktemp calls live in the carved mode sections (T9), not the
// skeleton — the walker scans their .tmpl sources.
const withMktemp = files.filter((f) => fs.readFileSync(f, 'utf-8').includes('mktemp'));
expect(withMktemp.length).toBeGreaterThanOrEqual(5);
expect(withMktemp).toContain(path.join(ROOT, 'codex', 'SKILL.md.tmpl'));
expect(withMktemp).toContain(path.join(ROOT, 'codex', 'SKILL.md'));
expect(withMktemp).toContain(path.join(ROOT, 'codex', 'sections', 'review-mode.md.tmpl'));
expect(withMktemp).toContain(path.join(ROOT, 'codex', 'sections', 'consult-mode.md.tmpl'));
expect(withMktemp).toContain(path.join(ROOT, 'scripts', 'resolvers', 'review.ts'));
});