ktg-plugin-marketplace/plugins/voyage/tests/lib/profile-flag-coverage.test.mjs
Kjell Tore Guttormsen 71fcf6065a feat(voyage): document --profile flag in all 6 commands — SC #4 + arv-policy
Step 7 av v4.1-execute (Wave 3, Session 4).

Legg ny "## Profile (v4.1)"-seksjon i hver kommando-fil rett før "## Hard rules":
- trekbrief.md: --profile + VOYAGE_PROFILE + premium default
- trekresearch.md: + economy/balanced auto-disable external_research_enabled
- trekplan.md: + plan.md frontmatter recording for inheritance
- trekexecute.md: + 4-step resolution (flag > env > inheritance > default)
- trekreview.md: + opus-default for review-deepening
- trekcontinue.md: spesiell — INHERITANCE er default (ikke premium), --profile
  overstyr emitter stderr-advarsel

Tester (13 nye, baseline 432 → 445):
- 6 commands × 2 (--profile + VOYAGE_PROFILE)
- trekcontinue.md "inheritance"-keyword

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 09:38:36 +02:00

41 lines
1.5 KiB
JavaScript

// tests/lib/profile-flag-coverage.test.mjs
// SC #4 (docs side): every command file must document --profile + VOYAGE_PROFILE.
// /trekcontinue.md must additionally describe profile-arv (inheritance) policy.
import { test } from 'node:test';
import { strict as assert } from 'node:assert';
import { readFileSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const __dirname = dirname(fileURLToPath(import.meta.url));
const COMMANDS_DIR = join(__dirname, '..', '..', 'commands');
const COMMAND_FILES = [
'trekbrief.md',
'trekresearch.md',
'trekplan.md',
'trekexecute.md',
'trekreview.md',
'trekcontinue.md',
];
for (const filename of COMMAND_FILES) {
test(`${filename} documents --profile flag`, () => {
const content = readFileSync(join(COMMANDS_DIR, filename), 'utf-8');
assert.match(content, /--profile/,
`${filename} must contain --profile flag documentation`);
});
test(`${filename} mentions VOYAGE_PROFILE env-var`, () => {
const content = readFileSync(join(COMMANDS_DIR, filename), 'utf-8');
assert.match(content, /VOYAGE_PROFILE/,
`${filename} must mention VOYAGE_PROFILE env-var (resolution order)`);
});
}
test('trekcontinue.md documents inheritance policy (profile arves fra plan-frontmatter)', () => {
const content = readFileSync(join(COMMANDS_DIR, 'trekcontinue.md'), 'utf-8');
assert.match(content, /inheritance/,
'trekcontinue.md must describe profile-arv (inheritance) policy from plan-frontmatter');
});