Skip to content

Commit 8c74e55

Browse files
test: lock advisory and blocking LLM audit behavior
1 parent 7898c9b commit 8c74e55

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import test from 'node:test';
2+
import assert from 'node:assert/strict';
3+
import { advisoryLlmAuditSummary } from '../lib/audit-policy.mjs';
4+
5+
test('high-risk LLM findings are advisory by default after deterministic audit passes', () => {
6+
const result = advisoryLlmAuditSummary({
7+
auditInputHash: 'audit-hash',
8+
deterministicFailures: 0,
9+
highRiskFindings: 3,
10+
pass: false
11+
}, { audit: {} });
12+
assert.equal(result.pass, true);
13+
assert.equal(result.llmFindingsBlocking, false);
14+
assert.equal(result.advisoryHighRiskFindings, 3);
15+
});
16+
17+
test('explicit blockOnLlmFindings preserves the hard gate', () => {
18+
const result = advisoryLlmAuditSummary({
19+
deterministicFailures: 0,
20+
highRiskFindings: 3,
21+
pass: false
22+
}, { audit: { blockOnLlmFindings: true } });
23+
assert.equal(result, null);
24+
});
25+
26+
test('LLM advisory policy never hides deterministic failures', () => {
27+
const result = advisoryLlmAuditSummary({
28+
deterministicFailures: 114,
29+
highRiskFindings: 3,
30+
pass: false
31+
}, { audit: { blockOnLlmFindings: false } });
32+
assert.equal(result, null);
33+
});

0 commit comments

Comments
 (0)