linkedin-studio/tests/fact-reviewer-fixture.test.mjs
Kjell Tore Guttormsen 9111f006cc refactor(linkedin-studio): move agent fasit fixtures + tests out of agents/ (v0.5.3)
The 6 long-form-review fasit fixtures (agents/fixtures/*-cases.md) were registered
by Claude Code as junk `fixtures:*` agents because agents/ is scanned recursively.
They are test fixtures, not capabilities. Moved them + their 6 lint tests to
tests/ + tests/fixtures/ and retargeted the 5 agent fasit-refs. Count-neutral
namespace hygiene (ls agents/*.md still 19).

- agents/fixtures/*-cases.md            -> tests/fixtures/        (6)
- agents/__tests__/*-fixture.test.mjs   -> tests/                 (6; ../fixtures -> ./fixtures)
- 5 agent refs ${CLAUDE_PLUGIN_ROOT}/agents/fixtures -> /tests/fixtures
- version-sync 0.5.2 -> 0.5.3 (plugin.json / README badge / CLAUDE.md / CHANGELOG)

Verify: fixture-lint 35/35 at new path; render 20/20, hooks 139/139; test-runner 109/0/0.
Reinstall/reload required for the 6 spurious agents to leave the registry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CrTb8ktf1XZWEVwgz5MTTo
2026-06-24 13:29:57 +02:00

92 lines
2.9 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { describe, test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
// Lint-test for the fact-reviewer fasit fixture.
// Mirrors the structure-only discipline of fact-checker-fixture.test.mjs and
// editorial-reviewer-fixture.test.mjs: this test asserts the SHAPE of the
// fixture — the single axis (faktisk-korrekthet), the four checks (F1F4), the
// 🔴/🟡/🟢 risk sort, the six Del 4 (Security Champions) cases, the
// direction-not-copy boundary, and the cold-reader / pivot-risk rationale.
// Whether the agent's live verdicts actually reproduce the fasit is
// [GATE]/[OPERATØR], never self-certified here.
const FIXTURE_PATH = fileURLToPath(
new URL('./fixtures/fact-reviewer-cases.md', import.meta.url)
);
const fixture = readFileSync(FIXTURE_PATH, 'utf8');
// The four checks: F1 verifiable claims · F2 quote precision · F3 number
// attribution · F4 source quality.
const CHECKS = ['F1', 'F2', 'F3', 'F4'];
// The 🔴/🟡/🟢 risk sort (the emoji are the safest assertion).
const VERDICTS = ['🔴', '🟡', '🟢'];
describe('fact-reviewer fixture structure', () => {
test('names the axis "faktisk-korrekthet"', () => {
assert.ok(
/faktisk-korrekthet/i.test(fixture),
'fixture must name the axis "faktisk-korrekthet"'
);
});
test('documents all four checks (F1F4)', () => {
for (const check of CHECKS) {
assert.ok(
fixture.includes(check),
`fixture must reference the check "${check}"`
);
}
});
test('references the 🔴/🟡/🟢 risk sort', () => {
for (const v of VERDICTS) {
assert.ok(
fixture.includes(v),
`fixture must reference the risk verdict "${v}"`
);
}
});
test('references the PASS/REWORK/BLOCK gate', () => {
for (const gate of ['PASS', 'REWORK', 'BLOCK']) {
assert.ok(
fixture.includes(gate),
`fixture must reference the gate decision "${gate}"`
);
}
});
test('documents exactly 6 Del 4 cases', () => {
const cases = fixture.match(/^###\s+Case\s+\d+\b/gim) || [];
assert.equal(
cases.length,
6,
`fixture must document exactly 6 Del 4 cases (found ${cases.length})`
);
});
test('states the direction-not-copy boundary', () => {
assert.ok(
/direction, not rewritten copy/i.test(fixture),
'fixture must state the direction-not-copy boundary'
);
});
test('documents the cold-reader / context-pollution principle', () => {
assert.ok(
/context pollution/i.test(fixture) && /framing-bias/i.test(fixture),
'fixture must document the cold-reader / context-pollution / framing-bias principle'
);
});
test('records the pivot-premise-risk rationale', () => {
assert.ok(
/pivot/i.test(fixture),
'fixture must record why the gate exists (pivot premise never met Step 5)'
);
});
});