Archilyzer · Source

archilyzer

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

commit 4211b45fc861d64078a9363690ec7904146a2cb9
parent cc24a9a97722239decbaacacd783a40071f221c5
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Thu, 15 Oct 2026 17:18:59 -0400

umtool, plans: a frame-scan draft's on-screen text is code's draft (drafted.onscreen, model "code": no review row, an edit makes it the operator's); FACTS "Release 30 lane P: the frame scan"; CHANGELOG

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

Diffstat:
Meditor/CHANGELOG.md | 2++
Mplans/FACTS.md | 41+++++++++++++++++++++++++++++++++++++++++
Mumtool/report-to-video/frames-cut.mjs | 5++++-
Mumtool/report-to-video/frames-cut.test.mjs | 1+
4 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +- **A saved stream can be scanned frame by frame for a poker tournament's progress.** On a video whose source is in the saved-video store, the video page's new **Frame scan** panel has **Scan frames** (or `pnpm ops frame-scan --json '{"slug":"<channel>","id":"<video>"}'`). The scan takes a frame every 10 seconds (keyframes only, so a 4-hour stream decodes in a minute or two), skips frames that show the same picture as the last one read, and has a vision model read the poker client in the rest: the phase (table, lobby, break), the tournament's name, level, blinds and players left, the hero's chips, the board, an all-in or a bust shown on screen. It also reads the numbers the streamer says in the transcript ("eighty five players left", "the average stack is…"). From both, code works out each tournament's chip and players-left series (one wild reading between two that agree is set aside as a misread), the events (a double-up, a big loss, a bust, the final table, a win), the phases, and a flag wherever a spoken number and a frame disagree. The panel shows the phases as a strip, a small chart per tournament, the events (each time a link to that moment on the video's platform) and the flags. Everything is written to `frame-scan.poker.json` beside the video; the frames themselves are a cache on the channel's media drive, removed with `{"evict": true}`. Scanning again only reads frames not read yet. It runs on the Claude API by default (`settings.generation.frames`: Claude Haiku 4.5, a $5 cap a scan, the day's cap as for every generation) or on a local vision model (route `frames` to `local`). Needs a restart of the editor. +- **`umtool new <slug> --from <channel>/<video> --seed frames` drafts a supercut from a frame scan.** One clip around each event, cut at the transcript's sentence edges, each with the running stats as its on-screen subtitle ("Level 5 · 9 left · 9,000 chips (22.5 BB)"), and the stats along each clip kept in the manifest's `frameScan` block for a stats overlay (not drawn yet). Review each clip in the bench before keeping it. - **find-copy can fetch from an archive.org copy that is a single video file.** Such a file's fetch failed with "Requested format is not available" and the copy was then marked as failed. A copy's window is now cut from whatever single file it is, and a copy is marked failed only when the copy itself is gone or refused. `pnpm ops find-copy --json '{"article": "<id>", "retryFailed": true}'` tries copies marked failed again. Needs a restart of the editor. - **A model can propose verdicts for a fact-check's unruled claims, for you to approve or reject.** `pnpm ops report-draft --json '{"task":"verdicts","article":"<id>"}'` asks each claim with no verdict, with the verdict bench's own prompt, and keeps each proposed verdict, its reason, the model and the prompt version in `verdicts.proposed.json` beside the article, never in `report.json`. It runs only on a model you ticked on the verdict bench (`settings.generation.verdicts.models`, empty until you do), and never sets a verdict itself. umtool's Inbox shows "N verdicts proposed" under Review; **Review verdicts** opens the article, where each proposal has **Approve** (the claim gets that verdict) and **Reject** (the claim stays unruled), with an optional note. A claim you have ruled, or whose proposal you have reviewed, is not asked again. `pnpm ops verdict-review` does the same from the command line. Needs a restart of the editor and umtool. - **Draft everything can add the on-screen deck first.** Tick **with the deck** beside **Draft everything** on a cut's Media tab (or `umtool chain <article> <n> --draft-all --deck`): before the flips, a step adds the on-screen deck with every setting at its default to a cut that has none, so the flips and threads are drafted on a cut the converter made. A copy of the cut as it was is kept in its revisions first. A cut that already has a deck is left as it is, and the step says "deck added" or "deck already there". Off by default: without the tick, Draft everything is as it was. Needs a restart of umtool. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -9604,3 +9604,44 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri `planArticleDelete` refuses while it is live. `settings.generation.verdicts.window {mode, seconds}` (default seconds, 60) is the window proposals read; umtool's bar form writes the run's. `benchItemsHash` covers the claim's text and its quotes' spans. + +## Release 30 lane P: the frame scan (verified 2026-10-15, branch `r30/frame-scan`) + +- **Files.** `channels/<slug>/data/<id>/frame-scan.<profile>.json` (declared with `sidecar()` per profile in + `common/lib/frameScan-server.ts`; `poker` is the only profile) — TEXT, never published. The frame CACHE is + `channels/<slug>/media/<id>/frames/<profile>/` when the channel has a `media` (dir or link), else + `data/<id>/frames/<profile>/` (`frameCacheDirOf`): JPEGs named by centisecond (`t000012340.jpg`) plus + `index.json` `{everySeconds, width, keyframesOnly, frames: [{t, file, hash}]}`. Evictable (`frame-scan {evict}`); + deleting the video's `media/<id>/` takes it. +- **The sidecar**: `{format: "archilyzer-frame-scan", version: 1, profile, source: {savedVideo (basename), + durationSeconds}, sampling: {everySeconds, from, to, width, keyframesOnly, frames, kept, skippedDuplicates}, model: + {route, model, promptVersion}, costUsd (all runs), runs: [{at, jobId?, model, route, frames, read, failed, costUsd, + stopped?: cap|cancelled|errors|maxFrames}], readings: [{t, phase, tournament?, hero?, hand?, event?}] (read frames + only), duplicates: [[t, the read frame's t]], spoken: [{t, field, value, text, approx?}], derived: {tournaments: + [{key, name?, from, to, series: {stack, stackBB, playersLeft, level: [[t, v] | [t, v, "spoken"]]}, facts}], events: + [{t, kind, detail, source: frame|series|spoken, tournament?}], segments: [{from, to, phase, tournament?}], flags: + [{t, field, spoken, frame, frameT, tournament?}], misreads: [{t, field, value}]}, updatedAt}`. Every `t` is SOURCE + seconds on the sampling grid (`from + k·everySeconds`); with keyframes-only sampling the picture is the keyframe + nearest it. +- **Resume** is by grid time: a reading in the sidecar is never asked again; a frame whose dHash (17×16 grey + thumbnail, `lib/frames/dhash.ts`) is within the profile's `dupMaxBits` of the last READ frame is not asked (re-read + every `rereadEvery`); the derivation reads duplicates as copies of the frame they show. +- **The reading** is the model's; everything else is code: `coercePokerReading` (ranges, enums, card format, misread + pairs dropped), `derivePoker` (series per tournament keyed by the name on screen — unnamed readings take the name + before them; a field size change over 1.5× is `<name>#2`; a misread is a point both neighbours agree against; events + are judged on every kept point, a change needing the reading after it), `pokerSpoken` (`lib/frames/pokerSpoken.ts` + over `numberWords.ts`). A spoken number within 90 s of a frame value of its field agrees or is a FLAG; with none it + fills the series as `[t, v, "spoken"]` and never makes an event. +- **The job**: kind `frame-scan` (`needsMedia`), queue `frames` (`FRAME_SCAN_QUEUE`) on the API or `draft:local` on a + local model (GPU arbiter; ollama unloaded at the end); refused when `resolveSavedVideo` finds nothing, past + `caps.daily`, or with `maxUsd` over `caps.max`; spend to the usage ledger as `task: "frame-scan"`. The log ends + `@@frame-scan {…}`. `settings.generation.routes.frames` (code/api/local; `code` = name a model) and + `settings.generation.frames {apiModel, localModel, maxUsd, everySeconds}`. `frames` is a GENERATION_TASK but never + a report-draft task (`reportDraft.ts` TASKS and the MCP's GENERATE_TASKS leave it out). +- **Images in `structuredAnswer`**: `images: [{mediaType, data}]` → Claude image blocks before the text; ollama the + user message's `images`. `promptEstimate` counts an image at `IMAGE_TOKEN_ESTIMATE` (1200), never its base64. +- **umtool**: `report-to-video/frames-cut.mjs` (`framesCut`, `frameTotals`, `statsLine`; pure) and `umtool new … --seed + frames` write clips with ids `fNN`, `quote: ""`, `onscreen.{title, subtitle}` marked `drafted.onscreen {task: "frames", model: "code"}` (code's: no review row; an + edit makes it the operator's), + `frameEvents`, and a top-level `frameScan {profile, file, channel, video, tournaments, overlay: [{clip, points: [{at, + …frameTotals}]}]}` no render reads yet. diff --git a/umtool/report-to-video/frames-cut.mjs b/umtool/report-to-video/frames-cut.mjs @@ -80,7 +80,7 @@ export function statsLine(totals) { * to the video; windows within `mergeGap` of each other are one clip. At most * `maxClips`, the most important events kept, in time order. */ -export function framesCut(scan, { channel, video, cues = null, ...o } = {}) { +export function framesCut(scan, { channel, video, cues = null, at = new Date().toISOString(), ...o } = {}) { const opt = { ...FRAMES_CUT_DEFAULTS, ...o }; if (!channel || !video) throw new Error("framesCut needs the channel and the video"); const duration = scan?.source?.durationSeconds ?? scan?.sampling?.to ?? Infinity; @@ -127,6 +127,9 @@ export function framesCut(scan, { channel, video, cues = null, ...o } = {}) { cite: Math.floor(lead.t), quote: "", onscreen: { title: TITLES[lead.kind] ?? lead.kind, subtitle: statsLine(totals) || lead.detail }, + // Code's draft (release 28's mark, `model: "code"`): no review row, and + // an edit makes it the operator's. + drafted: { onscreen: { task: "frames", model: "code", at, attempt: 1 } }, frameEvents: w.events.map((e) => ({ t: e.t, kind: e.kind, detail: e.detail })), }; }); diff --git a/umtool/report-to-video/frames-cut.test.mjs b/umtool/report-to-video/frames-cut.test.mjs @@ -55,6 +55,7 @@ test("framesCut: a clip around each event, overlapping windows merged, the most assert.deepEqual(timeline[0].frameEvents.map((e) => e.kind), ["double-up", "final-table", "big-loss"]); assert.equal(timeline[0].onscreen.subtitle, "Level 5 · 9 left · 9,000 chips (22.5 BB)"); assert.equal(timeline[1].quote, ""); + assert.equal(timeline[0].drafted.onscreen.model, "code"); assert.equal(frameScan.file, "frame-scan.poker.json"); assert.deepEqual(frameScan.overlay[0].points.map((p) => [p.at, p.stack]), [[70, 20000], [90, 41000], [120, 9000]]); assert.equal(frameScan.tournaments.length, 2);