34 lines
1.5 KiB
JavaScript
34 lines
1.5 KiB
JavaScript
// tests/commands/trekexecute.test.mjs
|
|
// v5.1 — sequencing-gate surface + low-effort prose check for /trekexecute.
|
|
// Plan Assumption 2 locks low-effort to --gates open + sequential-only.
|
|
|
|
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', 'trekexecute.md');
|
|
|
|
function read() {
|
|
return readFileSync(COMMAND_FILE, 'utf8');
|
|
}
|
|
|
|
test('trekexecute — sequencing-gate surface mentions BRIEF_V51_MISSING_SIGNALS + phase_signals', () => {
|
|
const text = read();
|
|
assert.ok(text.includes('BRIEF_V51_MISSING_SIGNALS'),
|
|
'/trekexecute must surface the BRIEF_V51_MISSING_SIGNALS sequencing gate');
|
|
assert.ok(text.includes('phase_signals'),
|
|
'/trekexecute must reference phase_signals (v5.1 composition rule)');
|
|
});
|
|
|
|
test('trekexecute — low-effort path references --gates open + sequential', () => {
|
|
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, /--gates open/, 'Low-effort path must mention --gates open');
|
|
assert.match(section, /sequential/, 'Low-effort path must mention sequential-only execution');
|
|
});
|