Archilyzer · Source

archilyzer

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

commit 97cf526e66e18edf5b66becb5601329a8f02e6a8
parent 6792f35e4e715e1e22cdada4f9e6f6ea4d614413
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 16 Oct 2026 19:40:26 -0400

plans: release 32 lane R5 as shipped — a clip window from the stored media URL (record, FACTS, changelog)

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

Diffstat:
Meditor/CHANGELOG.md | 1+
Mplans/FACTS.md | 30++++++++++++++++++++++++++++++
Aplans/release-32/stored-url.md | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +- **A clip window can be cut from the media URL an Odysee record already stores, when Odysee's lookup is rate-limited.** `pnpm ops fetch-windows` takes `"storedUrl"`: `"fallback"` tries the page as before and, when the lookup answers 429, cuts the window from the file the record's `metadata.info.json` names on Odysee's CDN (`*.odycdn.com`) instead; `"only"` goes straight to that file and asks the page nothing. A held or cooling Odysee no longer refuses those windows — only the ones with no stored file are refused or left for a later run. Same queue, same gaps between fetches, the audio check still applies, and the window's provenance says `source: "stored-media-url"` with the host. The default, `"never"`, changes nothing; only Odysee is allowed. Needs a restart of the editor. - **umtool's drafts review is an audition deck: hear the cited moment, then keep it or cut it.** `/projects/<project>/review` shows one card per drafted field still waiting for a verdict: the drafted value large, the cited span of its clip playing (video when a window or saved video holds it, else audio marked "audio only"), and the quote under it lighting word by word as it is spoken. Swipe right, → or `k` keeps it (approves); left, ← or `x` cuts it (rejects — tap a reason chip or write a few words, never required); up, ↑ or `e` edits it on the card (on-screen text, narration, teaser lines and the YouTube title; Enter keeps it as edited); down, ↓ or `s` skips it to the back; space replays the span; `z` undoes the last keep, cut or skip. Tap a word to mark it misheard: the note says so. Every action is also a button (a bar under the thumb on a phone). The next card's media is already loading, and the deck ends with what was cut and skipped. Verdicts are the same `drafts.review.json` as before; **List** (`?view=list`) is the old list, whose reader now plays the span too. No model is needed for any of it. - **Fetch clip wherever a citation is shown in umtool.** When nothing on disk holds a cited span — on the deck, in the list's reader, on an article's evidence panel and its evidence walk — **Fetch clip** asks the editor for those seconds exactly as the MCP's `fetch_clip` does, shows its progress, and plays the window when it lands. A rate limit says the platform is rate-limiting; a window the audio check refused says the source served corrupt audio. The evidence panel plays video first and has **Play span** (from the span's start to its end). - **Verify quotes and Check report on an article's page.** The Article tab has **Verify quotes** (what `archilyzer reports verify-quotes --article <id>` prints: each quote's status — ok, fragment, inexact, drift, en-orig-drift — its score and track, with **Play** to hear it) and **Check report** (what `archilyzer reports check --article <id>` says: compose would pass, or each problem in its own sentence, with **Play** where it names a citation; **allow missing media** as `--allow-missing-media`). The article's respellings apply. Needs a restart of umtool. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -10056,3 +10056,33 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri - **Cookie spec `file:<path>`** (`cookiePolicy.ts` `cookieArgs`, `cookieFileOf`; gallery-dl's login args) → `--cookies <path>`; any other spec stays `--cookies-from-browser <spec>`. `file:` with no path → no flag. - **First run:** the dashboard's `FirstRunPanel` renders only while the actionable summary has zero channels. + +## Release 32 lane R5: a clip window from the stored media URL (verified 2026-10-16, branch `r32/stored-url`) + +- **`lib/storedMediaUrl.ts`** (pure) + **`lib/storedMediaUrl-server.ts`** (`storedMediaUrl(videoDir)`, reads + `metadata.info.json`, null on any failure). Trusted only when the record's `webpage_url` (else `original_url`) is a + platform in `STORED_URL_PLATFORMS = ["odysee"]`, the record has exactly ONE format (or no `formats` and a top-level + `url`), its `protocol` is absent or `http`/`https`, the URL is http(s) with no credentials, and its host passes the + platform's CDN test (Odysee: hostname ends `.odycdn.com`). The Referer sent is pinned per platform + (`https://odysee.com/`), not read from the file. Live shape (cornbreadman, 2026-10-16): one format `original`, + `https://player.odycdn.com/v6/streams/<claim>/<hash>.mp4`, height 720, `protocol: https`. +- **`storedUrl: "never" | "fallback" | "only"`** on the fetch-windows body (route, `fetchWindowsAction`, + `fetchMissingEvidenceAction`, the job spec's `params.storedUrl` for Retry, `fetchWindows({storedUrl})`). Default + `never` = the old code path exactly. Never used for an item with `copy` (find-copy's URL is another recording). +- **The controller's rules (stored modes):** `only` + a stored URL → no page request. A platform held, cooling, or + rate-limited earlier in the run goes into a per-run `limited` map: its stored-URL items run via the stored URL + (`why` held | rate-limited), the rest go to `notAttempted` and `result.stopped ??= held | cooldown | rate-limit` + (the job then ends failed "Stopped (…)"). `fallback`: a page `rate_limit` on an item with a stored URL → the gap → + the stored-URL fetch (the page's backoff is already recorded by fetchWindowManaged). A stored-URL success never + calls `recordPlatformClean`; a 429 from the stored URL itself stops the run as before. Gaps and the gap key + (`clip-window:<platform>`) are unchanged. `result.storedUrl` lists the items fetched that way (a subset of `fetched`). +- **The editor's door** (`storedUrlDoor` in `controller/fetchWindows.ts`): a refused group (held/cooldown) with a stored + mode starts its job with the items whose record stores a trusted URL and refuses the rest (`refused[].items` = the + rest). The dry run's group carries `storedUrlItems` only when a stored mode was asked. +- **`fetchWindowManaged({storedMedia})`**: the yt-dlp target is the stored URL, `-f copyClipFormatSelector`, + `--add-headers Referer:<referer>`, everything else as a page fetch; `videoUrl` stays the PAGE URL, so the platform + args and `audioCheckApplies` key on it (`detectPlatform(<odycdn url>)` is null). Provenance gains + `source: "stored-media-url"` (`CLIP_WINDOW_SOURCES`) and `sourceHost`; the log says + `cut from the stored media URL (<host>) — <platform> lookup rate-limited|held` or `(asked: only)`. +- Not wired: the single `/api/media/fetch-window` route and the MCP's `fetch_clip` (which posts to that route, not to + fetch-windows), and any UI toggle. diff --git a/plans/release-32/stored-url.md b/plans/release-32/stored-url.md @@ -0,0 +1,55 @@ +# Release 32 lane R5 — a clip window from the stored media URL when the lookup is rate-limited (as shipped) + +Live (2026-10-16): Odysee answers 429 to yt-dlp's page/API lookup (`[lbry] … HTTP Error 429`) on the first request of a +run, hours apart, with cookies; the fetch-windows job stops (`stopped: rate-limit`) and the platform is held, so later +runs are refused at the door. Every held Odysee record's `metadata.info.json` already stores its media: one format on +`player.odycdn.com`, a different endpoint. Ruling (operator): for this case, cut the window from that stored URL; +opt-in per request. + +## What + +- `common/lib/storedMediaUrl.ts` (pure) + `storedMediaUrl-server.ts`: `storedMediaUrl(videoDir)` → `{url, host, + platform, referer}` or null. Allowlist `STORED_URL_PLATFORMS = ["odysee"]`; CDN hosts `*.odycdn.com`; one format + (or the top-level `url` when there are none), http(s) only, no manifest protocol, no credentials. +- `fetchWindows({storedUrl})`, `"never" | "fallback" | "only"`, default `never` (the old path). `fallback`: the page + first; on a page `rate_limit` the window is cut from the stored URL after the gap. `only`: no page request. A platform + held, cooling or rate-limited earlier in the run does not stop its stored-URL items; its items without one are + `notAttempted` and the run reports the stop. The backoff is still recorded; a stored-URL success never records the + platform clean; a 429 from the stored URL itself stops the run. Same queue, same gaps. `result.storedUrl` lists them. +- `fetchWindowManaged({storedMedia})`: yt-dlp gets the stored URL, `copyClipFormatSelector`, `--add-headers + Referer:https://odysee.com/`, `--download-sections` as before; `videoUrl` stays the page URL, so the audio check + (`audioCheckApplies(config, pageUrl)`) and its final probe + one re-fetch still apply. +- Provenance: `source: "stored-media-url"` (`CLIP_WINDOW_SOURCES`, parsed tolerantly) and `sourceHost`. The log: + `cut from the stored media URL (player.odycdn.com) — odysee lookup rate-limited` | `— odysee lookup held` | + `(asked: only)`. +- Editor: `fetchWindowsAction` / the ops route take `storedUrl` (validated; siteId bodies too); a held or cooling + group with a stored mode starts its job with the windows that have a stored URL and refuses the rest + (`storedUrlDoor`); the dry run's group carries `storedUrlItems`; the job spec keeps `storedUrl` for Retry. +- `pnpm ops fetch-windows` help, COMMANDS.md regenerated. + +## Files + +`common/lib/storedMediaUrl.ts`, `common/lib/storedMediaUrl-server.ts`, `common/lib/clipWindow.ts`, +`common/ytdlp/fetchWindowManaged.ts`, `common/controller/fetchWindows.ts`, +`editor/app/channels/[slug]/videos/fetchWindowsAction.ts`, `editor/app/api/ops/fetch-windows/route.ts`, +`editor/app/jobs/jobReplayRegistry.ts`, `scripts/archilyzer-ops.mjs`, `COMMANDS.md`. Tests: +`common/lib/storedMediaUrl.test.ts` (7), `common/controller/fetchWindowsStoredUrl.test.ts` (13), +`editor/app/channels/[slug]/videos/fetchWindowsStoredUrl.test.ts` (3), `editor/app/api/ops/fetch-windows/route.test.ts` +(+1 test, +2 cases). + +## Gates + +tsc clean. common 4488 → 4508 (4507 pass + 1 skipped); editor 327 → 331; scripts 1052 (1048 + 4 skipped); docs cli, +env, files and settings example checks clean. mcp not touched (its `fetch_clip` posts to the single fetch-window +route, not to fetch-windows). No e2e named for this lane (no UI). + +## Rulings followed + +Opt-in per request, default `never`; allowlist of one platform and its CDN hosts; one stream, real gaps (the gap key +and the gap are the page fetch's); the audio check keys on the page URL; no model, no live network in any test. + +## Owed + +- A UI toggle (the operator's UI-without-AI rule): "Cut from the stored media URL" on the Reports tab's Fetch missing + evidence and the video page's window fetch. +- `storedUrl` on the single `/api/media/fetch-window` route and the MCP's `fetch_clip`.