// tests/commands/trekresearch.test.mjs // v5.1 — sequencing-gate surface + low-effort prose check for /trekresearch. 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'; const HERE = dirname(fileURLToPath(import.meta.url)); const ROOT = join(HERE, '..', '..'); const COMMAND_FILE = join(ROOT, 'commands', 'trekresearch.md'); function read() { return readFileSync(COMMAND_FILE, 'utf8'); } test('trekresearch — sequencing-gate surface mentions BRIEF_V51_MISSING_SIGNALS + phase_signals', () => { const text = read(); assert.ok(text.includes('BRIEF_V51_MISSING_SIGNALS'), '/trekresearch must surface the BRIEF_V51_MISSING_SIGNALS sequencing gate'); assert.ok(text.includes('phase_signals'), '/trekresearch must reference phase_signals (v5.1 composition rule)'); }); test('trekresearch — 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'); });