import test from "node:test"; import assert from "node:assert/strict"; const { promptLibrary, reportPromptOptions, specs } = await import("../lib/report-spec.ts"); test("the prompt advertises every component and the root", () => { const p = promptLibrary.prompt(reportPromptOptions); for (const n of ["Report", "Headline", "VerdictBlock", "MetricGrid", "Findings", "OptionTable", "StepList", "SqlBlock", "ScoreBar", "Callout"]) assert.ok(p.includes(n), `missing ${n}`); assert.match(p, /root/i); assert.match(p, /never invent/i); }); test("every spec has a renderer, so the model can never emit an unrenderable block", async () => { const { library } = await import("../lib/report-ui.ts"); for (const s of specs) assert.ok(library.components[s.name], `no renderer for ${s.name}`); });