Archilyzer · Source

archilyzer

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

commit 4275ce24fc1d9b77e14f9082e642a2f11e389921
parent 78c026bcdcaac1c3c79a121ab985f8b4e0aa00c2
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon, 19 Oct 2026 12:44:26 -0400

umtool: the Create form's Video picker (auto-scope); docs, FACTS, CHANGELOG for the clip finder's round two

Highlights from a recording gains **Video** ([data-new-video]): the longest
narrated video found, or the 1st/2nd/3rd, instead of From s / To s.
report-video.md "Highlights" (auto-scope, the chat, a channel on no site,
the route's mode "new"), cli.md, the test kit README, a FACTS section, two
[Unreleased] bullets.

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

Diffstat:
Mcommon/testing/README.md | 1+
Meditor/CHANGELOG.md | 2++
Mplans/FACTS.md | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mumtool/components/NewProjectMenu.tsx | 20+++++++++++++++++---
Mumtool/docs/cli.md | 15++++++++++++---
Mumtool/docs/report-video.md | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
Mumtool/e2e/create.spec.ts | 18++++++++++++++++++
7 files changed, 163 insertions(+), 8 deletions(-)

diff --git a/common/testing/README.md b/common/testing/README.md @@ -30,6 +30,7 @@ transcript, channel or person goes in these fixtures, ever. | `audio/syntheticVoice.mjs` | Release 34 N2: synthetic "voices" for the speaker-similarity tests — `syntheticVoice({f0, formants, seconds, phase})` (additive harmonics shaped by formant resonances, a syllable envelope and a vibrato; `phase` makes another take of the same voice), `withSilence`, and `VOICE_A` / `VOICE_B`, two voices TitaNet-small tells apart (cosine ~0.98 within a voice, ~0.63 across, measured). | | `audio/fakeSpeakerEmbed.mjs` | Release 34 N2: a stand-in for `scripts/speaker-embed.py` with its command line and JSON (`node fakeSpeakerEmbed.mjs --emb <x> <request.json>`): the "embedding" is the long-term spectrum (32 log-spaced Goertzel bands, dB, mean-removed, L2-normalised) — deterministic, and it separates `VOICE_A` from `VOICE_B`. Not a speaker model: set `VOICE_MATCH_PYTHON` to `node` and `VOICE_MATCH_SCRIPT` to it for a run with no python or model. | | `mirrors/mirrorCorpus.mjs` | Release 31 lane D: a synthetic creator (`synth-streamer`, "youtube": a public, a deleted and a private stream, removed shorts in and out of the window), its Rumble twin (`synth-streamer-rumble`: data dirs are URL slugs, ids embed ids) and a VOD mirror (`synth-vod-archive`, "odysee", titles `[VOD] SynthStreamer - MM/DD/YYYY - <topic>`, config `recordedDate` + `mirror.of`). `MIRROR_RECORDS` / `CREATOR_RECORDS` / `RUMBLE_RECORDS` are the matcher's input; `writeMirrorCorpus(channelsDir)` writes the three channels to disk (config, metadata, availability); `EXPECTED` is what a mirror scan finds (each status once or more, the removed uploads the mirror holds). | +| `clips/reactionStream.mjs` | Release 35: a synthetic reaction stream (`reactionStream()`: a host interjecting over a narrated video — turns, words, cues, laugh windows; `reactionAudio()` its sound; `writeReactionCorpus(dir, o)` a channel on disk). Release 36: `twoVideoStream()` (an intro, video A by speaker 1, the host between, video B by speaker 2 with a pause and a stray cluster, an outro — what auto-scope reads), `reactionChat(o)` (a chat replay: a steady trickle and a burst of laugh tokens `lag` s after each laugh, `chatOnly` bursts), and `writeReactionCorpus`'s `two`, `chat` (live_chat.cues.json) and `meta` (keys into metadata.info.json) options. The "narration" is numbered filler words. | | `draft/runs/*.json` | One recorded run per generation task (release 27 S5): the model side, scripted — `turns` for the fake Anthropic (`sweep-agent`, `revise-report`, `revise-video`, `research`) or the fake ollama (`sweep-pipeline`, `narrate`; release 28's `flips`, `threads` and `youtube`, release 29's `social`, each with a `note` saying what it is run over and why its first answer is refused), with the question, channels or feedback it answers. `mcp/src/draftTasks.test.ts` runs each task over the synthetic corpus against them. | | `draft/derive.ts`, `draft/regenerate.ts` | How the derived files are made. After a converter change: `cd common && pnpm exec tsx testing/draft/regenerate.ts`, review the diff, commit. `fakes.test.ts` fails until they match. | diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +- **The clip finder finds each narrated video in a reaction stream, and listens to the chat.** A stream that reacts to one video and then another no longer needs its scope read off the speakers by hand: `umtool new <slug> --seed reactions --from <channel>/<id> --scope auto` reads the narrated video the speaker turns show (`--segment s2` names one, else the longest), with the host's reaction after the video kept and the roles found for that video alone; `umtool clips segments <project>` lists them. When the stream's chat replay is on disk, the moments the chat laughs together (lol, KEKW, 😂, a wall of W) become proposals too, moved back by how late the chat types — found by lining the chat up against the laughs heard in the sound, else 6 seconds — and always ranked below the host's own laugh; the analysis says the delay it found. Without a chat replay nothing changes. Needs a restart of umtool. +- **Highlights of a channel that is on no site link the source and start with a clean look.** Each proposed clip links its platform page at its second (YouTube, Twitch, Rumble…), the channel's name is filled in from the video, and the cut starts with no header, no QR code, half-second fades through black and a −16 LUFS loudness target — no edits to the manifest needed. umtool's clips job also answers the editor directly (its `WORKER_TOKEN`), so the editor's Find clips makes or re-analyzes the project in one call; asking again for a video already cut analyzes that project again and keeps every clip you touched. - **A report video's cut can dip through black between clips.** `render.transitionStyle: "fadeblack"` (or `fadewhite`, `dissolve`; default `fade`) changes how the crossfade looks, not its length — for highlights where every clip shares one layout and a plain dissolve hides the jump. - **Hop in on an assistant's clips in umtool: trim, split, merge, keep or cut them, and comment.** A report video whose cut is not a montage has a **Clip editor** on its Cut tab (`/projects/<id>/clips`). It loops the selected clip from what is on disk, and under it shows the clip's neighbourhood (± 60 s, or closer): the speaker turns coloured host and subject, the laughs, the words, the other clips, and the cut with a handle at each edge. Move the edges by dragging, typing, nudging (±0.1, ±0.5, ±2 s) or **Snap to words**; **Keep** / **Cut**; **Split here** at the playhead; **Merge with next**; **Add a clip** from a span dragged on the strip; **Restore the assistant's version**; **Bring in** a proposal the assistant left out. Each clip says whether it is "by the assistant" (with its score and why) or "edited by you", with its edit history. A comment on a clip is a note anchored to it, so an agent reading `umtool notes` can act on it and its reply shows in the clip's thread. **This is the host** on a speaker's turn corrects which voice is the host. Keys: space, J/L, I/O, S, M, K, X, ←/→. A keep or cut follows its clip when an edit moves the clip's start. It works on any report video; a cut without the clip finder's speakers simply has no colours. - **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`. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -10784,3 +10784,57 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri finder's `setSpeakerRole` (common/lib/clips/reactions.mjs: one host / one subject, `rolesChangedAt`) beside a lenient reader (`{doc, error}`). Re-propose = `POST /api/report/clips {project, mode: "propose"}` (a job), offered while `rolesChangedAt > proposedAt` (the view carries both). + +## Release 36 lane B: auto-scope, the chat signal, site-less links, the clips route's `mode: "new"` (verified 2026-10-19, branch `r36/clip-analysis-2`) + +- **`reactions.json` gains** (all optional; absent in a release 35 file) `segments: [{id "s1"…, from, to, subject, + host, why}]` (every pass, from the whole recording's turns), `segment: "s1" | null` (the segment whose edges the + scope is, within 0.01 s; null for a scope by hand), `chat: {source "live_chat.cues.json", lagS, lag {how + "xcorr"|"default", r|null, why}, messages, bursts, bins {hop 2, rate[], laugh[]}} | null`; a moment's `kind` may be + `"chat"` (with `messages`). Types: `ReactionsDoc` in `common/lib/clips/reactions.d.mts`. +- **Auto-scope** (`common/lib/clips/segments.mjs` `findSegments({turns, duration, host?, operator?})`): host = + the given/operator's, else assignRoles' over the whole recording, and left out of the counting; windows 300 s every + 30 s; a window's subject = the non-host cluster with the most seconds in turns ≥ SHORT_TURN_S (8), counted when ≥ 60 s + and ≥ 60 % of the window's non-host long-turn time; runs of one subject edged on that subject's first/last long turn + in the run; same-subject neighbours joined, spans < 180 s dropped (then joined again); the tail = the last turn end + ≤ min(next span's from, to + 300 s); nothing before a span's first long turn is folded. `pickSegment(segs, id?)` + (the named, else the longest; unknown id throws), `scopeOverlapsSegment(scope, seg, duration)` (overlap ≥ half the + shorter; null scope = the whole). Live (`harmful-opinions/fGSRhEWc9M4`, audioSeconds 9367.858): s1 292.68–6318.09 + (subject 4, host 1), s2 6501.93–9276.01 (subject 16). +- **`--scope auto`** (CLI `umtool new --seed reactions` and `clips analyze|propose`; `--segment sN` implies it; + scaffold `scope: "auto"`, `segment`; job `clipsSteps({scope: "auto", segment})`): resolved against the recording + (`resolveParams` in `umtool/lib/report/reactions.mjs`) to the segment's numbers, written as `params.scope`; no + segment found → the whole recording, said in a note. `umtool clips segments <project> [--json]` re-finds them from + the diarization on disk. +- **The chat** (`common/lib/clips/chat.mjs`; lib reads `live_chat.cues.json` itself — lib may not import controller): + the file must be `{version: number, source: "live_chat", cues: [{start, text: "<author>: <message>"}]}`; bins of 2 s + over [0, recording duration); a laugh = the message (after the first ": ") is W's alone, holds 😂/🤣, or a token + matching lol/lmao/lmfao/KEKW/LUL/OMEGALUL/rofl/haha…/:face-with-tears-of-joy: (`CHAT_LAUGH_RE`); lag = argmax Pearson + r of chat-laugh[k] vs CED-bin[k − s] (each 2 s bin the max window score centred in it) over s = 0..10 bins inside the + scope, parabola-refined, 0.1 s; no scan / no variance / r < 0.2 → 6 s; burst bin = laughs ≥ 3 and ≥ 2.5 × max(1, + median of ±30 bins); runs (one quiet bin bridged) → moment t = start − lag, end = end − lag, wholly inside the scope, + score 0.6 × (1 − e^(−Σ(laugh/base − 1)/6)), speaker by attributeLaughs; spans as a laugh's. With no chat (absent, + null, or no cues) `analyze` is release 35's output exactly (digests pinned in `chat.test.ts`). +- **Site-less links** (`siteLessLinks(rec, manifest)` in `umtool/lib/report/reactions.mjs`, each seed and pass): when + `provenance.siteOrigin` is empty, metadata `webpage_url` is a URL, and no `<SITES_DIR>/*/site.json` WITH a non-empty + `siteUrl` lists the channel in `channels[].slug` or `citedChannels`, `applyProposals(…, {citeUrlAt})` writes + `citeUrl = watchUrlAt(webpage_url, cite)` (`common/lib/clips/assist.mjs`: youtube/youtu.be `t=<s>s`, twitch + `t=<h>h<m>m<s>s`, rumble.com `start=<s>`, else `t=<s>`; an existing same-name param replaced) on every clip it adds or + moves; a kept clip with no citeUrl gains it; a citeUrl that is not the derived one for its cite is never touched. + The seed then sets `render` to `SITELESS_LOOK` (`umtool/lib/projects/scaffold.mjs`: headerHeight 0, footerHeight 0, + qr false, transition 0.5, transitionStyle "fadeblack", loudness {target: -16}) instead of `transition: 0`, and + `provenance.channel` from metadata `channel` (else `uploader`) whenever it was empty. `report.mjs` `originUnused(m)`: + an EMPTY siteOrigin with every clip carrying an http(s) citeUrl and no card or post is no "dead QR origin" flag or + blocking decision. Nothing in lint/build refuses an unknown render key (verified: `lintManifest(…, {validators: + true})` on a seeded site-less manifest gives no render error). +- **`/api/report/clips`** POST: `routeCaller(authorization, agentToken())` (`umtool/lib/annotations/agentAuth.mjs`) — + no header = the page, `Bearer <umtool's WORKER_TOKEN>` = the editor, else 401 `{error}`; every POST answers `jobId` + beside `job`. `{mode: "new", slug, from, target?, scope? ("auto" default | "all" | [from, to]), segment?, + wordsPath? (absolute)}` → `planClipsNew` (`umtool/lib/report/clipsNew.mjs`): 409 while any umtool job runs; the + recording loaded (404 no video dir, 400 no diarization); the span chosen; the reactions projects under REPORTS_ROOT + with the same `source.channel/video` whose `params.scope` covers the span (`scopeOverlapsSegment`), best overlap then + latest `proposedAt` → that project, untouched but for `words.json` copied in when it has none (`created: false`); + else `scaffoldReportVideo({slug, seed: "reactions", scope, segment, target})` (409 when the slug exists) + the words + copied (`created: true`); then ONE job `clips analyze <id>` → `{ok, jobId, job, project, created, segments, + segment (the chosen one's id), scope (the project's params.scope), href "/projects/<id>/clips", notes}`. GET + `?project=` adds `segments`, `segment`, `chat {source, lagS, lag, messages, bursts}`. diff --git a/umtool/components/NewProjectMenu.tsx b/umtool/components/NewProjectMenu.tsx @@ -38,6 +38,8 @@ import { useHydrated } from "@/components/ui/use-hydrated"; // (seconds, default 600), [data-new-laugh-min] and the scope [data-new-scope-from]/ // [data-new-scope-to]; creating one starts "Find the clips" (the laugh scan // and the voices, then proposals) as a job, and opens the project. +// Release 36 B1: [data-new-video] picks the narrated video auto-scope finds +// ("auto": the longest, or the 1st/2nd/3rd found) instead of From s / To s. type Brand = { id: string; label: string }; type Kind = { id: string; label: string; scaffold?: { fields: string[]; brands?: Brand[] } | null }; @@ -51,6 +53,7 @@ const FIELD_HINT: Record<string, string> = { highlights: "the highlights' length: the proposed clips ranked into this many seconds (10 to 7200)", laughMin: "how sure the sound model must be that a second is laughter, 0.01 to 1 (default 0.25; lower finds more)", scope: "read only this part of the recording, in seconds (empty: from the start / to the end)", + video: "which narrated video to cut: found from the speaker who talks in long runs, or the From s / To s you type", phrase: "a regular expression, any case — e.g. slow[ ,]+news (day|week)", channels: "the channel slugs to scan, separated by commas", prefer: "the channel to cut from where it holds a copy of the same stream (optional)", @@ -111,6 +114,7 @@ export default function NewProjectMenu({ const [laughMin, setLaughMin] = useState("0.25"); const [scopeFrom, setScopeFrom] = useState(""); const [scopeTo, setScopeTo] = useState(""); + const [video, setVideo] = useState(""); // What the video can be seeded from (null: not asked yet, or not a video). const [seeds, setSeeds] = useState<{ chapters: boolean; frames: boolean; reactions: boolean } | null>(null); const [brand, setBrand] = useState(""); @@ -161,7 +165,8 @@ export default function NewProjectMenu({ if (seed === "reactions") { body.target = Number(hlTarget); if (laughMin.trim()) body.laughMin = Number(laughMin.trim()); - if (scopeFrom.trim() || scopeTo.trim()) body.scope = [scopeFrom.trim() || null, scopeTo.trim() || null]; + if (video) Object.assign(body, { scope: "auto" }, video !== "auto" ? { segment: video } : {}); + else if (scopeFrom.trim() || scopeTo.trim()) body.scope = [scopeFrom.trim() || null, scopeTo.trim() || null]; } } if (fields.includes("brand") && brand) body.brand = brand; @@ -385,11 +390,20 @@ export default function NewProjectMenu({ <Field label="Laugh min"> <Input value={laughMin} onChange={(e) => setLaughMin(e.target.value)} inputMode="decimal" aria-label={`laugh min — ${FIELD_HINT.laughMin}`} title={FIELD_HINT.laughMin} data-new-laugh-min className="num w-20" /> </Field> + <Field label="Video"> + <Select value={video} onChange={(e) => setVideo(e.target.value)} aria-label={`video — ${FIELD_HINT.video}`} title={FIELD_HINT.video} data-new-video> + <option value="">From s / To s</option> + <option value="auto">the longest one found</option> + <option value="s1">the 1st found</option> + <option value="s2">the 2nd found</option> + <option value="s3">the 3rd found</option> + </Select> + </Field> <Field label="From s"> - <Input value={scopeFrom} onChange={(e) => setScopeFrom(e.target.value)} inputMode="numeric" placeholder="start" aria-label={`from seconds — ${FIELD_HINT.scope}`} title={FIELD_HINT.scope} data-new-scope-from className="num w-20" /> + <Input disabled={!!video} value={scopeFrom} onChange={(e) => setScopeFrom(e.target.value)} inputMode="numeric" placeholder="start" aria-label={`from seconds — ${FIELD_HINT.scope}`} title={FIELD_HINT.scope} data-new-scope-from className="num w-20" /> </Field> <Field label="To s"> - <Input value={scopeTo} onChange={(e) => setScopeTo(e.target.value)} inputMode="numeric" placeholder="end" aria-label={`to seconds — ${FIELD_HINT.scope}`} title={FIELD_HINT.scope} data-new-scope-to className="num w-20" /> + <Input disabled={!!video} value={scopeTo} onChange={(e) => setScopeTo(e.target.value)} inputMode="numeric" placeholder="end" aria-label={`to seconds — ${FIELD_HINT.scope}`} title={FIELD_HINT.scope} data-new-scope-to className="num w-20" /> </Field> </> )} 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>] [--max N]` · `new <slug> --seed reactions --from <channel>/<id> [--target S] [--laugh-min X] [--scope FROM:TO] [--no-analyze]` | 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]` · `new <slug> --seed reactions --from <channel>/<id> [--target S] [--laugh-min X] [--scope FROM:TO\|auto [--segment sN]] [--no-analyze]` | 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 | @@ -47,7 +47,7 @@ Inbox cannot disagree about what is wrong with one. | `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)) | -| `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]` | 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. 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) | +| `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. **`--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) | A project argument is an exact id, a directory, or a **unique** basename. Two projects answering to one name is reported, never resolved by picking one. @@ -229,7 +229,14 @@ analysis and every proposal, used or not. The seed reads laughs from the transcript alone; `umtool new` then runs `umtool clips analyze` (the laugh scan and the voices on the sound) unless `--no-analyze`. `--laugh-min X` sets the laugh bar and `--scope FROM:TO` reads only that part of the recording (a stream that -reacts to two videos, one at a time); both are kept for the next pass. The new-project form's seed +reacts to two videos, one at a time); both are kept for the next pass. +`--scope auto` (release 36) reads the narrated video auto-scope finds in the +speaker turns — `--segment s2` names one, else the longest — and writes the +numbers it chose; `umtool clips segments <project>` lists the segments. When no +site carries the channel (and no `--site-origin` is given), each clip links its +platform page at its second (`citeUrl`), `provenance.channel` comes from the +metadata, and the render starts with no header, no QR, 0.5 s fades through +black and `loudness: {target: -16}`. The new-project form's seed "highlights" (and Create's **Highlights from a recording**) does the same and starts the scan as a job. @@ -237,4 +244,6 @@ starts the scan as a job. archilyzer diarize backfill --scope video:some-channel/abc123 umtool new some-stream-highlights --seed reactions --from some-channel/abc123 --target 600 umtool clips propose some-stream-highlights --host 1 # the other speaker is the host +umtool new second-half --seed reactions --from some-channel/abc123 --scope auto --segment s2 +umtool clips segments second-half ``` diff --git a/umtool/docs/report-video.md b/umtool/docs/report-video.md @@ -998,6 +998,28 @@ What it reads, and what it does without: classes) at `.diarize/models/sherpa-onnx-ced-mini-audio-tagging-2024-04-19/` (`AUDIO_TAG_MODEL`). Without it: the transcript's laugh markers (`[laughter]`, `haha`, `lol`, `lmao`) and the host's loud wordless bursts. +- **The chat** (release 36) — `live_chat.cues.json` beside the recording (the + editor writes it for a YouTube stream's chat replay). Without it, nothing + below changes: the analysis is release 35's, byte for byte. + +**Which part of the recording: auto-scope** (release 36). A reaction stream +plays one narrated video, then another, with the host talking over both and +between them. `--scope auto` (the editor's Find clips uses it) reads the +narrated video the speaker turns show: 5-minute windows every 30 s, each +window's subject the speaker (not the host) with the most seconds in turns of +8 s or more — at least 60 s of them and 60 % of that time; a run of windows +with one subject is a **segment**, from that speaker's first long turn to its +last; neighbouring runs of one subject join, and a segment under 3 minutes is +dropped. The host's talk after a video's last line — his reaction to it — is +folded into it, up to 5 minutes and never past the next video's first line, +ending on a turn's end; the time before a video's first line (an intro, the +host between videos past that) is in no segment. `--segment s2` names one, +else the longest is read; `umtool clips segments <project>` lists them +(`reactions.json` `segments: [{id, from, to, subject, host, why}]`, and +`segment`, the one the scope is). The roles are still found per segment (the +subject of one video is not the next one's). On the first case (a 2.6-hour +stream reacting to two videos) it finds 292.7–6318.1 s (subject 4) and +6501.9–9276.0 s (subject 16). The steps (over the **scope**, when one is set: `--scope FROM:TO`, or the form's From/To — turns, words and laugh windows outside it are not read, and the @@ -1030,7 +1052,19 @@ recording ends at its `to`): by who laughed: the host 1, nobody 0.8, another speaker 0.6, the subject 0.5, the subject by voice 0.3) and every host turn with 1.5 s of words or more (half its length, half the - strongest laugh around it). + strongest laugh around it). With a chat replay, every **chat burst** too + (`kind: "chat"`): the chat in 2 s bins — messages, and messages with a laugh + token (lol, lmao, lmfao, KEKW, LUL, OMEGALUL, rofl, haha…, 😂, 🤣, a lone W); + a bin with 3 laughs or more and 2.5 × the median of the minute either side + is a burst; a run of them is a moment at its start minus the chat's **lag**, + scored up to 0.6 (below what a host laugh can score). The lag is how late the + chat laughs: the chat-laugh bins lined up against the laugh scan's score at + every shift from 0 to 20 s, the best (refined between bins); with no scan, or + a best correlation under 0.2, 6 s. `clips analyze` says which + (`chat: … lag 6.4 s — cross-correlated with the laugh scan (r 0.8)`), and + `reactions.json` keeps `chat: {source, lagS, lag: {how, r, why}, messages, + bursts, bins: {hop, rate[], laugh[]}}` (null without a replay). A chat burst's + reaction runs as a laugh's does; its why reads "chat laughs (N messages)…". 4. **Proposals.** From the start of the subject's sentence that set the moment up (the latest sentence start at least 3 s before it, at most `setupMax` 20 s back) through the reaction (the host's turn, at most 12 s past a laugh) to @@ -1046,6 +1080,28 @@ recording ends at its `to`): `assist: {by: "assistant", proposal, score, why, original, edits: []}`, in time order, hard cuts (`render.transition: 0`). +**A channel on no site** (release 36): with no `siteOrigin` and the channel in +no public site's `channels`/`citedChannels` (a `site.json` with a `siteUrl`), +there is no archive page for a QR, so each clip the seed or a pass writes links +its platform page at its second (`citeUrl` from the metadata's `webpage_url`: +YouTube `&t=<s>s`, Twitch `?t=<h>h<m>m<s>s`, Rumble `?start=<s>`, anything else +`t=<s>`), and a moved clip's link follows it (a link you wrote stays). The seed +writes `provenance.channel` from the metadata and the look chosen for a +one-video cut: `render` `headerHeight: 0, footerHeight: 0, qr: false, +transition: 0.5, transitionStyle: "fadeblack", loudness: {target: -16}`. With +every clip linked, an empty `siteOrigin` is not a blocking decision. + +**From the editor** (release 36): `POST /api/report/clips {mode: "new", slug, +from: "<channel>/<id>", target?, scope? ("auto", the default | "all" | [from, +to]), segment?, wordsPath?}` with `Authorization: Bearer <WORKER_TOKEN>` (no +header is the app's own page; any other is a 401) — the editor's **Find clips**. +A reactions project for the same recording whose scope covers the chosen +segment is analyzed again as it is (`created: false`: its scope, its params and +every clip you touched stay); else `slug` is made with the reactions seed and +`wordsPath` copied in as `words.json` (`created: true`). Either way `clips +analyze` runs as one job: `{jobId, job, project, created, segments, segment, +scope, href, notes}`; `GET ?job=<id>` follows it. + **A proposal pass never touches your work.** A clip whose `assist.by` is `"operator"` (the first edit flips it), a clip with no `assist`, one ruled in `montage-rulings.json` and one with a `lock*` stays exactly as it is; a @@ -1071,7 +1127,8 @@ end, score, speaker: n|null, src?: "text"|"energy", voice?: {host, subject}, by? kind: "laugh"|"comment", score, speaker: n|null, text}], proposals: [{id, start, end, score, moments, used, clipId: "r001"|null, why}], laughSource: "model"|"text"|"text+energy", scans: {laughs, voices}, madeAt, proposedAt, -rolesChangedAt?}`. The clip editor changes only a speaker's role, through +rolesChangedAt?, segments?, segment?, chat?}` (a moment's `kind` may be `"chat"`, +with `messages`). The clip editor changes only a speaker's role, through `setSpeakerRole` (`yt-dlp-transcript-common/lib/clips/reactions.mjs`), which records `rolesChangedAt` so the page can offer Re-propose. diff --git a/umtool/e2e/create.spec.ts b/umtool/e2e/create.spec.ts @@ -51,6 +51,7 @@ const WRITTEN = [ "channels/synth-two", "p36-find", "p36-find-again", + "p36-ui", ]; const clean = () => { for (const p of WRITTEN) rmSync(path.join(FIXTURE, p), { recursive: true, force: true }); @@ -302,6 +303,23 @@ test("Find clips from the editor (release 36): mode new with the worker token sc expect(existsSync(path.join(FIXTURE, "p36-find-again"))).toBe(false); }); +test("Highlights from a recording, the video found for you: the form's Video picks the 2nd narrated video", async ({ page, request }) => { + writeReactionCorpus(path.join(FIXTURE, "channels"), { channel: "synth-two", video: "two001", two: true }); + await page.goto(urls.createHref({ make: "video-highlights" })); + const f = form(page, "video-highlights"); + await f.locator("[data-new-from]").fill("synth-two/two001"); + await expect(f.locator("[data-new-seed]")).toHaveValue("reactions"); + await f.locator("[data-new-video]").selectOption("s2"); + await expect(f.locator("[data-new-scope-from]")).toBeDisabled(); + await f.locator("[data-new-slug]").fill("p36-ui"); + await f.getByRole("button", { name: "Find the clips" }).click(); + await page.waitForURL(/\/projects\/p36-ui$/, { timeout: 20_000 }); + const r = JSON.parse(readFileSync(path.join(FIXTURE, "p36-ui", "reactions.json"), "utf8")); + expect(r.params.scope).toEqual([1500, 2390]); + expect(r.segment).toBe("s2"); + await expect.poll(async () => (await (await request.get("/api/jobs")).json()).running, { timeout: 60_000 }).toBeNull(); +}); + test("Video from a sweep report: the reports on disk are offered, and one becomes a project", async ({ page }) => { await page.goto(urls.createHref({ make: "video-report" })); const f = form(page, "video-report");