-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverdict-matrix.feature.test.ts
More file actions
42 lines (38 loc) · 1.61 KB
/
Copy pathverdict-matrix.feature.test.ts
File metadata and controls
42 lines (38 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Verdict-matrix feature — walks the 6-row table from
// HulumiDrift.trace.md (upstream planning corpus, vendored at
// tests/_utils/trace-matrix.ts) cell by cell. Each row is one Vitest
// test, plus a meta-row asserting the test count matches the trace
// row count (no silent row drift).
import { describe, it, expect } from "vitest";
import { hardenedVerdict } from "../src/verdict";
import { TRACE_MATRIX } from "./_utils/trace-matrix";
describe("verdict-matrix — TLA+ HardenedVerdict 6-row trace walk", () => {
for (const row of TRACE_MATRIX) {
it(`row ${row.id}: ${row.description}`, () => {
const verdict = hardenedVerdict(row.snapshot);
expect(verdict.source).toBe(row.expected.source);
expect(verdict.confidence).toBe(row.expected.confidence);
});
}
it("row_count_matches_trace_md — exactly 6 rows, no silent additions / removals", () => {
expect(TRACE_MATRIX).toHaveLength(6);
const ids = TRACE_MATRIX.map((r) => r.id);
expect(ids).toEqual([1, 2, 3, 4, 5, 6]);
});
it("Row 4 — ProviderApiChurn never reaches high (TLA+ SafetyRealistic upper bound)", () => {
// Even with mutated+providerDrift in any combination of probe state
// EXCEPT eventDelivered, the verdict for ProviderApiChurn maxes at
// medium. Brute-force the truth-table to be sure.
for (const eventInTransit of [false, true]) {
const v = hardenedVerdict({
mutated: true,
eventInTransit,
eventDelivered: false,
providerDrift: true,
});
if (v.source === "ProviderApiChurn") {
expect(v.confidence).not.toBe("high");
}
}
});
});