commit 3ce40c1db6fab60ce6f4392266f87b4823c55a67
parent d7ec68210a4c8d2eb64d7f42fff5b4cadc9350c9
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sat, 17 Oct 2026 17:19:35 -0400
plans: release 33 M1 as shipped — the take maker (record, FACTS, CHANGELOG)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
3 files changed, 150 insertions(+), 0 deletions(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,7 @@
# Changelog
## [Unreleased]
+- **Variant auditions: make takes on umtool's Takes page, and use one.** A report video's Takes page (the Cut tab's **Takes — N**, or **Make takes** when there are none yet) has **New take**: a montage style or none, a label, a group, the window (from S seconds for D seconds, or the full cut), an optional patch (JSON, checked before it is sent) and **quick render**. **Make all styles** makes one take per montage style with the same window. A take is rendered beside the project from the media the project already has — nothing is fetched — and appears when it is built, its changes listed in plain lines (`render.montage.cut: flash`, `render.crf: 34 (was 30)`); **Rebuild** makes it again against the cut as it is now. **Use this take** makes the take's manifest the project's and marks it **picked**, one per group; the Cut tab's **Undo last edit** takes it back. When the cut changed since the take was made, the card says so and waits for **Use anyway**. The same from a terminal: `umtool take`, `umtool takes make` (a recipe, or `--all-styles`), `umtool takes styles`, `umtool takes pick`. Nothing calls a model. Needs a restart of umtool.
- **`pnpm heavy` caps what it runs.** A command admitted to the heavy slot through `pnpm heavy -- <cmd>` (or `scripts/queue-lock.mjs --heavy`) now runs in a memory-capped systemd user scope of its own — 8 GB, 2 GB of swap — so a runaway render or build is stopped in its scope instead of taking the desktop session down. A command that sets its own `MemoryMax=`, or one started from inside a capped unit or scope (the live editor and umtool, a publish stage's build), is run as before. `HEAVY_CAP=0` turns it off; `HEAVY_CAP_MB` and `HEAVY_CAP_SWAP_MB` size it.
- **A media move says how far its copy got again with the newer rsync.** rsync 3.5.1 as packaged since mid-October writes its progress with a unit on the byte count and an unscaled rate, which the move did not read: the job showed no progress bar and no "Copying… · N % ·" lines, and the log filled with rsync's raw redraws. Both forms are read now, and the rate reads as before (for example 1.16GB/s). Needs a restart of the editor.
- **A full download from Odysee's stored media URL survives a dropped connection.** When the connection to the file's server drops mid-file (`fetch failed`, a reset, a timeout, a body cut short), the same download now checks what came down, pauses 45 seconds, opens the video's page again and goes on from the last clean byte — it no longer ends the job. Each one is in the job log as "Connection dropped at <bytes> — reopening the page and resuming (k of 6)". After six drops in a row with no progress the download stops and keeps what it has for the next run, as before. A refusal that follows bytes the server served is handled the same way; a refusal straight after the page was opened still stops at once. A continuation is not a new file: it does not wait the 20-minute rest between files, and the whole run is still one attempt on the video's record (one of the two full-audio attempts before a salvage). The attempt records how many continuations it took. Needs a restart of the editor.
diff --git a/plans/FACTS.md b/plans/FACTS.md
@@ -10387,3 +10387,43 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri
`dropGapBytes` (default `dropAfterBytes`; 0 = every later request cut before its first byte): the cut is mid-body
(headers + part of the body, then the socket destroyed) or, on a request's first byte, before any response; a cut
request is `dropped: true` with the bytes it sent. `cdn.lock()` takes an unlock back.
+
+## Release 33 lane M1: the take maker (verified 2026-10-17, branch `r33/takes`)
+
+- **A take on disk** (`umtool/lib/report/takeMaker.mjs`; the contract `takes.mjs`): `takes/<id>/video.manifest.json`
+ is the WHOLE patched manifest (what a pick copies); `preview.mp4` the render; `out/` the take's own render scratch
+ (made by `ensureWriteDir`, so it follows `UMTOOL_MEDIA_DIR`) with `clips-raw` and `narration` as absolute links to
+ `<project>/out/<name>` (only when the project has them); `take.json` written LAST, only once the preview exists (a
+ dir without it is a work dir the listing ignores). The new manifest is `.next.video.manifest.json` until the render
+ is done, so a failed rebuild leaves the old take whole. take.json adds (optional, checked by `parseTake`): `style`,
+ `patch`, `window` (`"full"` | `{at, dur}`), `quick`, `entries {ids, basis: "schedule"|"estimate"}`, `baseHash`
+ (sha256 of the project's manifest TEXT the take was made from). `changes[]`: `style: <label>` then one line per leaf
+ the patches change (`changeLines`; a leaf whose value is unchanged has none). No change at all = kind `reference`.
+- **The patch** is RFC 7386 (`mergePatch`: objects merge, `null` removes, arrays/scalars replace): the style's
+ (`MONTAGE_STYLES[name].patch` from `report-to-video/montage-styles.mjs`, loaded at run time by an assembled
+ `pathToFileURL` + `webpackIgnore`; `E2E_UMTOOL_MONTAGE_STYLES` overrides the file; a missing module = no styles,
+ `error: null`), then the take's own.
+- **The window is a sub-cut**, not `--chrome-preview`/`--preview`: the sourced entries [at, at+dur] touches, timed by
+ `<project>/out/sourced/schedule.json` when it names every entry, else each entry's own length (clip `cutEnd−cutStart`
+ else `end−start`, else `seconds`, else 4 s), computed on the BASE manifest so a group's takes cover the same entries;
+ posts attached outside are dropped. Montage features numbered by position (`planMontage`'s `k`, `n`) count within
+ the sub-cut.
+- **The render** (`takeRender.mjs`): `node scripts/queue-lock.mjs --heavy -- node build-video.mjs
+ <project>/.take-<id>.render.json --out takes/<id>/out --progress ndjson --skip-fetch --continue-on-error
+ [--no-xfade] [--no-chapters]` from the checkout root. The render manifest sits BESIDE the project's (its relative
+ paths, drafts review and shadow channels hold) and is removed after. `--no-xfade` unless a patch sets
+ `render.transition` > 0; `--no-chapters` for a window. Quick (`--quick`) merges `QUICK_RENDER` (`render.preset:
+ veryfast`) into the render manifest only. The final (`variantPaths(out, slug, "sourced").final`) is renamed (EXDEV:
+ copied) to `preview.mp4`; seconds by ffprobe.
+- **The pick** (`pickTake`): refused (`TakeStale`) when the project's manifest hash ≠ `baseHash` or the take has none,
+ unless `anyway`; a project whose manifest text already IS the take's is a no-op write. Writes through
+ `replaceManifest` (manifest.mjs: lock, token, `autoSnapshot(dir, "pick-take")`, `writeManifestAtomic`) inside
+ edit-guard's `withEditNotes`; `undoStructural` (the Cut tab's Undo) restores it. Then `setTakePicked`: verdicts.json
+ rows gain `picked: true` (present only when true), one per group; an unpicked row that then says nothing is removed;
+ `setTakeVerdict` keeps a pick.
+- **The app's jobs**: `/api/report/takes/make` POST `{project, take | allStyles | rebuild, force?}` → `takeSteps` →
+ ONE job on lib/jobs.ts whose step runs the CLI (`umtool take …` / `umtool takes make … --all-styles`, NDJSON);
+ GET `?job=` the job, GET `?project=` the styles and a running take job. `/api/report/takes/pick` POST `{project,
+ take, anyway?}` → 409 `{stale: true}`. Recipes: `{group, window, quick?, takes: [{id, label, style?, patch?, summary?,
+ kind?, group?, window?, quick?}]}`; `takes/recipe.json` is the CLI's default, Make all styles writes
+ `takes/all-styles.recipe.json`; a recipe carries on past a failed take and exits 1.
diff --git a/plans/release-33/takes.md b/plans/release-33/takes.md
@@ -0,0 +1,109 @@
+# Release 33 lane M1 — `r33/takes`: variant auditions in umtool (as shipped)
+
+Operator request (2026-10-17): variant auditions for a montage project, in umtool. Operator rule (2026-10-16):
+everything a model can do is doable in the UI with no model. Before this lane takes were only ever made by a one-off
+script, and the winner was copied by hand. Now umtool makes them, from the Takes page or a terminal, and **Use this
+take** puts one in the project's place. Nothing here calls a model.
+
+## What
+
+1. **The take maker** (`umtool/lib/report/takeMaker.mjs`). `makeTake(projectDir, spec)` reads the project's
+ manifest, applies a montage style's patch (lane M3's `report-to-video/montage-styles.mjs`, loaded at run time;
+ none installed = no styles), then the take's own patch. Both are RFC 7386 merge patches (`mergePatch`, our own
+ implementation: arrays replace). It writes `takes/<id>/video.manifest.json` (the whole patched manifest) and
+ `changes[]` (`style: <label>`, then one plain line per changed leaf, e.g. `render.crf: 34 (was 30)`), then renders.
+ take.json is written only once the preview exists. It carries `builtAt`, `seconds` (ffprobe), `style`, `patch`,
+ `window`, `quick`, `entries` and `baseHash`. An empty change is kind `reference`; otherwise `different`, or the
+ given `kind`.
+2. **The render** (`takeRender.mjs`): build-video through `scripts/queue-lock.mjs --heavy` (capped by default since
+ r33/heavy-cap; passes through under HEAVY_HELD), `--skip-fetch --continue-on-error`. It writes into the take's own
+ `out/`, whose `clips-raw` and `narration` are links to the project's; nothing is copied or fetched. `--no-xfade`
+ unless a patch sets `render.transition` > 0 (the `fast` preset). `--no-chapters` for a window.
+ **Quick render** (`--quick`, on by default in the form) encodes the render with x264 veryfast and never touches the
+ take's manifest.
+3. **The window is a sub-cut.** `{at, dur}` renders the entries that window touches, as a cut of their own. The
+ entries are timed by the project's deck schedule when it names every entry, otherwise by the manifest's own
+ lengths, on the base manifest. `"full"` renders the whole cut.
+4. **Recipes**: `makeTakes(projectDir, recipe)` makes one take at a time. It skips a take that exists unless forced,
+ carries on past a failure, and exits 1 at the end. `allStylesRecipe` gives one take per style.
+5. **The CLI** (`lib/report/takeCli.mjs`, two dispatch lines in `bin/umtool.mjs`): `umtool take`, `umtool take --id X
+ --rebuild`, `umtool takes make [--recipe F | --all-styles]`, `umtool takes styles`, `umtool takes pick [--anyway]`.
+6. **The pick** (`pickTake`) goes through a new manifest writer, `replaceManifest` (manifest.mjs). That takes the
+ lock and the token, takes the auto snapshot `auto-before-pick-take` (so the Cut tab's **Undo last edit** restores
+ it), keeps the drafted-mark rule and writes atomically, all inside `withEditNotes`. The pick is then recorded in
+ verdicts.json (`setTakePicked`, takes.mjs): `picked: true`, one per group. The pick is refused when the project's
+ manifest hash ≠ the take's `baseHash`, or when the take records none, until `anyway`. A take whose manifest
+ already is the project's re-picks as a no-op write.
+7. **UI** (`/projects/<p>/takes`):
+ - **New take** (`NewTakePanel.tsx`): style select, label (taken from the style), group (the newest take's),
+ window (from/for, or Full cut; 0/60 by default), patch JSON (checked before submit), quick render, and "make it
+ again if it exists".
+ - **Make all styles**. The job is watched with JobProgress (per-take steps, log, Stop), and the page refreshes
+ when it ends.
+ - Per card: **Use this take**; on a stale base, "The project changed since this take was made." and **Use
+ anyway**. Once used, "The project's manifest is this take's now." with a link to **Revisions** (the History
+ tab).
+ - Per card: a **picked** badge, and **Rebuild** (takes the maker made).
+ - The Cut tab links **Make takes** when the project has no `takes/`. The notes digest marks the picked take.
+ - Works at 390 px.
+
+## Files
+
+umtool: `lib/report/{takeMaker,takeRender,takeCli}.mjs` (new), `lib/report/takeMaker.test.mjs` (new),
+`lib/report/takes.mjs` (+ `parseWindow`, `setTakePicked`, parseTake's maker fields, `picked` rows), `takes.test.mjs`,
+`lib/report/manifest.mjs` (`replaceManifest`), `lib/annotations/digest.mjs`, `bin/umtool.mjs` (dispatch + usage),
+`app/api/report/takes/{make,pick}/route.ts` (new), `components/projects/{NewTakePanel,TakesBench,TakesPage}.tsx`,
+`components/projects/report/CutTab.tsx`, `e2e/takes.spec.ts`, `e2e/fixtures/make-fixture.mjs` (takes-make-fixture),
+`e2e/fixtures/montage-styles.e2e.mjs` (new), `playwright.config.ts` (E2E_UMTOOL_MONTAGE_STYLES), `docs/cli.md`,
+`docs/report-video.md` ("Making takes"). plans/FACTS.md, editor/CHANGELOG.md.
+
+## Interfaces
+
+- `makeTake(projectDir, {id, label, group?, kind?, summary?, style?, patch?, window?, order?, quick?}, {force,
+ render, probe, styles, emit, log, ensureOut, now})` → `{id, skipped, take?}`; `RenderFn(job: {manifestPath,
+ outDir, slug, full, xfade, emit, log}) → {file}`.
+- `makeTakes(projectDir, recipe, {...makeTake opts, only})` → `[{id, status: made|skipped|failed, error?}]`;
+ `parseRecipe`, `allStylesRecipe(styles, {group, window, quick})`.
+- `pickTake({id, dir, kind}, takeId, {anyway, token, now})` → `{take, group, snapshot, token, editNotes, verdicts}`;
+ `TakeStale`; `takeIsStale(projectDir, take)`.
+- `mergePatch`, `changeLines(before, after, patches)`, `patchLeaves`, `patchFromSets`, `windowEntries(timeline,
+ {at, dur}, schedule?)`, `windowManifest`, `loadMontageStyles({file?})`, `montageStylesFile`, `takeSteps(project, req,
+ ctx)`, `lastGroup`, `uniqueTakeId`, `hashText`, `QUICK_RENDER`, `renderManifestPath`.
+- takes.mjs: `setTakePicked(projectDir, takeId, groupIds)`, `parseWindow`.
+- manifest.mjs: `replaceManifest(dir, manifest, {token, op})`.
+- Reads M3's `MONTAGE_STYLES: Record<name, {label, summary, patch}>`. `montageStyle()` is not needed.
+
+## Decisions / rulings followed
+
+- The window is a sub-cut, not `--chrome-preview`/`--preview`. Those need every segment already built in the take's
+ `out/`; linking the project's segments would show the old cut for any patch that re-cuts a clip; and `--preview` is
+ the rail's.
+- The render manifest is `<project>/.take-<id>.render.json`, beside the project's (relative paths, drafts review,
+ shadow channels hold), and is removed after.
+- A rebuild writes the new manifest under a work name until the render succeeds.
+- The UI's Make all styles writes `takes/all-styles.recipe.json`, never a hand-written `takes/recipe.json`.
+- The window is prefilled 0/60: the Cut tab's preview window is component state and is not kept.
+- Quick render is on by default in the form (an audition compares cuts); the CLI's default is off.
+- A pick of a take with no `baseHash` (made by hand) needs Use anyway.
+
+## Gates (all through the shared lock)
+
+- tsc (all packages) clean before every commit.
+- test:scripts 1073 (1069 pass, 4 skipped, 0 fail). Baseline 1056 (1052 pass, 4 skipped) on `643434f7`, so +17:
+ takeMaker 15, takes 2.
+- umtool `test` 45/45 (no take tests in it).
+- e2e umtool `takes.spec.ts` 7/7 (17.9 s; +2 tests, one assertion more in test 1).
+- e2e umtool `bench-shell.spec.ts` + `visual-audit.spec.ts` 71/71 (1.4 min).
+- Smoke on a COPY of the montage project's manifest under `$T/r33m1-smoke/` (the real corpus read-only), with `--quick`:
+ - window 0/20 s gives 7 clips and a 26.1 s 1080p preview in 14 s.
+ - The first run failed by design, naming all 7 clips: the manifest's `render.fetchPad: 3` asks for wider windows than
+ the editor fetched. It passed with `--set render.fetchPad=0`.
+
+## Found and left
+
+- **The montage project's manifest:** `render.fetchPad: 3` makes every `--skip-fetch` build of it (a take, or the Build tab with
+ skip-fetch) refuse. The editor's windows are the clip extents exactly. Set `render.fetchPad: 0` in the project
+ first, or fetch wider.
+- **Window takes and position-counted montage features:** M3's `planMontage` numbers by position. A window take's
+ counter starts at #1 and its ramp runs over the window. For `accelerate` and `wall-finale` audition the full cut,
+ or have the counter read `montage.n`.