commit a7a95daa26dfeeed0dc0c1423f99b684bad3af67
parent 4a84811d59642ffe92ba73644b6c69a294904b70
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 27 Oct 2026 14:48:12 -0400
umtool docs + e2e: walking a take, drafts, the take's own edits and undo, promote
clip-bench.md "Walking a take", report-video.md "Walking a take: drafts,
edits into the take, and making it the cut", cli.md rows for walk, window
--take, timeline --take and take --draft/--promote, a pointer from knobs.md,
and the [Unreleased] entry. take-walk.spec.ts on its own take-walk-fixture:
the draft card, the walk page and GET /api/report/walk, a confirm that writes
the take and not the manifest, remove + undo, and Make this the cut.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
8 files changed, 284 insertions(+), 0 deletions(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,7 @@
# Changelog
## [Unreleased]
+- **A report-video take can be walked clip by clip before it is rendered, and made the cut.** Until now the clip bench walked only a project's own cut, and a take's clips could only be watched as a render. Now a take — a tight version's 27 sub-windows, say — opens on the bench at `/projects/<project>/takes/<take>/walk` (**Walk this take** on its card, or **walk a take** on the Cut tab): its clips in walk order with their verdicts, each played from the windows already fetched, with nothing fetched again for a clip inside one. Everything the walk changes — a verdict, a trim, a note, a clip removed or moved (**← earlier**, **later →**, **Remove from take**) — goes into the take's own patch in `takes/<take>/take.json`, never the project's manifest, and **Undo take edit** takes back the newest one. **walk every clip** keeps the clips that already carry a verdict on the walk. `umtool take <project> --id <take> --patch F --draft` records a take without rendering it (the Takes page shows it as **draft — walk / render**), and `umtool take <project> --id <take> --full` or **Render full** renders it later from its walked patch. **Make this the cut** (`umtool take <project> --id <take> --promote`) puts the take over the project's manifest with one undo point, so the Cut tab's **Undo last edit** takes it back; it waits for **Make it the cut anyway** when the take's timeline would replace a cut that changed since the take was made. From a terminal: `umtool walk <project> --take <take>`, `umtool window <project> <clip> --take <take> …` and `umtool timeline <project> --take <take> move|remove|undo`. A windowed render of a take whose timeline has none of the project's clips is now timed over the take's own clips instead of being refused. Needs a restart of umtool for the pages; the CLI has it at once.
- **An X post's screenshot is of the post, not of a page in the middle of laying itself out.** On 2026-10-27 a forced capture of TheQuartering's post 2114859155022389342 came out shifted about 100 px: its left edge cut off, X's menu laid over its words and the gap beside the column showing; another post once came out as a strip of the post above it. The shot was a full-page capture, which resizes the page for the moment of the capture — in the X session profile the page saw its window go to 1×1 — and X laid itself out again for that size while it was being captured, so the shot was cut from a different layout than the one measured. A post is now shot from the window as it stands: scrolled into it, the window made taller first when the post is taller than it, so nothing is resized under the shot; and the post is measured again after the shot and shot again if it moved. An X Article's shot is taken the same way. Posts taller than the tallest window (16,384 px) are still shot from a full-page capture. Needs a restart of the editor.
- **Use with AI is the homepage's.** A published site's header and slide-out menu no longer carry it (nor the hub's header); a site still reaches the homepage's AI and MCP doc from its footer and from Ask AI, and its corpus.json and llms.txt still name it. Rebuild a site to see it.
- **The site-swap intro no longer shifts vertically on the chime.** With the URLs under MEDIA the drawing used to rise to stay centred; the lockup is now centred as the plain intro centres it and the URLs hang below it, so on the chime it only moves sideways. Intros without a site swap are unchanged.
diff --git a/umtool/docs/cli.md b/umtool/docs/cli.md
@@ -23,6 +23,8 @@ Inbox cannot disagree about what is wrong with one.
| `inbox [--all] [--json]` | the decisions grouped and ranked by piece (`a:<site>/<report>`, `p:<project>`): Your call, Review, Blocking, Notes, Open, Ready to finish, Quiet — one card per piece and kind, and how many sit hidden on parked or done pieces (`--all` lists them). Every decision, songs' and articles' included; runs `bin/inbox.ts` through tsx |
| `folders [--json]` · `kinds [--json]` | the tree, the registry |
| `window <project> <clip> [--start S] [--end E] [--lock] [--lock-end] [--no-lock-end] [--note …]` | edit a window |
+| `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 |
| `link <project> <site>/<report>` · `link <project> --clear` | the manifest names the article it is the video of (settles `link-ambiguous`) |
| `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)); `key=` clears one ([knobs.md](knobs.md#marks)) |
| `look <project> key=value …` | the cut's **knobs**: `factcheck.stamp.*`, `factcheck.verdicts.<V>.stampLabel\|label\|color`, `deck.markers=<json>`, `deck.markerLayout`, `variants=<json>`, and the look's keys ([knobs.md](knobs.md)) |
@@ -45,6 +47,7 @@ Inbox cannot disagree about what is wrong with one.
| `schedule list \| show <id> [--json]` | the recurring reports, read-only ([recurring.md](recurring.md)) |
| `notes …` | operator notes: list, read, reply, resolve ([notes.md](notes.md)) |
| `take <project> --id <id> --label L [--group G] [--kind similar\|different] [--summary S] [--style NAME] [--patch FILE \| --patch-json JSON \| --set path=value …] [--effect NAME] [--at S --dur S \| --full] [--quick] [--force] [--progress ndjson]` | one **take**: the manifest with a montage style's patch, then an overlay effect's (`--effect`, release 35), then the take's own, rendered into `takes/<id>/` (the Takes page's New take); `--id <id> --rebuild` makes one again from its own `take.json` ([report-video.md](report-video.md#making-takes)) |
+| `take <project> --id <id> --label L [--patch F \| …] --draft` (`--no-render`) · `take <project> --id <id> [--full \| --at S --dur S]` · `take <project> --id <id> --rebuild [--full \| --at S --dur S]` · `take <project> --id <id> --promote [--anyway] [--json]` | a **draft** take: recorded with nothing rendered, to be walked first; a draft named with no patch flags is rendered from its stored (walked) patch, and `--rebuild` takes a window flag; **make it the cut**: the take's patch applied to the manifest now, one undo point (`revisions/…-auto-before-promote-take`), refused (exit 1) when its timeline would replace a cut that changed since, until `--anyway` ([report-video.md](report-video.md#walking-a-take-drafts-edits-into-the-take-and-making-it-the-cut)) |
| `takes make <project> [--recipe FILE] [--only ID,ID] [--force]` · `takes make <project> --all-styles [--group G] [--at S --dur S \| --full]` | a recipe's takes, one at a time (default `takes/recipe.json`); every montage style, one take each (Make all styles); **exit 1** if any failed |
| `takes styles [--json]` · `takes effects <project> [--json]` · `takes pick <project> <take> [--anyway] [--json]` | the montage styles; the overlay effects the cut offers (`render.chrome.fx` presets: the Takes page's **Effect** list); **Use this take** — refused (exit 1) when the project changed since the take was made, until `--anyway` |
| `trailer <project> --take <t> (--beats FILE \| --beats-json JSON) [--intro] [--finale S] [--xfade 0.3] [--out NAME] [--dry-run] [--json]` | a **trailer cut from the take's finished master**: spans of the master's own frames (the deck shows the whole timeline), clip beats in source seconds mapped by the take's build records, crossfaded, the take's encode, in the heavy slot; writes `takes/<t>/out/<slug>.trailer.mp4` and `.trailer.json`; **exit 1** on a refusal ([report-video.md](report-video.md#trailer-from-the-master)) |
@@ -55,6 +58,7 @@ Inbox cannot disagree about what is wrong with one.
| `voice-match <project> [--reference auto\|rulings\|recordings] [--reference-video <channel>/<id> …] [--reference-channel <slug> …] [--instances FILE] [--span phrase\|cut] [--pad S] [--likely X --unlikely Y] [--out FILE] [--dry] [--json] [--progress ndjson]` | who is speaking, per montage clip: a local speaker-similarity score (TitaNet-small) against the host's voice → `<project>/voice-match.json` (the Cut tab's **Score the voices**); `--instances` also scores a phrase scan's instances not in the manifest; `--dry` prints the plan ([report-video.md](report-video.md#who-is-speaking-the-voice-match)) |
| `clips analyze <project> [--from <channel>/<id>] [--rescan] [--no-laughs] [--no-voices] [params] [--words FILE] [--progress ndjson] [--json]` · `clips propose <project> [--from <channel>/<id>] [--host N] [params] [--words FILE] [--dry] [--json]` · `clips show <project> [--json]` · `clips segments <project> [--json]` | the **clip finder** on a long recording ([report-video.md](report-video.md#highlights-the-clip-finder)): `analyze` runs the laugh scan (CED-mini) and a voice centroid per speaker on the recording's sound (cached in `<project>/scans/`), then proposes; `propose` proposes again from what is there (after a role flip, a param change, new words); `show` prints the speakers, laughs and the cut. Params `--target S` (600) `--laugh-min X` (0.25) `--merge-gap S` (6) `--setup-max S` (20) `--clip-max S` (75) and the scope `--scope FROM:TO` (either side may be empty; `all` clears it) or `--from S --to S` with numbers (a `--from` that is a `<channel>/<id>` names the recording), kept in `reactions.json`; `--host N` is your word on the host, kept. `--keep-cut` proposes without touching the cut (nothing moved, removed or added; the proposals are listed). **`--scope auto`** reads the narrated video auto-scope finds in the speaker turns (`--segment sN` names one, else the longest); `segments` lists them. A chat replay beside the recording (`live_chat.cues.json`) adds chat-burst moments and the log names the chat's lag. A channel on no site gets each clip linked to its platform page (`citeUrl`). A clip you edited, ruled, locked or added is never moved. **Exit 2** with no `diarization.json` (the message names the `archilyzer diarize backfill` to run) |
| `timeline <project> [ls] [--json]` · `timeline <project> insert --after <id\|-> <channel>/<video>@<start>-<end> [--id ID] [--section N] [--lock] [--lock-end] [--title T] [--stream-title T] [--date YYYY-MM-DD] [--quote Q] [--cite S] [--cite-url U]` · `timeline <project> move <id> --to <index>` · `remove <id>` · `duplicate <id>` (`--at <index>` names one of an id's twins) · `post <json\|@file>` · `post-remove <id>` · `teaser <id> <patch-json\|@file>` · `undo` | the **structure** of the cut (the Cut tab's timeline, the On-screen section's teasers and posts) through the writers `POST /api/report/timeline` runs: `ls` prints index, id, type, video, start–end, date and title (`--json` adds the token and the posts); an insert's attribution is a second write through `window`'s writer, its date checked before anything is written; it is written in the manifest's own convention — under the deck `--title` is the deck's title (`onscreen.title`, `--stream-title` the stream's), a cut whose deck titles are dates gets `--date` as one in their format, and the clip takes the section of the clip it goes after (`--section N` names another) and, from the same recording, its deck title and its citation link. Every write snapshots the manifest first (`revisions/…-auto-before-<op>`), is refused only for what it breaks in the build's own words (**exit 1**), and on a generated manifest leaves an `edit` note ([report-video.md](report-video.md#structural-edits)) |
+| `timeline <project> --take <take> [ls \| move <id> --to <index> \| remove <id> \| undo]` | a **take's** timeline (walk a take): the same structure checks, written into the take's patch, each write with an undo point of the take's own (`takes/<take>/revisions/`); `undo` takes the take's newest edit back, whichever writer made it |
| `scenes <project> <clip> [--black-min 0.05] [--threshold 8] [--pix-th 0.10] [--pad 30 \| --from S --to S] [--json]` | the picture's **scene cuts** (ffmpeg `scdet`, score ≥ threshold) and **black spans** (`blackdetect`) in the clip's fetched window, in SOURCE seconds — for `blur.from`/`blur.to` and trims ([knobs.md](knobs.md#a-clips-picture-blurred)). The window is the one the build would cut from (the project's `out/clips-raw`, the editor's `channels/<slug>/data/<id>/clips/`, a saved source); the extent ± `--pad` inside it is scanned. Nothing is fetched: **exit 1** with no window on disk (`fetch` first) |
| `posts add <project> <archive-channel>/<postId> [--attach <clipId>] [--flag F] [--author A] [--id ID] [--dry-run] [--json]` | a **post card** from the corpus's posts archive (`channels/<slug>/posts/*.jsonl`): its words, date, link and handle; id `x-<postId>` (`bsky-`, `post-`); the author an earlier post by the same handle carries in the cut, else the archive's. Its capture (`posts-media/<postId>/`: `shot.png`, `capture.json`, the post's pictures) is copied to the project's `posts-media/<slug>/<postId>/` — or used where it is, when that folder links the channel's captures; never copied through a link anywhere else. Then `upsertPost` (a post with the id is replaced, its `attachTo` kept). **Exit 1** with no screenshot, naming the `pnpm ops capture-posts` to run |
diff --git a/umtool/docs/clip-bench.md b/umtool/docs/clip-bench.md
@@ -289,6 +289,39 @@ reviewed. See
[report-video.md](report-video.md#verdict--what-the-walk-said) for what is
stored and what the writer refuses.
+## Walking a take
+
+`/projects/<project>/takes/<take>/walk` — from **Walk this take** on the take's card, or **walk a
+take** on the Cut tab — lists the take's clips in walk order: each clip's window, length, verdict,
+whether a fetched file holds it, and (→) the ones the walk visits, with **Walk → start at
+`<clip>`**. A take is the project's manifest with its patch applied (a draft too:
+[report-video.md](report-video.md#walking-a-take-drafts-edits-into-the-take-and-making-it-the-cut)),
+so its clips may be windows the project's cut does not have — a tight version's sub-windows. Each
+plays from the cached windows of its recording: a sub-window inside a fetched window plays without
+a new fetch.
+
+`/projects/<project>/takes/<take>/clip/<id>` is this bench on the take's clip. Everything works as
+on the project's cut, and **every save goes into the take's patch** (`takes/<take>/take.json`),
+never the project's manifest: the verdict (`y`, `x`), the edges, the attribution, the mute mark,
+cut to quote, a wider fetch (the job is pointed at the take's manifest, written beside the
+project's; the bytes land where every fetch's do). A strip at the top says **walking take
+`<take>` — edits go to the take, not the cut**, with **← earlier**, **later →**, **Remove from
+take** and **Undo take edit** (the take's newest edit taken back, whichever it was). The one-clip
+re-render is not offered: a take is rendered whole (**Render full** on the Takes page, or `umtool
+take <p> --id <take> --full`).
+
+**`?all=1` walks every clip.** A take's clips often carry the verdict of the clip they were cut
+from, so the default walk — fetched and still needing a verdict — would skip them. **walk every
+clip** keeps the judged ones on the walk too.
+
+The terminal reads the same walk (`lib/report/walkData.mjs`, also `GET /api/report/walk`):
+
+```
+umtool walk <project> --take <take> [--all] [--json]
+umtool window <project> <clip> --take <take> --verdict confirmed # or --start/--end/--correction …
+umtool timeline <project> --take <take> [ls | move <id> --to <i> | remove <id> | undo]
+```
+
## The extent you reviewed, and the cut that plays
The window you drag is the clip's **extent** — how much of this recording is
diff --git a/umtool/docs/knobs.md b/umtool/docs/knobs.md
@@ -228,6 +228,13 @@ own patch (a take's own `timeline` included), from `takes/<id>/take.json` or —
names it; its pages are composed under `takes/<id>/out/`, never over the project's. `render.blur: "off"` on the
take plays its blurred clips as recorded.
+**To judge a take clip by clip, walk it** (`/projects/<p>/takes/<id>/walk`, **Walk this take** on its card):
+the clip bench on the take's own clips, whose verdicts, trims and removals go into the take's patch, never the
+project's manifest; `umtool walk <p> --take <id>`, `umtool window <p> <clip> --take <id> …` and `umtool timeline
+<p> --take <id> move|remove|undo` are the terminal's. **Make this the cut** (`umtool take <p> --id <id> --promote`)
+puts the walked take over the project's manifest with one undo
+([report-video.md](report-video.md#walking-a-take-drafts-edits-into-the-take-and-making-it-the-cut)).
+
| | In umtool | Keys |
|---|---|---|
| play / pause, back (tap again: further), pause, play (tap again: 1.5×, 2×, …; the voice keeps its pitch), ±5 s, previous / next clip | the transport under the picture, the speed menu | Space, J K L, ← →, P N |
diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md
@@ -934,6 +934,63 @@ the one the take was made from (its `baseHash`), the card says **The project cha
take was made** and the pick waits for **Use anyway**. A take that does not record its base asks
the same.
+### Walking a take: drafts, edits into the take, and making it the cut
+
+A take can be **walked** on the clip bench like the project's own cut — its clips, played from the
+cached windows (a sub-window inside a fetched window plays without a new fetch), each confirmed,
+noted, trimmed, removed or moved — and every one of those edits goes into the **take's patch**,
+never the project's manifest ([clip-bench.md](clip-bench.md#walking-a-take)).
+
+```
+umtool take <project> --id tight --label "Tight — walk" --patch tight.json --draft # recorded, nothing rendered
+umtool walk <project> --take tight [--all] # the clips, verdicts, where the walk starts
+umtool window <project> t06a --take tight --verdict confirmed --end 6201.2 # a clip of the take
+umtool timeline <project> --take tight move t07b --to 3 | remove t09c | undo # its structure, its undo
+umtool take <project> --id tight --full # render the draft, edits and all
+umtool take <project> --id tight --promote [--anyway] # make it the cut (one undo)
+```
+
+**A draft** (`--draft`, or `--no-render`) is the take recorded with nothing rendered:
+`takes/<id>/take.json` with `draft: true`, its `patch`, label, group and `baseHash`, `preview`
+naming where the render will go, `seconds` and `builtAt` null, and `window` null unless one was
+given. The patch is applied once to check it makes a manifest with a timeline (refused now, not at
+the render) and to write `changes[]`. No take.json is written over a rendered take; over a draft
+only with `--force`. The Takes page shows it as **draft — walk / render**. `umtool take <p> --id
+<id> --full` (or **Render full** on its card) renders a draft from what it stores — the patch as
+the walk left it — and it is an ordinary made take from then on; `--rebuild` takes a window flag
+too (`--rebuild --full`, `--rebuild --at 0 --dur 60`).
+
+**The walk's edits** (`lib/report/takeEdit.mjs`) resolve the take's manifest as it is now (the
+merge the build makes: `takeManifest.mjs resolveTakeManifest`), apply the edit with the project
+writer's own functions — `patchClipEntry` (updateClip's rules: 2 dp, the verdict needing its
+note, the cut inside the extent, …) or `applyStructural` (the build's structure checks) — and
+write the WHOLE edited timeline back as `patch.timeline` (an RFC 7386 array replaces whole). A
+take whose patch had no timeline (a style take) gets one on its first edit, and from then on its
+timeline is its own. Each write first copies take.json into
+`takes/<id>/revisions/<stamp>-<ms>-auto-before-<op>.take.json` — every write, not one per two
+minutes, because a walk is many small edits and Undo means the last of them — and stamps
+`editedAt`. **Undo take edit** (`umtool timeline <p> --take <id> undo`) restores the newest one
+byte for byte, keeping the take.json it replaces as `…-undo-saved…` and renaming the restored one
+`…-undone-<op>…`, so the next undo goes one further. The token is take.json's mtime: a stale one
+is a 409, never an overwrite. A rendered take walked since says **edited since render** on its
+card.
+
+**Make this the cut** (`umtool take <p> --id <id> --promote`, `POST /api/report/takes/promote`)
+writes the take's manifest — the project's as it is now with the take's patches applied — over the
+project's through `replaceManifest`: one auto snapshot `auto-before-promote-take`, so the Cut
+tab's **Undo last edit** (`umtool timeline <p> undo`) takes the whole promotion back; the
+generated-manifest guard; the build's structure checks (refused only for what the promotion
+breaks); then the take is its group's pick in verdicts.json. It is not **Use this take**, which
+copies the manifest a take was *rendered* from: a draft, or a take walked since its render,
+promotes exactly what was walked. When the take's patch replaces the timeline and the project's
+manifest changed since the take was made (`baseHash`), it is refused until `--anyway` (**Make it
+the cut anyway**) — the take's timeline would replace what the cut gained since.
+
+**A window of a take that replaces the timeline.** A windowed render times its window over the
+project's timeline so every take of a group covers the same entries; a take whose timeline holds
+none of those entries (a tight version's sub-windows) is timed over its own timeline instead, and
+its log says so, rather than refused as emptied.
+
### Trailer from the master
`umtool trailer <project> --take <t> (--beats FILE | --beats-json JSON) [--intro] [--finale S]
diff --git a/umtool/e2e/fixtures/make-fixture.mjs b/umtool/e2e/fixtures/make-fixture.mjs
@@ -33,6 +33,7 @@ import { makeClipDeckFixture } from "./clip-deck-fixture.mjs";
import { makeMontageOpsFixture } from "./montage-ops-fixture.mjs";
import { makeClipEditorFixture } from "./clip-editor-fixture.mjs";
import { makeBenchShellFixture } from "./bench-shell-fixture.mjs";
+import { makeTakeWalkFixture } from "./take-walk-fixture.mjs";
import { makeYoutubeFixture } from "./youtube-fixture.mjs";
import { makeBoardFixture, makeResearchFixture } from "./research-fixture.mjs";
import { makeRunTraceFixture } from "./run-trace-fixture.mjs";
@@ -1845,6 +1846,8 @@ makeClipEditorFixture({ reports, manifest, cachedWindow: path.join(REPORT, "out"
makeClipEditorFixture({ reports, manifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4"), cues: CUES.vid1, name: "clip-look-fixture", title: "The Clip Look Fixture" });
// P4b: the bench shell's own clips, and the Media tab's fields with their draft files.
makeBenchShellFixture({ reports, manifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4") });
+// Walk a take: a draft take of sub-windows, walked on the bench (take-walk.spec.ts).
+makeTakeWalkFixture({ reports, manifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4") });
// Release 28 M6: the YouTube text, previewed and built (media-draft-e.spec.ts).
makeYoutubeFixture({ reports, manifest, cachedWindow: path.join(REPORT, "out", "clips-raw", "vid1_0.00-9.00.mp4") });
// Release 36 lane D: the assistant's labels, Suggest, Ask and Apply in the clip editor (clips-suggest.spec.ts).
diff --git a/umtool/e2e/fixtures/take-walk-fixture.mjs b/umtool/e2e/fixtures/take-walk-fixture.mjs
@@ -0,0 +1,73 @@
+// What take-walk.spec.ts acts on (walk a take): its own project, written by
+// that spec alone.
+//
+// reports/take-walk-fixture/
+// video.manifest.json ONE clip, w01 1.00-8.00 (confirmed) -- the master
+// out/clips-raw/ vid1 0.00-9.00, which holds every take clip below
+// takes/tight/take.json a DRAFT take (recorded, nothing rendered) whose
+// patch replaces the timeline with three
+// sub-windows of w01, as `umtool take … --draft`
+// writes one:
+// t01a 1.00-3.00 confirmed (carried from w01)
+// t01b 3.50-6.00 no verdict -- where the walk starts
+// t01c 6.20-8.50 no verdict
+//
+// Synthetic, like every fixture.
+import { copyFileSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
+import { createHash } from "node:crypto";
+import path from "node:path";
+
+const write = (dir, name, text) => {
+ mkdirSync(dir, { recursive: true });
+ writeFileSync(path.join(dir, name), text);
+};
+const json = (doc) => JSON.stringify(doc, null, 2) + "\n";
+
+/**
+ * @param {{ reports: string, manifest: Function, cachedWindow: string }} o
+ * `manifest` is make-fixture's manifest(slug, title, provenance, timeline);
+ * `cachedWindow` the vid1 0-9 s window the build fixtures share.
+ */
+export function makeTakeWalkFixture({ reports, manifest, cachedWindow }) {
+ const dir = path.join(reports, "take-walk-fixture");
+ const clip = (id, start, end, extra = {}) => ({ type: "clip", id, video: "vid1", start, end, cite: start, section: 0, lock: true, ...extra });
+ write(
+ dir,
+ "video.manifest.json",
+ json(manifest("take-walk-fixture", "The Take Walk Fixture", { siteOrigin: "https://archive.example" }, [
+ clip("w01", 1.0, 8.0, { verdict: "confirmed", quote: "the whole of it" }),
+ ])),
+ );
+ mkdirSync(path.join(dir, "out", "clips-raw"), { recursive: true });
+ copyFileSync(cachedWindow, path.join(dir, "out", "clips-raw", path.basename(cachedWindow)));
+ const baseHash = createHash("sha256").update(readFileSync(path.join(dir, "video.manifest.json"), "utf8")).digest("hex");
+ write(
+ path.join(dir, "takes", "tight"),
+ "take.json",
+ json({
+ id: "tight",
+ group: "takes",
+ order: 1,
+ label: "Tight — walk",
+ kind: "different",
+ summary: "",
+ changes: ["timeline: 3 items"],
+ preview: "preview.mp4",
+ seconds: null,
+ builtAt: null,
+ style: null,
+ patch: {
+ timeline: [
+ clip("t01a", 1.0, 3.0, { verdict: "confirmed", quote: "the first of it" }),
+ clip("t01b", 3.5, 6.0, { quote: "the middle of it" }),
+ clip("t01c", 6.2, 8.5, { quote: "the end of it" }),
+ ],
+ },
+ window: null,
+ draft: true,
+ draftedAt: "2026-10-27T12:00:00.000Z",
+ baseHash,
+ }),
+ );
+ return dir;
+}
diff --git a/umtool/e2e/take-walk.spec.ts b/umtool/e2e/take-walk.spec.ts
@@ -0,0 +1,106 @@
+import { test, expect } from "@playwright/test";
+import { readFileSync } from "node:fs";
+import path from "node:path";
+import { fileURLToPath } from "node:url";
+import * as urls from "./urls";
+
+// ---------------------------------------------------------------------------
+// WALK A TAKE (umtool/docs/clip-bench.md, "Walking a take"): a draft take --
+// recorded, not rendered -- walked on the clip bench, every edit landing in
+// the take's patch and none in the project's manifest; then made the cut.
+//
+// Fixture (fixtures/take-walk-fixture.mjs), written by this file alone:
+// take-walk-fixture's master is one clip, w01; its draft take `tight` replaces
+// the timeline with t01a (confirmed), t01b and t01c, all inside the cached
+// vid1 0-9 s window. The tests run in order, each leaving what the next reads.
+// ---------------------------------------------------------------------------
+
+test.describe.configure({ mode: "serial" });
+
+const PROJECT = "reports/take-walk-fixture";
+const TAKE = "tight";
+const DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", ".e2e-song", "reports", "take-walk-fixture");
+const manifestText = () => readFileSync(path.join(DIR, "video.manifest.json"), "utf8");
+const takeDoc = () => JSON.parse(readFileSync(path.join(DIR, "takes", TAKE, "take.json"), "utf8"));
+const takeClip = (id: string) => (takeDoc().patch.timeline as { id: string; verdict?: string }[]).find((e) => e.id === id);
+
+/** The bench's keys answer once it has hydrated (`x` focuses the note box). */
+const keyboardLive = async (page: import("@playwright/test").Page) => {
+ const box = page.locator("[data-attrib-field=correction]");
+ await expect(async () => {
+ await page.locator("body").press("x");
+ await expect(box).toBeFocused({ timeout: 500 });
+ }).toPass({ timeout: 10_000 });
+ await box.blur();
+};
+
+let masterBefore = "";
+test.beforeAll(() => {
+ masterBefore = manifestText();
+});
+
+test("the Takes page shows the draft as `draft — walk / render`, with Walk this take", async ({ page }) => {
+ await page.goto(urls.takesHref(PROJECT));
+ const card = page.locator(`[data-take="${TAKE}"]`);
+ await expect(card.locator(`[data-take-draft="${TAKE}"]`)).toContainText("draft — walk / render");
+ await expect(card.locator("[data-take-is-draft]")).toBeVisible();
+ await expect(card.locator(`[data-take-walk-link="${TAKE}"]`)).toHaveAttribute("href", urls.takeWalkHref(PROJECT, TAKE));
+ // Nothing rendered to use: the draft is made the cut, not "used".
+ await expect(card.locator("[data-action=pick]")).toHaveCount(0);
+ await expect(card.locator("[data-take-promote]")).toBeVisible();
+});
+
+test("the take's walk: its clips in walk order, the walk starting at the first one needing a verdict", async ({ page, request }) => {
+ await page.goto(urls.takeWalkHref(PROJECT, TAKE));
+ await expect(page.locator("[data-take-walk-clip]")).toHaveCount(3);
+ await expect(page.locator("[data-take-walk-go]")).toHaveAttribute("href", urls.takeClipHref(PROJECT, TAKE, "t01b"));
+ await page.locator("[data-take-walk-all]").click();
+ await expect(page.locator("[data-take-walk-go]")).toHaveAttribute("href", urls.takeClipHref(PROJECT, TAKE, "t01a", { all: true }));
+ // The data route: the same reading.
+ const j = (await (await request.get(`/api/report/walk?project=${encodeURIComponent(PROJECT)}&take=${TAKE}`)).json()) as {
+ first: string;
+ take: { draft: boolean };
+ clips: { id: string; onWalk: boolean; fetched: boolean }[];
+ };
+ expect(j.first).toBe("t01b");
+ expect(j.take.draft).toBe(true);
+ expect(j.clips.map((c) => [c.id, c.fetched, c.onWalk])).toEqual([
+ ["t01a", true, false],
+ ["t01b", true, true],
+ ["t01c", true, true],
+ ]);
+});
+
+test("confirming on the bench writes the take's patch, never the manifest, and walks on", async ({ page }) => {
+ await page.goto(urls.takeClipHref(PROJECT, TAKE, "t01b"));
+ await expect(page.locator(`[data-take-walk="${TAKE}"]`)).toContainText("edits go to the take, not the cut");
+ await expect(page.locator("[data-bench-kind]")).toHaveText("Take walk");
+ // A take renders whole: no one-clip re-render of the project's segment here.
+ await expect(page.locator("[data-rerender]")).toHaveCount(0);
+ await keyboardLive(page);
+ await page.locator("body").press("y");
+ await expect(page.locator("[data-bench=t01c]")).toBeVisible();
+ await expect.poll(() => takeClip("t01b")?.verdict).toBe("confirmed");
+ expect(manifestText()).toBe(masterBefore);
+ expect(takeDoc().draft).toBe(true);
+});
+
+test("remove from the take, then undo the take's edit", async ({ page }) => {
+ await page.goto(urls.takeClipHref(PROJECT, TAKE, "t01c"));
+ await expect(page.locator(`[data-take-walk="${TAKE}"]`)).toBeVisible();
+ await page.locator("[data-take-remove=t01c]").click();
+ await expect.poll(() => (takeDoc().patch.timeline as { id: string }[]).map((e) => e.id)).toEqual(["t01a", "t01b"]);
+ await page.goto(urls.takeClipHref(PROJECT, TAKE, "t01b"));
+ await page.locator("[data-take-undo]").click();
+ await expect.poll(() => (takeDoc().patch.timeline as { id: string }[]).map((e) => e.id)).toEqual(["t01a", "t01b", "t01c"]);
+ expect(manifestText()).toBe(masterBefore);
+});
+
+test("Make this the cut: the take's walked timeline becomes the project's", async ({ page }) => {
+ await page.goto(urls.takeWalkHref(PROJECT, TAKE));
+ await page.locator(`[data-take-actions="${TAKE}"] [data-take-promote]`).click();
+ await expect(page.locator("[data-take-promoted]")).toBeVisible();
+ const m = JSON.parse(manifestText()) as { timeline: { id: string; verdict?: string }[] };
+ expect(m.timeline.map((e) => e.id)).toEqual(["t01a", "t01b", "t01c"]);
+ expect(m.timeline[1].verdict).toBe("confirmed");
+});