// A verdict bench run, synthetic (release 28 M7), for verdict-bench.spec.ts: // four invented claims ruled CORROBORATED, PARTLY, CONTRADICTED and // NOT_FOUND, asked of two models — one right on three (it calls the PARTLY // one CORROBORATED), one that always says CORROBORATED and fails to parse // once. Written as `archilyzer reports bench-verdicts` writes a run // (common/lib/report/draft/bench/store.ts); the page scores it again. import { mkdirSync, rmSync, writeFileSync } from "node:fs"; import path from "node:path"; export const BENCH_RUN = "vb-e2e"; export const SONNET = "claude-sonnet-5-5"; export const QWEN = "qwen3:8b"; const claims = [ ["c1", "The article says she opened the shop in spring.", "CORROBORATED"], ["c2", "The article says the oven was broken for a month.", "PARTLY"], ["c3", "The article says she sold the van.", "CONTRADICTED"], ["c4", "The article says she named the supplier.", "NOT_FOUND"], ]; const said = { [SONNET]: ["CORROBORATED", "CORROBORATED", "CONTRADICTED", "NOT_FOUND"], [QWEN]: ["CORROBORATED", "CORROBORATED", "CORROBORATED", null], }; export function makeBenchRun(root, o = { parts: true }) { const run = o.run ?? BENCH_RUN; const answers = o.said ?? said; const dir = path.join(root, run); rmSync(dir, { recursive: true, force: true }); mkdirSync(dir, { recursive: true }); const items = claims.map(([id, text, verdict], i) => ({ key: `synth-bench/${id}`, report: "synth-bench", claim: id, text, verdict, quotes: [{ citation: `q${i}`, channel: "synth-kitchen", id: "bread-day-01", start: 10 + i * 15, end: 14 + i * 15, quote: "a line" }], windows: [{ channel: "synth-kitchen", id: "bread-day-01", from: 0, to: 80, cited: [{ start: 10 + i * 15, end: 14 + i * 15 }], cues: [{ start: 10 + i * 15, end: 14 + i * 15, text: "a line" }] }], // Bench v3: a cited post beside the transcript (c2's). ...(id === "c2" ? { evidence: [{ citation: "p1", kind: "post", channel: "synth-kitchen-posts", quote: "the oven was off for a week", date: "2026-01-06" }] } : {}), })); // Bench v3: the parts a v3 answer carries, consistent with its verdict. const partsOf = (v, claim) => ({ CORROBORATED: [{ part: `${claim}: what the article says`, finding: "shown" }], PARTLY: [{ part: `${claim}: what the article says`, finding: "shown" }, { part: `${claim}: how long`, finding: "not shown" }], CONTRADICTED: [{ part: `${claim}: what the article says`, finding: "shown wrong" }], NOT_FOUND: [{ part: `${claim}: what the article says`, finding: "not shown" }], })[v]; const results = []; for (const [model, verdicts] of Object.entries(answers)) { items.forEach((it, i) => { const v = verdicts[i]; results.push({ key: it.key, model, verdict: v, ...(v ? { reason: `${model} read the window for ${it.claim}` } : { failure: "parse", error: "the answer is not JSON" }), ...(v && o.parts && model === SONNET ? { parts: partsOf(v, it.claim) } : {}), ms: 1200 + i * 100, usd: model === SONNET ? 0.004 : 0, inputTokens: 900, outputTokens: 60, at: "2026-10-13T12:00:00.000Z", }); }); } const jsonl = (rows) => rows.map((r) => `${JSON.stringify(r)}\n`).join(""); writeFileSync(path.join(dir, "items.jsonl"), jsonl(items)); writeFileSync(path.join(dir, "results.jsonl"), jsonl(results)); writeFileSync( path.join(dir, "summary.json"), JSON.stringify({ format: "archilyzer-verdict-bench", version: 1, id: run, createdAt: o.createdAt ?? "2026-10-13T12:00:00.000Z", updatedAt: "2026-10-13T12:05:00.000Z", status: "done", models: Object.keys(answers), ...(o.promptVersion ? { promptVersion: o.promptVersion } : {}), windowS: 60, maxUsd: 5, reports: [], spentUsd: Object.keys(answers).includes(SONNET) ? 0.016 : 0, items: items.length, skipped: [{ key: "synth-bench/c5", report: "synth-bench", claim: "c5", reason: "no citation" }], score: {}, }), ); return dir; } // Release 29 V1: a second run over the SAME items (prompt version 2, made // earlier so the page still opens the first by default), Sonnet alone: it now // calls c2 PARTLY (as ruled) and c3 PARTLY (ruled CONTRADICTED). export const BENCH_RUN_V2 = "vb-e2e-v2"; export function makeBenchRunV2(root) { return makeBenchRun(root, { run: BENCH_RUN_V2, said: { [SONNET]: ["CORROBORATED", "PARTLY", "PARTLY", "NOT_FOUND"] }, promptVersion: "2", createdAt: "2026-10-13T11:00:00.000Z", }); }