commit e73dd8d55dc45bc9e79aba6e0130871594cd0299
parent bddd20472b20f0238c1481ec151fa159b834081f
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Mon, 19 Oct 2026 14:01:31 -0400
plans: release 36 lane B -- the record (auto-scope, the chat, site-less links, the clips route's mode "new"), gates
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 114 insertions(+), 0 deletions(-)
diff --git a/plans/release-36/clip-analysis-2.md b/plans/release-36/clip-analysis-2.md
@@ -0,0 +1,114 @@
+# Release 36 lane B — `r36/clip-analysis-2`: auto-scope, the chat, site-less links (as shipped)
+
+The plan of record is [clip-finder-2.md](clip-finder-2.md); this lane is its analysis half, extending release 35
+C1's clip finder ([../release-35/clip-analysis.md](../release-35/clip-analysis.md)): where in a reaction stream each
+narrated video is, the stream's chat as a second ear, links and a look for a channel on no site, and the umtool
+route the editor's Find clips (lane A) calls. Lane D (the optional AI pass) builds on this branch.
+
+## What
+
+- **Auto-scope** — `common/lib/clips/segments.mjs` (pure, `.d.mts`): `findSegments({turns, duration, host?,
+ operator?})` → `[{id: "s1", from, to, subject, host, why}]`. The host (the operator's, else assignRoles' over the
+ whole recording) is left out of the counting; 300 s windows every 30 s; a window's subject is the non-host cluster
+ with the most seconds in turns ≥ 8 s, counted at ≥ 60 s and ≥ 60 % of that time; a run of one subject is a span
+ from its first long turn to its last; same-subject neighbours join, spans < 180 s drop; the host's talk after a
+ video's last line folds in (≤ 300 s, never past the next video's first line, ending on a turn's end); nothing
+ before a video's first line is folded. `pickSegment` (named, else the longest), `scopeOverlapsSegment`.
+ reactions.json gains `segments` and `segment` on every pass; roles stay per segment (the existing role code over
+ the scope's turns; the operator's roles win). `--scope auto` / `--segment sN` on `umtool new --seed reactions` and
+ `clips analyze|propose` (resolved to numbers, kept in `params.scope`), `umtool clips segments <project>`, the job's
+ `scope: "auto"`, and the Create form's **Video** picker (`[data-new-video]`: the longest, or the 1st/2nd/3rd found).
+- **The chat signal** — `common/lib/clips/chat.mjs`: `readChatCues` (reads `live_chat.cues.json` itself — lib may not
+ import controller, and the module is plain ESM), `isChatLaugh` (lol, lmao, lmfao, KEKW, LUL, OMEGALUL, rofl,
+ haha…, 😂, 🤣, the `:face-with-tears-of-joy:` emote, a lone W), `chatBins` (2 s: messages, laughing messages),
+ `chatLag` (Pearson r over shifts 0–20 s against the CED score binned to 2 s, parabola-refined; no scan, no variance
+ or r < 0.2 → 6 s), `chatMoments` (≥ 3 laughs and ≥ 2.5 × the ±60 s median, at least 1; runs → a moment at start −
+ lag, scored ≤ 0.6). `analyze` takes `chat` and adds `kind: "chat"` moments (a laugh's span rules; why "chat laughs
+ (N messages) …"); reactions.json `chat: {source, lagS, lag {how, r, why}, messages, bursts, bins {hop, rate[],
+ laugh[]}} | null`; `clips analyze` logs `chat: … lag X s — …`. No chat file: release 35's analysis byte for byte.
+- **Site-less links** — `watchUrlAt(url, s)` (`common/lib/clips/assist.mjs`: YouTube `t=<s>s`, Twitch
+ `t=<h>h<m>m<s>s`, Rumble `start=<s>`, else `t=<s>`) and `applyProposals(…, {citeUrlAt})`: with no siteOrigin and the
+ channel on no PUBLIC site (a site.json with a `siteUrl` listing it), every clip the seed or a pass adds or moves
+ carries `citeUrl` at its cite; a derived link follows its clip, one somebody wrote stays (`siteLessLinks`,
+ `channelOnPublicSite` in `umtool/lib/report/reactions.mjs`). The seed fills `provenance.channel` from the metadata.
+- **The site-less look** — the seed writes `SITELESS_LOOK` (`umtool/lib/projects/scaffold.mjs`): `headerHeight 0,
+ footerHeight 0, qr false, transition 0.5, transitionStyle "fadeblack", loudness {target: -16}` (else hard cuts, as
+ before). Lint and the build refuse no unknown render key (checked: `lintManifest(…, {validators: true})` on a
+ seeded manifest), so `loudness` waits harmlessly for lane C's validator and renderer. An empty siteOrigin with every
+ clip linked (no card, no post) is no longer a "dead QR origin" flag or blocking decision (`report.mjs`
+ `originUnused`).
+- **The route** — `umtool/app/api/report/clips/route.ts`: every POST through `routeCaller` (`agentAuth.mjs`: no header
+ = the page, `Bearer <WORKER_TOKEN>` = the editor, else 401), every POST answers `jobId`; `mode: "new"`
+ (`umtool/lib/report/clipsNew.mjs` `planClipsNew`): a reactions project for the same recording whose scope covers the
+ chosen segment is analyzed again as it is, with `--keep-cut` (`created: false`: nothing in the cut moves, goes or
+ is added; the new proposals are listed unused), else `slug` is scaffolded with the reactions seed and
+ `wordsPath` copied in as `words.json` (`created: true`); then one `clips analyze` job → `{jobId, job, project,
+ created, segments, segment, scope, href, notes}`. GET `?project=` adds `segments`, `segment`, `chat`.
+- **Test kit** — `testing/clips/reactionStream.mjs`: `twoVideoStream()`, `reactionChat(o)`, and
+ `writeReactionCorpus`'s `two`, `chat`, `meta` options (synthetic only).
+
+## Interfaces (exported)
+
+`findSegments`, `pickSegment`, `scopeOverlapsSegment`, `SEGMENT_*` (segments.mjs); `readChatCues`, `isChatLaugh`,
+`chatMessage`, `chatBins`, `chatLag`, `chatMoments`, `CHAT_*` (chat.mjs); `watchUrlAt`, `applyProposals`'s and
+`clipFromProposal`'s `citeUrlAt` (assist.mjs); `findMoments`'s `chat`, `analyze`'s `chat` in and out (clips.mjs);
+umtool `recordingSegments`, `segmentOfScope`, `autoScope`, `resolveParams`, `projectSegments`, `channelOnPublicSite`,
+`siteLessLinks`, `chatLine` (reactions.mjs), `planClipsNew`, `parseNewBody`, `projectsCovering`, `ClipsNewError`
+(clipsNew.mjs), `routeCaller` (agentAuth.mjs), `SITELESS_LOOK` (scaffold.mjs), `originUnused` (report.mjs).
+
+## The live case's numbers
+
+`harmful-opinions/fGSRhEWc9M4` (audioSeconds 9367.9, read-only): s1 **292.68–6318.09** (subject 4, host 1; expected
+≈ 290–6300) and s2 **6501.93–9276.01** (subject 16; expected ≈ 6500–9278) — every edge within 18 s. A dry
+`clips propose` on a copy of the first case's project gives the same moments, laughs, speakers and proposals as
+`main` (the brought-in comment now counts toward the target first, so both drop r021 and add r031 — release 35's
+rule, not this lane's); its 18 kept clips' hand-written citeUrls equal the derived ones, so none is re-pointed.
+With `--keep-cut` (what the editor's Find clips runs on an existing project) the same dry pass is `clips +0 ~0 -0`:
+21 clips in the cut, 657 s, the other 91 proposals listed unused.
+
+## Rulings followed
+
+- The UI works without AI: every step here is arithmetic over turns, words, the sound's scores and the chat; nothing
+ calls a model. Auto-scope has a form control; the chat needs nothing.
+- Release 35's proposal rules stand: an operator's, ruled or locked clip is never moved. A re-analysis from the
+ editor keeps the project's own scope and its whole cut (`--keep-cut`): the plan's "operator edits stand; chat
+ proposals show as unused".
+- No corpus content in fixtures; records state rulings.
+
+## Commits
+
+| sha | what |
+|---|---|
+| `1b636348` | clips: auto-scope — segments, `--scope auto` / `--segment`, `clips segments`; the test kit's two-video stream + chat |
+| `3a9a5c3c` | clips: the chat signal — chat moments, the lag; release 35's output pinned |
+| `76a205b1` | umtool: `/api/report/clips` — the worker token and `mode: "new"` |
+| `643ecaaf` | clips: site-less links and the site-less look; no dead-origin decision when every clip links itself |
+| `5164c59e` | umtool: the Create form's Video picker; docs, FACTS, CHANGELOG |
+| `c233df3d` | clips: `--keep-cut` — the editor's re-analysis of a project already cut leaves the cut as it is |
+| (this) | plans: this record |
+
+## Gates (all through the shared lock, from the worktree root)
+
+- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit` — clean before every commit (six runs; the last at
+ `c233df3d`'s tree).
+- common `pnpm --filter yt-dlp-transcript-common test` — **4663 tests, 4661 pass, 2 skipped**, 0 fail. Before this
+ lane: 4651 (the first baseline run counted 4655, having picked up `segments.test.ts`'s 4 already on disk). New: 12
+ (`segments.test.ts` 4, `chat.test.ts` 6, `links.test.ts` 2).
+- `pnpm run test:scripts` — **1263 tests, 1259 pass, 4 skipped**, 0 fail. Before: 1255 (the baseline's 1256 held one
+ test of the new file). New: 8 in `umtool/lib/report/reactions-r36.test.mjs`; `reactions.test.mjs` unchanged and
+ green.
+- umtool `pnpm --filter umtool test` — 45 / 45 (unchanged).
+- `pnpm archilyzer docs env --check`, `docs cli --check`, `docs files --check` — clean (no env, CLI row or schema
+ touched).
+- e2e (umtool, `E2E_MODE=dev`, one run): `create.spec.ts` + `clip-editor.spec.ts` — **14 passed, 0 failed, 1.7 min**
+ (three new create tests: the route's `mode: "new"` + 401 + `created: false`; the Video picker; the existing
+ Highlights test unchanged and green). Run with `--keep-cut` in the tree before its commit (the same code).
+- No build: the slice's e2e ran under `next dev`.
+
+## Found and left
+
+- A plain `clips propose` on the first case's project (main's code and this branch alike) drops r021 and adds r031:
+ the operator's brought-in comment counts toward the 600 s target first. `--keep-cut` (the editor's path) does not.
+- `render.loudness` is written but drawn by nobody until lane C's renderer; its validator is lane C's.
+- The clip editor does not show `segments` or the chat's lag yet (GET `?project=` carries them; lanes C/D own that
+ page).