Archilyzer · Source

archilyzer

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

commit 0aa49a99bca3f3a2254cefb44762864ea28c7cd6
parent a64b505d39f281ced90a5e5e6d464076e281632f
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Thu, 15 Oct 2026 20:42:50 -0400

plans: the frame derivation's record (plans/release-30/frame-derive.md), FACTS, CHANGELOG

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

Diffstat:
Meditor/CHANGELOG.md | 1+
Mplans/FACTS.md | 7+++++++
Aplans/release-30/frame-derive.md | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [Unreleased] +- **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. - **A damaged recording is transcribed for what decodes, instead of not at all.** Transcribing a corrupt full source used to fail at the first bad stretch. It is now decoded with error tolerance, with the stretches that will not decode kept as silence of their own length, so every line of the transcript is at its true time in the recording; with parakeet, a window that still fails is skipped and noted. The transcript is marked **salvaged**: the video page says how much decoded and which stretches have no transcript, and the channel's report lists it under **salvaged transcript**. It happens on its own for a corrupt full source; `pnpm ops transcribe-one --json '{"slug": "<channel>", "id": "<video>", "salvage": true}'` asks for it on any video (`false` turns it off). When a later retry downloads the recording clean, the salvaged transcript is removed so the recording is transcribed again in full. On the sites, a salvaged transcript's video page says "Partial transcript: N of M min decoded", and the MCP's `get_transcript` and `get_video_metadata` say it is partial. Needs a restart of the editor; the sites show it after their next build. - **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. `"crop": [x, y, w, h]` (fractions of the picture) reads only the poker client when a webcam sits beside it, and `"hero": "<screen name>"` tells the model whose seat is the streamer's; both are remembered for the next scan, and `"fresh": true` reads every frame again (another model). 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. diff --git a/plans/FACTS.md b/plans/FACTS.md @@ -9690,6 +9690,13 @@ parsed to 0 cues, indexing the video textless) is CLOSED by `200a3105` (transcri - **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 derivation's rules since `r30/frame-derive`** (they supersede the bullet below where they differ): a tournament + changes only after a confirmed bust + a screen away + chips again (never on a name); its name is `canonicalTitle` of + `looksLikeTitle` names; stack excursions (left and returned to within 90 s) are set aside before events; players left + only from a header (position beside it) or finishing lines, never rising; the log's "Blinds are now" is the big blind; + the model's `won` is no event. `rederiveRecord` / `deriveOf` (`lib/frames/scan.ts`) recompute `derived` from a + record with no model — `frame-scan {rederive: true}`, `archilyzer frames rederive <slug>/<id>`; `rederivedAt` on the + record. - **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 diff --git a/plans/release-30/frame-derive.md b/plans/release-30/frame-derive.md @@ -0,0 +1,64 @@ +# Release 30, lane P follow-up: the frame derivation (`r30/frame-derive`) + +The first live scan (`v7gkv5w`, 1,139 readings, $4.06 on Haiku 4.5) read well and derived badly: 26 tournaments +where there is one, false double-ups from mid-hand dips, a final table from a table's seat count, stacks of 730 BB +from a misread big blind, six "won" banners on other players' hands. The readings were kept; only the derivation +changed, and a re-derive brings the sidecar up to date with no model call. + +### D1–D6, as shipped (2026-10-15, lane P, `r30/frame-derive` from `main` `14d09aa2`) + +- **D1 One tournament unless the hero is out.** A name read is no longer evidence of a tournament: the model put hand + descriptions, seat names and title misreads in the field. A tournament changes only after a CONFIRMED bust (a stack + of 0 held on the reading beside it, a bust/eliminated banner on it or beside it, or the hero's "has finished the + tournament" line within a minute), a screen away from the table, and chips in front of the hero again. Its name is + `canonicalTitle` of its title-like names (`looksLikeTitle`: not a hand description, not a name the log shows as a + player — `speakersOf` — not the hero, at 75% letter similarity), clustered (case and punctuation, one name's words the + start of the other's, or 75% alike) and named by the biggest cluster's most frequent spelling when it is read at + least 3 times (or is the only one). The old field-size split (totalPlayers changing by 1.5×) is gone (misreads). + A Day/structure change in the header is not a trigger: Day 1B → Day 2 is one tournament, and the header's "Day" was + misread ("Day 18's"). +- **D2 Dips are not events.** `dropExcursions` (`series.ts`): a run of stack readings that leaves a level and comes back + to it (within 1.1×) inside 90 s of the last reading before it is set aside (a stack read mid-hand: chips in the pot + are not in front of the player; a misread), before `dropMisreads`. A double-up or big loss needs its new level held + by the next reading (within 1.25×). +- **D3 Players left from the header only.** A reading's players left counts only with a position beside it, the + position within it, and not a table's seats (≤ 10 of ≤ 10); else the log's finishing places. Players left never rise: + a reading followed within ten minutes by one 1.5× and 3 larger is a misread. A spoken number with no agreeing frame + point in its 90-s window flags every one of them, and a flagged point makes no event; a gap is filled by a spoken + number only when it fits a reading either side (within 2×), else it is flagged. The final table needs a field of more + than 9 read EARLIER in the tournament. +- **D4 The log's blinds.** "Blinds are now a/b" is the big blind from the line on, carried until the next; a read + that disagrees with it by more than 2× is a misread (recorded). Before the log says any, reads only go up and never + above the first the log will say. Stack in big blinds is the kept stack over the big blind of its moment (or the + client's own figure). +- **D5 The model's banners.** `won` is not an event (the model said it for other players' pots; a hand the hero takes + is the log's `pot`/`big-pot`; the tournament won is the players-left series reaching one); `bust`/`eliminated` stand + only with no table frame showing the hero's chips in the next two minutes; `final-table` only beside a header of 9 or + fewer. +- **D6 Re-derive.** `rederiveRecord(record, {cues?, hero?})` and `deriveOf` (`lib/frames/scan.ts`): `derived` (and, + with cues, `spoken`) from the stored readings and duplicates, no model, no frame; readings, runs and spend kept, + `rederivedAt` set. `pnpm ops frame-scan --json '{"slug","id","rederive":true}'` (no job; refused while a scan of the + video is queued or running; answers `{rederived: {before, after, tournaments, eventsByKind}}`) and + `archilyzer frames rederive <slug>/<id> [--profile] [--hero] [--dry] [--json]` (offline: cannot see the editor's + jobs). +- **Measured on the live sidecar, in memory (nothing of it committed; a scratch copy for the CLI):** tournaments 26 → + 1 ("VENOM", 130–13,500 s); events 35 → 18 (big-pot 2, pot 11, buy-in 3, bust 1 at 13,480 "out from 66,429", + eliminated 1 at 13,500; no double-up, big loss, final table or won); flags 1 → 6 (85 said vs 65 read at 5:40; 15 + said at 53:38 against a field of 67, the other tournament; a stack, two places and a stack in BB said that disagree); + big blind 625 → 1,250 → 1,600 read, then the log's 1,800 … 5,500; players left 65, 67, then 115 … 86 from the header. + Left: the header's 65/67 at the start are probably misreads of 85 (flagged); the tournament's `buyIn` fact takes the + first said ($5, the viewer tournament's). + +| Commit | What | +| --- | --- | +| `2c98d31e` | common, editor, scripts: the derivation rebuilt (D1–D5), re-derive (D6) on ops and the CLI, the fixtures and tests, COMMANDS.md | +| (this commit) | plans, CHANGELOG, FACTS: this record | + +Gates (from the worktree root; every tsc and suite under the shared heavy2 lock; no build or e2e — the user bus was down): +- `pnpm -r --no-bail --workspace-concurrency=1 exec tsc --noEmit`: clean. +- common 4362/4362 (lib/frames 72/72: `pokerDerive.test.ts` 12 on `testing/frames/pokerReadings.mjs`, the derivation's + old tests moved to the new rules, `dropExcursions`); editor unit 319/319 (`_frameScan.test.ts` 7/7 with re-derive); + test:scripts 1033 (1030 + 3 skipped); umtool 33/33; mcp 373/373. +- `docs cli` regenerated; `docs cli --check`, `docs files --check`, `docs env --check`, `settings example --check` clean. +- Not run: the editor e2e and builds (bus down). The panel and supercut code are unchanged; the one `frameScanActions` + line is a type narrowing.