Archilyzer · Source

archilyzer

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

commit 33fafac1a866719ff1a6e2573ae15c401908be2b
parent 67cec86206475d0225b34ac94846786e70f02f52
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon, 19 Oct 2026 00:01:54 -0400

plans: release 35 O1 — montage operations as shipped; FACTS (alternates, the cap, fetch-runs.json, fallbackFrom), CHANGELOG, umtool docs

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

Diffstat:
Meditor/CHANGELOG.md | 2++
Mplans/FACTS.md | 48++++++++++++++++++++++++++++++++++++++++++++++++
Aplans/release-35/montage-ops.md | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/docs/cli.md | 4+++-
Mumtool/docs/report-video.md | 37+++++++++++++++++++++++++++++++++++++
5 files changed, 150 insertions(+), 1 deletion(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +- **Fetch a montage's windows from umtool, and swap in another upload when Rumble refuses one.** A report video's Cut tab and its clip deck have **Fetch windows**: one button asks the editor for every clip's window (a dry run first — how many per platform, how many already on disk — then Start, with each job followed to its end and each refused window named); `umtool fetch <project>` does the same from a terminal. When a window is refused for good (a Rumble video whose lookup answers 403 every time, a deleted recording), the clip deck offers a **stand-in** — the same moment in the stream's YouTube upload (or Odysee) — and **Use stand-in** switches the clip, noting where it came from; **Restore** puts it back. `umtool fallback <project>` is the terminal form. Every run is kept in the project's `fetch-runs.json`. +- **Cap a phrase montage at N clips, spread across the years.** `umtool new … --seed phrase --max N`, the New project form's **Max** and the phrase finder's **Max clips** keep N instances, each year's share in proportion to how often it was said there (at least one per year), preferring clips with no speaker change in the captions and spread through each year. The rest are listed in `phrase-scan.json`. - **The report-video test suite passes in the Docker image.** Run inside `archilyzer:r33-umtool` (Debian's ffmpeg 7.1), six report-to-video tests failed that pass on a newer ffmpeg. Four came from how the tests drove ffmpeg, not from the videos it renders: they now run the graphs the way a build does. One compared against an older ffmpeg's timing drift, which 7.1 does not show; it is now only checked where the drift happens. The sixth needs a git checkout, which an image does not include, and now says so and skips. Nothing a build renders changed. - **umtool scores who is speaking in each montage clip.** A montage's clip deck and its Cut tab have **Score the voices**: each clip's phrase (and a second either side, its speech only) is compared with the host's voice, and every Cut-tab row then reads `voice 0.43 · unsure` — likely, unsure or unlikely him — and the deck puts the doubtful clips first with their scores. The host's voice is the clips you ruled keep in the audition deck once there are three, or before that solo uploads of the channel found on disk (captioned, no speaker change in the captions, not a stream, no guest in the title, spread over the years); the picker beside the button chooses. It runs on this machine with the speaker model the diarization lane already uses — no network, no AI model — and takes about half a minute for 73 clips. It sorts and flags; whether it is him is still decided by ear. The scores are kept in `voice-match.json` beside the manifest, by the source moment, so a re-seeded montage keeps them. The same from a terminal: `umtool voice-match <project>`. Needs a restart of umtool. - **A montage's closing wall is the right length on older ffmpeg.** With ffmpeg 7.1 (the umtool Docker image), a tile did not hold its last frame after saying its phrase and did not wait for its turn, so the wall came out short of the length its plan gives (23 frames on the test cut) and, with groups, tiles vanished instead of freezing. The tiles now hold and wait on ffmpeg 7.1 as they do on newer versions; renders on the newer ffmpeg are unchanged. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -10600,3 +10600,51 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri run and by the next. Engine: `VOICE_MATCH_PYTHON` / `_SCRIPT` / `_MODEL` (ENVIRONMENT.md), else `settings.diarization.python` / `.embModel` (read from `SETTINGS_FILE` or `<repo>/settings.json`), else `.diarize/`. The e2e runs `common/testing/audio/fakeSpeakerEmbed.mjs` with node. + +## Release 35 lane O1: montage operations in the app (verified 2026-10-19, branch `r35/montage-ops`) + +- **`alternates`** (common/lib/montage/phraseScan.mjs `foldHits`, both scanners): every instance in `instances` carries + `alternates: [{slug, videoId, start, end, platform, availability}]` (an empty list when none; ABSENT = a scan made + before release 35) — the other-channel hits folded into it: a twin's hit its preferred copy already has (attached + to the twin hit that scores best, ≥ `SAME_HIT_MIN_SCORE`; whether a hit is covered is release 34's rule), the hit a + `via` instance was placed from, and every `alsoIn` fold with that fold's own alternates. Deduped by + `<slug>/<videoId>`, the instance's own recording left out; `availability` null for the preferred channel, else + availability.json's. Everything else is release 34's answer: `fixtures/phraseScan.r34.json` (release 34's output on + the test corpus) == the new answer minus `alternates`. `dropped` carries none. +- **The cap**: `capInstances(instances, max)` → `{kept, skipped}` (both chronological, the given order). Year = the + date's first 4 digits (no date = its own year "~", last). `max ≥ years`: each year `max(1, floor(quota))` capped at + its count, then +1 by largest `quota − alloc` (ties: bigger year, then earlier), or −1 from a year > 1 with the + smallest `quota − alloc` (ties: bigger year, then later); `max < years`: one each for `spreadIndices(years, max)`. + Within a year the instances without `speakerCheck` first, `spreadIndices` = the middle of each of n equal + stretches. The scaffold's `max` (1…10000): `phrase-scan.json` gains `max` and `skippedByCap` (instance shape) after + `instances`; README and notes name it. No `max`: manifest + README byte-identical to release 34, phrase-scan.json + differs only by `alternates`. +- **`<project>/fetch-runs.json`** (umtool/lib/report/fetchWindows.mjs, one writer, in-process queue, tmp + rename, the + newest 50 kept): `{runs: [{at, bodyHash (sha256 of the body with sorted keys), dryRun, items, jobIds, summary: + {dryRun, groups[{platform, queueKey, items, storedUrlItems?}], cached[clipId], inFlight[{clipId, jobId}], + unresolved[{clipId, slug, id, error}], refused[{platform, items, error}], jobs[{platform, queueKey, jobId, items}]}, + jobs?: {<jobId>: {status, platform, failed[{slug, id, from, to, clipId, class, message}], at}}}]}`. A job's + `failed` is parsed from its whole log (`GET /api/jobs/<id>/log`, ungated) — the controller's ` ✗ <slug>/<id> + <from>–<to> (<clipId>): <class> — <message>` lines — once `GET /api/ops/job/<id>` says it ended + (done/failed/cancelled/interrupted); an ended job is never asked again. +- **The body** (`fetchWindowsBody`): `{requestedBy: "umtool:<project id>", manifest: <abs manifest path>, storedUrl: + "fallback", items: [{slug: clip.channel ?? provenance.channelSlug, id, from, to, clipId, pad, reason}]}`; from/to = + build-video `fetchSpan` (start − fetchPad … end + fetchPad, 2 dp; a phrase seed's fetchPad is 0); `pad` = fetchPad + when > 0 else 3 (provenance); `reason` = `--reason`, else "<title> montage" when any clip carries `montage`, else + the title. Skipped: a clip with no channel/video, and a clip ruled cut / not-him / read-aloud. Token: `agentToken()` + (WORKER_TOKEN, else editor/.env*); URL: ARCHILYZER_EDITOR_URL (default http://localhost:3001). +- **`fallbackFrom`** (umtool/lib/report/standIns.mjs): a switched clip carries `fallbackFrom: {channel, ownChannel?: + false, video, start, end, cutStart, cutEnd, cite, note, platform, reason}` (null for a field the clip lacked; + `reason` "403" when the refusal's message says 403, else its class) and `note` "from the <Platform> upload: the + <Platform> copy refused (<reason>)"; its channel/video/cut become the alternate's, start/end keep the clip's + margins, `montage.platform` the alternate's. `restoredClip` puts every field back (same key order). A candidate: + not on disk (`projectCache(...).isFetched`), refused (`refusedWindows`: failed classes except rate_limit / + unreachable / cut-failed / cancel(led), or the editor's `unresolved`; the newest word per clip), not already + switched, and an `eligibleAlternates` entry (availability null / public / unknown; not a refused recording; + ranked youtube 0, odysee or slug cornbreadman 1, else 2). Writes: `replaceManifest` op `stand-in` / + `restore-stand-in` (auto snapshot → Undo); `moveMontageRuling(dir, from, to)` (the rulings writer; nothing when + `from` has none or `to` has one); the voice-match row moved the same way (`writeVoiceMatch`). +- Surfaces: `/api/report/fetch-windows` (GET; POST `{project, action: "dry-run"|"start"|"follow"}`), + `/api/report/stand-ins` (GET plan; POST `{project, clips?}` | `{project, restore}`), `umtool fetch`, `umtool + fallback`; components `FetchWindowsPanel` (Cut tab, clip deck) and `MontageFetchTools` (clip deck: fetch + + stand-ins). The e2e stub's door is `umtool/e2e/fixtures/editor-stub-fetch-windows.mjs` (a `vrefuse*` id = a 403). diff --git a/plans/release-35/montage-ops.md b/plans/release-35/montage-ops.md @@ -0,0 +1,60 @@ +# Release 35 lane O1 — montage operations in the app (`r35/montage-ops`), as shipped + +The steps the orchestrator did by hand for the slow-news montage — a scan, no cap, a fetch-windows body built in +python, a second fetch for refused Rumble windows from the same stream's other upload — as app operations, each with a +CLI and a UI button, deterministic, no model. + +## What + +1. **Alternates** (common/lib/montage/phraseScan.mjs): every instance records `alternates: [{slug, videoId, start, end, + platform, availability}]` — the other-channel hits folded into it (a covered twin hit, attached to the twin hit that + scores best; the `via` source; every `alsoIn` fold). Everything else is release 34's answer + (`fixtures/phraseScan.r34.json`, equivalence-tested for both scanners). +2. **The cap**: `capInstances` + the phrase seed's `max` (`umtool new … --seed phrase --max N`, the New project form's + **Max**, the phrase finder's **Max clips**). `phrase-scan.json` gains `max` and `skippedByCap`; README and notes name + it. No `max`: manifest + README byte-identical to release 34. +3. **Fetch windows**: `umtool fetch <project> [--body | --dry-run | --wait | --status] [--reason R]`, the + `/api/report/fetch-windows` route and `FetchWindowsPanel` (Cut tab, clip deck). Runs in `<project>/fetch-runs.json`. +4. **Stand-ins**: `umtool fallback <project> [--dry-run | --clip <id> … | --restore <clipId>]`, `/api/report/stand-ins`, + `MontageFetchTools` on the clip deck (Use stand-in / Use all / Restore). `fallbackFrom` on the clip; ruling and + voice-match row moved with it (`moveMontageRuling`, the rulings' writer). + +Shapes: plans/FACTS.md, "Release 35 lane O1". + +## Commits + +| sha | | +|---|---| +| 07caf3eb | common: the phrase scan records each instance's alternates (slice 1) | +| f5914aeb | umtool: the phrase seed's cap `--max N` (slice 2) | +| 7992d406 | umtool: Fetch windows — `umtool fetch` and the button (slice 3) | +| be45001b | common: a covered twin hit's alternate goes to the best-scoring twin hit (slice 1 follow-up) | +| aa9b8ad9 | umtool: stand-ins — `umtool fallback`, Use stand-in / Restore (slice 4) | +| (this) | plans + docs: record, FACTS, CHANGELOG, cli.md, report-video.md | + +Slices 1–3 (07caf3eb..7992d406) were merged to main by the orchestrator as 9d0ab192. + +## Gates (all through r31-locked.sh) + +- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean at 7992d406 and at aa9b8ad9. +- common: 4627 tests, 4625 pass, 0 fail, 2 skip (both points; the new tests are in phraseScan.test.ts +3 and + phraseScanMany.test.ts +2 — net count equal because the count was first taken after they were written). +- test:scripts: 1175 / 1171 pass / 4 skip at 7992d406 (+4 scaffold-phrase/fetchWindows tests); 1180 / 1176 pass / + 4 skip at aa9b8ad9 (+5 standIns tests). 0 fail. +- e2e `umtool/e2e/montage-ops.spec.ts`: **written, NOT run** — three attempts (10 min each, inside r31-locked6.sh) never + got the machine-wide heavy slot (held by other agents' e2e and builds; MemAvailable under the floor). Owed: one run. +- Checked on real data (read-only): `umtool fetch quartering-oopsie --body --reason "oopsie montage"` == the hand-built + `~/reports/quartering-oopsie/windows.json` (68 items; python dict equality); with no `--reason` all but the reason + ("Oopsie doopsie montage"). A release-34 scaffold (the primary checkout's module) vs this branch on a synthetic + corpus: video.manifest.json and README.md byte-identical; phrase-scan.json differs only by `alternates`. +- Stand-ins on a COPY of quartering-oopsie with a synthesized fetch-runs.json from its refusals (s23, s24, s27, s29, + s30, all the-quartering-rumble, 403): the re-scan (the scan predates alternates) finds each instance and **no + alternate for any** — no other channel's transcript says those moments, so `umtool fallback` reports "refused with + none" for all five. Correct, but it means oopsie's refused clips need another source. + +## Rulings followed + +- No model anywhere; every step has a UI button and a CLI. +- The editor fetches; umtool asks (WORKER_TOKEN, else editor/.env, never sent to the browser). +- The manifest is written only through `replaceManifest` (lock, auto snapshot, atomic); rulings through their writer. +- Fixtures synthetic; nothing under `~/reports` written (copies under the job's scratch). diff --git a/umtool/docs/cli.md b/umtool/docs/cli.md @@ -25,7 +25,7 @@ Inbox cannot disagree about what is wrong with one. | `window <project> <clip> [--start S] [--end E] [--lock] [--lock-end] [--no-lock-end] [--note …]` | edit a window | | `build <project> [--preset preview\|fast\|final] [--only ID]` | **prints** the chain | | `index [--rebuild] [--prune] [--since MS] [--json]` | the cache | -| `new <slug> [--from <report.md>\|<share URL>\|<channel>/<id>] [--site-origin URL] [--seed chapters\|frames [--target S]]` · `new <slug> --seed phrase --phrase <regex> --channels a,b [--prefer <slug>] [--exclude <regex>]` | scaffold | +| `new <slug> [--from <report.md>\|<share URL>\|<channel>/<id>] [--site-origin URL] [--seed chapters\|frames [--target S]]` · `new <slug> --seed phrase --phrase <regex> --channels a,b [--prefer <slug>] [--exclude <regex>] [--max N]` | scaffold | | `doctor [--json]` | which tools are on this machine and where the roots are; **exit 1** if the report pipeline is missing one, or `UMTOOL_MEDIA_DIR` is set and not there | | `storage [<project>] [--json]` | where each project's `out/` lives: dir, link, DANGLING, none — and a report's deliverables (`clips/`, `share-*/`) and its switch | | `storage move-out\|move-back <project>\|--all [--dry-run] [--json]` | `out/` to the media root (a link left behind) and back — copied, mirrored, verified first; run when nothing is building | @@ -43,6 +43,8 @@ Inbox cannot disagree about what is wrong with one. | `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 pick <project> <take> [--anyway] [--json]` | the montage styles; **Use this take** — refused (exit 1) when the project changed since the take was made, until `--anyway` | | `rulings <project> [--json]` · `rulings <project> import [--dry-run] [--json]` · `rulings <project> set <clip\|key> keep\|cut\|not-him\|read-aloud [--reason R] [--match M]` · `rulings <project> clear <clip\|key>` | a montage's **clip rulings** (`montage-rulings.json`, the clip deck's): each clip and its ruling and the next render's kept clips; the earlier rulings in the seed's `edits.json`, once; one ruling set or cleared. A render leaves out every clip ruled cut, not-him or read-aloud ([report-video.md](report-video.md#ruling-the-clips)) | +| `fetch <project> --body` · `fetch <project> --dry-run [--json]` · `fetch <project> [--wait] [--json]` · `fetch <project> --status [--json]` · `… [--reason R]` | **Fetch windows** (the Cut tab's and the clip deck's button): every clip's window asked of the editor as ONE fetch-windows batch — `--body` prints the body and asks nobody; `--dry-run` the editor's plan (groups per platform, cached, in flight, unresolved); no flag starts it (one paced job per platform queue), `--wait` follows the jobs to their end and names each window a job failed; `--status` follows the last run's jobs once. Clips the montage rulings leave out are not asked for. Every run is recorded in `<project>/fetch-runs.json`. Needs WORKER_TOKEN (else the editor's env files) and the editor at ARCHILYZER_EDITOR_URL. **Exit 1** when a job failed or the editor refused ([report-video.md](report-video.md#fetching-the-windows-and-stand-ins)) | +| `fallback <project> --dry-run [--json]` · `fallback <project> [--clip <id> …] [--json]` · `fallback <project> --restore <clipId>` | **stand-ins** (the clip deck's **Use stand-in** / **Restore**): a montage clip whose window a fetch run says the editor refused, and is not on disk, switched to its phrase-scan instance's first public alternate (YouTube, then Odysee / cornbreadman, then the rest) — recorded on the clip as `fallbackFrom`, its ruling and voice-match row moved with it; `--restore` puts it back. An older `phrase-scan.json` with no `alternates` is scanned again. **Exit 1** when a named clip has no stand-in | | `phrases "<phrase>" ["<phrase>" …] --channels a,b [--prefer c] [--exclude RE] [--words \| --regex] [--samples N] [--no-cache] [--json \| --full]` | the phrase finder's search ([tools.md](tools.md#the-phrase-finder-toolsphrases)): every phrase in one pass, each with its count once folded, by year, the preferred channel's share or Rumble's, speaker changes, sample contexts. Plain words become a tolerant pattern unless the phrase holds a regular expression's characters. `--json` the numbers, `--full` every instance; `--spec FILE --out FILE --progress` is the page's job form. **Exit 1** on a bad phrase | | `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)) | diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md @@ -860,6 +860,43 @@ 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)). +### Fetching the windows, and stand-ins + +A phrase seed's every clip needs its window on disk before anything plays or +renders. **Fetch windows** (the Cut tab, the clip deck; `umtool fetch <project>`) +asks the editor for all of them as one `fetch-windows` batch — the body is +`{requestedBy: "umtool:<project>", manifest: <its path>, storedUrl: "fallback", +items: [{slug, id, from, to, clipId, pad, reason}]}`, the window the build would +fetch (`start`–`end` for a phrase seed, whose `fetchPad` is 0), `pad` 3 as +provenance, `reason` "<title> montage". Clips ruled cut, not him or read aloud +are not asked for. The dry run says what the editor would do (the windows per +platform, those already on disk, those a job is already fetching, those it +cannot resolve); **Start** queues one paced job per platform and the panel +follows them to their end, naming each window a job failed. Every run is +recorded in `fetch-runs.json` beside the manifest. + +Some windows are refused for good: a Rumble video whose embed lookup answers 403 +on every try (per video — not the Cloudflare clearance), or a recording gone +from its platform. The phrase scan knows the other uploads of each moment: every +instance in `phrase-scan.json` lists its `alternates` (the other channels' hits +folded into it, each at its own moment). The clip deck then offers a **stand-in** +for each refused clip whose window is still missing — the first public +alternate, YouTube first, then Odysee or cornbreadman — and **Use stand-in** +switches the clip to it: its channel, video and moment become the alternate's +(the cut is the alternate's phrase, the window keeps the clip's margins), the +note says "from the YouTube upload: the Rumble copy refused (403)", and +`fallbackFrom` records everything it was. Its montage ruling and voice score +move to the new moment. **Restore** (or `umtool fallback <project> --restore +<clip>`) puts every field back, and the ruling with it. Then **Fetch windows** +again asks for the stand-ins' windows. A scan made before release 35 has no +`alternates`; the stand-in step scans the same channels again (the cue-text +cache makes it quick) to find them. + +A capped reel (`--max N`, the form's **Max**, the phrase finder's **Max clips**) +keeps N instances spread across the years in proportion to each year's count, +at least one for each year; the rest are in `phrase-scan.json` as +`skippedByCap`. + ### Who is speaking: the voice match A montage of one phrase is also a montage of everyone who said it near the host: