Archilyzer · Source

archilyzer

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

commit 3be91cc5d518dd40ce619befccd1779c00f19c2f
parent 03f756b38ac989bfa49ca9a82f81b0fedf262323
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Sun, 18 Oct 2026 17:06:18 -0400

umtool: the clip deck's docs, visual audit and one filled action; FACTS, CHANGELOG

docs/report-video.md "Ruling the clips", the report-to-video README's
montage-rulings.json section and module row, the visual audit's bench-clips page
(one filled action: Keep; Start listening and Import are outlines), synthetic ids in
the tests, FACTS "Release 34 lane N1", the CHANGELOG bullet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Meditor/CHANGELOG.md | 1+
Mplans/FACTS.md | 33+++++++++++++++++++++++++++++++++
Mumtool/components/projects/report/CutTab.tsx | 2+-
Mumtool/components/projects/review/ClipDeck.tsx | 4++--
Mumtool/docs/report-video.md | 41+++++++++++++++++++++++++++++++++++++++++
Mumtool/e2e/clip-deck.spec.ts | 1+
Mumtool/e2e/visual-audit.spec.ts | 1+
Mumtool/lib/report/montageRulings.test.mjs | 20++++++++++----------
Mumtool/report-to-video/README.md | 27+++++++++++++++++++++++++++
Mumtool/report-to-video/montage-rulings.test.mjs | 2+-
10 files changed, 118 insertions(+), 14 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +- **Rule a montage's clips by ear, and the render leaves out the ones that aren't him.** A report video made of one phrase said many times has a clip deck (the Cut tab's **Clips — n to rule**, at `/projects/<id>/clips`): one card per instance, its cut playing from the cached window (**Wider** plays the whole clip), the quote with the phrase marked, the date and source, the clip's note, and — when a speaker score is beside the manifest — that score. Swipe or press → **Keep**, ← **Cut**, ↓ **Not him** (a co-host, a guest, a clip played), ↑ **Read aloud** (a post or a quote read out); **e** keeps it with a wider phrase, **s** skips, space replays, **z** undoes; a reason chip or a few words go with the ruling. The deck walks the unruled clips, the doubtful ones first, the ruled ones, or all, and works at phone width with the buttons under the thumb. The rulings are `montage-rulings.json` beside the manifest, kept by the moment in the source rather than the clip's number, so seeding the montage again keeps them. A render, and a take, leaves out every clip ruled cut, not him or read aloud (of the cut and of the wall), cuts a clip to its wider phrase, and numbers the kept clips 1 to N; the build log names each clip left out and why. Without a rulings file a render is exactly as before; `--no-rulings` builds every clip. The end of the deck counts the rulings, shows the next render's clips, and **Re-render the take** makes the picked take (or the one whole-cut take) again. A seed's `edits.json` is offered once as **Import earlier rulings**. From a terminal: `umtool rulings <project>` (show, `import`, `set`, `clear`). Nothing calls a model. Needs a restart of umtool. - **Report videos cut clips from Rumble windows on the right second.** Some downloaded windows (Rumble's) keep their source's clock, so their picture starts a second or two in, and every cut from one landed that much late — in the slow-news montage, one clip's "slow news week" fell into the pause after it. The build now reads where such a window's picture starts and cuts on its own clock (and says so in the build log). In a montage with even loudness, a clip or wall tile that measures near-silent is taken for a phrase looked for in the wrong place: it is found again by the sound — the speech nearest where it was expected — recorded, said in the log, and never boosted from silence. - **Montages are level, and their walls don't repeat themselves side by side.** With `render.montage.loudness` (every montage style has it, at −16 LUFS), each clip and each wall tile is measured and brought to the same loudness, with a limiter so a quiet clip raised up cannot clip — an old upload and a recent stream no longer jump in level at the cut. `wall.spread: "stream"` keeps two clips of one stream, or a stream and its mirror on another platform, from touching in the wall's grid, and `wall.distinct` takes one clip per stream when there are enough. `wall.label` puts each tile's year, its number or both in its corner. Build to the wall uses all three. Manifests without them render exactly as before. - **A montage can build to its wall.** The closing wall can fill in groups of 1, 1, 2, 4, 8 … tiles, each group sliding in on a beat that comes a little sooner than the last; a group says the phrase together, with every tile's first syllable placed on the beat (from whisper's word timings, or from the captions checked against the sound), and at the end every tile says it on the same frame. The wall can take the latest clips instead of a spread (`wall.clips: "tail"`) and take them out of the run before it (`wall.exclusive`), so it condenses the repetition instead of repeating it; the count before it then stops where the wall begins. A ramp can end at the wall's first beat (`ramp.into: "wall"`), so the cuts speed straight into it. A seventh style, **Build to the wall**, puts these together: whip cuts getting shorter, tally marks, then the latest twenty-five in synced groups. Manifests without the new keys render exactly as before. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -10493,3 +10493,36 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri estimate; tuned on s38/s70) → recut; records `montage.loudness.relocated {from, to, why}` and `montage.found: "sound"`; a wall-only tile: `montageWall.sync[].relocated`. `loudnessGain` is 0 under −40 LUFS. Consensus shifts failing `shiftAllowed` (−10 dB) keep the estimate (`by: "estimate"`, `held`). + +## Release 34 lane N1: the clip deck and montage rulings (verified 2026-10-18, branch `r34/clip-deck`) + +- **`<project>/montage-rulings.json`** `{version: 1, rulings: {"<channel>/<video>@<cutStart.toFixed(2)>": {verdict: + "keep"|"cut"|"not-him"|"read-aloud", reason, match?, at}}}`. The key rule is ONE function, + `umtool/report-to-video/montage-rulings.mjs` `clipMomentKey(entry, manifest)`: the clip's `channel`, else + `provenance.channelSlug`; `cutStart`, else `start`; a `src` clip (no video) has no key. voice-match.json (N2) uses the + same key. Exported as `umtool-report-to-video/montage-rulings`. +- **Applied at render** by `applyMontageRulings(manifest, doc, {keep})` → `{manifest, left, matched, renumbered}`: + cut / not-him / read-aloud clips dropped from the timeline (so from the wall: `montageSplit` takes tiles from it); + `match` replaces `montage.match`; when anything was dropped, every kept clip's `montage.n` / `montage.of` (where + present) become 1…N of N in timeline order. Nothing changed → the SAME object (byte-identical render, tested by md5). + build-video applies it to the variant view only (`selectVariant(applied)`): `whole` (validators, posts, a bench + `--fetch-only`) is the manifest as written; `--only <id>` keeps that id. `verify-build` applies the same file. + `--no-rulings` on both. A file that does not parse refuses the build (`readMontageRulings` throws; null = no file). +- **The take maker** applies the rulings to the patched manifest BEFORE windowing (windowEntries still times entries + on the base manifest); the render manifest beside the project is re-applied by build-video as a no-op (nothing left + to drop, so no renumber). `takes/<id>/video.manifest.json` (what a pick copies) is the manifest as written. +- **The one writer**: `umtool/lib/report/montageRulings.mjs` (in-process queue, tmp + rename, sorted keys, an + unparseable file never overwritten). `setMontageRuling(dir, key, ruling|null)`; `resolveRulingKey(manifest, id|key)` + refuses a key no clip has (the route and `umtool rulings set`); the import writes keys the manifest may not have. +- **Import of a seed's edits.json** (`{exclude: [{videoId, near, why}], match: [{videoId, near, match, why}]}`, `near` = + the instance's start): the clip with that `video` whose cutStart (else start) is nearest and < 30 s away; else the + seed's `instances.json` (`{slug, videoId, start}`, key at `round(start, 2)`); an exclude's verdict from its words + (`verdictFromWhy`: another speaker / co-host / guest → not-him; read out / tweet / post / chat → read-aloud; else + cut). Offered while some mapped key is unruled (no extra state). On the slow-news project the two excludes are no + longer in the manifest (the seed dropped them) and map through instances.json. +- **Surfaces**: `/projects/<id>/clips` (`clipDeckHref(p, {show})`, `show` = all|unruled|doubtful|ruled; the Cut tab's + `[data-clip-deck-link]`), `GET/POST /api/report/montage-rulings` (`{project, clip, ruling|null}` | `{project, import: + true, dryRun?}`; GET returns `plan` = `renderPlan` = the kept clips as the build numbers them), `umtool rulings + <project> [--json] | import [--dry-run] | set <clip|key> <verdict> [--reason] [--match] | clear <clip|key>`. + "Re-render the take" = `POST /api/report/takes/make {project, rebuild}` on the single picked take, else the single + full-window maker take (`baseHash`), else a link to the Takes page. diff --git a/umtool/components/projects/report/CutTab.tsx b/umtool/components/projects/report/CutTab.tsx @@ -137,7 +137,7 @@ export default async function CutTab({ project, detail, search, tabHref }: Repor <Link href={clipDeckHref(project.id)} data-clip-deck-link={unruled} - className={buttonVariants({ variant: unruled ? "go" : "outline", size: "lg" })} + className={buttonVariants({ size: "lg" })} > Clips — {unruled ? `${unruled} of ${montage.length} to rule` : `${montage.length} ruled`} </Link> diff --git a/umtool/components/projects/review/ClipDeck.tsx b/umtool/components/projects/review/ClipDeck.tsx @@ -434,7 +434,7 @@ export default function ClipDeck({ {offer.left ? ` · ${offer.left} left out` : ""} {offer.matched ? ` · ${offer.matched} phrase${offer.matched === 1 ? "" : "s"} widened` : ""} </span> - <button type="button" data-import-rulings="" disabled={busy || !writable} onClick={() => void importEarlier()} className={buttonVariants({ variant: "go", size: "sm" })}> + <button type="button" data-import-rulings="" disabled={busy || !writable} onClick={() => void importEarlier()} className={buttonVariants({ variant: "outline", size: "sm" })}> Import {offer.count} earlier ruling{offer.count === 1 ? "" : "s"} </button> </div> @@ -541,7 +541,7 @@ export default function ClipDeck({ <button type="button" data-deck-start="" - className={buttonVariants({ variant: "go", size: "lg" })} + className={cn(buttonVariants({ variant: "outline", size: "lg" }), "bg-panel")} onClick={() => { setStarted(true); clip.current?.playSpan(); diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md @@ -819,6 +819,47 @@ into a wall of the latest 25: they are taken out of the run (`wall.exclusive`, beats, each group saying it in unison with its onsets synced to the beat, then all 25 at once. +### Ruling the clips + +A montage made from a transcript search hears every instance of the phrase, +whoever said it: a co-host, a guest, a clip played on stream, a post read out. +The **clip deck** (`/projects/<id>/clips`, the **Clips** button on the Cut tab +of a cut whose clips carry `montage`) is where they are ruled by ear, one card +at a time, the clip's cut playing from its cached window: + +| Gesture | Key | Ruling | +| --- | --- | --- | +| swipe → | → or `k` | **keep** | +| swipe ← | ← or `x` | **cut** | +| swipe ↓ | ↓ or `n` | **not him**: another speaker | +| swipe ↑ | ↑ or `r` | **read aloud**: a post, a tweet, a quote read out | +| | `e` | keep, with a wider phrase (the cut widens to it) | +| | `s` · `w` · space · `z` | skip · play the clip's whole extent · replay · undo | + +A reason chip or a few words ride with the next ruling. The filters walk the +unruled clips, the **doubtful first** (a voice match's `unlikely`, then +`unsure`, then a clip whose note asks for a voice check), the ruled ones, or +all. When `voice-match.json` (release 34's speaker score) is beside the +manifest, each card shows its score; without it the deck works the same. + +The rulings are `montage-rulings.json` beside the manifest, keyed by the source +moment (`<channel>/<video>@<cutStart>`), never the clip id — so a seed run again, +which numbers its clips afresh, keeps every ruling. **A render applies them**: +a clip ruled cut, not him or read aloud is left out of the cut and of the wall; +a ruled phrase replaces `montage.match`; and the counter numbers the kept clips +1…N, so it never skips a number. The build log names each clip left out and +why; `verify-build` counts the clips that were built. With no rulings file the +render is exactly what it was. `--no-rulings` builds every clip anyway. A take +applies the rulings before it windows the cut, so a window still counts over the +whole kept cut; a take's own manifest (what **Use this take** copies) stays as +written. + +The end of a walk counts the rulings, lists the clips left out, shows the next +render's clips as the build will number them, and **Re-render the take** makes +the picked take (or the one whole-cut take) again with them. A seed's +`edits.json` (its `exclude` and `match` lists) is offered once as **Import +earlier rulings**. The same writer is `umtool rulings` ([cli.md](cli.md)). + ## Operator notes, timed notes and the generated-manifest guard Notes on a project live in `<project>/notes.json` (shape and CLI: diff --git a/umtool/e2e/clip-deck.spec.ts b/umtool/e2e/clip-deck.spec.ts @@ -156,4 +156,5 @@ test("the clip deck at phone width: one column, the bar under the thumb, no side expect(box.y + box.height).toBeLessThanOrEqual(844 + 1); const wide = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth); expect(wide).toBeLessThanOrEqual(0); + if (process.env.P6B_SHOTS) await page.screenshot({ path: path.join(process.env.P6B_SHOTS, "clip-deck-390x844.png"), fullPage: true }); }); diff --git a/umtool/e2e/visual-audit.spec.ts b/umtool/e2e/visual-audit.spec.ts @@ -53,6 +53,7 @@ const PAGES: [string, string][] = [ ["bench-narration", urls.narrationHref("reports/narration-review-fixture")], ["bench-takes", urls.takesHref("reports/takes-fixture")], ["bench-review", urls.reviewHref("reports/media-review-fixture", { view: "list" })], + ["bench-clips", urls.clipDeckHref("reports/clip-deck-fixture", { show: "all" })], ["create", urls.createHref()], ...(["research", "article", "article-board", "recurring", "video-article", "video-board", "video-recording", "video-report", "song"] as const).map( (make) => [`create-${make}`, urls.createHref({ make })] as [string, string], diff --git a/umtool/lib/report/montageRulings.test.mjs b/umtool/lib/report/montageRulings.test.mjs @@ -20,15 +20,15 @@ const clip = (id, channel, video, cutStart) => ({ }); const MANIFEST = { provenance: { channelSlug: "chan" }, - timeline: [clip("s01", "chan", "aaa", 100), clip("s02", "chan-rumble", "v70yc82", 3597.6), clip("s03", "chan", "bbb", 12.25), { type: "card", id: "k1" }], + timeline: [clip("s01", "chan", "aaa", 100), clip("s02", "chan-rumble", "v1a2b3c", 3597.6), clip("s03", "chan", "bbb", 12.25), { type: "card", id: "k1" }], }; const tmp = () => mkdtemp(path.join(os.tmpdir(), "umtool-rulings-")); const file = (dir) => path.join(dir, "montage-rulings.json"); test("keys: every clip's moment; a clip id or a key resolves, anything else is refused", () => { - assert.deepEqual([...momentKeysOf(MANIFEST)], [["s01", "chan/aaa@100.00"], ["s02", "chan-rumble/v70yc82@3597.60"], ["s03", "chan/bbb@12.25"]]); - assert.equal(resolveRulingKey(MANIFEST, "s02"), "chan-rumble/v70yc82@3597.60"); + assert.deepEqual([...momentKeysOf(MANIFEST)], [["s01", "chan/aaa@100.00"], ["s02", "chan-rumble/v1a2b3c@3597.60"], ["s03", "chan/bbb@12.25"]]); + assert.equal(resolveRulingKey(MANIFEST, "s02"), "chan-rumble/v1a2b3c@3597.60"); assert.equal(resolveRulingKey(MANIFEST, "chan/bbb@12.25"), "chan/bbb@12.25"); assert.equal(resolveRulingKey(MANIFEST, "chan/zzz@1.00"), null); assert.equal(hasMontageClips(MANIFEST), true); @@ -50,11 +50,11 @@ test("setMontageRuling: set, replace, remove; writes queue; no temp file is left await Promise.all([ setMontageRuling(dir, "chan/aaa@100.00", { verdict: "cut", reason: "wrong moment" }, { now: NOW }), setMontageRuling(dir, "chan/bbb@12.25", { verdict: "read-aloud" }, { now: NOW }), - setMontageRuling(dir, "chan-rumble/v70yc82@3597.60", { verdict: "keep", match: "it's not that it's a slow news cycle" }, { now: NOW }), + setMontageRuling(dir, "chan-rumble/v1a2b3c@3597.60", { verdict: "keep", match: "it's not that it's a slow news cycle" }, { now: NOW }), ]); let disk = JSON.parse(await readFile(file(dir), "utf8")); assert.equal(disk.version, 1); - assert.deepEqual(Object.keys(disk.rulings), ["chan-rumble/v70yc82@3597.60", "chan/aaa@100.00", "chan/bbb@12.25"]); + assert.deepEqual(Object.keys(disk.rulings), ["chan-rumble/v1a2b3c@3597.60", "chan/aaa@100.00", "chan/bbb@12.25"]); assert.deepEqual(disk.rulings["chan/aaa@100.00"], { verdict: "cut", reason: "wrong moment", at: NOW.toISOString() }); await setMontageRuling(dir, "chan/aaa@100.00", { verdict: "not-him" }, { now: NOW }); await setMontageRuling(dir, "chan/bbb@12.25", null); @@ -97,7 +97,7 @@ const EDITS = { { videoId: "gone", near: 454, why: "a tweet read out, not his own line" }, { videoId: "nowhere", near: 1, why: "x" }, ], - match: [{ videoId: "v70yc82", near: 3597, match: "it's not that it's a slow news cycle", why: "the rebuttal" }], + match: [{ videoId: "v1a2b3c", near: 3597, match: "it's not that it's a slow news cycle", why: "the rebuttal" }], }; const INSTANCES = [{ slug: "chan", videoId: "gone", start: 454.259 }, { slug: "chan", videoId: "aaa", start: 100 }]; @@ -106,7 +106,7 @@ test("mapEarlierRulings: the clip whose video matches within 30 s; a moment the assert.deepEqual(m.rulings, [ { key: "chan/aaa@100.00", clip: "s01", ruling: { verdict: "not-him", reason: "another speaker" } }, { key: "chan/gone@454.26", clip: null, ruling: { verdict: "read-aloud", reason: "a tweet read out, not his own line" } }, - { key: "chan-rumble/v70yc82@3597.60", clip: "s02", ruling: { verdict: "keep", reason: "the rebuttal", match: "it's not that it's a slow news cycle" } }, + { key: "chan-rumble/v1a2b3c@3597.60", clip: "s02", ruling: { verdict: "keep", reason: "the rebuttal", match: "it's not that it's a slow news cycle" } }, ]); assert.deepEqual(m.unmapped, [{ videoId: "nowhere", near: 1, why: "x" }]); // 30 s is the edge. @@ -122,14 +122,14 @@ test("the import: offered while something is new, written once, then not offered await writeFile(path.join(dir, "instances.json"), JSON.stringify(INSTANCES)); await setMontageRuling(dir, "chan/aaa@100.00", { verdict: "keep" }, { now: NOW }); const offer = await earlierRulingsOffer(dir, MANIFEST); - assert.deepEqual(offer.rulings.map((r) => r.key), ["chan/gone@454.26", "chan-rumble/v70yc82@3597.60"]); + assert.deepEqual(offer.rulings.map((r) => r.key), ["chan/gone@454.26", "chan-rumble/v1a2b3c@3597.60"]); const dry = await importEarlierRulings(dir, MANIFEST, { dryRun: true }); assert.deepEqual(dry.written, []); const done = await importEarlierRulings(dir, MANIFEST, { now: NOW }); - assert.deepEqual(done.written, ["chan/gone@454.26", "chan-rumble/v70yc82@3597.60"]); + assert.deepEqual(done.written, ["chan/gone@454.26", "chan-rumble/v1a2b3c@3597.60"]); const disk = (await readRulingsState(dir)).doc.rulings; assert.equal(disk["chan/aaa@100.00"].verdict, "keep", "the deck's ruling stands"); - assert.equal(disk["chan-rumble/v70yc82@3597.60"].match, "it's not that it's a slow news cycle"); + assert.equal(disk["chan-rumble/v1a2b3c@3597.60"].match, "it's not that it's a slow news cycle"); assert.equal((await earlierRulingsOffer(dir, MANIFEST)).rulings.length, 0); } finally { await rm(dir, { recursive: true, force: true }); diff --git a/umtool/report-to-video/README.md b/umtool/report-to-video/README.md @@ -13,6 +13,7 @@ Two scripts and a manifest: | `resolve-windows.mjs` | stable | widens clip windows from cue spans to whole sentences. Run once after authoring a manifest. | | `brand.mjs`, `brand-cards.mjs` | stable | the opt-in brand preset (`render.brand`); see [its section](#the-archilyzer-media-preset-renderbrand). | | `montage.mjs`, `montage-styles.mjs` | stable | montage editing (`render.montage`) and its named styles; see [its section](#rendermontage--montage-editing-release-33). | +| `montage-rulings.mjs` | stable | the clip deck's rulings (`montage-rulings.json` beside the manifest), applied at render; see [its section](#montage-rulingsjson--the-clip-decks-rulings-release-34). | | `<report>/video.manifest.json` | per report | the edit decision list. **This is the regeneration source of truth**, not the report. | ``` @@ -810,6 +811,32 @@ node umtool/report-to-video/montage-styles.mjs list node umtool/report-to-video/montage-styles.mjs apply flash-count video.manifest.json --out takes/flash/video.manifest.json ``` +### `montage-rulings.json` — the clip deck's rulings (release 34) + +Beside the manifest, written by umtool's clip deck (`/projects/<id>/clips`) and +`umtool rulings`, read here by `build-video` and `verify-build`: + +```json +{ "version": 1, + "rulings": { "a-channel/abc123xyz@3127.54": { "verdict": "not-him", "reason": "another speaker", "at": "…" }, + "a-channel-rumble/v1a2b3c@3597.60": { "verdict": "keep", "reason": "", "match": "it's not that it's a slow news day", "at": "…" } } } +``` + +- The key is the source moment, `<channel>/<video>@<cutStart to 2 decimals>` + (`clipMomentKey`: the clip's `channel`, else `provenance.channelSlug`; + `cutStart`, else `start`) — never the clip id, so a re-seed keeps it. +- `verdict` `cut`, `not-him` or `read-aloud` leaves the clip out of the cut and + the wall; `keep` keeps it. `match` replaces the clip's `montage.match`. +- When a clip is left out, every kept clip's `montage.n` / `montage.of` are + numbered again 1…N of N, in order. Nothing left out: the numbers stand (a + take's window of an already-ruled manifest keeps the whole cut's). +- No file, or no ruling that changes anything: the same manifest, the same + render, byte for byte. A file that does not parse refuses the build. +- The build log: `montage rulings: 2 clip(s) left out — s04 (not him: another + speaker), …`. `--no-rulings` (build-video and verify-build) builds every clip. +- On the cut only: the validators and a bench `--fetch-only` read the manifest + as written, and `--only <id>` builds a ruled-out clip's segment anyway. + ### `publish.youtube` — the upload's text (`out/youtube.txt`) ```jsonc diff --git a/umtool/report-to-video/montage-rulings.test.mjs b/umtool/report-to-video/montage-rulings.test.mjs @@ -46,7 +46,7 @@ test("the key: <channel>/<video>@<cutStart to 2 decimals>; the manifest's channe assert.equal(clipMomentKey({ type: "clip", id: "x", video: "vz", start: 4 }), null, "no channel anywhere"); assert.equal(clipMomentKey({ type: "card", id: "k" }), null); assert.equal(clipMomentKey({ type: "clip", id: "x", src: "a.mp4", start: 1 }), null, "a local file is no moment"); - assert.ok(isMomentKey("the-quartering-rumble/v70yc82@3597.60")); + assert.ok(isMomentKey("a-channel-rumble/v1a2b3c@3597.60")); assert.ok(!isMomentKey("a/b@1.5"), "two decimals"); assert.ok(!isMomentKey("a b/c@1.50")); assert.deepEqual(parseMomentKey("ch/v@12.30"), { channel: "ch", video: "v", at: 12.3 });