Archilyzer · Source

archilyzer

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

commit 1ba49ce4a5b5c983a9516da1e2abfa899ff21734
parent ea44fabeb77596b09ae105e525cc828cc9e245f7
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 16 Oct 2026 17:48:22 -0400

plans: release 32 lane R3 as shipped — the record, FACTS, CHANGELOG

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

Diffstat:
Meditor/CHANGELOG.md | 6++++++
Mplans/FACTS.md | 44++++++++++++++++++++++++++++++++++++++++++--
Aplans/release-32/ops-buttons.md | 111+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 159 insertions(+), 2 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog ## [Unreleased] +- **A frame scan can be re-derived and corrected from its panel, with no model.** The video page's **Frame scan** panel has **Re-derive (no model)** beside the hero's screen name (what `archilyzer frames rederive` did), and **Correct a reading**: open the reading at a time, or from the **Correct** beside any event, and set a field to what the frame shows — the stack, players left, the blinds, the tournament's name, the log lines… — or **Mark misread** to set the whole reading aside. The correction is kept beside what the model read (each corrected field says what it read), the timeline is worked out again at once with your values, and every later scan and re-derive keeps them; **Clear correction** takes one back. The corrections are listed under the flags. Needs a restart of the editor. +- **Find copies of gone videos from the channel page and the site page.** The channel's Download stage (and a site's page, for all its channels) has **Find copies of gone videos**: which gone videos (no transcript, or every one with no media), at most how many lookups, and whether to try failed copies again. **Preview** looks without recording or fetching anything and lists each video with the copy it would use (the Wayback capture or the archive.org file); **Find and fetch copies**, armed by a preview of the same settings, runs it and links the find-copy job and the fetch-copies job it started. Needs a restart of the editor. +- **Audit audio from the channel page, and see the verdicts.** The Download stage has **Audit audio** (videos with no transcript, or every video holding audio; at most how many files; decode again files already audited) and a line with the channel's verdicts — clean, damaged, undecodable, and out of date where the file changed since — and when it last checked. The video page shows its audio's verdict: how much decodes and where the gaps are. The counts appear once the channel's report is regenerated. Needs a restart of the editor. +- **A video's media operations are buttons on its page.** Under **Media tools**: attach the video's file from a local archive (a folder, a .zip or a .7z; preview, then attach), make a playable copy of its saved video, and for a Wayback or archive.org record bring the channel's records up to their rules (preview, then refresh; a Wayback record's title and date can be given with it). Needs a restart of the editor. +- **More ops-only operations have buttons.** Each article on the Articles tab has **Attach video** (a video file, a poster and a caption: what `archilyzer reports attach-video --article` did). The Download stage's **More ways in** imports an archive.org item, completes a podcast channel's records from its feed, and reads an Odysee or BitChute channel's remote listing; a posts channel imports one post by its URL and captures posts by id; the Cleanup stage has **Keep videos matching** (preview the matches, then keep them). Needs a restart of the editor. +- **An Odysee channel's Configure form shows the audio check on.** The check is on by default for Odysee, but the box showed unticked; it now shows ticked with "on by default for Odysee", and unticking it turns the check off for the channel (`pnpm ops channel-config` with `"audioCheckEnabled": false` too). Needs a restart of the editor. - **Odysee downloads always get the audio check, clip windows included.** A video from Odysee — which intermittently serves corrupt audio — is downloaded with the audio check on unless its channel turns it off (`audioCheck: {"enabled": false}`); before, a channel had to opt in. A clip window from such a source now gets the check's final probe too: a malformed window is deleted and fetched once more, and if it is malformed again the fetch fails and nothing is kept, so a clip is never cut from corrupt audio. The verdict is recorded in the window's provenance. - **An article can correct what the transcripts mishear in its quotes.** `archilyzer reports respell <article> --heard "cake cup,cakeup" --reads K-Cup` previews every change — the article's quotes and citations, its report's own words, and its video's burned-in quotes and flip cards — as before → after, and writes nothing; `--apply` writes it, each file backed up first. `--bracket` shows the correction as an altered quote, `[K-Cup]`. The article records the respelling, and every quote check applies it to the transcript before comparing, so a corrected quote still verifies exactly; the transcript itself is untouched. A video shows the new words once it is rebuilt. - **`pnpm ops audio-audit` checks the audio already on disk, file by file.** `pnpm ops audio-audit --json '{"platform":"odysee"}'` (or `{"slug":"<channel>"}`; `"scope":"all"` for transcribed videos too, `"max"` to cap the files) decodes each audio file a channel holds with error tolerance — one file at a time, at the lowest CPU and disk priority — and writes what it found beside the file in `audio-integrity.json`: clean, damaged (part of it will not decode) or undecodable, with how much decodes and where the gaps are. Audio downloaded before the audio check existed, or on a channel without it, was never checked. The same command again skips the files already checked. A drive that stops answering ends that channel's run with a sentence that says so instead of hanging. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -9911,6 +9911,46 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri malformed → `FetchWindowError` `per_video` ("the source serves corrupt audio…"), nothing kept. Provenance `audioCheck: {verdict: "clean" | "partial", attempts}` (`ClipAudioCheck`, parsed tolerantly). Cached windows are not re-probed. -- The editor's Configure form writes `audioCheck` only when its box is ticked: an Odysee channel with no `audioCheck` - shows an unticked box though the check is on (owed: show the default). +- The editor's Configure form (since release 32 R3): on an Odysee channel the box shows ticked with no `audioCheck` + stored ("on by default for Odysee"); ticked with no other audio-check field → nothing written; unticked → + `{enabled: false}`. `channelConfigToFormData` ticks it the same way, so an ops patch keeps the default. + +## Release 32 lane R3: every operation has a button (verified 2026-10-16, branch `r32/ops-buttons`) + +- **Reading corrections** (`common/lib/frames/corrections.ts`): `frame-scan.<profile>.json` gains + `corrections?: [{t, at, by: "person", misread?: true, set?: {<field path>: value | null}, note?}]` — one per grid + second (coerce keeps the newest), sorted. Field paths per profile in `CORRECTABLE_FIELDS` (poker: phase, + tournament.{name, level, blinds.sb/bb/ante, playersLeft, totalPlayers, position, averageStack, prizePool, payout}, + hero.{stack, bb, bounty, cards}, hand.{pot, action}, event, log); `checkCorrectionSet` checks each by kind (whole, + number — commas allowed —, text, enum, lines, cards); null clears a field (empty objects pruned). The model's + `readings` are never rewritten. +- **The derivation applies them** (`deriveOf(…, {corrections})`): over the readings first (a duplicate copies the + corrected reading; a reading set aside is copied nowhere; a read second is never filled by a copy), then again over + the expanded list (a correction at a duplicate's own second). Idempotent. `rederiveRecord` passes the record's + corrections; `runFrameScan` carries them across every run, `fresh` included. The poker rules are unchanged: a + corrected value goes through the same smoothing and flags. +- **The controller** (`controller/frameCorrections.ts`): `frameReadingAt(paths, {slug, id, profile?, t})` → the grid + second nearest `t` (readings ∪ duplicates) with each field's `read` (model) and `value` (as derived), `copyOf`, + `prev`/`next`; `correctFrameReading(paths, {slug, id, profile?, t, set?, misread?, clear?, note?})` stores only the + fields that differ from the model's reading (none and not misread → the correction is removed), re-derives with the + cues and writes; refused while a frame-scan job of the video is queued or running (`frameScanBusy`, exported from + controller/frameScan.ts, also the rederive's guard). No ops route: the editor's actions only. +- **Snapshot `audioIntegrity`** (`AudioIntegrityTally {clean, damaged, undecodable, stale, lastCheckedAt?}`): one + count per `audio-integrity.json`, the verdict recomputed by `integrityVerdict`; `stale` when the record's file is not + in the dir's audio files or its size differs (the same name+size test the `corruptHeldAudio` bucket uses). Optional: + absent until a channel's next regen. +- **`StreamActionLog.onSettled(started, {log, jobId})`**: the second argument is new (the run's whole streamed log and + its job id). `editor/app/lib/resultMarker.ts` reads a job's last `@@<kind> {json}` line client-side; its marker + strings are pinned to the controllers' constants by its test. +- **Job kind `attach-report-video`** (queue `report-video`, not drainable, not replayable, no media guard): the + Articles tab's Attach video, `attachReportVideo` + `patchArticle`, as the CLI row. +- **Editor surfaces** (no new routes, no new ops keys): channel Download stage — `FindCopiesControl` + (`app/components/`, also on `/sites/<id>`), Audit audio, "More ways in" (import-archive-org, feed-metadata, + remote-listing for Odysee/BitChute); Cleanup — Keep videos matching (`keepVideosAction`); posts channel — + import-post, capture-posts; video page — the audit's verdict line (`aria-label="audio integrity"`), "Media tools" + (attach-media narrowed to the id — `items` when a file is named, else `match` = the escaped id —, prepare-playable + `ids: [id]`, wayback / archive-org refresh run in the request), Frame scan's Re-derive and Correct a reading + (`?reading=<s>` opens it). Find copies, attach, the archive.org import, the feed backfill, keep-matching and the + records refreshes are armed by a preview of the same settings; the playable copy (lossless, keyed by the source's + sha256) is not. diff --git a/plans/release-32/ops-buttons.md b/plans/release-32/ops-buttons.md @@ -0,0 +1,111 @@ +# Release 32, lane R3 — every operation has a button, in the editor (as shipped) + +Branch `r32/ops-buttons` from `main` `977917c7`. Brief: `r32r3-brief.md` (the plan of record for this lane). FACTS: +"Release 32 lane R3: every operation has a button" (and the Configure-form line of "The audio check's reach"). + +## What and why + +The operator's rule for the release: every step a model or the CLI can do must also be doable by a person in the UI, +and nothing built here calls a model. Each gap the brief named, verified, now has a surface where its object lives. + +- **Frame scan, with no model** (`common/lib/frames/corrections.ts`, `controller/frameCorrections.ts`; the video + page's Frame scan panel): **Re-derive (no model)** beside the hero's screen name (the panel's action refused + `rederive` before), and **Correct a reading** — open the reading at a time, or from an event's **Correct** + (`?reading=<s>`), set fields to what the frame shows or **Mark misread**, **Clear correction**. A correction is kept + in the sidecar's `corrections` beside the model's readings (never over them), only the fields that differ from the + model's reading; the derivation lays the corrections over the readings (duplicates copy the corrected reading, a + misread is copied nowhere) and every scan and re-derive keeps them. Saving re-derives at once. P2's guarantees hold: + the poker rules are untouched, a corrected value goes through the same smoothing and flags. +- **find-copy's scope mode** (`app/components/FindCopiesControl.tsx`, on the channel's Download stage and + `/sites/<id>`): which gone videos, at most N lookups, try failed copies again; **Preview** is the dry-run job, its + `@@find-copy` line read into the candidate list with the copy each would use; **Find and fetch copies** is armed by + a preview of the same settings and links the find-copy and fetch-copies jobs. +- **The audio audit** (Download stage, `audioAuditActions.ts`): scope, at most N files, decode again; the line is the + channel report's new `audioIntegrity` tally (clean, damaged, undecodable, out of date, last checked). The video page + shows the file's verdict (`describeIntegrity`, the gaps, out of date when the file changed). +- **The video's media operations** ("Media tools", `mediaToolsActions.ts`): attach from a local archive (attach-media + narrowed to this id: `items` when a file is named, else `match` = the escaped id; preview then attach), a playable + copy (prepare-playable `ids: [id]`), and for a Wayback or archive.org record the channel's records refreshed + (`refreshWaybackRecords` / `refreshArchiveOrgRecords` in the request; preview then refresh; a Wayback record's title + and date as `titles`). +- **reports attach-video** (Articles tab, `sites/lib/attachVideoAction.ts`): per article, a video file, poster and + caption → an `attach-report-video` job (new kind, queue `report-video`). +- **The rest of COMMANDS.md's channel-level ops-only rows**: the Download stage's "More ways in" (import-archive-org + one item, preview then import; feed-metadata, preview then complete; remote-listing on Odysee/BitChute), a posts + channel's import-post and capture-posts, the Cleanup stage's **Keep videos matching** (keep-videos; preview then + keep). +- **The Configure form's audio check**: an Odysee channel with no `audioCheck` shows ticked, "on by default for + Odysee"; ticked with nothing else writes nothing, unticked writes `{enabled: false}`; `channelConfigToFormData` ticks + it the same way, so `pnpm ops channel-config` keeps the default and `{"audioCheckEnabled": false}` turns it off. +- `StreamActionLog.onSettled` also hands over the run's log and job id (`{log, jobId}`), so a dry run's result marker + can be read (`app/lib/resultMarker.ts`). + +| Commit | What | +| --- | --- | +| `d1575e95` | common: reading corrections (lib + controller), `frameScanBusy`, the snapshot's `audioIntegrity` tally; tests | +| `68fc0cc7` | editor: the Frame scan panel's Re-derive and Correct a reading, the view's hero/corrections, `?reading=` | +| `e7480d7c` | editor: find copies (channel + site), Audit audio, the video page's verdict line and Media tools, `onSettled` out, resultMarker | +| `aa95ddb9` | editor: Attach video on each article; the `attach-report-video` job kind | +| `9aeb1e20` | channels: the Odysee audio-check default on the Configure form and in the ops patch | +| `790a72f5` | channels: archive.org import, feed backfill, remote listing, import-post, capture-posts | +| `1ed526da` | channels: Keep videos matching | +| `d406c560` | editor: `e2e/ops-buttons.spec.ts` | +| (this commit) | this record, FACTS, CHANGELOG | + +## Gates (from the worktree root, every heavy step through the shared lock) + +- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean (editor's tsc before each editor commit, the + full workspace before the spec commit and at the end). +- common: 4448 (4447 + 1 skipped) at the branch's start → 4455 (4454 + 1 skipped), all pass. New: `lib/frames/corrections.test.ts` 5, + `controller/frameCorrections.test.ts` 2; `controller/audioAudit.test.ts` (the tally asserted in the report test); + `jobs/jobKinds.test.ts` pins the new kind. `lib/frames/*` 87/87 with the new files. +- editor unit: 322 → 327/327 (`lib/resultMarker.test.ts` 2, `frameScanView.test.ts` +1, + `parseChannelForm.test.ts` +2). +- `docs env --check`, `docs files --check`, `docs cli --check`, `settings example --check`: clean (no CLI row, ops + key, env or settings key changed; COMMANDS.md not regenerated). +- e2e (editor, one spec, through the lock): `ops-buttons.spec.ts` **4/4 passed** in 20.9 s on its first run (the + start-mode build in the heavy slot first: TypeScript 33 s; the slot waited 1 m 52 s and 3 m 25 s behind another + project's jobs) — find-copy preview (a gone non-YouTube record: listed, no network), Audit audio (the fake + ffmpeg's damaged file: the job's `@@audio-audit`, the tally on the Download stage after the regen, the verdict on + the video page), Re-derive then Mark misread from an event and a field corrected, the Odysee audio-check default. +- test:scripts, mcp, export, homepage, umtool: not run — nothing under `umtool/`, `scripts/`, `mcp/`, `export/` or + `homepage/` changed, and the common changes they import (`deriveOf`, the frame-scan sidecar's coerce) change + nothing for a sidecar without `corrections`. + +## Decisions I made + +- **Corrections live beside the readings, and the derivation reads both** — the model's readings stay as read, so a + correction can be cleared and the record says who said what. Only differing fields are stored, so the form can + send every field it shows. +- **A correction does not bypass the derivation's rules** (P2: "keep the guarantees"): the person's value replaces + the model's in the reading, and smoothing, flags and the one-tournament rule apply as before. To take a reading out + entirely, Mark misread. +- **"Hero name" is the record's hint, not a reading field** (a reading has no hero name): it sits beside Re-derive, + as `frame-scan {rederive, hero}` takes it. +- **No ops key for corrections**: the brief asks UI for what the CLI does, not the reverse; the controller is + callable if an agent needs it later. +- **Corrections re-derive in the request and are no job** (as `rederive` is): pure code over one sidecar. +- **The Wayback / archive.org refreshes run in the request**, not as jobs: offline, over one channel's records, and + the controller already skips a record a live job holds. They are channel-wide (as the CLI) though offered on the + video page of such a record; a rename links the new id. +- **The audit tally is in the snapshot**, read where the `corruptHeldAudio` bucket already reads each sidecar — no new + walk; it shows after the job's regen (the e2e polls for it). +- **Attach video is a job on its own queue `report-video`** (an encode takes minutes), not gated by the heavy slot: + `attachReportVideo` spawns ffmpeg itself and the CLI row never was; a ≤24 MiB output is a short encode. +- **find-copy's Run is armed by a preview of the same settings** (the evict pattern), and runs its lookups again — + the preview is not replayed (a copy may have appeared or gone since). +- **The Odysee default**: ticked with no other audio-check field saves nothing (the default), so saving an Odysee + channel's form never writes `{enabled: true}` it did not have; a stored `{enabled: true}` with no other field is + saved as no key — the same behaviour. + +## Not done, and why + +- Channel-wide `media attach` (a whole archive, `--create-records`) and channel-wide `media playable` + (`--trackers`, `--root`): the buttons are per video; the channel-wide runs stay `pnpm ops attach-media` / + `prepare-playable`. +- `feeds backfill-metadata --feed <url>` (another feed than the channel's URL): the button reads the channel's URL. +- `persist-videos` in bulk: the video page's existing Persist source video covers one video. +- `storage migrate-tier` (runs only with the editor stopped), `reconcile video-dirs` (every report regen runs it), + `verify transcripts` and `diarize backfill` per video (passthrough diagnostics; the Cleanup stage's Diarize speakers + covers a channel): left on the CLI. +- No live run (the orchestrator's).