Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 01bf7a5ca8f6aed8dbc3206b17fd51532f575ab1
parent 36d42e633a871fbd5ca2ba323a29d9e680a982fc
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Tue, 10 Nov 2026 16:00:51 -0500

umtool: Fix in the review pass is "needs work" -- a mark in review-pass.json on any block, a clip too, never a clip's verdict (`incorrect` is the bench's fact-error ruling: a blocking check and `umtool corrections`); Keep on a clip writes `confirmed` only while it has no verdict or is confirmed (and takes back a Fix it carried); a clip the bench ruled incorrect or wrong speaker is shown with its words, Keep off, Full bench the way to change it; the CLI's mark takes clips for fix and clear; knobs.md; the fixture's c04 is ruled wrong speaker -- L7b review item 6

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Diffstat:
Mumtool/components/projects/bench/walkVerdict.ts | 6+++---
Mumtool/components/projects/workspace/BlockStrip.tsx | 6+++---
Mumtool/components/projects/workspace/ReviewPass.tsx | 89+++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------
Mumtool/docs/cli.md | 4++--
Mumtool/docs/knobs.md | 14++++++++++----
Mumtool/e2e/fixtures/make-fixture.mjs | 2++
Mumtool/e2e/review-pass.spec.ts | 46+++++++++++++++++++++++++++++++---------------
Mumtool/lib/cli/groups.mjs | 5+++--
Mumtool/lib/cli/verbs.mjs | 4++--
Mumtool/lib/report/reviewPass.mjs | 24+++++++++++++-----------
Mumtool/lib/report/reviewPass.test.mjs | 18+++++++++++++++---
Mumtool/lib/report/reviewPassModel.mjs | 43+++++++++++++++++++++++++++++++------------
12 files changed, 175 insertions(+), 86 deletions(-)

diff --git a/umtool/components/projects/bench/walkVerdict.ts b/umtool/components/projects/bench/walkVerdict.ts @@ -2,7 +2,7 @@ // `incorrect` with its `correction` -- written exactly as the clip bench writes it: the clip's own token read // (GET /api/report/clip), then the window writer (PUT /api/report/window), one write and one undo point // (lib/report/manifest.mjs updateClip). The bench's Undo of a Confirm writes through this, and the workspace's -// review pass (Keep · Fix) does; ClipBench's own Confirm keeps its in-component save, which carries a moved +// review pass's Keep does; ClipBench's own Confirm keeps its in-component save, which carries a moved // window in the same patch. Its terminal twin: `umtool window <p> <clip> --verdict confirmed|incorrect`. export type ClipWrite = @@ -24,7 +24,7 @@ export async function writeClipPatch(project: string, clip: string, patch: Recor return { ok: true, entry: (j.entry ?? {}) as Record<string, unknown>, token: String(j.token ?? ""), json: j }; } -/** The walk's two answers a review pass gives: Keep (`confirmed`) and Fix (`incorrect`, saying what). */ -export function writeWalkVerdict(project: string, clip: string, v: { verdict: "confirmed" } | { verdict: "incorrect"; correction: string } | { verdict: "" }): Promise<ClipWrite> { +/** The walk's verdict a review pass writes: Keep (`confirmed`) -- never `incorrect`, the bench's fact-error ruling. */ +export function writeWalkVerdict(project: string, clip: string, v: { verdict: "confirmed" } | { verdict: "" }): Promise<ClipWrite> { return writeClipPatch(project, clip, v); } diff --git a/umtool/components/projects/workspace/BlockStrip.tsx b/umtool/components/projects/workspace/BlockStrip.tsx @@ -68,7 +68,7 @@ export default function BlockStrip({ /** The + at the end: what it opens (none outside Edit). */ plus: React.ReactNode; /** The review pass's answers (L7b): a block kept or to fix is marked. */ - marks?: Map<string, { mark: "keep" | "fix"; note: string | null }> | null; + marks?: Map<string, { mark: "keep" | "fix" | "ruled"; note: string | null }> | null; }) { const ref = useRef<HTMLDivElement | null>(null); const [drag, setDrag] = useState<string | null>(null); @@ -148,8 +148,8 @@ export default function BlockStrip({ <span className="flex items-baseline gap-1"> <span className={cn("truncate font-mono text-[11.5px] font-medium text-text", b.rejected && "line-through")}>{b.id}</span> {marks?.get(b.id) && ( - <span aria-label={marks.get(b.id)!.mark === "keep" ? "kept" : "to fix"} className={cn("shrink-0 text-[11px] font-semibold", marks.get(b.id)!.mark === "keep" ? "text-kept-text" : "text-doubt-text")}> - {marks.get(b.id)!.mark === "keep" ? "✓" : "✎"} + <span aria-label={marks.get(b.id)!.mark === "keep" ? "kept" : marks.get(b.id)!.mark === "fix" ? "needs work" : "ruled in the bench"} className={cn("shrink-0 text-[11px] font-semibold", marks.get(b.id)!.mark === "keep" ? "text-kept-text" : "text-doubt-text")}> + {marks.get(b.id)!.mark === "keep" ? "✓" : marks.get(b.id)!.mark === "fix" ? "✎" : "✗"} </span> )} <span className="ml-auto shrink-0 text-[10px] uppercase tracking-[0.06em] text-muted">{TYPE_WORD[b.type] ?? b.type}</span> diff --git a/umtool/components/projects/workspace/ReviewPass.tsx b/umtool/components/projects/workspace/ReviewPass.tsx @@ -4,8 +4,8 @@ import Link from "next/link"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { buttonVariants } from "@/components/ui/button"; import { cn } from "@/lib/utils"; -import { openInDraftHref } from "@/lib/hrefs"; -import { blockAnswer, reviewProgress } from "@/lib/report/reviewPassModel.mjs"; +import { clipBenchHref, openInDraftHref } from "@/lib/hrefs"; +import { blockAnswer, clipKeepable, clipVerdict, reviewProgress } from "@/lib/report/reviewPassModel.mjs"; import AnchoredNotes from "@/components/notes/AnchoredNotes"; import { useSharedNotes } from "@/components/notes/NotesProvider"; import { writeWalkVerdict } from "../bench/walkVerdict"; @@ -19,9 +19,10 @@ import { aModalIsOpen } from "@/components/ui/modalOpen"; // THE REVIEW PASS (umtool redesign L7b; the workspace's `?mode=review`): the inspector hidden, the viewer playing // the draft block by block, and each block answered here -- // -// Keep k a clip: its walk verdict `confirmed` (the bench's writer, bench/walkVerdict.ts); a post or a card: -// `keep` in review-pass.json (lib/report/reviewPass.mjs) -// Fix f says what needs fixing: a clip's `incorrect` with that correction; a post's or a card's `fix` note +// Keep k a clip: its walk verdict `confirmed` (the bench's writer, bench/walkVerdict.ts) -- only while it has +// none or is confirmed: a clip the bench ruled incorrect is shown, never overwritten (Full bench); a post +// or a card: `keep` in review-pass.json (lib/report/reviewPass.mjs) +// Fix f "needs work", saying what: a `fix` mark in review-pass.json on ANY block -- never a clip's verdict // Note n the notes composer, anchored to the block (notes.json, `umtool notes`) // // -- then on to the next block, playing. After the last, the VERDICT for the draft (saved as a version first when @@ -30,7 +31,7 @@ import { aModalIsOpen } from "@/components/ui/modalOpen"; // A version (`?take=`) is read-only: its blocks are watched and noted, never marked -- Open in draft to change it. // --------------------------------------------------------------------------- -export type Answer = { mark: "keep" | "fix"; note: string | null }; +export type Answer = { mark: "keep" | "fix" | "ruled"; note: string | null; verdict?: string }; type Mark = { mark: "keep" | "fix"; note?: string; at: string }; /** The pass's state: the marks (review-pass.json), each block's answer, the progress, and the writers. */ @@ -61,7 +62,7 @@ export function useReviewPass(project: string, entries: PlayEntry[], on: boolean entries.map((e) => { const w = written[e.id]; if (!w || e.type !== "clip") return e; - return { ...e, review: { verdict: w.mark === "keep" ? "confirmed" : "incorrect", reason: null, correction: w.note, rejectNote: null } }; + return { ...e, review: { verdict: "confirmed", reason: null, correction: null, rejectNote: null } }; }), [entries, written], ); @@ -75,29 +76,45 @@ export function useReviewPass(project: string, entries: PlayEntry[], on: boolean return m; }, [seen, marks]); - /** One block answered: a clip through the walk's writer, anything else into review-pass.json. */ - const answer = useCallback( - async (e: PlayEntry, mark: "keep" | "fix", note: string | null): Promise<string | null> => { - // A version on screen (readOnly.ts): its marks would land on the draft's blocks. - if (readOnly) return READ_ONLY_SAID; - if (e.type === "clip") { - const w = await writeWalkVerdict(project, e.id, mark === "keep" ? { verdict: "confirmed" } : { verdict: "incorrect", correction: note ?? "" }); - if (!w.ok) return w.stale ? "the draft changed since — try again" : w.error; - setWritten((x) => ({ ...x, [e.id]: { mark, note } })); - announceManifestChanged(project); - return null; - } + const postMark = useCallback( + async (block: string, mark: "keep" | "fix" | null, note: string | null): Promise<string | null> => { const r = await fetch("/api/report/review-pass", { method: "POST", headers: { "content-type": "application/json" }, - body: JSON.stringify({ project, block: e.id, mark, note: note ?? undefined }), + body: JSON.stringify({ project, block, mark, note: note ?? undefined }), }); const j = (await r.json().catch(() => ({}))) as { error?: string; doc?: { marks?: Record<string, Mark> } }; if (!r.ok) return j.error ?? `HTTP ${r.status}`; setMarks(j.doc?.marks ?? {}); return null; }, - [project, readOnly], + [project], + ); + /** + * One block answered. Fix ("needs work"), on any block, is a mark in review-pass.json -- never a clip's verdict. + * Keep on a clip is its walk verdict `confirmed` (the bench's writer), only while it has none or is confirmed: a + * clip the bench ruled incorrect is the bench's to change. Keep on anything else is a mark. + */ + const answer = useCallback( + async (e: PlayEntry, mark: "keep" | "fix", note: string | null): Promise<string | null> => { + // A version on screen (readOnly.ts): its marks would land on the draft's blocks. + if (readOnly) return READ_ONLY_SAID; + if (mark === "fix" || e.type !== "clip") return postMark(e.id, mark, note); + if (!clipKeepable(e)) return `marked ${clipVerdict(e)} in the bench: the Full bench changes it`; + // A Fix it carried is taken back: kept now. + if (marks[e.id]) { + const err = await postMark(e.id, null, null); + if (err) return err; + } + if (clipVerdict(e) !== "confirmed") { + const w = await writeWalkVerdict(project, e.id, { verdict: "confirmed" }); + if (!w.ok) return w.stale ? "the draft changed since — try again" : w.error; + setWritten((x) => ({ ...x, [e.id]: { mark: "keep", note: null } })); + announceManifestChanged(project); + } + return null; + }, + [project, readOnly, postMark, marks], ); return { marks, loaded, progress, answers, answer }; } @@ -214,10 +231,15 @@ export default function ReviewPass({ setFixText(""); }, [id]); const answer = id ? (rv.answers.get(id) ?? null) : null; + // The bench's ruling on a clip (incorrect: a fact error, wrong speaker), shown and left as it is. + const bench = + entry?.type === "clip" && !clipKeepable(entry) + ? { verdict: String(clipVerdict(entry)), words: entry.review?.correction || entry.rejected?.label || entry.review?.reason || null } + : null; const go = useCallback( async (mark: "keep" | "fix", note: string | null) => { - if (!entry || readOnly || busy) return; + if (!entry || readOnly || busy || (mark === "keep" && bench)) return; setBusy(true); setErr(null); const e = await rv.answer(entry, mark, note); @@ -226,7 +248,7 @@ export default function ReviewPass({ setFixing(false); onAnswered(); }, - [entry, readOnly, busy, rv, onAnswered], + [entry, readOnly, busy, rv, onAnswered, bench], ); const openFix = useCallback(() => { if (!entry || readOnly) return; @@ -312,18 +334,27 @@ export default function ReviewPass({ <div className="flex flex-wrap items-baseline gap-2"> <span className="micro">{TYPE_WORD[entry.type] ?? entry.type}</span> <span className="font-mono text-[13px] font-medium text-text">{entry.id}</span> - {answer && ( + {answer && answer.mark !== "ruled" && ( <span className={cn("text-[12px]", answer.mark === "keep" ? "text-kept-text" : "text-doubt-text")} data-review-said=""> - {answer.mark === "keep" ? "kept" : `fix: ${answer.note ?? ""}`} + {answer.mark === "keep" ? "kept" : `needs work: ${answer.note ?? ""}`} </span> )} </div> + {/* A clip the bench ruled (a fact error, wrong speaker): the pass shows it and never overwrites it. */} + {bench && ( + <p className="m-0 text-[12px] text-doubt-text" data-review-bench={bench.verdict}> + marked {bench.verdict} in the bench{bench.words ? `: ${bench.words}` : ""}{" "} + <Link href={clipBenchHref(project, entry.id)} prefetch={false} className="ink-link" data-review-full-bench=""> + Full bench + </Link> + </p> + )} {(entry.quote || entry.heading) && <p className="m-0 font-serif text-[13.5px] leading-snug text-text-2">{entry.type === "clip" && entry.quote ? `“${entry.quote}”` : entry.heading}</p>} <div className="flex flex-wrap items-center gap-1.5"> - <button type="button" className={btn("go")} disabled={readOnly || busy} onClick={() => void go("keep", null)} data-review-keep="" title={readOnly ? "a version is read-only: Open in draft to mark its blocks" : entry.type === "clip" ? "keep it: the walk's verdict, confirmed (k)" : "keep it (k): review-pass.json"}> + <button type="button" className={btn("go")} disabled={readOnly || busy || !!bench} onClick={() => void go("keep", null)} data-review-keep="" title={readOnly ? "a version is read-only: Open in draft to mark its blocks" : bench ? `marked ${bench.verdict} in the bench: the Full bench changes it` : entry.type === "clip" ? "keep it: the walk's verdict, confirmed (k)" : "keep it (k): review-pass.json"}> Keep <kbd>k</kbd> </button> - <button type="button" className={btn("outline")} disabled={readOnly || busy} onClick={openFix} data-review-fix="" title={readOnly ? "a version is read-only: Open in draft to mark its blocks" : "say what needs fixing (f)"}> + <button type="button" className={btn("outline")} disabled={readOnly || busy} onClick={openFix} data-review-fix="" title={readOnly ? "a version is read-only: Open in draft to mark its blocks" : "it needs work: say what (f) -- a mark in review-pass.json, never the clip's verdict"}> Fix <kbd>f</kbd> </button> <button type="button" className={btn("quiet")} onClick={() => setNoting((x) => !x)} aria-pressed={noting} data-review-note="" title="a note on this block (n): notes.json, for you or an agent (umtool notes)"> @@ -356,13 +387,13 @@ export default function ReviewPass({ } }} rows={2} - placeholder={entry.type === "clip" ? "what needs fixing (the clip's correction)" : "what needs fixing"} + placeholder="what needs work" data-review-fix-text="" className="w-full rounded-[3px] border border-seam-2 bg-ground px-2 py-1 text-[12.5px] text-text outline-none focus:border-[var(--color-signal)]" /> <span className="flex gap-1.5"> <button type="submit" className={cn(buttonVariants({ variant: "go", size: "sm" }))} disabled={busy || !fixText.trim()} data-review-fix-save=""> - Save the fix + Save </button> <button type="button" className={cn(buttonVariants({ variant: "quiet", size: "sm" }))} onClick={() => setFixing(false)}> Cancel diff --git a/umtool/docs/cli.md b/umtool/docs/cli.md @@ -42,7 +42,7 @@ Inbox cannot disagree about what is wrong with one. | `window <project> <clip> --align` · `--quote-ruled` / `--no-quote-ruled` | the cut snapped to the quote as HEARD (0.15 s before its first word, 0.3 s after its last, the extent widened to hold it, `lockCut`); a person's ruling on the quote check (a take renders a ruled clip) | | `window <project> <clip> --take <take> …` | a **take's** clip (walk a take): the same fields, written into the take's patch (`takes/<take>/take.json`) with an undo point first; the project's manifest is untouched ([clip-bench.md](clip-bench.md#walking-a-take)) | | `walk <project> [--take <take>] [--all] [--json]` | the clip bench's **walk**: every clip in walk order with its window, verdict and whether a fetched file holds it, and (→) the ones the walk visits — fetched and needing a verdict; `--all` every fetched one; `--take` walks a take (a draft too); the bench's address to start at. The intro (`render.intro`) is listed first, watched, not judged (`intro`, `stops` in `--json`) | -| `review-pass <project> [ls] [--json]` · `review-pass <project> mark <block> keep\|fix\|clear [--note T]` | the workspace's **review pass** (`?mode=review`): every block but the intro and a clip rejected for a cut reason, its answer and the block the pass resumes on; a clip's Keep · Fix is its walk verdict (`window --verdict confirmed\|incorrect --correction`), a post's or a card's lives in `<project>/review-pass.json` — `mark` writes one (a Fix needs `--note`, what needs fixing); a clip is refused here ([knobs.md](knobs.md#the-review-pass)) | +| `review-pass <project> [ls] [--json]` · `review-pass <project> mark <block> keep\|fix\|clear [--note T]` | the workspace's **review pass** (`?mode=review`): every block but the intro and a clip rejected for a cut reason, its answer and the block the pass resumes on; a Fix ("needs work", saying what) is a mark in `<project>/review-pass.json` on any block, a clip too — never a clip's verdict (`incorrect` is the bench's fact-error ruling, never written or overwritten here); a clip's Keep is its walk verdict (`window --verdict confirmed`), a post's or a card's a mark — `mark` writes one (a Fix needs `--note`; a clip takes `fix` and `clear`) ([knobs.md](knobs.md#the-review-pass)) | | `review-pass <project> verdict like\|maybe\|no\|clear [--note T] [--json]` | the pass's **verdict on the draft**, one locked call: a draft that differs from its parent version only by what the walk and the review pass write (verdict, correction, reason, reject note, walk note, ★) judges the PARENT and saves nothing; otherwise the draft is saved as the next version and that is judged (`takes/verdicts.json`) | | `present <project> [--take <take> \| --cut] [--json] [--public] [--open] [--url <origin>]` | **present mode**: the cut as slides, navigated like a deck (`/projects/<p>/present`) — prints the address and every slide (its kind, id — a post's `<channel>/<id>`, a clip's id, `section-<n>`, `day-<YYYY-MM-DD>` — date, words and censor counts); `--json` the payload (each post's card as Play draws it and its censor data by kind, each clip's spans, the dividers); `--public` the payload a public page would carry (censored, no reveal data); `--open` opens it; `<address>#<slide id>` opens a slide ([knobs.md](knobs.md#present-mode-the-cut-as-slides-navigated-like-a-deck)) | | `set <project> <clip> key=value …` | a clip's **knobs**: `claim.at` `claim.hold` `claim.stamp` `claim.count` `claim.label` (the first mark's, or `--mark <id>`'s), its **marks** `mark.add=<verdict>[@<sec>]` `mark.remove=<id>` `mark.verdict=<verdict>` `marks=<json>`, `audio.offset` `audio.gain` `audio.fadeIn` `audio.fadeOut`, its picture's **blur** `blur.on=true` `blur.caption=…` `blur.strength` `blur.from` `blur.to` (`blur.on=` clears it; [knobs.md](knobs.md#a-clips-picture-blurred)), its **effects** `fx.zoom=<json>` `fx.receipts=<json>` `fx.punch=…` `fx.quote` `fx.punchIn=<json>` `fx.speakers=<json>` (`fx=<json>` all of them, `fx=` clears them; a shot is a file in the project; [knobs.md](knobs.md#effects)); `key=` clears one ([knobs.md](knobs.md#marks)) | @@ -193,7 +193,7 @@ draft (the project's manifest); *project*: a project's other files, or reads; *c | `window <project> <clip> [--start N] [--end N] [--lock] [--lock-end] [--no-lock-end] [--cut-start N] [--cut-end N] [--lock-cut] [--align] [--title TITLE] [--date DATE] [--cite N] [--cite-url CITE-URL] [--quote QUOTE] [--repeat-of REPEAT-OF] [--verdict confirmed\|incorrect] [--correction CORRECTION] [--reject not-matching\|wrong-speaker\|irrelevant\|repeats\|weak\|privacy\|other] [--note NOTE] [--walk-note WALK-NOTE] [--star] [--no-star] [--quote-ruled] [--no-quote-ruled] [--move-stamp MOVE-STAMP] [--clear-stamp] [--move-mute nearest] [--clear-mute] [--gap GAP…] [--gap-remove N] [--gaps GAPS] [--take TAKE]` | a clip's window, cut, attribution and verdict | form · *draft* | | `walk <project> [--take TAKE] [--all]` | the clip bench's walk: clips in walk order, verdicts, fetched | form · *project* | | `review-pass <project> ls` | the review pass: each block's answer, and where it resumes | form · *project* | -| `review-pass <project> mark <block> keep\|fix\|clear [--note NOTE]` | a post's or a card's review-pass answer: keep, fix (with what) or clear | form · *project* | +| `review-pass <project> mark <block> keep\|fix\|clear [--note NOTE]` | a block's review-pass mark: keep (a post, a card), fix (needs work, saying what; any block) or clear | form · *project* | | `review-pass <project> verdict like\|maybe\|no\|clear [--note NOTE]` | the draft's verdict at the pass's end: its parent's when only review fields differ, else saved as a version and judged | form · *project* | | `present <project> [--take TAKE] [--cut] [--public]` | present mode's address and slides | form · *project* | | `set <project> <clip> key=value… [--mark MARK] [--take TAKE]` | a clip's knobs: claim, marks, audio, blur, fx … | form · *draft* | diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md @@ -792,10 +792,16 @@ rejected for a cut reason is in it, **"4 / 12 reviewed"**, and it resumes on the | Answer | Key | A clip | A post, a card, a video entry | |---|---|---|---| -| **Keep** | k | its walk verdict, `confirmed` (the bench's writer) | `keep` in `<p>/review-pass.json` | -| **Fix** — says what needs fixing | f | `incorrect`, that text its correction | `fix`, that text its note | +| **Keep** | k | its walk verdict, `confirmed` (the bench's writer) — only while it has none or is confirmed | `keep` in `<p>/review-pass.json` | +| **Fix** — "needs work", saying what | f | a `fix` mark with that text in `review-pass.json` — **never** its verdict | the same | | **Note** | n | the notes composer, anchored to the block (`notes.json`) | the same | +A clip the BENCH ruled `incorrect` (a fact error, wrong speaker) is answered already: the pass shows that verdict +and its words, **Keep** is off ("marked incorrect in the bench"), and **Full bench** is where it changes — the pass +never writes `incorrect` (that is the fact-error verdict: a blocking `clip-incorrect` and `umtool corrections`) and +never overwrites it. A mark wins over a verdict in what the pass shows; Keep on a clip carrying a Fix takes the +mark back. + Keep and Fix move on to the next block and play it; **← →** step without answering; Space plays and pauses. The strip marks each answered block (✓ kept, ✎ to fix). Past the last block: the **verdict** — **Like · Maybe · No**, L4's writer (`takes/verdicts.json`), one locked call on the server: a draft that differs from its parent version @@ -808,8 +814,8 @@ changes it). The take walk's old address (`/takes/<t>/walk`) is that version's p | | CLI twin | |---|---| | each block's answer, where the pass resumes | `umtool review-pass <p> [ls] [--json]` | -| a post's or a card's answer | `umtool review-pass <p> mark <block> keep\|fix\|clear [--note T]` | -| a clip's | `umtool window <p> <clip> --verdict confirmed` · `--verdict incorrect --correction T` | +| a post's or a card's answer; any block's Fix | `umtool review-pass <p> mark <block> keep\|fix\|clear [--note T]` (a clip: `fix`, `clear`) | +| a clip's Keep | `umtool window <p> <clip> --verdict confirmed` | | a note on a block | `umtool notes <p>` (reading); the app writes it | | the verdict | `umtool review-pass <p> verdict like\|maybe\|no\|clear` (a version: `umtool takes verdict <p> <v> …`) | diff --git a/umtool/e2e/fixtures/make-fixture.mjs b/umtool/e2e/fixtures/make-fixture.mjs @@ -2194,6 +2194,8 @@ makePlayCutFixture({ reports, deckManifest, cachedWindow: path.join(REPORT, "out // c03 on vid1 (its cues in the corpus) far past any window a spec fetches: a clip never fetched whose source // answers -- the readiness bar's captures count (readiness.spec.ts), never a build-dies row. rpM.timeline = rpM.timeline.map((e) => (e.id === "c03" ? { ...e, video: "vid1", start: 300, end: 302, cite: 300 } : e)); + // c04 ruled in the bench -- wrong speaker, a fact error: the pass shows it and never overwrites it (L7b review 6). + rpM.timeline = rpM.timeline.map((e) => (e.id === "c04" ? { ...e, verdict: "incorrect", reason: "wrong-speaker", correction: "it is the co-host speaking" } : e)); rpM.timeline.splice(2, 0, { type: "post", id: "p-5", post: "postchan-x/5", platform: "x", author: "Post Subject", handle: "postsubject", date: "2026-10-30T12:00:00.000Z", text: "The scale said 291 this morning. I said the scale was broken.", url: "https://x.com/postsubject/status/5", subjects: ["postsubject"], diff --git a/umtool/e2e/review-pass.spec.ts b/umtool/e2e/review-pass.spec.ts @@ -9,8 +9,8 @@ import * as urls from "./urls"; // `?mode=review` -- the inspector hidden, the viewer playing block by block, each block answered Keep · Fix · Note // (k f n), the verdict at the end, and the pass resuming where it stopped. // -// review-pass-fixture (WRITES; make-fixture.mjs): workspace-fixture's cut -- c01 c02 p-5 k01 c03 c04 -- and -// play-cut-fixture's version v1. The tests run in order, each leaving what the next reads. +// review-pass-fixture (WRITES; make-fixture.mjs): workspace-fixture's cut -- c01 c02 p-5 k01 c03 c04, c04 ruled +// wrong speaker in the bench -- and play-cut-fixture's version v1. The tests run in order, each leaving what the next reads. // // L7B_SHOTS (a directory): the pass's screenshots at 1366×768 go there too. // --------------------------------------------------------------------------- @@ -34,7 +34,7 @@ test.beforeEach(async ({ page }) => { await page.setViewportSize({ width: 1366, height: 768 }); }); -test("Review pass: the inspector hidden, k keeps two clips (their walk verdicts), f fixes the post (what needs fixing), n opens the composer on the card", async ({ page }) => { +test("Review pass: the inspector hidden, k keeps a clip (its walk verdict), f on a clip and on the post is \"needs work\" (a mark, never a verdict), n opens the composer on the card", async ({ page }) => { await page.goto(urls.workspaceHref(P)); await expect(page.locator("[data-ws-mode-edit]")).toHaveAttribute("aria-current", "page"); await expect(page.locator("[data-ws-mode-review]")).toHaveAttribute("href", urls.workspaceHref(P, { mode: "review" })); @@ -45,8 +45,9 @@ test("Review pass: the inspector hidden, k keeps two clips (their walk verdicts) await expect(page.locator("[data-ws-inspector]")).toHaveAttribute("data-ws-inspector", "review"); await expect(page.locator("[data-ws-project-panels]")).toHaveCount(0); await expect(pass(page)).toHaveAttribute("data-review-current", "c01", { timeout: 20_000 }); - await expect(pass(page)).toHaveAttribute("data-review-progress", "0/6"); - await expect(page.locator("[data-review-count]")).toHaveText("0 / 6 reviewed"); + // c04 is answered already: the bench ruled it. + await expect(pass(page)).toHaveAttribute("data-review-progress", "1/6"); + await expect(page.locator("[data-review-count]")).toHaveText("1 / 6 reviewed"); // The viewer is on the block under review. await expect(page.locator('[data-ws-block="c01"]')).toHaveAttribute("aria-selected", "true"); await shot(page, "ws-review.png"); @@ -57,10 +58,17 @@ test("Review pass: the inspector hidden, k keeps two clips (their walk verdicts) await expect.poll(() => verdictOf("c01")?.verdict).toBe("confirmed"); await expect(page.locator('[data-ws-block="c01"]')).toHaveAttribute("data-ws-block-review", "keep"); await expect(page.locator("[data-ws-viewer]")).toHaveAttribute("data-play-item", "c02", { timeout: 20_000 }); - await page.keyboard.press("k"); + // f on a clip: "needs work", a mark in review-pass.json -- its verdict untouched (never `incorrect`). + await page.keyboard.press("f"); + await expect(page.locator("[data-review-fix-text]")).toBeFocused(); + await page.locator("[data-review-fix-text]").fill("trim the tail"); + await page.locator("[data-review-fix-text]").press("Enter"); await expect(pass(page)).toHaveAttribute("data-review-current", "p-5"); - await expect.poll(() => verdictOf("c02")?.verdict).toBe("confirmed"); - await expect(pass(page)).toHaveAttribute("data-review-progress", "2/6"); + await expect.poll(() => json("review-pass.json").marks.c02).toMatchObject({ mark: "fix", note: "trim the tail" }); + expect(verdictOf("c02")?.verdict).toBeUndefined(); + expect(verdictOf("c02")?.correction).toBeUndefined(); + await expect(page.locator('[data-ws-block="c02"]')).toHaveAttribute("data-ws-block-review", "fix"); + await expect(pass(page)).toHaveAttribute("data-review-progress", "3/6"); // f on the post: what needs fixing, then on. A post has no walk verdict: review-pass.json holds it. await page.keyboard.press("f"); @@ -71,7 +79,7 @@ test("Review pass: the inspector hidden, k keeps two clips (their walk verdicts) await expect(pass(page)).toHaveAttribute("data-review-current", "k01"); await expect.poll(() => (existsSync(path.join(DIR, "review-pass.json")) ? json("review-pass.json").marks["p-5"] : null)).toMatchObject({ mark: "fix", note: "the crop cuts his face" }); await expect(page.locator('[data-ws-block="p-5"]')).toHaveAttribute("data-ws-block-review", "fix"); - await expect(pass(page)).toHaveAttribute("data-review-progress", "3/6"); + await expect(pass(page)).toHaveAttribute("data-review-progress", "4/6"); // n on the card: the notes composer, anchored to the block (notes.json). await page.keyboard.press("n"); @@ -84,7 +92,7 @@ test("Review pass: the inspector hidden, k keeps two clips (their walk verdicts) .toEqual({ kind: "entry", entry: "k01" }); // A note is not an answer: the card is still the block under review. await expect(pass(page)).toHaveAttribute("data-review-current", "k01"); - await expect(pass(page)).toHaveAttribute("data-review-progress", "3/6"); + await expect(pass(page)).toHaveAttribute("data-review-progress", "4/6"); }); test("a reload resumes at block 4; so does the pass entered afresh (the first block with no answer)", async ({ page }) => { @@ -92,17 +100,17 @@ test("a reload resumes at block 4; so does the pass entered afresh (the first bl await expect(pass(page)).toHaveAttribute("data-review-current", "k01", { timeout: 20_000 }); await page.reload(); await expect(pass(page)).toHaveAttribute("data-review-current", "k01", { timeout: 20_000 }); - await expect(page.locator("[data-review-count]")).toHaveText("3 / 6 reviewed"); + await expect(page.locator("[data-review-count]")).toHaveText("4 / 6 reviewed"); await page.goto(urls.workspaceHref(P, { mode: "review" })); await expect(pass(page)).toHaveAttribute("data-review-current", "k01", { timeout: 20_000 }); // The answers so far, said on the strip. expect(await page.locator("[data-ws-block-review]").evaluateAll((els) => els.map((e) => `${e.getAttribute("data-ws-block")}:${e.getAttribute("data-ws-block-review")}`))).toEqual([ "c01:keep", - "c02:keep", + "c02:fix", "p-5:fix", "k01:", "c03:", - "c04:", + "c04:ruled", ]); // Under a modal (the Keys), k answers nothing -- even with the focus nowhere in it; a held k is one press. const manifestNow = readFileSync(path.join(DIR, "video.manifest.json"), "utf8"); @@ -122,7 +130,7 @@ test("a reload resumes at block 4; so does the pass entered afresh (the first bl const { reviewPassCommand } = await import("../lib/report/reviewPass.mjs"); const out: string[] = []; await reviewPassCommand([P, "--json"], { resolve: async () => ({ id: P, dir: DIR }), log: (s: string) => out.push(s), err: (s: string) => out.push(s) }); - expect(JSON.parse(out.join("\n"))).toMatchObject({ done: 3, total: 6, next: "k01" }); + expect(JSON.parse(out.join("\n"))).toMatchObject({ done: 4, total: 6, next: "k01" }); }); test("past the last block, the verdict: Like saves the draft as a version and writes verdicts.json (L4's writer); Done is back to Edit", async ({ page }) => { @@ -133,10 +141,18 @@ test("past the last block, the verdict: Like saves the draft as a version and wr await page.keyboard.press("ArrowRight"); await expect(pass(page)).toHaveAttribute("data-review-current", id); } + // c04, ruled wrong speaker in the bench: shown with its words, Keep off, k writes nothing; the Full bench changes it. + await expect(page.locator('[data-review-bench="incorrect"]')).toContainText("it is the co-host speaking"); + await expect(page.locator("[data-review-keep]")).toBeDisabled(); + await expect(page.locator("[data-review-full-bench]")).toHaveAttribute("href", urls.clipBenchHref(P, "c04")); + await page.keyboard.press("k"); + await page.waitForTimeout(400); + expect(verdictOf("c04")).toMatchObject({ verdict: "incorrect", correction: "it is the co-host speaking" }); + await expect(pass(page)).toHaveAttribute("data-review-current", "c04"); await page.keyboard.press("ArrowRight"); await expect(pass(page)).toHaveAttribute("data-review-current", "end"); const end = page.locator("[data-review-end]"); - await expect(end).toContainText("3 blocks not reviewed"); + await expect(end).toContainText("2 blocks not reviewed"); await shot(page, "ws-review-end.png"); await end.locator('[data-review-verdict="like"]').click(); const judged = end.locator("[data-review-verdict-take]"); diff --git a/umtool/lib/cli/groups.mjs b/umtool/lib/cli/groups.mjs @@ -258,13 +258,14 @@ export const GROUPS = [ usage: [ " umtool review-pass <project> [ls] [--json] the workspace's REVIEW PASS: each block's answer (a clip's is its", " walk verdict; a post's or a card's review-pass.json) and the block it resumes on", - " umtool review-pass <project> mark <block> keep|fix|clear [--note T] a post's or a card's answer (a Fix says what)", + " umtool review-pass <project> mark <block> keep|fix|clear [--note T] a block's mark: a Fix (\"needs work\", saying", + " what) on any block, a clip too; Keep on a post or a card (a clip's Keep is its walk verdict)", " umtool review-pass <project> verdict like|maybe|no|clear [--note T] the draft's verdict: its parent's when only", " the walk's and the pass's fields differ, else the draft saved as the next version and judged", ], docs: [ ["`review-pass <project> [ls] [--json]` · `review-pass <project> mark <block> keep\\|fix\\|clear [--note T]`", - "the workspace's **review pass** (`?mode=review`): every block but the intro and a clip rejected for a cut reason, its answer and the block the pass resumes on; a clip's Keep · Fix is its walk verdict (`window --verdict confirmed\\|incorrect --correction`), a post's or a card's lives in `<project>/review-pass.json` — `mark` writes one (a Fix needs `--note`, what needs fixing); a clip is refused here ([knobs.md](knobs.md#the-review-pass))"], + "the workspace's **review pass** (`?mode=review`): every block but the intro and a clip rejected for a cut reason, its answer and the block the pass resumes on; a Fix (\"needs work\", saying what) is a mark in `<project>/review-pass.json` on any block, a clip too — never a clip's verdict (`incorrect` is the bench's fact-error ruling, never written or overwritten here); a clip's Keep is its walk verdict (`window --verdict confirmed`), a post's or a card's a mark — `mark` writes one (a Fix needs `--note`; a clip takes `fix` and `clear`) ([knobs.md](knobs.md#the-review-pass))"], ["`review-pass <project> verdict like\\|maybe\\|no\\|clear [--note T] [--json]`", "the pass's **verdict on the draft**, one locked call: a draft that differs from its parent version only by what the walk and the review pass write (verdict, correction, reason, reject note, walk note, ★) judges the PARENT and saves nothing; otherwise the draft is saved as the next version and that is judged (`takes/verdicts.json`)"], ], diff --git a/umtool/lib/cli/verbs.mjs b/umtool/lib/cli/verbs.mjs @@ -167,8 +167,8 @@ export const VERBS = Object.freeze([ // The workspace's review pass (umtool redesign L7b, lib/report/reviewPass.mjs): a clip's Keep / Fix is its walk // verdict (`window --verdict`); a post's or a card's lives in review-pass.json. form("review-pass ls", "project", "the review pass: each block's answer, and where it resumes", [project()], { shape: "review-pass <project> ls" }), - form("review-pass mark", "project", "a post's or a card's review-pass answer: keep, fix (with what) or clear", [ - project(), arg("block", { context: "post", help: "the post item's or the card's id" }), pick("mark", ["keep", "fix", "clear"], { required: true }), opt("--note", { type: "text", help: "a Fix: what needs fixing" }), + form("review-pass mark", "project", "a block's review-pass mark: keep (a post, a card), fix (needs work, saying what; any block) or clear", [ + project(), arg("block", { help: "the block's id: a clip, a post item, a card" }), pick("mark", ["keep", "fix", "clear"], { required: true }), opt("--note", { type: "text", help: "a Fix: what needs work" }), ], { shape: "review-pass <project> mark <block> <mark>" }), form("review-pass verdict", "project", "the draft's verdict at the pass's end: its parent's when only review fields differ, else saved as a version and judged", [ project(), pick("verdict", ["like", "maybe", "no", "clear"], { required: true }), opt("--note", { type: "text", help: "the verdict's note" }), diff --git a/umtool/lib/report/reviewPass.mjs b/umtool/lib/report/reviewPass.mjs @@ -4,11 +4,12 @@ // // Where each answer lands -- no new store for what already has one: // -// a clip its WALK VERDICT, the bench's (the manifest, through the window writer): Keep is `confirmed`, -// Fix is `incorrect` with its correction (what needs fixing). Terminal twin: -// `umtool window <p> <clip> --verdict confirmed|incorrect --correction T`. -// a post, a card, `<project>/review-pass.json` (this file's): `{ mark: "keep" | "fix", note? }` per block id -- -// a video entry a post has no walk verdict. Twin: `umtool review-pass <p> mark <block> keep|fix|clear`. +// Keep on a clip its WALK VERDICT `confirmed` (the bench's writer), and only when it has none or is confirmed +// already: a clip the bench ruled incorrect (a fact error, wrong speaker) is never overwritten +// here -- the bench changes it. Twin: `umtool window <p> <clip> --verdict confirmed`. +// Fix ("needs `<project>/review-pass.json` (this file's) on ANY block, a clip too: `{ mark: "fix", note }` -- +// work"), Keep on NEVER a clip's verdict (`incorrect` is the fact-error verdict: a blocking check and `umtool +// anything else corrections`). Twin: `umtool review-pass <p> mark <block> keep|fix|clear` (a clip: fix, clear). // Note the notes store (notes.json), anchored to the block (`{ kind: "entry", entry }`): `umtool notes`. // the end verdict takes/verdicts.json, L4's writer (`umtool takes verdict <p> <take> like|maybe|no`). // @@ -67,8 +68,8 @@ function serial(file, fn) { }); } -/** The timeline entry kinds whose mark lives here (a clip's is its walk verdict). */ -const MARKED_HERE = new Set(["post", "card", "teaser", "video"]); +/** The timeline entry kinds the pass marks here (a clip: its Fix and its clearing; its Keep is its walk verdict). */ +const MARKED_HERE = new Set(["clip", "post", "card", "teaser", "video"]); /** * Set (or clear) one block's mark. Refused: a clip (its mark is its walk verdict), a block the timeline does not @@ -84,13 +85,13 @@ const MARKED_HERE = new Set(["post", "card", "teaser", "video"]); export async function setReviewMark(dir, manifest, block, mark, { note, now = new Date() } = {}) { const e = (manifest?.timeline ?? []).find((x) => x && x.id === block); if (!e) throw new Error(`no block "${block}" in the cut`); - if (e.type === "clip") { - throw new Error(`${block} is a clip: its mark is its walk verdict (umtool window <p> ${block} --verdict confirmed | --verdict incorrect --correction "…")`); + if (e.type === "clip" && mark === "keep") { + throw new Error(`${block} is a clip: its Keep is its walk verdict (umtool window <p> ${block} --verdict confirmed); a Fix or a clear is a mark here`); } if (!MARKED_HERE.has(String(e.type))) throw new Error(`${block} is a ${e.type}: the review pass does not mark it`); if (mark !== null && !REVIEW_MARKS.includes(mark)) throw new Error(`mark must be one of ${REVIEW_MARKS.join(", ")} (or clear)`); const text = typeof note === "string" ? note.trim().slice(0, REVIEW_NOTE_LIMIT) : ""; - if (mark === "fix" && !text) throw new Error("a Fix says what needs fixing (--note)"); + if (mark === "fix" && !text) throw new Error("a Fix says what needs work (--note)"); const file = path.join(dir, REVIEW_PASS_FILE); return serial(file, async () => { const doc = await readReviewPass(dir); @@ -183,7 +184,8 @@ export async function reviewPassCommand(args, { resolve, log = console.log, err log(`${p.id}: ${prog.done} / ${prog.total} reviewed${prog.next ? ` · resumes at ${prog.next}` : " · every block answered: the verdict is next"}`); for (const r of rows) { const a = r.answer; - log(` ${r.id === prog.next ? "→" : " "} ${r.id.padEnd(10)} ${String(r.type).padEnd(6)} ${a ? a.mark : "—"}${a?.note ? ` ${a.note}` : ""}`); + const said = !a ? "—" : a.mark === "fix" ? "needs work" : a.mark === "ruled" ? `${a.verdict} (the bench)` : a.mark; + log(` ${r.id === prog.next ? "→" : " "} ${r.id.padEnd(10)} ${String(r.type).padEnd(6)} ${said}${a?.note ? ` ${a.note}` : ""}`); } return 0; } diff --git a/umtool/lib/report/reviewPass.test.mjs b/umtool/lib/report/reviewPass.test.mjs @@ -5,6 +5,7 @@ import assert from "node:assert/strict"; import { mkdtempSync, readFileSync, rmSync } from "node:fs"; import { tmpdir } from "node:os"; import path from "node:path"; +import { clipKeepable } from "./reviewPassModel.mjs"; import { blockAnswer, readReviewPass, reviewBlocks, reviewPassCommand, reviewProgress, setReviewMark, REVIEW_PASS_FILE } from "./reviewPass.mjs"; const timeline = [ @@ -16,12 +17,18 @@ const timeline = [ { type: "clip", id: "c04" }, ]; -test("the pass walks every block but the intro and a clip rejected for a cut reason; an incorrect clip is a Fix", () => { +test("the pass walks every block but the intro and a clip rejected for a cut reason; a clip the bench ruled incorrect is answered by the bench, a mark wins over a verdict", () => { const view = [{ id: "intro", type: "intro" }, ...timeline.map((e) => ({ id: e.id, type: e.type, review: { verdict: e.verdict ?? null, correction: e.correction ?? null } }))]; assert.deepEqual(reviewBlocks(view).map((b) => b.id), ["c01", "c02", "p-5", "k01", "c04"]); assert.deepEqual(reviewBlocks(timeline).map((b) => b.id), ["c01", "c02", "p-5", "k01", "c04"]); assert.deepEqual(blockAnswer(timeline[0], {}), { mark: "keep", note: null }); - assert.deepEqual(blockAnswer(timeline[1], {}), { mark: "fix", note: "the date is wrong" }); + assert.deepEqual(blockAnswer(timeline[1], {}), { mark: "ruled", note: "the date is wrong", verdict: "incorrect" }); + // A Fix on a clip is a mark (never its verdict), and it is what the pass shows. + assert.deepEqual(blockAnswer(timeline[0], { c01: { mark: "fix", note: "trim the tail", at: "" } }), { mark: "fix", note: "trim the tail" }); + assert.equal(clipKeepable(timeline[0]), true); + assert.equal(clipKeepable(timeline[1]), false); + assert.equal(clipKeepable(timeline[5]), true); + assert.equal(clipKeepable({ type: "clip", id: "w", verdict: "incorrect", reason: "wrong-speaker" }), false); assert.equal(blockAnswer(timeline[2], {}), null); assert.deepEqual(blockAnswer(timeline[2], { "p-5": { mark: "keep", at: "" } }), { mark: "keep", note: null }); }); @@ -45,8 +52,11 @@ test("the store: a post's mark written and cleared; a clip, an unknown block and await setReviewMark(dir, m, "k01", null); assert.deepEqual(Object.keys(JSON.parse(readFileSync(path.join(dir, REVIEW_PASS_FILE), "utf8")).marks), ["p-5"]); await assert.rejects(setReviewMark(dir, m, "c04", "keep"), /walk verdict/); + // A clip's Fix and its clearing are marks: its verdict is untouched. + assert.deepEqual((await setReviewMark(dir, m, "c04", "fix", { note: "trim the tail", now: new Date("2026-11-10T11:00:00Z") })).mark, { mark: "fix", note: "trim the tail", at: "2026-11-10T11:00:00.000Z" }); + assert.equal((await setReviewMark(dir, m, "c04", null)).mark, null); await assert.rejects(setReviewMark(dir, m, "nope", "keep"), /no block/); - await assert.rejects(setReviewMark(dir, m, "k01", "fix"), /what needs fixing/); + await assert.rejects(setReviewMark(dir, m, "k01", "fix"), /what needs work/); } finally { rmSync(dir, { recursive: true, force: true }); } @@ -63,6 +73,8 @@ test("umtool review-pass: ls says where it resumes; mark writes a card's", async assert.match(out[0], /2 \/ 5 reviewed · resumes at p-5/); assert.equal(await reviewPassCommand(["reports/x", "mark", "k01", "keep"], o), 0); assert.equal(await reviewPassCommand(["reports/x", "mark", "c04", "keep"], o), 1); + assert.equal(await reviewPassCommand(["reports/x", "mark", "c04", "fix", "--note", "the tail"], o), 0); + assert.equal(await reviewPassCommand(["reports/x", "mark", "c04", "clear"], o), 0); out.length = 0; assert.equal(await reviewPassCommand(["reports/x", "--json"], o), 0); const j = JSON.parse(out.join("\n")); diff --git a/umtool/lib/report/reviewPassModel.mjs b/umtool/lib/report/reviewPassModel.mjs @@ -20,25 +20,44 @@ export function reviewBlocks(entries) { } /** - * One block's answer: a clip's from its walk verdict (confirmed → keep, incorrect → fix), anything else's from - * the marks. null: not reviewed yet. + * One block's answer. null: not reviewed yet. * - * @param {{ id: string, type: string, verdict?: string | null, review?: { verdict?: string | null, correction?: string | null } | null, correction?: string | null }} e + * a review-pass mark (review-pass.json), on any block keep, or fix ("needs work") with its note + * a clip the BENCH ruled incorrect (a fact error, "ruled": answered, by the bench -- the pass never + * wrong speaker), no mark overwrites it (its verdict and its words shown) + * a clip whose walk verdict is confirmed, no mark keep + * + * Fix never writes a clip's verdict: `incorrect` is the fact-error verdict (a blocking check, `umtool corrections`). + * + * @param {{ id: string, type: string, verdict?: string | null, reason?: string | null, correction?: string | null, review?: { verdict?: string | null, reason?: string | null, correction?: string | null } | null }} e * @param {Record<string, ReviewMark>} marks - * @returns {{ mark: "keep" | "fix", note: string | null } | null} + * @returns {{ mark: "keep" | "fix" | "ruled", note: string | null, verdict?: string } | null} */ export function blockAnswer(e, marks) { - if (e.type === "clip") { - const v = e.review?.verdict ?? e.verdict ?? null; - const correction = e.review?.correction ?? e.correction ?? null; - if (v === "confirmed") return { mark: "keep", note: null }; - if (v === "incorrect") return { mark: "fix", note: typeof correction === "string" ? correction : null }; - return null; - } const m = marks?.[e.id]; - return m ? { mark: m.mark, note: m.note ?? null } : null; + if (m) return { mark: m.mark, note: m.note ?? null }; + if (e.type !== "clip") return null; + const v = clipVerdict(e); + if (v === "confirmed") return { mark: "keep", note: null }; + if (v === "incorrect") { + const words = e.review?.correction ?? e.correction ?? e.review?.reason ?? e.reason ?? null; + return { mark: "ruled", note: typeof words === "string" && words ? words : null, verdict: v }; + } + return null; } +/** A clip's walk verdict, from either shape of an entry. */ +export const clipVerdict = (e) => e?.review?.verdict ?? e?.verdict ?? null; + +/** + * May the review pass's Keep write this clip's walk verdict (`confirmed`)? Only when it has none or is confirmed + * already: a clip the bench ruled incorrect (a fact error, wrong speaker) is the bench's to change. + */ +export const clipKeepable = (e) => { + const v = clipVerdict(e); + return v === null || v === undefined || v === "" || v === "confirmed"; +}; + /** * The pass's progress: how many of its blocks have an answer, and where it resumes (the first with none; null when * every block has one -- the verdict at the end).