import { errorResponse } from "@/lib/articles/generation"; import { readVerdictsPolicy, writeVerdictsPolicy } from "@/lib/bench"; export const dynamic = "force-dynamic"; // THE VERDICT BENCH'S BAR (release 28 M7): settings.generation.verdicts — the // operator's bar and the passing models they ticked — read from and written // through the editor's settings action (POST /api/ops/settings), whole. // // GET -> { verdicts } // POST { bar: {agreement, contradictedRecall, notFoundRecall}, models } -> { ok, verdicts } export async function GET() { try { return Response.json({ verdicts: await readVerdictsPolicy() }, { headers: { "cache-control": "no-store" } }); } catch (err) { return errorResponse(err); } } export async function POST(request: Request) { try { const body = await request.json().catch(() => null); return Response.json({ ok: true, verdicts: await writeVerdictsPolicy(body) }, { headers: { "cache-control": "no-store" } }); } catch (err) { return errorResponse(err); } }