Removes Voyage's measurement, statistics and export apparatus (decision 189; condition 175 met in step 1) and the R-a leftovers: lib/stats/, lib/exporters/, the otel-export and post-bash-stats hooks, yardstick, end-state and comparison gates, synthesis-measure, gold-scorer, docs/observability.md, examples/observability/, docs/T1-cc26-delegated-orchestration.md and their tests and fixtures. The six command stats phases and the /trekexecute main-merge event blocks go; intent-approval --stamp no longer emits brief-approved. README and docs point to Claude Code's own OpenTelemetry. Files removed: 52. Files edited: 37. npm test: 2930 tests (2928 pass / 0 fail / 2 skipped) before, 2600 tests (2598 pass / 0 fail / 2 skipped) after. removed-surfaces group R1 green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
74 lines
3.1 KiB
JavaScript
74 lines
3.1 KiB
JavaScript
// tests/commands/trekreview.test.mjs
|
|
// v5.1 prose-pin tests + v5.1.1 runtime SC4 + SC7 tests for /trekreview.
|
|
|
|
import { test } from 'node:test';
|
|
import { strict as assert } from 'node:assert';
|
|
import { readFileSync } from 'node:fs';
|
|
import { dirname, join } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { resolvePhaseSignal } from '../../lib/profiles/phase-signal-resolver.mjs';
|
|
import { validateBriefContent } from '../../lib/validators/brief-validator.mjs';
|
|
import { parseDocument } from '../../lib/util/frontmatter.mjs';
|
|
|
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
const ROOT = join(HERE, '..', '..');
|
|
const COMMAND_FILE = join(ROOT, 'commands', 'trekreview.md');
|
|
const PHASE = 'review';
|
|
|
|
function read() { return readFileSync(COMMAND_FILE, 'utf8'); }
|
|
function readFixture(name) { return readFileSync(join(ROOT, 'tests', 'fixtures', name), 'utf8'); }
|
|
function frontmatterOf(text) {
|
|
const doc = parseDocument(text);
|
|
return doc.parsed && doc.parsed.frontmatter;
|
|
}
|
|
|
|
// --- Pattern D prose-pins ---
|
|
|
|
test('trekreview — sequencing-gate surface mentions BRIEF_V51_MISSING_SIGNALS + phase_signals', () => {
|
|
const text = read();
|
|
assert.ok(text.includes('BRIEF_V51_MISSING_SIGNALS'),
|
|
'/trekreview must surface the BRIEF_V51_MISSING_SIGNALS sequencing gate');
|
|
assert.ok(text.includes('phase_signals'),
|
|
'/trekreview must reference phase_signals (v5.1 composition rule)');
|
|
});
|
|
|
|
test('trekreview — low-effort path references --quick equivalent', () => {
|
|
const text = read();
|
|
const compIdx = text.indexOf('## Composition rule (v5.1)');
|
|
assert.ok(compIdx >= 0, 'Composition rule (v5.1) section missing');
|
|
const section = text.slice(compIdx, compIdx + 2000);
|
|
assert.match(section, /--quick/, 'Low-effort path must mention --quick equivalent');
|
|
});
|
|
|
|
// --- v5.1.1 runtime SC4 + SC7 ---
|
|
|
|
test('trekreview — SC4: low-effort fixture → resolver returns {effort: low, model: sonnet}', () => {
|
|
const fm = frontmatterOf(readFixture('brief-effort-low.md'));
|
|
const r = resolvePhaseSignal(fm, PHASE);
|
|
assert.equal(r.effort, 'low');
|
|
assert.equal(r.model, 'sonnet');
|
|
});
|
|
|
|
test('trekreview — SC4: standard-effort fixture → resolver returns {effort: standard, model: undefined}', () => {
|
|
const fm = frontmatterOf(readFixture('brief-effort-standard.md'));
|
|
const r = resolvePhaseSignal(fm, PHASE);
|
|
assert.equal(r.effort, 'standard');
|
|
assert.equal(r.model, undefined);
|
|
});
|
|
|
|
test('trekreview — SC4: high-effort fixture → resolver returns {effort: high, model: opus}', () => {
|
|
const fm = frontmatterOf(readFixture('brief-effort-high.md'));
|
|
const r = resolvePhaseSignal(fm, PHASE);
|
|
assert.equal(r.effort, 'high');
|
|
assert.equal(r.model, 'opus');
|
|
});
|
|
|
|
test('trekreview — SC7: brief_version 2.1 + no phase_signals + no partial → BRIEF_V51_MISSING_SIGNALS', () => {
|
|
// Falsification via brief-v21-no-signals fixture: validator must catch missing signals.
|
|
const r = validateBriefContent(readFixture('brief-v21-no-signals.md'), { strict: true });
|
|
assert.equal(r.valid, false);
|
|
assert.ok(
|
|
r.errors.find(e => e.code === 'BRIEF_V51_MISSING_SIGNALS'),
|
|
`sequencing gate must fire; errors=${JSON.stringify(r.errors)}`,
|
|
);
|
|
});
|