diff --git a/plugins/voyage/tests/synthetic/plan-determinism.test.mjs b/plugins/voyage/tests/synthetic/plan-determinism.test.mjs index 15938e5..30bac0c 100644 --- a/plugins/voyage/tests/synthetic/plan-determinism.test.mjs +++ b/plugins/voyage/tests/synthetic/plan-determinism.test.mjs @@ -112,14 +112,16 @@ test('plan determinism — forward-compat: new fixtures with profile_used parse } }); -test('plan determinism — forward-compat: real v4.1 plan validates with --strict (no PLAN_VERSION_MISMATCH)', async () => { +test('plan determinism — forward-compat: synthetic v1.7 plan validates with --strict (no PLAN_VERSION_MISMATCH)', async () => { // Sanity check that adding profile_used to manifest-yaml schema doesn't - // regress full plan-validator strict-mode behaviour on a real plan that - // ships profile_used in step manifests. - const realPlan = '.claude/projects/2026-05-08-voyage-v4.1-modellprofiler/plan.md'; + // regress full plan-validator strict-mode behaviour on a v1.7 plan with + // standard step + manifest structure. Uses a committed synthetic fixture + // (plan-run-C.md) instead of a gitignored project plan so the assertion + // is stable across worktrees and headless runs. + const fixturePlan = 'tests/synthetic/plan-run-C.md'; const { validatePlan } = await import('../../lib/validators/plan-validator.mjs'); - const result = await validatePlan(join(ROOT, realPlan), { strict: true }); - assert.equal(result.valid, true, `real plan must validate strict: ${JSON.stringify(result.errors)}`); + const result = await validatePlan(join(ROOT, fixturePlan), { strict: true }); + assert.equal(result.valid, true, `synthetic plan must validate strict: ${JSON.stringify(result.errors)}`); const versionMismatch = (result.warnings || []).find((w) => w.code === 'PLAN_VERSION_MISMATCH'); - assert.equal(versionMismatch, undefined, 'real plan must NOT emit PLAN_VERSION_MISMATCH warning'); + assert.equal(versionMismatch, undefined, 'synthetic plan must NOT emit PLAN_VERSION_MISMATCH warning'); }); diff --git a/plugins/voyage/tests/synthetic/plan-run-C.md b/plugins/voyage/tests/synthetic/plan-run-C.md new file mode 100644 index 0000000..4bf6427 --- /dev/null +++ b/plugins/voyage/tests/synthetic/plan-run-C.md @@ -0,0 +1,98 @@ +--- +type: trekplan-synthetic +plan_version: "1.7" +created: 2026-05-10 +slug: plan-run-C +task: "Synthetic v1.7 plan fixture for plan-validator forward-compat test" +profile: balanced +run_id: C +--- + +# Synthetic Plan-Run C — Minimal v1.7 Fixture + +> **Plan quality: A** (95/100) — APPROVE +> +> Generated by trekplan v4.1.0 on 2026-05-10 — `plan_version: 1.7` +> +> Profile: `balanced` + +## Context + +Minimal synthetic fixture used by `tests/synthetic/plan-determinism.test.mjs` +forward-compat assertion: any v1.7 plan must validate cleanly under `--strict` +mode after the v4.1 schema additions (`profile_used`, `profile`, etc.). + +## Implementation Plan + +Each step targets one focused change. Three dummy steps satisfy the heading ++ manifest requirements without exercising real implementation. + +### Step 1: Add config entry for verbose flag + +- **Files:** `package.json` +- **Changes:** Add `verbose` boolean to config entry. +- **Reuses:** existing config-entry pattern. +- **Verify:** `grep -c "verbose" package.json` → expected: `1` +- **On failure:** revert +- **Checkpoint:** `git commit -m "feat(synth): add verbose config entry"` +- **Manifest:** + ```yaml + manifest: + expected_paths: + - package.json + min_file_count: 1 + commit_message_pattern: "^feat\\(synth\\): add verbose" + bash_syntax_check: [] + forbidden_paths: [] + must_contain: [] + ``` + +### Step 2: Define types for verbose mode + +- **Files:** `types.ts` +- **Changes:** Export `VerboseMode` enum with `silent | normal | verbose`. +- **Reuses:** existing type-export pattern. +- **Verify:** `grep -c "VerboseMode" types.ts` → expected: `1` +- **On failure:** revert +- **Checkpoint:** `git commit -m "feat(synth): define VerboseMode enum"` +- **Manifest:** + ```yaml + manifest: + expected_paths: + - types.ts + min_file_count: 1 + commit_message_pattern: "^feat\\(synth\\): define VerboseMode" + bash_syntax_check: [] + forbidden_paths: [] + must_contain: [] + ``` + +### Step 3: Wire verbose flag into parseArgs + +- **Files:** `cli.ts` +- **Changes:** Recognise `--verbose` flag in `parseArgs`, pass `VerboseMode` to logger. +- **Reuses:** parseArgs flag-recognition pattern. +- **Verify:** `grep -c "--verbose" cli.ts` → expected: `1` +- **On failure:** revert +- **Checkpoint:** `git commit -m "feat(synth): wire --verbose into parseArgs"` +- **Manifest:** + ```yaml + manifest: + expected_paths: + - cli.ts + min_file_count: 1 + commit_message_pattern: "^feat\\(synth\\): wire --verbose" + bash_syntax_check: [] + forbidden_paths: [] + must_contain: [] + ``` + +## Verification + +- [ ] `node lib/validators/plan-validator.mjs --strict --json tests/synthetic/plan-run-C.md` → `valid: true`, no `PLAN_VERSION_MISMATCH` warning + +## Estimated Scope + +- **Files to modify:** 3 +- **Files to create:** 0 +- **Complexity:** low (synthetic fixture only)