commit e09a7ca2620a2706d5d3d831088eaf56920e2951
parent 896da18aa3c74e663f90549c7a1cc8289e11af4f
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Thu, 15 Oct 2026 07:52:31 -0400
umtool: verdict proposals — the Inbox's `verdict-proposed` kind (Review, "Review verdicts"; lib/inbox/verdicts.mjs after drafts-unreviewed's pattern, groups/what, lib/inbox.ts reading each store fact-check's waiting proposals on still-unruled claims), the article tab's proposals panel (components/articles/VerdictProposals.tsx: each claim, the proposed verdict as plain text, the reason, model and prompt version, Approve / Reject with a note) through /api/articles/verdicts → the editor's verdict-review; the e2e stub runs the REAL review over the fixture's store (common/testing/verdicts/reviewStub.ts); verdict-proposed.spec, inbox/verdicts.test.mjs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
12 files changed, 489 insertions(+), 6 deletions(-)
diff --git a/common/testing/verdicts/reviewStub.ts b/common/testing/verdicts/reviewStub.ts
@@ -0,0 +1,30 @@
+// `verdict-review` for umtool's e2e editor stub (release 29 M8): the REAL
+// controller (controller/reportVerdicts.ts reviewProposal) over the fixture's
+// article store — what umtool/e2e/fixtures/editor-stub.mjs runs for each
+// `POST /api/ops/verdict-review`. Test-only; synthetic.
+//
+// tsx common/testing/verdicts/reviewStub.ts --articles <ARTICLES_DIR>
+// (the body on stdin)
+//
+// Prints one JSON line: {ok: true, proposal} or {ok: false, status, error}.
+
+import path from "node:path";
+import { reviewProposal } from "../../controller/reportVerdicts";
+import type { Paths } from "../../lib/paths";
+
+async function main() {
+ const at = process.argv.indexOf("--articles");
+ const articles = at >= 0 ? process.argv[at + 1] : "";
+ if (!articles) throw Object.assign(new Error("--articles <dir> is required"), { status: 500 });
+ let raw = "";
+ for await (const chunk of process.stdin) raw += chunk;
+ const body = JSON.parse(raw || "{}") as Record<string, unknown>;
+ const paths = { articlesDir: articles, exportIndexDir: path.join(path.dirname(articles), ".export-index") } as Paths;
+ const proposal = await reviewProposal(body, { paths });
+ process.stdout.write(`${JSON.stringify({ ok: true, proposal })}\n`);
+}
+
+main().catch((e: Error & { status?: number }) => {
+ const status = typeof e.status === "number" ? e.status : e.name === "ArticleRegistryError" ? 409 : 400;
+ process.stdout.write(`${JSON.stringify({ ok: false, status, error: e.message })}\n`);
+});
diff --git a/umtool/app/api/articles/verdicts/route.ts b/umtool/app/api/articles/verdicts/route.ts
@@ -0,0 +1,25 @@
+import { errorResponse } from "@/lib/articles/generation";
+import { readArticleProposals, reviewArticleProposal } from "@/lib/articles/verdicts";
+
+export const dynamic = "force-dynamic";
+
+// VERDICT PROPOSALS (release 29 M8): an article's waiting proposals, and the
+// operator's approve or reject of one — through the editor's verdict-review
+// (approve sets the claim's verdict through the registry).
+//
+// GET ?article=<id> -> { waiting, approved, rejected }
+// POST {article, claim, decision: "approve" | "reject", note?} -> { proposal }
+export async function GET(request: Request) {
+ const article = new URL(request.url).searchParams.get("article") ?? "";
+ const got = await readArticleProposals(article).catch(() => null);
+ return Response.json(got ?? { waiting: [], approved: 0, rejected: 0 }, { headers: { "cache-control": "no-store" } });
+}
+
+export async function POST(request: Request) {
+ try {
+ const body = await request.json().catch(() => null);
+ return Response.json(await reviewArticleProposal(body), { headers: { "cache-control": "no-store" } });
+ } catch (err) {
+ return errorResponse(err);
+ }
+}
diff --git a/umtool/components/articles/ArticlePage.tsx b/umtool/components/articles/ArticlePage.tsx
@@ -27,6 +27,8 @@ import { articleWorkspaceListing, openWorkspaceFile } from "@/lib/articles/files
import { linkedProjects } from "@/lib/articles/links.mjs";
import { readArticleNotes, readReportFile, reportDirFor } from "@/lib/articles/sites";
import { sourceFor } from "@/lib/articles/sources.mjs";
+import { readArticleProposals } from "@/lib/articles/verdicts";
+import VerdictProposals from "@/components/articles/VerdictProposals";
import { articleEvidenceHref, articleHref, projectHref } from "@/lib/hrefs";
import { ARTICLES_KEY, corpusNotesFile } from "@/lib/paths";
import { readPieceGraph } from "@/lib/pieces";
@@ -450,6 +452,8 @@ async function ArticleTab({
...(notes.error ? { error: notes.error } : {}),
};
const status = sp.status === "resolved" || sp.status === "all" ? sp.status : "open";
+ // A fact-check's proposed verdicts (release 29 M8), waiting on the operator.
+ const proposals = site === ARTICLES_KEY && r.kind === "factcheck" ? await readArticleProposals(reportId).catch(() => null) : null;
const videoSlot = r.video
? { file: r.video.src, src: media(r.video.src), poster: r.video.poster ? media(r.video.poster) : undefined, caption: r.video.caption }
: null;
@@ -463,7 +467,16 @@ async function ArticleTab({
initialNotes={initialNotes}
initialFilter={status}
initialNote={sp.note ?? null}
- meta={line}
+ meta={
+ proposals ? (
+ <>
+ {line}
+ <VerdictProposals article={reportId} waiting={proposals.waiting} />
+ </>
+ ) : (
+ line
+ )
+ }
video={videoSlot}
videoProjects={links.linked.map((p: { id: string; title: string; generatedBy: string | null }) => ({ id: p.id, title: p.title, generatedBy: p.generatedBy }))}
/>
diff --git a/umtool/components/articles/VerdictProposals.tsx b/umtool/components/articles/VerdictProposals.tsx
@@ -0,0 +1,88 @@
+"use client";
+
+import { useState } from "react";
+import { useRouter } from "next/navigation";
+import { Button } from "@/components/ui/button";
+import type { WaitingProposal } from "@/lib/articles/verdicts";
+
+// A FACT-CHECK'S PROPOSED VERDICTS (release 29 M8), on the article's tab: each
+// unruled claim a model proposed a verdict for, with the model's reason, the
+// model and its prompt version — and Approve (the claim's verdict is set, by
+// the editor's verdict-review through the registry) or Reject (the claim
+// stays unruled), each with an optional note. Proposed verdicts are plain
+// text: a verdict's colour is a ruling's, and these are not rulings yet.
+
+export default function VerdictProposals({ article, waiting }: { article: string; waiting: WaitingProposal[] }) {
+ const router = useRouter();
+ const [left, setLeft] = useState(waiting);
+ const [notes, setNotes] = useState<Record<string, string>>({});
+ const [busy, setBusy] = useState<string | null>(null);
+ const [status, setStatus] = useState<{ ok: boolean; text: string } | null>(null);
+
+ async function review(p: WaitingProposal, decision: "approve" | "reject") {
+ setBusy(p.claim);
+ setStatus(null);
+ try {
+ const note = notes[p.claim]?.trim();
+ const r = await fetch("/api/articles/verdicts", { method: "POST", body: JSON.stringify({ article, claim: p.claim, decision, ...(note ? { note } : {}) }) });
+ const body = await r.json();
+ if (!r.ok) throw new Error(body.error ?? `HTTP ${r.status}`);
+ setLeft((xs) => xs.filter((x) => x.claim !== p.claim));
+ setStatus({ ok: true, text: decision === "approve" ? `Approved: ${p.claim} is ${p.verdict}.` : `Rejected: ${p.claim} stays unruled.` });
+ router.refresh();
+ } catch (e) {
+ setStatus({ ok: false, text: (e as Error).message });
+ } finally {
+ setBusy(null);
+ }
+ }
+
+ if (!left.length && !status) return null;
+ return (
+ <section aria-label="verdict proposals" id="verdict-proposals" className="w-full rounded-[3px] border border-seam bg-panel px-3 py-2 text-[12px] text-text">
+ <div className="micro">
+ verdict proposals · {left.length} waiting
+ </div>
+ {status && (
+ <p role="status" className={status.ok ? "mt-1 text-text-2" : "mt-1 text-[var(--color-bad)]"}>
+ {status.text}
+ </p>
+ )}
+ <ul className="mt-1 flex flex-col gap-2">
+ {left.map((p) => (
+ <li key={p.claim} data-proposal={p.claim} className="border-t border-seam pt-1.5">
+ <div className="flex flex-wrap items-baseline gap-2">
+ <span className="font-mono text-[11px] text-muted">{p.claim}</span>
+ {p.section && <span className="text-muted">{p.section}</span>}
+ </div>
+ <p className="m-0">{p.text}</p>
+ <p className="m-0 mt-0.5">
+ <span className="font-mono" data-proposed={p.verdict}>
+ {p.verdict}
+ </span>{" "}
+ <span className="text-text-2">— {p.reason}</span>
+ </p>
+ <div className="mt-0.5 font-mono text-[10.5px] text-muted">
+ {p.model} · prompt v{p.promptVersion}
+ </div>
+ <div className="mt-1 flex flex-wrap items-center gap-2">
+ <input
+ aria-label={`note on ${p.claim}`}
+ placeholder="note (optional)"
+ className="min-w-[14rem] flex-1 rounded-[3px] border border-seam-2 bg-[var(--color-ink)] px-1.5 py-0.5 text-[12px] text-text"
+ value={notes[p.claim] ?? ""}
+ onChange={(e) => setNotes({ ...notes, [p.claim]: e.target.value })}
+ />
+ <Button type="button" size="sm" disabled={busy !== null} onClick={() => void review(p, "approve")}>
+ Approve
+ </Button>
+ <Button type="button" size="sm" disabled={busy !== null} onClick={() => void review(p, "reject")}>
+ Reject
+ </Button>
+ </div>
+ </li>
+ ))}
+ </ul>
+ </section>
+ );
+}
diff --git a/umtool/e2e/fixtures/editor-stub.mjs b/umtool/e2e/fixtures/editor-stub.mjs
@@ -112,6 +112,9 @@ function writeWindow(dir, name, seconds) {
// the stub's acquisition jobs, then
// approved (a job: running after 1 s,
// done after 3 s) or rejected
+// POST /api/ops/verdict-review (release 29 M8) the REAL review of
+// a verdict proposal over the
+// fixture's article store (tsx)
// A `refresh` report-draft (R4): `dryRun` answers a plan (the iteration
// refreshed, a fetch per channel and one held platform skipped, a site built,
// the policy's model and cap); else a `refresh` iteration, running after 1 s,
@@ -900,6 +903,30 @@ function generationRoute(req, res, url, auth) {
return json(res, 200, out);
});
}
+ // VERDICT PROPOSALS (release 29 M8): the REAL verdict-review over the
+ // fixture's article store (common/testing/verdicts/reviewStub.ts, under
+ // tsx) — approve sets the claim's verdict through the registry.
+ if (req.method === "POST" && url.pathname === "/api/ops/verdict-review") {
+ return readBody(req, (body) => {
+ requests.push({ route: "verdict-review", ...(body ?? {}), authorization: auth });
+ record();
+ const r = spawnSync(path.join(REPO, "node_modules/.bin/tsx"), [path.join(REPO, "common/testing/verdicts/reviewStub.ts"), "--articles", ARTICLES], {
+ cwd: REPO,
+ input: JSON.stringify(body ?? {}),
+ encoding: "utf8",
+ timeout: 60_000,
+ });
+ const last = String(r.stdout ?? "").trim().split("\n").filter(Boolean).at(-1);
+ let out;
+ try {
+ out = JSON.parse(last ?? "");
+ } catch {
+ return json(res, 500, { ok: false, error: `the verdict-review stub failed: ${String(r.stderr ?? "").slice(-400)}` });
+ }
+ if (!out.ok) return json(res, out.status ?? 400, { ok: false, error: out.error });
+ return json(res, 200, out);
+ });
+ }
if (req.method === "POST" && url.pathname === "/api/ops/research-approve") {
return readBody(req, (body) => {
requests.push({ route: "research-approve", ...(body ?? {}), authorization: auth });
diff --git a/umtool/e2e/verdict-proposed.spec.ts b/umtool/e2e/verdict-proposed.spec.ts
@@ -0,0 +1,112 @@
+import { test, expect } from "@playwright/test";
+import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
+import path from "node:path";
+import { fileURLToPath } from "node:url";
+import { WARM_TIMEOUT, warm } from "./warm";
+
+// ---------------------------------------------------------------------------
+// Verdict proposals (release 29 M8): a synthetic fact-check in the fixture's
+// article store with two unruled claims a model proposed verdicts for
+// (`verdicts.proposed.json` beside it). The Inbox's `verdict-proposed` card
+// (Review) → the article's tab → Approve sets the claim's verdict (the stub
+// editor runs the REAL verdict-review over the fixture's store), Reject
+// leaves the claim unruled; the card goes once nothing waits.
+// ---------------------------------------------------------------------------
+
+const HERE = path.dirname(fileURLToPath(import.meta.url));
+const ARTICLES = path.join(HERE, "..", ".e2e-song", "articles");
+const ID = "vprop-check";
+const DIR = path.join(ARTICLES, ID);
+const AT = "2026-10-15T10:00:00.000Z";
+const MODEL = "qwen3:8b";
+
+const report = {
+ format: "archilyzer-report",
+ version: 1,
+ id: ID,
+ kind: "factcheck",
+ title: "The Bakery Check",
+ citations: {
+ q1: { kind: "video", channel: "sitechan", id: "sv1", start: 3, end: 6, quote: "The vote was rigged and everybody knew." },
+ },
+ sections: [
+ {
+ id: "s1",
+ title: "The shop",
+ claims: [
+ { id: "c1", text: "The article says she opened the shop in spring.", verdict: "CORROBORATED", citations: ["q1"] },
+ { id: "c2", text: "The article says the oven was broken for a month.", citations: ["q1"] },
+ { id: "c3", text: "The article says she sold the van.", citations: ["q1"] },
+ ],
+ },
+ ],
+};
+
+const proposals = {
+ format: "archilyzer-verdict-proposals",
+ version: 1,
+ article: ID,
+ proposals: {
+ c2: { verdict: "PARTLY", reason: "She says the oven ran hot, not that it was broken.", model: MODEL, promptVersion: "2", at: AT, status: "proposed" },
+ c3: { verdict: "CONTRADICTED", reason: "She says she kept the van.", model: MODEL, promptVersion: "2", at: AT, status: "proposed" },
+ },
+ updatedAt: AT,
+};
+
+const claims = () => (JSON.parse(readFileSync(path.join(DIR, "report.json"), "utf8")) as typeof report).sections[0]!.claims as { id: string; verdict?: string }[];
+const sidecar = () => JSON.parse(readFileSync(path.join(DIR, "verdicts.proposed.json"), "utf8")) as typeof proposals;
+
+test.beforeAll(async ({ playwright }) => {
+ test.setTimeout(WARM_TIMEOUT);
+ rmSync(DIR, { recursive: true, force: true });
+ mkdirSync(DIR, { recursive: true });
+ writeFileSync(path.join(DIR, "report.json"), JSON.stringify(report, null, 2) + "\n");
+ writeFileSync(path.join(DIR, "verdicts.proposed.json"), JSON.stringify(proposals, null, 2) + "\n");
+ await warm(playwright, ["/", `/articles/${ID}?tab=article`, "/api/browse/decisions"]);
+});
+test.afterAll(() => {
+ rmSync(DIR, { recursive: true, force: true });
+});
+
+test("an Inbox row → the article's proposals → Approve sets the verdict, Reject leaves the claim; the card goes", async ({ page, request }) => {
+ // The API: one row per waiting proposal, in Review, its action the article's tab.
+ const rows = ((await (await request.get("/api/browse/decisions")).json()) as {
+ items: { kind: string; target: string; group: string; piece?: string; action: { label: string; href: string } }[];
+ }).items.filter((d) => d.kind === "verdict-proposed" && d.piece === `a:articles/${ID}`);
+ expect(rows.map((d) => d.target).sort()).toEqual(["c2", "c3"]);
+ expect(rows.every((d) => d.group === "review")).toBe(true);
+ expect(rows[0]!.action).toEqual({ label: "Review verdicts", href: `/articles/${ID}?tab=article` });
+
+ await page.goto("/");
+ const card = page.locator("[data-group=review] [data-card=verdict-proposed]").filter({ hasText: "The Bakery Check" });
+ await expect(card).toHaveCount(1);
+ await expect(card.locator("[data-count]")).toHaveText("2");
+ await expect(card.locator("[data-card-title]")).toHaveText("The Bakery Check · 2 verdicts proposed");
+ await expect(card.locator("small")).toHaveText(`by ${MODEL} · prompt v2`);
+ await card.locator("[data-action-link]").click();
+ await expect(page).toHaveURL(new RegExp(`/articles/${ID}\\?tab=article$`));
+
+ const panel = page.getByRole("region", { name: "verdict proposals" });
+ await expect(panel.locator("[data-proposal]")).toHaveCount(2);
+ const c2 = panel.locator('[data-proposal="c2"]');
+ await expect(c2.locator("[data-proposed]")).toHaveText("PARTLY");
+ await expect(c2).toContainText("She says the oven ran hot");
+ await c2.getByRole("button", { name: "Approve" }).click();
+ await expect(panel.getByRole("status")).toHaveText("Approved: c2 is PARTLY.");
+ await expect(panel.locator('[data-proposal="c2"]')).toHaveCount(0);
+ expect(claims().find((c) => c.id === "c2")!.verdict).toBe("PARTLY");
+ expect(sidecar().proposals.c2.status).toBe("approved");
+
+ const c3 = panel.locator('[data-proposal="c3"]');
+ await c3.getByRole("textbox", { name: "note on c3" }).fill("the window is too short");
+ await c3.getByRole("button", { name: "Reject" }).click();
+ await expect(panel.getByRole("status")).toHaveText("Rejected: c3 stays unruled.");
+ expect(claims().find((c) => c.id === "c3")!.verdict).toBeUndefined();
+ expect(sidecar().proposals.c3).toMatchObject({ status: "rejected", note: "the window is too short" });
+ // The operator's ruling stayed as it was.
+ expect(claims().find((c) => c.id === "c1")!.verdict).toBe("CORROBORATED");
+
+ // Nothing waits: the card is gone.
+ await page.goto("/");
+ await expect(page.locator("[data-group=review] [data-card=verdict-proposed]").filter({ hasText: "The Bakery Check" })).toHaveCount(0);
+});
diff --git a/umtool/lib/articles/verdicts.ts b/umtool/lib/articles/verdicts.ts
@@ -0,0 +1,91 @@
+import { readVerdictProposals, waitingProposals, type VerdictProposal } from "yt-dlp-transcript-common/lib/report/verdictProposals";
+import { articleFile } from "yt-dlp-transcript-common/lib/report/registry";
+import { readJsonFile } from "yt-dlp-transcript-common/lib/jsonFile-server";
+import { isVerdict, type Verdict } from "yt-dlp-transcript-common/lib/report/verdicts";
+import { isReportId } from "yt-dlp-transcript-common/lib/report/schema";
+import { askEditor, EditorError } from "./generation";
+import { sitesPaths } from "./sites";
+
+// VERDICT PROPOSALS, AS UMTOOL SEES THEM (release 29 M8): a model's proposed
+// verdicts for a fact-check's unruled claims, read from the article's
+// `verdicts.proposed.json` (common's lib/report/verdictProposals.ts; read
+// here, never written) and joined with its report.json as it is now — a
+// proposal waits while its claim is still unruled. The operator's approve or
+// reject goes to the editor's `verdict-review` (the one writer: approve sets
+// the claim's verdict through the registry).
+//
+// SERVER-ONLY.
+
+export type WaitingProposal = {
+ claim: string;
+ text: string;
+ section: string;
+ verdict: Verdict;
+ reason: string;
+ model: string;
+ promptVersion: string;
+ at: string;
+};
+
+export type ArticleProposals = {
+ waiting: WaitingProposal[];
+ approved: number;
+ rejected: number;
+ // The sidecar did not read (it is never taken for empty).
+ error?: string;
+};
+
+type ClaimRow = { id: string; text: string; section: string; verdict?: unknown };
+
+async function claimsOf(article: string): Promise<Map<string, ClaimRow> | null> {
+ const read = await readJsonFile(articleFile(sitesPaths(), article));
+ if (!read.ok) return null;
+ const r = read.value as { kind?: unknown; sections?: { title?: string; claims?: { id?: string; text?: string; verdict?: unknown }[] }[] };
+ if (r.kind !== "factcheck") return null;
+ const out = new Map<string, ClaimRow>();
+ for (const s of r.sections ?? []) {
+ for (const c of s.claims ?? []) if (typeof c.id === "string") out.set(c.id, { id: c.id, text: String(c.text ?? ""), section: String(s.title ?? ""), verdict: c.verdict });
+ }
+ return out;
+}
+
+/** An article's proposals: the waiting ones on still-unruled claims, in the report's order. */
+export async function readArticleProposals(article: string): Promise<ArticleProposals | null> {
+ if (!isReportId(article)) return null;
+ let f;
+ try {
+ f = await readVerdictProposals(article, sitesPaths());
+ } catch (e) {
+ return { waiting: [], approved: 0, rejected: 0, error: (e as Error).message };
+ }
+ if (!f) return null;
+ const claims = await claimsOf(article);
+ const all = Object.values(f.proposals) as VerdictProposal[];
+ const order = claims ? [...claims.keys()] : [];
+ const waiting = waitingProposals(f)
+ .filter(([id]) => {
+ const c = claims?.get(id);
+ return !!c && !isVerdict(c.verdict);
+ })
+ .map(([id, p]) => {
+ const c = claims!.get(id)!;
+ return { claim: id, text: c.text, section: c.section, verdict: p.verdict, reason: p.reason, model: p.model, promptVersion: p.promptVersion, at: p.at };
+ })
+ .sort((a, b) => order.indexOf(a.claim) - order.indexOf(b.claim));
+ return {
+ waiting,
+ approved: all.filter((p) => p.status === "approved").length,
+ rejected: all.filter((p) => p.status === "rejected").length,
+ };
+}
+
+/** Approve or reject one proposal through the editor's verdict-review. */
+export async function reviewArticleProposal(body: unknown): Promise<{ proposal: unknown }> {
+ const b = (body ?? {}) as Record<string, unknown>;
+ if (typeof b.article !== "string" || typeof b.claim !== "string") throw new EditorError('send {"article", "claim", "decision": "approve" | "reject", "note"?}', 400);
+ if (b.decision !== "approve" && b.decision !== "reject") throw new EditorError('"decision" is "approve" or "reject"', 400);
+ if (b.note !== undefined && typeof b.note !== "string") throw new EditorError('"note" is text', 400);
+ const sent = { article: b.article, claim: b.claim, decision: b.decision, ...(typeof b.note === "string" && b.note.trim() ? { note: b.note.trim() } : {}) };
+ const answer = await askEditor<{ proposal?: unknown }>("/api/ops/verdict-review", { method: "POST", body: sent });
+ return { proposal: answer.proposal ?? null };
+}
diff --git a/umtool/lib/inbox.ts b/umtool/lib/inbox.ts
@@ -10,6 +10,8 @@ import { readManifest, reportSignature } from "./projects/report.mjs";
import { draftsView } from "./report/drafts.mjs";
import { articleHref, generationPolicyHref, reviewHref, triageHref } from "./hrefs";
import { awaitingReview, draftsDecisions } from "./inbox/drafts.mjs";
+import { verdictsDecisions } from "./inbox/verdicts.mjs";
+import { readArticleProposals } from "./articles/verdicts";
import { readFieldProvenance } from "./report/draft-provenance.mjs";
import { pieceOfDecision, readPieceGraph, type Piece, type PieceGraph } from "./pieces";
import { lifecycleOf, readLifecycle, type LifecycleRead } from "./lifecycle";
@@ -57,6 +59,11 @@ import { refreshDecisions } from "./inbox/refresh";
// row per field, kept per project against
// reportSignature -- which signs the review files, so an
// approve drops the card on the next read
+// verdict-proposed a model's proposed verdict for a fact-check's unruled
+// claim (release 29 M8; the article's
+// verdicts.proposed.json, lib/inbox/verdicts.mjs), one row
+// per proposal, gone once approved or rejected (or the
+// claim ruled by hand)
//
// -- each row given its piece, category, group, one action, lifecycle and
// `hidden` (lib/inbox/groups.mjs), ranked. One row per decision, never dropped:
@@ -344,12 +351,29 @@ async function worthOf(views: ScheduleView[]): Promise<Map<string, { href: strin
return out;
}
-/** The decisions read from disk beside openDecisions(): iterations, research, links, looks-done, drafts, recurring reports. */
+/** The store's fact-checks' proposed verdicts (release 29 M8), waiting on the operator. */
+async function proposalDecisions(graph: PieceGraph): Promise<Decision[]> {
+ const per = await Promise.all(
+ storeArticles(graph).map(async (p) => {
+ const got = await readArticleProposals(p.report as string).catch(() => null);
+ if (!got?.waiting.length) return [] as Decision[];
+ return verdictsDecisions({
+ base: articleRow(p),
+ href: articleHref({ site: ARTICLES_KEY, id: p.report as string }, { tab: "article" }),
+ waiting: got.waiting,
+ }) as Decision[];
+ }),
+ );
+ return per.flat();
+}
+
+/** The decisions read from disk beside openDecisions(): iterations, research, links, looks-done, drafts, verdict proposals, recurring reports. */
export async function diskDecisions(graph: PieceGraph, life: LifecycleRead): Promise<Decision[]> {
- const [spend, drafts, schedules] = await Promise.all([
+ const [spend, drafts, schedules, proposals] = await Promise.all([
spendByJob(),
draftsDecisionsAll().catch(() => [] as Decision[]),
readSchedules().catch(() => ({ schedules: [] as ScheduleView[] })),
+ proposalDecisions(graph).catch(() => [] as Decision[]),
]);
// An edition's article is its series' piece's business (one Review card there).
// A watch's tick article is its watch's (one Worth researching card there).
@@ -366,7 +390,7 @@ export async function diskDecisions(graph: PieceGraph, life: LifecycleRead): Pro
const refresh = await readMutes()
.then((mutes) => refreshDecisions(graph, life, mutes))
.catch(() => [] as Decision[]);
- return [...perArticle.flat(), ...pieceDecisions(graph, life), ...drafts, ...refresh, ...recurring];
+ return [...perArticle.flat(), ...pieceDecisions(graph, life), ...drafts, ...proposals, ...refresh, ...recurring];
}
/**
diff --git a/umtool/lib/inbox/groups.mjs b/umtool/lib/inbox/groups.mjs
@@ -9,7 +9,8 @@
// your-call research proposals, then failed runs: money is waiting
// on a yes or no ("spend")
// review a finished iteration that is not current; a cut whose
-// drafted fields nobody has reviewed (r28's drafts, P2b)
+// drafted fields nobody has reviewed (r28's drafts, P2b);
+// a fact-check's proposed verdicts (release 29 M8)
// blocking something downstream would lie, on an ACTIVE piece
// notes the operator's open notes
// open every other open decision (a variant with no verdict, a
@@ -63,6 +64,9 @@ const KIND_CATEGORY = {
// recordings since the current report are something to review.
"refresh-held": "spend",
"refresh-available": "review",
+ // Release 29 M8: a model's proposed verdicts for a fact-check's unruled
+ // claims, each waiting on the operator's approve or reject.
+ "verdict-proposed": "review",
};
const CATEGORY_GROUP = {
@@ -91,7 +95,7 @@ export function groupOf(d) {
// Within a group: the brief's order first (proposals before failed runs), then
// everything else as equals.
-const KIND_RANK = { "worth-researching": 0, "research-proposal": 0, "iteration-failed": 1, "tick-held": 2, "tick-failed": 2, "tick-partial": 2, "iteration-ready": 0, "edition-ready": 0, "drafts-unreviewed": 1, "unreadable-notes": 0, "refresh-held": 2, "refresh-available": 2 };
+const KIND_RANK = { "worth-researching": 0, "research-proposal": 0, "iteration-failed": 1, "tick-held": 2, "tick-failed": 2, "tick-partial": 2, "iteration-ready": 0, "edition-ready": 0, "drafts-unreviewed": 1, "verdict-proposed": 1, "unreadable-notes": 0, "refresh-held": 2, "refresh-available": 2 };
const SEVERITY_RANK = { blocking: 0, open: 1, info: 2 };
// ONE primary action per decision, its button copy naming the result.
@@ -100,6 +104,7 @@ const ACTION_LABEL = {
"iteration-failed": "Retry run",
"iteration-ready": (d) => `Make ${d.target} current`,
"drafts-unreviewed": "Review drafts",
+ "verdict-proposed": "Review verdicts",
"open-note": "Answer note",
"unreadable-notes": "Repair notes.json",
"link-ambiguous": "Link the video",
diff --git a/umtool/lib/inbox/verdicts.mjs b/umtool/lib/inbox/verdicts.mjs
@@ -0,0 +1,38 @@
+// VERDICT PROPOSALS AS DECISIONS (release 29 M8; the kind the redesign
+// reserved): a fact-check whose unruled claims a model has proposed verdicts
+// for, waiting on the operator's approve or reject — the Inbox's Review
+// group, one row per proposal (the API keeps one row per decision), one card
+// per article ("3 verdicts proposed"), its action the article's tab where
+// each is approved or rejected. Pure: lib/inbox.ts reads the proposals
+// (lib/articles/verdicts.ts) and hands the waiting ones here. Not the
+// manifest claim bench's `claim-unadjudicated`.
+
+/** The card's title: how many verdicts wait. */
+export function verdictsWhat(waiting) {
+ const n = waiting.length;
+ return `${n} verdict${n === 1 ? "" : "s"} proposed`;
+}
+
+/** The card's sentence: how many, by which models, on which prompt. */
+export function verdictsWhy(waiting) {
+ const models = [...new Set(waiting.map((w) => w.model).filter(Boolean))];
+ const versions = [...new Set(waiting.map((w) => w.promptVersion).filter(Boolean))];
+ return [verdictsWhat(waiting), models.length ? `by ${models.join(", ")}` : null, versions.length ? `prompt v${versions.join(", v")}` : null].filter(Boolean).join(" · ");
+}
+
+/**
+ * The `verdict-proposed` rows of one article.
+ *
+ * @param {{
+ * base: { project: string, projectKind?: string, projectTitle: string, piece?: string },
+ * href: string,
+ * waiting: { claim: string, model: string, promptVersion: string, at: string }[],
+ * }} o
+ */
+export function verdictsDecisions({ base, href, waiting }) {
+ if (!waiting?.length) return [];
+ const what = verdictsWhat(waiting);
+ const why = verdictsWhy(waiting);
+ const at = Math.max(0, ...waiting.map((w) => Date.parse(w.at) || 0));
+ return waiting.map((w) => ({ ...base, kind: "verdict-proposed", target: w.claim, what, why, href, severity: "open", at }));
+}
diff --git a/umtool/lib/inbox/verdicts.test.mjs b/umtool/lib/inbox/verdicts.test.mjs
@@ -0,0 +1,29 @@
+// The verdict-proposed rows (release 29 M8): one per waiting proposal, one
+// card's words, in the Review group with its one action.
+import { test } from "node:test";
+import assert from "node:assert/strict";
+import { verdictsDecisions, verdictsWhy } from "./verdicts.mjs";
+import { annotate, groupOf, summarizeGroups } from "./groups.mjs";
+import { whatOf } from "./what.mjs";
+
+test("verdict-proposed: a row per proposal, the card's words, the Review group, Review verdicts", () => {
+ const waiting = [
+ { claim: "c2", model: "qwen3:8b", promptVersion: "2", at: "2026-10-15T10:00:00Z" },
+ { claim: "c4", model: "qwen3:8b", promptVersion: "2", at: "2026-10-15T11:00:00Z" },
+ ];
+ const rows = verdictsDecisions({ base: { project: "sites/articles/fc", projectKind: "article", projectTitle: "A check", piece: "a:articles/fc" }, href: "/articles/fc?tab=article", waiting });
+ assert.equal(rows.length, 2);
+ assert.ok(rows.every((r) => r.kind === "verdict-proposed" && r.severity === "open" && r.what === "2 verdicts proposed" && r.href === "/articles/fc?tab=article"));
+ assert.deepEqual(rows.map((r) => r.target), ["c2", "c4"]);
+ assert.equal(rows[0].at, Date.parse("2026-10-15T11:00:00Z"));
+ assert.equal(verdictsWhy(waiting), "2 verdicts proposed · by qwen3:8b · prompt v2");
+ assert.equal(groupOf(rows[0]), "review");
+ assert.equal(whatOf("verdict-proposed"), "verdicts proposed");
+ const annotated = annotate(rows, { pieceOf: () => "a:articles/fc", lifecycleOf: () => "active", isMuted: () => false });
+ assert.equal(annotated[0].action.label, "Review verdicts");
+ const review = summarizeGroups(annotated).find((g) => g.id === "review");
+ assert.equal(review.cards.length, 1);
+ assert.equal(review.cards[0].count, 2);
+ assert.equal(review.cards[0].what, "2 verdicts proposed");
+ assert.deepEqual(verdictsDecisions({ base: { project: "x", projectTitle: "x" }, href: "/", waiting: [] }), []);
+});
diff --git a/umtool/lib/inbox/what.mjs b/umtool/lib/inbox/what.mjs
@@ -8,6 +8,7 @@ export const WHAT = {
"iteration-failed": "run failed",
"iteration-ready": "iteration ready",
"drafts-unreviewed": "drafts to review",
+ "verdict-proposed": "verdicts proposed",
"open-note": "open notes",
"unreadable-notes": "notes.json does not read",
"link-ambiguous": "video not linked",