commit 1560889ecd1d1e20fb6f242786edd53022b52bd5
parent 6e5933dd984a921c1b83aef94d5bbf01ca45aa8b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sat, 10 Oct 2026 12:16:56 -0400
plans: release 23 F1 — release 20 D2 as shipped, option (b); the held section superseded
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 59 insertions(+), 1 deletion(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -130,6 +130,7 @@
- **A video whose YouTube subtitles answer "Too Many Requests" (HTTP 429) is downloaded anyway, and YouTube is not put in a cooldown for it.** YouTube refuses a subtitle file per video while the video itself downloads fine; every one of the day's 429s on 2026-10-01 was a subtitle fetch, and each failed its download, put all of YouTube in a cooldown that reached 30 minutes, and deferred the video for 6 hours to fail the same way again. Now that refusal is noted and the download goes on to the audio, as for a video with no captions, so the transcription lane transcribes it; nothing platform-wide is backed off. The video's subtitles are deferred: **Download missing subs** skips them for 6 hours, and from the third time they are refused, for 7 days; a download from the video's own page still fetches them. The download lane's page lists them under **Deferred subtitles**, and the video page says how many times and when. **Download missing subs** also goes on to the next video when one video's subtitles are refused, instead of stopping. Any other subtitle failure (a 403, a missing file, a chat replay that fails) still fails the download, as before. Needs a rebuild and restart of the editor.
- **The download pace adapts to rate limits, a rate limit that outlasts the cooldown holds the platform, and the auto-download lane waits between downloads.** Every yt-dlp run against a platform now waits its platform's current pace between requests: 1 second for YouTube and Rumble, doubled by each real rate limit (up to 16 seconds) and eased back one step after every 5 clean downloads, and one step for every hour with no rate limit; a subtitle-only refusal never raises it. When a platform has failed three times in a row at the 30-minute cooldown, it is **held**: auto-download tries it once an hour instead of every 30 minutes, and until that try is due a manual **Sync**, download or metadata scan on it is refused with a sentence giving its time. A clean try lifts the hold — the lane's, or a manual Sync, download or scan once the try is due, which is how a hold ends while auto-download is off or has nothing to fetch on that platform — and so does a try whose video came down although its subtitles were refused. The lane page keeps a held platform listed until then (saying when the lane is off), with a **Clear hold** button that drops the hold, the cooldown and the raised pace at once and says so in a job log. The auto-download lane now waits **Sleep between downloads** between two downloads on one platform, as a channel's batch downloads always did, plus whatever the pace was raised by; batch downloads add that too. The lane page's **Rate-limit cooldown** box shows held platforms, the raised paces and the deferred subtitles, the lane says when it is idle because a platform is held or it is pausing between downloads, and `archilyzer doctor` warns about a platform in a cooldown or held, and about a raised pace. **Download missing subs** also waits that gap between videos. The four numbers are the new `pacing` block in `settings.json` (SETTINGS.md). **After the restart, YouTube may be held at its first real failure:** its cooldown count from before the update (the subtitle refusals) still stands, so one failure puts it straight past the cap — **Clear hold** on the download lane's page resets it, and a clean download does too. Needs a rebuild and restart of the editor.
- **A podcast channel's episodes imported by their enclosure URL get their titles and dates back from the feed.** Such a record carried only its file name as its title and no upload date, so the index skipped it and every surface showed the file id. `archilyzer feeds backfill-metadata <slug> [--feed <url>] [--dry-run]`, `POST /api/ops/feed-metadata {slug, dryRun?}` and `pnpm ops feed-metadata` (the new `feed-metadata` job, on the channel's download queue) fetch the channel's RSS feed once — no media — and match each record lacking a date or a real title to an item by guid, enclosure URL or enclosure file name; a record more than one item fits is reported, not guessed. A match fills in what the record lacks: the title, the description as plain text, the duration (a measured one is kept), the upload date and timestamp in UTC, and `webpage_url` only when the new URL keeps the record's id. Every change is a `feed-backfill` entry in the video's metadata history; a dry run counts matched, unmatched and already complete and writes nothing. Rebuild the index afterwards for the titles and dates to reach search and the sites.
+- **A Twitch VOD cited by its published id is found on disk.** A Twitch video's folder is named by its number while its record (and its public page) says `v` and the number, so a clip fetch asked by the record's id (the MCP's `fetch_clip`, **Fetch missing evidence**, `pnpm ops fetch-windows`), a site's evidence clips and its missing-evidence list, and umtool's local cue lookup looked in a folder that does not exist: a clip or saved video already on disk was not found, and the video's availability and length were not read. They now look in the video's own folder. Published ids and URLs do not change. Needs a rebuild and restart of the editor and of umtool.
## [0.11.0] - 2026-09-30
- **Transcripts that arrived after a video was first seen are counted.** The stats behind the homepage, the hub and every site's charts were cached per video and refreshed only when the video's metadata changed, so a transcript that came later — a Whisper run days after the download, or a video downloaded after the last index build — never reached them, and a video with YouTube captions alone had no transcription date. Counts and charts were low; the homepage could show a site with 0 transcripts, 0 channels and 0 hours while it served its videos. A stat is now also redone whenever the index re-reads the video, every transcript has a date, and a captioned video is dated by when its captions arrived rather than by a later Normalize run, so its place on "Transcribed over time" can move. **After updating, rebuild and restart the editor before anything else:** until then, **Build stats dataset** runs the old code and would undo the new stats, while a site, hub or homepage build already runs the new code — and the first stats build of any kind re-reads every video once (about 10–30 minutes on a large archive; it can be stopped and picks up where it stopped). Then build the index, the stats, the homepage, the hub, and the sites.
diff --git a/plans/release-20.md b/plans/release-20.md
@@ -88,7 +88,7 @@ coverage reads.
channels whose name or URL says VODs, mirror or archive (listed in the track report). No channel's config was changed;
the patterns are the operator's to write.
-### Slice D2 — one Twitch id: held, operator ruling owed
+### Slice D2 — one Twitch id: held, operator ruling owed (superseded: ruled option (b), shipped as release 23 F1 below)
Built as `433815d4` and reverted on this branch; the build is kept on `r20/twitch-ids` (orchestrator, 2026-10-10:
it changes published URLs, which is the operator's ruling).
@@ -128,6 +128,63 @@ after the upload dropped; a changed rule re-derives once, a removed one drops th
(release 21 D2's tests included), and after the revert the touched index, normalize, caption-track and architecture tests 54/54, tsc clean; editor unit 228/228; export unit 118/118;
mcp 293/293; `archilyzer docs files --check` and `docs env --check` clean. E2E, one run in the foreground (start of the queue after the heavy slot freed): `transcript-source.spec.ts` (D3's index spec, 4) and `ops-api.spec.ts` (13, the channel-config round trip among them) — 17 passed, 1.5 min. Release end per the plan: the full editor suite once, the orchestrator's.
+### Slice D2, as shipped — option (b) (release 23 F1)
+
+**Ruled 2026-10-10: option (b).** The published `v<n>` stays; the join normalizes on the directory side. Built on
+`r23/fixes` (release 23 Lane 1); the held build on `r20/twitch-ids` is not used (its test cases are, without its
+re-keying of records).
+
+**The helper.** `common/lib/videoDirId.mjs` (pure, client-safe; re-exported by `lib/videoId.ts`):
+`twitchVodDirId` (`v<n>` → `<n>`), `twitchVodRecordId` (the reverse), `channelConfigPlatform` (config `platform`, else
+its `url`'s host), `pickVideoDirId`. Its disk half, `lib/videoDir-server.mjs`: `resolveVideoDirId` /
+`resolveVideoDir(channelsDir, slug, recordId, {platform?})`. Plain JS for umtool's bare-node scripts (the
+`detectPlatform.mjs` precedent; both exported by exact path from common's `package.json`).
+- An id that is not `v<digits>` passes through with no read.
+- A `v<digits>` id maps only for a Twitch record: the platform the caller passes, else the channel's config. Any other
+ platform's `v`-id (a Rumble slug, a YouTube id that reads `v` + ten digits) is never mapped.
+- The directory that exists wins, `<n>` first, then `v<n>`; with neither, `<n>` (so a fetch-window creates the
+ canonical one).
+
+**The join points** (release 20 D2's list, found in the tree):
+- the editor's fetch-window: `fetchWindowAction` and `fetchFullSourceAction` (`videoActions.ts`) name the video by
+ its directory from the config read on (cache, saved container, job, revalidated page); the in-flight dedupe asks
+ under both ids. The batch planner (`videos/fetchWindowsAction.ts`) and `controller/fetchWindows.ts` resolve each
+ item's directory and keep the item's record id in every result;
+- the evidence-clip tiers (`common/lib/evidenceClip.mjs`, a new async `recordDirOf`; `TierContext.platform`
+ optional) and `evidenceClip-server.ts` `recordDuration`, behind reports prepare and report-to-video's local
+ sources;
+- `publish/reportMedia.ts`'s per-record availability read (one line);
+- umtool `report-to-video/cues.mjs`'s local cue lookup.
+
+Records and published ids are unchanged; no index re-key.
+
+**Live corpus, offline and read-only** (a script over the channels' data dirs, and a key-only `byChannel` scan of
+the LMDB index opened `readOnly`; counts only): hasanabi 180 records, all `v<n>`, none equal to its directory; the
+plain join finds 0, the helper maps 180 to an existing `data/<n>/`, 0 unmatched. shondo-twitch 37: plain 0, helper 37,
+0 unmatched.
+
+**Found and left (other owners or outside D2's list):** these still join a record's id to `data/<id>/` directly and
+miss a Twitch citation: `publish/composeReports.ts` `readCitedRecord` (Lane 2's file this release: a report citing a
+Twitch `v<n>` record reads no record), `lib/report/convert-server.ts` (report convert's cue read), umtool
+`lib/projects/report.mjs` (`cuePathFor`, and the duration probe in `clipWindowDirs`) and
+`report-to-video/check-availability.mjs` (`cueMeta`). Each is one `resolveVideoDir` call.
+
+**Commits**
+
+| Commit | What |
+|---|---|
+| `5f1f4c0a` | `common:` F1 — the helper, the join points, the tests |
+
+**Gates.** tsc clean (`pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`). New tests:
+`lib/videoDirId.test.ts` 6 (D2's id cases, the platform rule, the pick order, the disk resolver over a temp corpus),
+`lib/evidenceClip-server.test.ts` +1 (every tier and the duration clamp through `data/<n>/`; a non-Twitch channel's
+`v`-id is not mapped), `publish/reportMediaTwitch.test.ts` 1 (cached, gone and missing citations; ids as cited —
+fails without the availability line), `controller/fetchWindows.test.ts` +1 (cache hit and fetch under `<n>`),
+editor `videos/fetchWindowTwitch.test.ts` 2 (both editor doors), umtool `cues.test.mjs` +1. Common suite 3,681: 3,670
+pass, 11 fail — the same 11 fail on `d3296bab` without this change (`attachMedia.test.ts` 8, `preparePlayable.test.ts`
+2 — environment — and `fetchPosts.test.ts` 1, a drain timing that passes alone). Editor unit 239/239;
+`test:scripts` 759 pass, 3 skipped, 0 fail (the cwd-join trace guard among them).
+
## As it went
**The whisper red: "Clear failure list" unmounted its own log** (`r20/whisper-fix`). `whisper.spec.ts:184`