Archilyzer · Source

archilyzer

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

commit 867f3baf71b0a380c0b020eae227cca9aa4a6184
parent 0ea3697dbda8d4376da82be46fadf87e984744fe
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 16 Oct 2026 02:46:09 -0400

plans: release 31 lane P3 — the poker-overlay record (plans/release-31/poker-overlay.md), FACTS, CHANGELOG

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

Diffstat:
Meditor/CHANGELOG.md | 2++
Mplans/FACTS.md | 29+++++++++++++++++++++++++++++
Aplans/release-31/poker-overlay.md | 117+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 148 insertions(+), 0 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +- **A poker frame scan finds the moments a highlight reel is made of.** Besides the double-ups, busts and big pots, the derivation now marks: every pot the streamer's player takes (a pot of 25 big blinds or more is a big pot; the same log line read twice with a digit off is one pot), the player's all-ins with how they ended (doubled, won, lost, busted, or not read), each blind level going up (from the client's "Blinds are now" line; a misread line that a later one contradicts is ignored, in the big blind too), and the field falling under 100, 50, 27 and 18 players and to the final table (from the client's "position N of M" only, once each). Each of these says which rule made it, what it read, and whether a second reading backs it (`confirmed`) or not; a reading flagged against a spoken number still makes nothing. An all-in banner the model reads is the player's only when the player's chips are all in the middle. The new moments appear on an existing scan by re-deriving it, with no model call: `pnpm ops frame-scan --json '{"slug":"<channel>","id":"<video>","rederive":true}'`. Needs a restart of the editor. +- **A frame-scan supercut has substance, and shows the numbers on screen.** `umtool new <slug> --from <channel>/<video> --seed frames` now ranks the scan's moments — big pots and won all-ins first, then the final table, players-left marks and the bust, then the other swings, the smaller pots, and level-ups last — and takes them until the clips fill `--target <seconds>` (240 by default). The draft turns on the on-screen deck with a new **stats** panel: the stack, the stack in big blinds, players left and the level, in a corner of the picture over each clip, each number changing when the scan read it change (`render.chrome.stats`; a clip's `"stats": false` leaves it out, `"stats": true` draws it on one clip only). A build checks the panel's frames, and fails when a clip that asks for it was drawn without it. The project is new: re-seeding an existing one needs a new slug. - **find-copy can bring a deleted or private video's whole audio home, so it gets transcribed.** `pnpm ops find-copy --json '{"siteId":"<site>","gone":"no-transcript","dryRun":true}'` (or `{"slug":"<channel>", …}`) lists every gone video of the site's channels (or of one channel) that has no audio and no transcript, and the copy each would use: the Wayback Machine when it holds the video, else an archive.org mirror of the upload. `"gone":"all"` takes the transcribed ones too, after the others. Without `dryRun` it looks up at most `max` videos (10 by default, at most 200) and starts one **Fetch copies** job on archive.org's download queue, which fetches each copy's audio into the video's own record as `audio.<format>`, one at a time with a pause between them; the transcription lane then picks it up like any downloaded audio. The video's title, date and page stay the original's. Its page says **Audio from a copy:** and links the Wayback capture (with its date) or the archive.org item, where the Wayback or archive.org line used to be. A video neither archive holds is noted in its `copy-attempts.json` and left out of the next 30 days of runs, as is one whose copy failed at its source; `"retryFailed": true` asks again. Needs a restart of the editor. - **A frame scan's timeline reads like the stream.** One tournament stays one tournament until the streamer busts: a hand description, a player's name or a misread of the title no longer starts a new one, and the tournament is named by the title most frames agree on. A stack read mid-hand (chips in the pot) or misread no longer makes a double-up or a big loss; players left come only from the client's own "position N of M" or the log's finishing places, so a table's seats are not the field and no final table appears from them; the big blind is the log's "Blinds are now", so a stack is never 700 big blinds by a misread; "won" banners on other players' hands are gone. A frame and a spoken number that disagree are flagged, and a flagged reading makes no event. **Re-derive** an existing scan with no model call: `pnpm ops frame-scan --json '{"slug":"<channel>","id":"<video>","rederive":true}'`, or `archilyzer frames rederive <channel>/<video> --dry` to see what would change. Needs a restart of the editor. - **Retrying a corrupt full source downloads it again.** A video whose download completed with malformed audio (Odysee's intermittent AAC, on a channel with the audio check) kept its file, and that file made every retry say "Nothing to fetch". A retry of the **corrupt full sources** bucket — the new card on the channel's Download stage, or `pnpm ops retry-bucket --json '{"slug": "<channel>", "bucket": "corruptFullSource"}'` — now sets the kept file aside and downloads again: a clean result replaces it; a malformed one keeps whichever copy decodes longer; a download that fails (a 429, the network) puts the kept file back and the video stays in the bucket, with the attempt recorded. Each retry is recorded in the video's `download-outcome.json`. Needs a restart of the editor. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -9751,3 +9751,32 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri - **The video page** reads `latestFetchedCopy(copy-attempts.json)`: "Audio from a copy: Wayback Machine, <date>" / "… archive.org <identifier>", linking the copy, in place of (and under the label of) the source's own provenance line ("Wayback provenance" / "archive.org provenance"). + +## Release 31 lane P3: poker highlight events, the frames-cut budget, the `stats` region (verified 2026-10-16, branch `r31/poker-overlay`) + +- **Events** (`common/lib/frames/poker.ts`, pure): a `DerivedEvent` may carry `rule`, `evidence` (numbers and the line + as read) and `confidence: "confirmed" | "unconfirmed"` (`types.ts`). New kinds and rules: `pot`/`big-pot` (`log-pot`; + `BIG_POT_BB` 25; a hero pot line within 180 s and 1% of an earlier one is that line misread; confirmed when the kept + stack after > before), `all-in` (`all-in`; the hero's from a log line or the action text naming the hero, or an + unnamed action/the model's banner only with the hero's cards and stack 0 on the reading; one per 60 s; `evidence + {via: log|action|banner, role: shove|call, outcome: doubled|won|lost|busted|unclear|unknown, stackBefore, + stackAfter, afterT}` from the kept stack within `ALL_IN_OUTCOME_WINDOW_S` 180), `level-up` (`log-blinds`; each new + big blind once per tournament; `evidence {smallBlind, bigBlind, from?, level?, line}`), `players-left` and + `final-table` (`players-left-milestone`; `PLAYERS_LEFT_MILESTONES` [100, 50, 27, 18] and `FINAL_TABLE` 9, on the kept + unflagged playersLeft points, at the first point after the LAST point over the mark; `evidence {milestone, + playersLeft, before, beforeT}`). The model's `all-in` banner is no longer an event by itself (frameEvents skips it). +- **The blinds line**: `BLINDS_LINE` takes an `INFO`/`Dealer:` prefix; a logged big blind a LATER line in the same + tournament undercuts is a misread (recorded once per run of the line) and is not carried in the `bigBlind` series. +- **frames-cut** (`umtool/report-to-video/frames-cut.mjs`): `rankOf(e) → {tier, score}` (tiers `CUT_TIERS` scoop, + milestone, swing, pot, level), `compareRank` (tier, confirmed first, score, earlier), `titleOf`; `framesCut(scan, + {target = 240, short: {pre 6, post 10}, stats})` takes ranked events while the merged windows fit `target` seconds + and `maxClips`, returns `seconds`; `stats: true` makes subtitles the event's detail. `umtool new … --seed frames + [--target S]` turns on the deck with `render.chrome.stats: {}` (`deck.qr.show: false` without `--site-origin`); the + scaffold still refuses an existing directory (a re-seed is a new slug). +- **The `stats` region** (`stats.mjs`, `chrome-stats.mjs`, `deck.mjs` `statsGeometry`): `render.chrome.stats {position + (bottom-left), fields (stack, stackBB, playersLeft, level), name}` and a clip's boolean `stats`; a clip DECLARES it + (`statsClips`) when it asks and `frameScan.overlay` has points for it. `schedule.json` gains `stats {position, fields, + name, clips: [{segment, in, out, name, states: [{at, values}]}]}` (cut seconds; `at = start + (t − playWindow.from)`) + only when a clip declares it. compose-chrome `--region stats` → `chrome/stats/`, `chrome/stats-frames/` (keyed, + windowable); the build lays it after the stamps (`statsRegion`); `verify-build` fails on a declared clip missing from + the schedule's `stats` or a missing/short `stats-frames` (pruned counts read from `pruned.json`). diff --git a/plans/release-31/poker-overlay.md b/plans/release-31/poker-overlay.md @@ -0,0 +1,117 @@ +# Release 31, lane P3 — poker events and the stats overlay (as shipped) + +Branch `r31/poker-overlay` from `main` `3ef1b558` (main `c9ec3bc8` merged in before the last gates). Brief: +`r31p3-brief.md` (the plan of record for this lane). FACTS: "Release 31 lane P3: poker highlight events, the +frames-cut budget, the `stats` region". + +## What and why + +The frame scan of `the-quartering-rumble/v7gkv5w` derived 1 tournament and 18 events after release 30's derivation, +and the seeded supercut had 3 clips; `frameScan.overlay` was data nothing drew. This lane gives the derivation the +moments a highlight reel is cut from, ranks them into a length budget, and draws the running numbers over each clip. + +- **The events** (`common/lib/frames/poker.ts`, pure; `DerivedEvent` gains `rule`, `evidence`, `confidence`): + - hero pots — rule `log-pot`: the log's "Dealer: <hero> takes the [main|side] pot N", `big-pot` at `BIG_POT_BB` (25) + big blinds; a hero pot line within 180 s of an earlier one at a size within 1% is that line misread (live: + "60,025"/"60,026", "10,350"/"10,360"); `confirmed` when the kept stack after the line is above the stack before; + - all-ins — rule `all-in`: a log line naming the hero first with "all in" (or "<hero> calls" beside one), the action + text naming the hero, or an unnamed action / the model's all-in banner ONLY on a reading with the hero's cards and + the stack read 0; one per 60 s; the outcome from the kept stack within `ALL_IN_OUTCOME_WINDOW_S` (180 s), flagged + points left out: `busted` (the stack at 0 and staying, or the log's hero-out line), `doubled` (×1.8), `won` + (×1.1), `lost` (under ×0.9), `unclear`, `unknown` (no reading; a 0 with chips again past the window); + `confirmed` with a known outcome. The model's banner alone is no longer an event (it says it for any shove); + - level-ups — rule `log-blinds`: each new big blind of "Blinds are now a/b" once per tournament (an `INFO`/`Dealer:` + prefix read); a logged big blind a LATER line undercuts is a misread: no event, and (new) not carried in the + big-blind series either (recorded once per run of the line); `confirmed` when the big blind before it is lower; + - players-left milestones — rule `players-left-milestone`: `PLAYERS_LEFT_MILESTONES` [100, 50, 27, 18] and + `FINAL_TABLE` (9), on the kept unflagged players-left points (P2's: the header with a position beside it, or the + log's finishing places; never a spoken number), once each per tournament, at the first point after the LAST point + over the mark (players left never rise), the lowest when one point crosses several; the final table keeps its + kind (`final-table`, not at 1), the rest are `players-left`; `confirmed` when the next point holds it. + P2's guarantees hold: a flagged reading makes no event, one tournament until a confirmed bust. The test kit gains + `syntheticPokerHighlights()` (`common/testing/frames/pokerReadings.mjs`): every rule's evidence and a trap beside + each (a misread blinds line, a pot line read twice, another player's banner, a flagged header). +- **The ranking** (`umtool/report-to-video/frames-cut.mjs`): `rankOf` → tiers scoop (the tournament won, big pots, + all-ins won/doubled, double-ups, knockouts), milestone (bust, final table, players-left marks), swing (other + all-ins, a big loss), pot, level; `compareRank` (tier, confirmed first, score, earlier). `framesCut(scan, {target = + 240, short: {pre: 6, post: 10}, stats})` takes ranked events while the merged, sentence-widened windows fit `target` + seconds and `maxClips`, passing over one that would not fit for a later, smaller one; each clip keeps its + `frameScan.overlay` points; `seconds` is returned. `umtool new … --seed frames [--target S]` turns on the deck with + `render.chrome.stats: {}` (the QR off without `--site-origin`) and each subtitle is the event's own words. +- **The `stats` region** (`stats.mjs`, `chrome-stats.mjs`; the stamps' path): `render.chrome.stats {position + (bottom-left), fields, name}` per cut, a clip's boolean `stats` per clip; a clip declares it when it asks and + `frameScan.overlay` has points for it. The schedule's `stats` maps source seconds into the cut's clock (`start + t − + playWindow.from`), a state per change, the panel up from mid-dissolve to mid-dissolve and held across a cut between + two clips that both carry it. The page draws one block per state (seek-safe), on the palette's roles (bg 84%, fg, + muted, an accent rule), 648×150 at 1920 (48 + 150 a field; 112 tall without the name). compose-chrome `--region + stats`, the build lays it after the stamps (`statsRegion`, `-reinit_filter 0` + rgba like the deck's), the build and + the lint refuse bad `stats` keys (`validateStatsEntries`; `validateChrome` takes `stats`), and `verify-build` fails + on a declared clip the schedule does not draw, or a missing or short `stats-frames`. + +| Commit | What | +| --- | --- | +| `bd9a486f` | common: the highlight events (rules, evidence, confidence), the blinds-line misread, the test kit's highlights | +| `56d4159f` | umtool: frames-cut ranking and budget, `--seed frames --target`, the `stats` region, verify-build, lint, docs | +| `1c5a41ff` | merge `main` `c9ec3bc8` (lane C) | +| `499f1b9d` | umtool: `stats-overlay.spec.ts` and its `stats-build-fixture` | +| (this commit) | plans, CHANGELOG, FACTS: this record | + +## Gates + +From the worktree root; every tsc, suite, docs check and the e2e spec through the shared lock (`r31-locked.sh`, +`r31-locked6.sh`). +- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean at each commit and after the merge of `main`. +- common: 4362 at the branch's start → 4370 at `bd9a486f` (lib/frames 80/80: `pokerEvents.test.ts` 8 new on + `syntheticPokerHighlights`; the P2 all-in banner test moved to the new rule; `scan.test.ts` gains the lobby's + 120 → 85 crossing of 100) → 4387 after merging `main` (lane C's), all pass. +- test:scripts: 1033 (1030 + 3 skipped) → 1044 (1041 + 3 skipped): `frames-cut.test.mjs` 7 (2 new, 3 moved to the + ranking), `stats.test.mjs` 9 new (one a tiny real deck build of two lavfi clips beside the manifest with a stub + renderer: verify-build passes, then fails on the pruned record losing `stats-frames` and on a declared clip missing + from the schedule), `scaffold-frames.test.mjs` 1 (the deck, the subtitles, `--target`); `fixtures-r28.test.mjs` + green (the kit's manifests lint clean). +- umtool unit: 33 → 33. editor unit: 319 → 320 after the merge (lane C's), all pass. +- `docs cli --check`, `docs files --check`: clean (no CLI row or file schema changed; `umtool new`'s help and + `umtool/docs/cli.md` updated by hand — not generated). The lint on the e2e fixture's manifest: 0 errors, 0 warnings. +- umtool e2e, one spec: `stats-overlay.spec.ts` 1/1 (6.3 s; the umtool e2e build 544 s, then the heavy slot's + queue) — the fixture built offline through `/api/report/build` (preset fast) to `done`, its chain ending in + verify-build: the stats region composed and rendered after the deck, the schedule's states held from the scan's + points, the page's numbers, `stats-frames` as long as the deck's (pruned and recorded). +- A chromium still of the region on synthetic numbers (scratch only) checked by eye: legible at 1080p, the stack's + cell a third wider for "323.2K". +- Measured on the live sidecar in memory (read-only; nothing of it committed): events 18 → 27 — big-pot 2 (both + `unconfirmed`: the kept stack did not rise across them), pot 9 (11 → 9: two lines read twice with a digit off), + level-up 10 (1,800 at 1:24:10 … 5,500 at 3:44:50; all confirmed), players-left 1 (under 100 at 3:04:50, + confirmed), buy-in 3, bust 1, eliminated 1; no all-in (the client's log on this stream carries none and no reading + has an all-in action with the hero's chips in). `framesCut` with the cues: 240 s → 5 clips, 234.6 s (two big pots, + a pot, under 100, the bust with the last level-up); 360 s → 10 clips, 354.3 s. + +Not done: +- umtool's On-screen preview does not draw the stats region yet (it composes the deck, the posts and the stamps); + the build, `--chrome-only`/`--chrome-preview` and `compose-chrome --region stats --still` do. +- No all-in on the live stream to calibrate against: the all-in rule rests on the synthetic shapes. + +## Rulings followed and decisions + +- The brief's "stats header only" for milestones is read as P2's players-left points (the header with a position + beside it, or the log's finishing places), the same points the final table already used; never a spoken fill. +- An all-in is the hero's only with evidence naming the hero or the hero's chips in the middle; the model's banner + alone was an event in release 30 and is not now (the P2 test that pinned it was moved to the new rule). +- Plain pots are clips again, as filler between the milestones and the level-ups (release 30 left them out). +- The seed turns the deck on (the stats region is the deck's); its QR is off without `--site-origin`. +- A re-seed over an existing project is refused as before (the operator's edits live there): re-seed to a new slug. + +## Live (for the orchestrator, after merge) + +1. Re-derive the scan (no model call). The CLI runs the checkout's code (no editor restart needed); dry first: + `pnpm archilyzer frames rederive the-quartering-rumble/v7gkv5w --dry --json`, then without `--dry`. Expected + events 18 → 27: `{big-pot: 2, pot: 9, level-up: 10, players-left: 1, buy-in: 3, bust: 1, eliminated: 1}`. (Or, after + the editor restart, `pnpm ops frame-scan --json '{"slug":"the-quartering-rumble","id":"v7gkv5w","rederive":true}'`.) +2. Re-seed to a NEW slug (the scaffold refuses an existing directory; `~/reports/v7gkv5w-poker` keeps its edits): + `node umtool/bin/umtool.mjs new v7gkv5w-poker-2 --from the-quartering-rumble/v7gkv5w --site-origin + https://jeralyzer.pages.dev --seed frames --target 240` → 5 clips, ~235 s (`--target 360` → 10 clips). +3. The preview: `node umtool/bin/umtool.mjs build reports/v7gkv5w-poker-2 --preset fast` prints the chain (or the + piece's Build in umtool); run it through the heavy slot (`pnpm heavy -- …`) inside the shared lock, then + `node umtool/report-to-video/verify-build.mjs ~/reports/v7gkv5w-poker-2/video.manifest.json` (expects + `stats: N/N frame(s) over 5 of 5 declared clip(s)`). A still of the panel without a render: + `node umtool/report-to-video/compose-chrome.mjs ~/reports/v7gkv5w-poker-2/video.manifest.json --region stats + --still <s> --png <file>` once a build has written `out/sourced/schedule.json`.