Skip to content

Commit d7a94f6

Browse files
test: prove legacy audit config makes zero provider calls
1 parent 75aeb4d commit d7a94f6

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

global-template/docgen/test/audit-guard.test.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import fs from 'node:fs';
44
import os from 'node:os';
55
import path from 'node:path';
66
import { guardedAudit, sanitizeAuditInputs } from '../lib/audit-guard.mjs';
7+
import { audit as pipelineAudit } from '../lib/pipeline.mjs';
78
import { projectPaths, sha256, writeJson } from '../lib/core.mjs';
89

910
function pageText(page) {
@@ -56,6 +57,19 @@ test('deterministic failure stops before the costly audit provider', async () =>
5657
assert.equal(summary.pass, false);
5758
});
5859

60+
test('legacy llmEnabled config is migrated to deterministic-only audit with provider calls zero', async () => {
61+
const { root, paths, pages } = fixture();
62+
writeJson(paths.plan, { schemaVersion: '2.0', pages: [pages[0]] });
63+
const result = await pipelineAudit(root);
64+
const migrated = JSON.parse(fs.readFileSync(paths.config, 'utf8'));
65+
assert.equal(migrated.audit.llmMode, 'off');
66+
assert.equal(migrated.audit.requiredSectionsAsWarnings, true);
67+
assert.equal(result.pass, true);
68+
assert.equal(result.llmAuditedPages, 0);
69+
assert.equal(result.highRiskFindings, 0);
70+
assert.equal(result.llmSkippedReason, 'llm-audit-off');
71+
});
72+
5973
test('sanitizer drops out-of-context evidence and refs and downgrades unsupported FACT', () => {
6074
const { root, paths, pages } = fixture();
6175
const page = pages[0];

0 commit comments

Comments
 (0)