From e440ca858c6e80bc8bcfab2fdb88dbfb30a0b9eb Mon Sep 17 00:00:00 2001 From: Kjell Tore Guttormsen Date: Sat, 9 May 2026 10:03:43 +0200 Subject: [PATCH] =?UTF-8?q?test(voyage):=20extend=20doc-consistency.test.m?= =?UTF-8?q?js=20=E2=80=94=20pin=20--profile=20+=20phase=5Fmodels=20on=206?= =?UTF-8?q?=20commands=20SC=20#20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Step 21 of v4.1 — extend-in-place per Plan-critic Blocker 2 split: commands-only assertions land here; CLAUDE.md / README.md pinning is deferred to Step 22 (post-write). Changes: 1. CLAUDE.md command coverage loop now spans all SIX pipeline commands (added /trekcontinue — was 5 of 6 pre-v4.1 per HIGH risk-assessor). 2. New: every pipeline command-file (trekbrief/research/plan/execute/ review/continue.md) must document the --profile flag. 3. New: forbidden-alias check — no command-file may use the legacy names model_per_phase / phase_to_model / profile_phase_models. Canonical name is "phase_models" (locked in brief). 4. New: at least one command-file must mention "phase_models" by name so the regression detects total removal of the canonical-name reference. Tests: 482 pass + 2 skipped (Docker not installed). --- .../voyage/tests/lib/doc-consistency.test.mjs | 67 ++++++++++++++++++- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/plugins/voyage/tests/lib/doc-consistency.test.mjs b/plugins/voyage/tests/lib/doc-consistency.test.mjs index 84c1caf..42d4f22 100644 --- a/plugins/voyage/tests/lib/doc-consistency.test.mjs +++ b/plugins/voyage/tests/lib/doc-consistency.test.mjs @@ -94,9 +94,17 @@ test('settings.json no longer carries vestigial exploration block', () => { 'agentTeam block was vestigial — should be deleted in v3.1.0 Spor 0'); }); -test('CLAUDE.md mentions all five pipeline commands', () => { +test('CLAUDE.md mentions all six pipeline commands', () => { + // Step 21 of v4.1 — added /trekcontinue to coverage (was 5/6 before). const md = read('CLAUDE.md'); - for (const c of ['/trekbrief', '/trekresearch', '/trekplan', '/trekexecute', '/trekreview']) { + for (const c of [ + '/trekbrief', + '/trekresearch', + '/trekplan', + '/trekexecute', + '/trekreview', + '/trekcontinue', + ]) { assert.ok(md.includes(c), `CLAUDE.md missing reference to ${c}`); } }); @@ -238,6 +246,61 @@ test('Phase 9 prose mandates parallel single-message dispatch + inline dedup', ( ); }); +// --- v4.1 Step 21 — pin --profile + phase_models on the 6 commands --- +// +// CLAUDE.md / README.md pinning is deferred to Step 22 (post-write of +// those documents). Step 21 only verifies command-file content, which +// was written in Step 7 (Wave 3). + +const PIPELINE_COMMANDS = [ + 'trekbrief.md', + 'trekresearch.md', + 'trekplan.md', + 'trekexecute.md', + 'trekreview.md', + 'trekcontinue.md', +]; + +test('every pipeline command-file documents the --profile flag (SC #20)', () => { + for (const f of PIPELINE_COMMANDS) { + const text = read(`commands/${f}`); + assert.match( + text, + /--profile\b/, + `commands/${f}: --profile flag is required documentation in v4.1`, + ); + } +}); + +test('command-files mentioning model profiles use canonical name `phase_models`', () => { + // Reject legacy / brainstormed alternatives that would confuse readers. + const FORBIDDEN = ['model_per_phase', 'phase_to_model', 'profile_phase_models']; + for (const f of PIPELINE_COMMANDS) { + const text = read(`commands/${f}`); + for (const bad of FORBIDDEN) { + assert.ok( + !text.includes(bad), + `commands/${f}: forbidden alias "${bad}" — canonical name is "phase_models"`, + ); + } + } +}); + +test('at least one pipeline command-file references `phase_models` canonical name', () => { + // Sanity: not every command has to enumerate phase_models inline (e.g. + // trekbrief and trekcontinue may only mention --profile), but ≥ 1 + // command-file must spell out the canonical name so the regression test + // pins drift. + let mentioned = 0; + for (const f of PIPELINE_COMMANDS) { + if (read(`commands/${f}`).includes('phase_models')) mentioned += 1; + } + assert.ok( + mentioned >= 1, + `expected ≥ 1 command-file to mention canonical name "phase_models", got ${mentioned}`, + ); +}); + test('commands/trekplan.md Phase 8 seals Opus-4.7 schema-drift defense', () => { const cmd = read('commands/trekplan.md'); // Locate Phase 8 section