commit 6b929ba1e6ae4baf3d4f16bcbd931ea1c5269aa6
parent 3be91cc5d518dd40ce619befccd1779c00f19c2f
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sun, 18 Oct 2026 17:24:28 -0400
plans: release 34 lane N1 — the clip deck, as shipped
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 137 insertions(+), 0 deletions(-)
diff --git a/plans/release-34/clip-deck.md b/plans/release-34/clip-deck.md
@@ -0,0 +1,137 @@
+# Release 34 lane N1 — `r34/clip-deck`: the montage clip audition deck (as shipped)
+
+The operator rules montage clips by ear ("#4 is another speaker, #6 is him reading a tweet, #58 only makes sense if
+she's refuting his claim"), and until now the orchestrator hand-edited the seed's `edits.json`. This lane is the app
+surface for it: one card per instance, swiped keep / cut / not him / read aloud, persisted through the app, applied at
+render. Rulings followed: audits get an app-like UI, one decision per item, persisted; the UI works with no model
+(nothing here calls one); no cards in the video; plain words; synthetic fixtures only.
+
+## What
+
+1. **The rulings store** — `<project>/montage-rulings.json` `{version: 1, rulings: {"<channel>/<video>@<cutStart to 2
+ decimals>": {verdict, reason, match?, at}}}`, keyed by the source moment so a re-seed keeps every ruling.
+ - The key rule, the shape check and the render application are `umtool/report-to-video/montage-rulings.mjs`
+ (exported as `umtool-report-to-video/montage-rulings`); `clipMomentKey(entry, manifest)` is the one key function
+ (the clip's `channel`, else `provenance.channelSlug`; `cutStart`, else `start`).
+ - The one writer is `umtool/lib/report/montageRulings.mjs`: an in-process queue, tmp + rename, keys sorted, a file
+ that does not parse never overwritten (and never read as empty).
+ - **Import**: a seed's `edits.json` maps to moments — the clip with that video whose cutStart is nearest and within
+ 30 s, else the seed's `instances.json` (a moment the seed already left out). An exclude's verdict comes from its
+ words; a match keeps the clip with the wider phrase. Offered while some mapped moment is unruled, so once imported
+ it is not offered again (no extra state).
+2. **Applied at render** — `applyMontageRulings` in build-video (on the variant view; `whole` stays as written for the
+ validators and a bench `--fetch-only`; `--only <id>` keeps that clip) and verify-build: cut / not-him / read-aloud
+ clips are left out of the cut and the wall; `match` replaces `montage.match`; when anything was left out the kept
+ clips' `montage.n` / `montage.of` are numbered 1…N of N. No file, or nothing that changes anything, returns the same
+ object: today's render byte for byte. The build log names each clip left out and why. `--no-rulings` on both. A file
+ that does not parse refuses the build. The take maker applies the rulings BEFORE windowing, so a window counts over
+ the whole kept cut; the take's own manifest (what a pick copies) stays as written.
+3. **The deck** at `/projects/<id>/clips` (`clipDeckHref`; the Cut tab's **Clips — n of N to rule** on a cut whose clips
+ carry `montage`): built on R1's AuditionDeck patterns (swipe threshold and flick, stamps, the decided card flying out,
+ the next card underneath with its media loading, the card after warmed, 20-deep undo, the bar under the thumb).
+ - A card: the counter's number, the phrase, the cut playing from the project's cached window (the cited clip;
+ **Wider**/`w` plays the clip's whole extent), the quote with the phrase marked, date · platform · channel · video,
+ the clip's note (the seed's voice check, a stand-in upload), and voice-match.json's label and score when present.
+ - Keys: → / `k` keep, ← / `x` cut, ↓ / `n` not him, ↑ / `r` read aloud, `e` keep with an edited phrase (Enter), `s`
+ skip, `w` wider, space replay, `z` / Backspace undo, `?` keys. Reason chips (co-host, guest, a clip played, a post
+ read out, chat read out, wrong moment, says something else) or a few words ride with the next ruling.
+ - Filters: Unruled, Doubtful first (voice unlikely by score, unsure, a voice check in the note, then the rest),
+ Ruled, All; `?show=` keeps it. One counter row: `n / N · k kept · c cut · h not him · r read aloud`, and `R of N
+ ruled`.
+ - End card: the counts, the clips left out with their reasons, **the next render** (GET's `plan`: the build's own
+ application, the kept clips as it numbers them) and **Re-render the take** (the take maker's Rebuild job on the
+ single picked take, else the single whole-cut maker take; otherwise a link to the Takes page), with how many
+ rulings were made since that take was built.
+ - Phone width: one column, the five rulings in a fixed bar under the thumb, no sideways scroll.
+4. **`umtool rulings <project>`** — show (`--json`: each clip, its key and ruling, the plan), `import [--dry-run]`,
+ `set <clip|key> <verdict> [--reason] [--match]`, `clear <clip|key>`: the same writer.
+5. **The route** `GET/POST /api/report/montage-rulings` (`{project, clip, ruling|null}`; `{project, import: true}`); a
+ ruling must name a clip the manifest has.
+
+## Files
+
+report-to-video: `montage-rulings.mjs` (new), `montage-rulings.test.mjs` (new, 9 tests: 6 pure, 3 real renders),
+`build-video.mjs` (apply on the variant view, the log lines, `--no-rulings`), `verify-build.mjs` (same file,
+`noRulings`), `package.json` (export), `README.md` (module row, "`montage-rulings.json`" section).
+umtool: `lib/report/montageRulings.mjs` (new), `montageRulings.test.mjs` (new, 8), `lib/report/rulingsCli.mjs` (new),
+`lib/report/clipDeck.ts` (new: the page data, voice-match.json read leniently), `lib/report/takeMaker.mjs` (+ test 1),
+`lib/hrefs.ts` (`clipDeckHref`, `CLIP_DECK_SHOWS`; + test 1), `app/api/report/montage-rulings/route.ts` (new),
+`components/projects/ClipDeckPage.tsx` (new), `components/projects/review/ClipDeck.tsx` (new),
+`components/projects/ProjectView.tsx` (the `clips` view), `components/projects/report/CutTab.tsx` (the link),
+`bin/umtool.mjs` (one dispatch + usage block), `docs/report-video.md` ("Ruling the clips"), `docs/cli.md` (one row),
+`e2e/clip-deck.spec.ts` (new, 2), `e2e/fixtures/clip-deck-fixture.mjs` (new) + `make-fixture.mjs` (registered),
+`e2e/visual-audit.spec.ts` (+ `bench-clips`). `editor/CHANGELOG.md`, `plans/FACTS.md` ("Release 34 lane N1").
+
+| Commit | What |
+| --- | --- |
+| `1a0b5a69` | report-to-video montage-rulings.mjs; build-video, verify-build, the take maker apply it; umtool's writer + import; tests |
+| `91735315` | the clip deck page, route, `umtool rulings`, Cut tab link, e2e fixture + clip-deck.spec |
+| `b1dbc15a` | docs, the visual audit's page and one filled action, synthetic test ids, FACTS, CHANGELOG |
+| (this commit) | this record |
+
+## Interfaces
+
+- `umtool-report-to-video/montage-rulings`: `MONTAGE_RULINGS_FILE`, `RULING_VERDICTS`, `LEFT_OUT_VERDICTS`,
+ `VERDICT_WORDS`, `momentKey({channel, video, at})`, `clipMomentKey(entry, manifest?)`, `isMomentKey`,
+ `parseMomentKey`, `parseMontageRulings(raw)`, `readMontageRulings(dir)` (null | doc | throws),
+ `applyMontageRulings(manifest, doc, {keep?})` → `{manifest, left: [{id, key, verdict, reason}], matched: [{id, key,
+ match, was}], renumbered}`, `rulingsLines(applied)`, `leftOutWords`.
+- `umtool/lib/report/montageRulings.mjs`: `readRulingsState(dir)` → `{exists, doc, error}`, `setMontageRuling(dir, key,
+ ruling|null, {now})`, `setMontageRulings(dir, entries, {overwrite})`, `normaliseRuling`, `montageClipsOf`,
+ `hasMontageClips`, `momentKeysOf`, `resolveRulingKey`, `verdictFromWhy`, `mapEarlierRulings(manifest, edits,
+ instances)`, `earlierRulingsOffer(dir, manifest, doc?)`, `importEarlierRulings(dir, manifest, {dryRun})`,
+ `renderPlan(manifest, doc)` → `{kept: [{id, n, of, match}], left, matched, lines}`.
+- `lib/report/clipDeck.ts`: `clipDeckView(project)`, `readVoiceMatch(dir)` (reads N2's `clips[key].{score, label,
+ speechSeconds}`; a row not that shape is skipped; no file = null), `doubtOf`.
+- `clipDeckHref(project, {show?, note?})`; `GET /api/report/montage-rulings?project=` → `{rulings, error, plan, offer}`.
+
+## Gates (all through the shared lock, from the worktree root)
+
+- tsc (all packages): clean before each code commit and at the end.
+- test:scripts: **1141 (1137 pass, 4 skipped) at `main` `9d5df831` → 1160 (1156 pass, 0 fail, 4 skipped)**: +9
+ montage-rulings, +8 montageRulings (store, import, CLI), +1 takeMaker, +1 hrefs.
+- umtool `test`: 45/45 before and after (no tests of mine in its globs).
+- Byte-identical: in-suite, the same four-clip montage rendered with no rulings file and with a file whose rulings
+ change nothing (a keep, a moment the cut does not have) — identical md5 for the final and two segments; a ruled cut's
+ kept clip #2 of 2 is md5-identical to a hand-numbered two-clip manifest's (the counter is drawn from the renumbered
+ values); a ruled-out clip is not a wall tile; `--no-rulings` builds all four and verify-build agrees.
+- `archilyzer docs cli --check`, `docs files --check`: clean (no generated doc changes; `umtool` rows are cli.md's).
+- e2e umtool, single specs: `clip-deck.spec.ts` 2/2 (12.1 s, after one fix of the spec's reload step); `clip-deck` +
+ visual-audit's `bench-clips` 3/3 (15.1 s, screenshots at 1366/1440 × dark/light and 390 px); `takes.spec.ts` +
+ `visual-audit.spec.ts` 73/73 (1.5 min).
+- No editor, export, homepage or common code touched; their suites not run.
+
+## Smoke (the project read only; its manifest, edits.json and instances.json copied to scratch)
+
+- `umtool rulings slow-news import --dry-run` → three: two excludes (no longer in the manifest) through instances.json
+ as not-him and read-aloud, and the widened phrase on s56 as keep; `import` wrote them; the show reads "1 of 73
+ ruled; the next render: 73 clip(s)" (the seed had already applied all three).
+- `set s04 not-him` → the plan: 72 clips, s05 numbered #4 of 72.
+- A quick window take (straight, 0/20 s, `--skip-fetch`, the corpus read-only): the log names s04 left out; segments
+ s01–s03, s05, s06 and no s04; s05's chip reads "#4". 12.9 s.
+
+## Decisions
+
+- Keys on the deck: ↓ / `n` is not him and ↑ / `r` read aloud (R1's ↓ skip and ↑ edit moved to `s` and `e`), as the
+ brief asked; `x`/`k` keep R1's cut/keep.
+- `e` saves as **keep** with the phrase (editing the phrase is a decision to keep it wider), as R1's edit decides its
+ card. A ruling keeps a phrase it already had when it is changed by a swipe.
+- A reason applies to whichever ruling comes next (keep included), not only cuts.
+- Renumbering happens only when a clip was left out, so applying twice (the take maker, then the build over the render
+ manifest) changes nothing, and a window keeps the whole cut's numbers. Only `n`/`of` a clip already carries are
+ rewritten; a clip with none is numbered by its place (planMontage) as before.
+- The rulings apply whether or not `render.montage` is set: the slow-news project's own manifest has no montage key (the
+ takes add it), and a ruled-out clip is out of any cut.
+- The import offer has no "done" flag (the prelude's shape is exact): it offers what maps to a moment not yet ruled.
+- The deck's Start overlay and the Import button are outlines and the Cut tab's Clips link an outline, so a page keeps
+ one filled action (the visual audit's rule).
+- No take is re-rendered by the deck when the choice is ambiguous (several picked, or none picked and several
+ whole-cut takes): it links the Takes page.
+
+## Found and left
+
+- The slow-news project's two excluded moments are not in its manifest (the seed dropped them), so their rulings only
+ matter if the seed is run again without `edits.json`'s excludes. `seed-manifest.py` still reads `edits.json`; whether
+ it should read `montage-rulings.json` instead is the orchestrator's call.
+- kbd hints in the deck's bar show at phone width (the same `hidden md:inline` classes R1's deck uses lose to kbd's own
+ display rule); left as R1 has it.