// 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 })); } /** * An article whose `verdicts.proposed.json` does not read (review fix 7): one * blocking row, as an unreadable notes.json is — nothing is shown from it, * and nothing writes it, until it is repaired. * * @param {{ base: { project: string, projectKind?: string, projectTitle: string, piece?: string }, href: string, error: string, at?: number }} o */ export function unreadableProposalsDecision({ base, href, error, at = Date.now() }) { return { ...base, kind: "unreadable-proposals", target: "verdicts.proposed.json", why: `verdicts.proposed.json does not read (${error}); no proposal is shown or written until it is fixed`, href, severity: "blocking", at, }; }