commit 8607f65626f2827f3336624566c2362484eec4ed
parent 1e50c19047d35b56377a6aef4bf7eaba6c03ba16
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 10 Nov 2026 18:17:03 -0500
umtool: a twin id's review mark is judged on the entry it was signed on -- marksAgainst read the LAST entry with the id while setReviewMark signs the FIRST, so a mark on a twin was "changed since reviewed" the moment it was made; the review pass's stale comments say what the code does (any block's Fix, a clip's too, lives in review-pass.json; a clip's Keep is its walk verdict; the draft's verdict is its own route) (L7b re-review nits)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat:
4 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/umtool/app/api/report/review-pass/route.ts b/umtool/app/api/report/review-pass/route.ts
@@ -6,9 +6,9 @@ import { crossSiteRefusal } from "@/lib/report/sameOrigin.mjs";
export const dynamic = "force-dynamic";
-// THE REVIEW PASS's post and card marks (lib/report/reviewPass.mjs; the workspace's `?mode=review`). A clip's
-// Keep / Fix is its walk verdict, written through the window writer (PUT /api/report/window); this is the store
-// for what has none.
+// THE REVIEW PASS's marks (lib/report/reviewPass.mjs; the workspace's `?mode=review`): any block's Fix (a clip's
+// too: never its verdict), a post's or a card's Keep. A clip's Keep is its walk verdict, written through the window
+// writer (PUT /api/report/window); the draft's verdict is POST /api/report/review-pass/verdict.
//
// GET ?project=<id> <project>/review-pass.json, as read
// POST { project, block, mark: "keep"|"fix"|null, note? } one block's mark (null clears it); a Fix says what
diff --git a/umtool/lib/cli/verbs.mjs b/umtool/lib/cli/verbs.mjs
@@ -177,8 +177,8 @@ export const VERBS = Object.freeze([
takeOpt(),
], B(["clip"], { clip: "{id}" })),
form("walk", "project", "the clip bench's walk: clips in walk order, verdicts, fetched", [project(), takeOpt({ help: "walk a take (a draft too)" }), bool("--all", "every fetched clip")]),
- // 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.
+ // The workspace's review pass (umtool redesign L7b, lib/report/reviewPass.mjs): a clip's Keep is its walk verdict
+ // (`window --verdict`); any block's Fix, and a post's or a card's Keep, live 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 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" }),
diff --git a/umtool/lib/report/reviewPass.mjs b/umtool/lib/report/reviewPass.mjs
@@ -99,7 +99,9 @@ export function entrySignature(e) {
* @param {{ timeline?: Array<Record<string, any>> } | null} manifest
*/
export function marksAgainst(doc, manifest) {
- const byId = new Map((manifest?.timeline ?? []).filter((e) => e && typeof e.id === "string").map((e) => [e.id, e]));
+ // A twin id (two entries sharing one) is judged by its FIRST entry, the one setReviewMark signs.
+ const byId = new Map();
+ for (const e of manifest?.timeline ?? []) if (e && typeof e.id === "string" && !byId.has(e.id)) byId.set(e.id, e);
return Object.fromEntries(
Object.entries(doc.marks).map(([id, m]) => {
const e = byId.get(id);
@@ -112,8 +114,9 @@ export function marksAgainst(doc, manifest) {
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
- * hold, a Fix with no note (say what needs fixing -- the rule the walk's `incorrect` has).
+ * Set (or clear) one block's mark -- any block's Fix, a post's or a card's Keep. Refused: a clip's Keep (its walk
+ * verdict, `umtool window --verdict confirmed`), a block the timeline does not hold, a Fix with no note (say what
+ * needs fixing -- the rule the walk's `incorrect` has). A twin id's mark is its first entry's.
*
* @param {string} dir
* @param {{ timeline?: Array<Record<string, any>> } | null} manifest
@@ -152,8 +155,9 @@ export const REVIEW_PASS_USAGE = [
];
/**
- * `umtool review-pass`: the pass's blocks with their answers and where it resumes (`ls`), or one post / card mark
- * (`mark`). A clip's answer is its walk verdict -- `umtool window` writes it.
+ * `umtool review-pass`: the pass's blocks with their answers and where it resumes (`ls`), one block's mark (`mark`:
+ * any block's Fix, a post's or a card's Keep), or the draft's verdict (`verdict`). A clip's Keep is its walk
+ * verdict -- `umtool window` writes it.
*
* @param {string[]} args
* @param {{ resolve?: (p: string) => Promise<{ id: string, dir: string } | null>, log?: Function, err?: Function }} [o]
diff --git a/umtool/lib/report/reviewPass.test.mjs b/umtool/lib/report/reviewPass.test.mjs
@@ -113,3 +113,20 @@ test("a mark is of what was reviewed: an edge moved, a post edited, an id reused
rmSync(dir, { recursive: true, force: true });
}
});
+
+test("a twin id's mark is signed and judged on the same entry, its first: not stale for being a twin", async () => {
+ const dir = mkdtempSync(path.join(tmpdir(), "review-pass-twin-"));
+ try {
+ const tl = [
+ { type: "card", id: "k1", heading: "First", seconds: 1.5 },
+ { type: "card", id: "k1", heading: "Second", seconds: 2 },
+ ];
+ await setReviewMark(dir, { timeline: tl }, "k1", "keep");
+ const doc = await readReviewPass(dir);
+ assert.equal(doc.marks.k1.sig, entrySignature(tl[0]), "signed on the first");
+ assert.equal(marksAgainst(doc, { timeline: tl }).k1.stale, undefined, "and judged on the first");
+ assert.equal(marksAgainst(doc, { timeline: [{ ...tl[0], heading: "Changed" }, tl[1]] }).k1.stale, true);
+ } finally {
+ rmSync(dir, { recursive: true, force: true });
+ }
+});