commit 5ded8cfad04ccd9818799b6fa173ac7ecd41c6fd
parent 1e426c77db10c998bfa7da1abf9d6cddf543ae23
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 14 Oct 2026 22:28:36 -0400
plans: umtool redesign — R6.3, as shipped (learned spellings: proposed and heard, confirmed by code and every window the judge reads, used as escaped literals on the watch only; the jeralyzer proof over four calibration runs — 23,194 recordings counted in one 10 s scan, nothing confirmed under the shipped rule; gates); status row
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
1 file changed, 151 insertions(+), 1 deletion(-)
diff --git a/plans/umtool-redesign.md b/plans/umtool-redesign.md
@@ -468,7 +468,7 @@ mis-transcriptions and adapt by adding its own terms.
| P6b 308s, screenshot audit | `ux/p6b` → `main` `850e0989` | LIVE 2026-10-14 (umtool Te2jR-P8…) |
| R6.1 honest tier 0 + R4.1 | `ux/r61` | shipped on the branch |
| R6.2 seen = transcribed | `ux/r62` → `main` `3d8af5b8` | LIVE 2026-10-14 (editor p2L5XyqT…) |
-| R6.3 learned spellings | `ux/r63` | in progress (operator, 2026-10-14) |
+| R6.3 learned spellings | `ux/r63` | shipped on the branch (`12f232e4` + this record) |
| Co-host pilot | — | RESUMED 2026-10-14 (weekly Mon 06:00 ET; first automatic tick 2026-10-19); seeded with learned spellings when R6.3 lands |
### P2a, as shipped
@@ -3763,3 +3763,153 @@ alone; full umtool e2e on the merged tip 538 passed, 0 failed, 6 skipped. Docs:
`triage.md` (whole-scope listing, seen = judge-able, partial runs, the transcription-paused skip, `reset-triage`),
`refresh.md`, `recurring.md`. umtool built and restarted (`scripts/board2-umtool.sh`); live `/research` and a case 200.
+### R6.3, as shipped
+
+**What.** Learned spellings: a watch sees how the AI transcripts mishear the names it watches and adds its own terms
+(operator, 2026-10-14). Two ways a spelling is found, one rule for keeping it, and the operator's controls.
+
+- **The names** (`lib/report/draft/triage/learned.ts` `namesOf`): each top-level alternative of the terms that is
+ literal once its `^`/`$`/`\b` anchors are stripped (a class, quantifier or group is skipped) and has a capital
+ letter or a space — a phrase of several words; a hyphenated word is one word. Capitalised first, at most 16 a pass
+ (`NAMES_PER_PASS`, the rest said as "not asked"). The pilot's terms give 18: 9 names and 9 phrases.
+- **Proposed** (`triage/confirm.ts` `proposeSpellings`, `parseProposals`): the triage model (the schedule's tier-1
+ model, `settings.generation.triage`, local by default) lists up to 5 likely mis-hearings a name. Put aside, with
+ the reason kept: the name itself, a repeat, a spelling already in the terms, learned or removed, one the terms'
+ own query already finds (`coveredByTerms`: "Melanie Mack" under "Melanie Mac"), non-words, more than 4 words.
+- **Heard** (`triage/judge.ts` `checkHeard`): with names, the window judge's prompt gains rule (6) and its schema
+ `heard: [{span, means}]`. Code keeps a span only when `means` is a watched name, the span is not the name, not
+ known and not found by the terms, at most 4 words, verbatim in the chunk the judge read (`locate`) and in the cues
+ near that second (R2's word check); else it is put aside with why (`heardDropped` in triage.json).
+- **Confirmed by code and the judge** (`confirmSpellings`): every pending spelling is counted in scope at once and
+ uncapped (`countPhrases`, below). No hits: dropped "no-hits"; a count that could not read everything and found
+ nothing is "unread", never "none". Then the judge reads up to 3 windows where it occurs — a heard span's own
+ recording first, then the newest — and **every** window read must say it means the name, quoting the line, which
+ must be verbatim in the window and the cues. One "no" drops it ("not-the-name", the judge's reason kept); a yes
+ whose line is not verbatim drops it ("not-verbatim"). Kept: `{spelling, means, quote, recording, channel, start,
+ url, hits, lines, source: proposed | heard, at, k?}`.
+- **The count** (`mcp/src/enumerate.ts` `countPhrases`; `CorpusTools.countPhrases`, not an agent tool): the scope
+ LISTED (R6.1's `listRecordings`, a recording without a transcript not counted), then enumerate's own scan
+ restricted to those ids in batches of 1,000 (under the 2,000-recording cap, so a batch is never cut), the phrases
+ as one alternation of escaped literals; each matching line is attributed to the phrases it holds. A capped batch
+ or an incomplete listing makes it `complete: false`, said. A corpus without it: `countViaEnumerate` (the listing,
+ then one restricted scan a phrase).
+- **Used** (`tier0.ts`, `task.ts`): the active spellings (their name still in the terms; at most 20) join the
+ candidate query as escaped literal alternatives — never a regex (`spellingPattern`: escaped, `\b` at a word end).
+ Tier 0 runs them as one query over the same new ids and dates, then, with several, each over what matched, so a
+ candidate names the spellings that brought it (`by: ["learned"]`, `learned: [...]`). The judge's windows are around
+ the terms and the learned spellings alike (`joinedQuery`). The log, the run's summary and triage.json say "terms
+ + N learned" (`file.learned`, `tier0.learned`, the tick line's `triage.learned`).
+- **Suggest removing** (`suggestRemoving`): each run records each spelling's use (its candidates, how many were
+ flagged; the last 8 kept). A spelling whose last 4 runs with candidates had none flagged is marked; nothing removes
+ it but the operator.
+- **The store** (`learnedStore.ts`): `reports/.series/<id>/learned.json` beside `series.json` (a living report's:
+ `reports/<article>/learned.json` beside `schedule.json`), `archilyzer-learned` v1: the spellings, the blocked ones,
+ the last 100 drops, the last 10 passes, the terms the last pass asked about and when. ONE WRITER,
+ `common/controller/learnedSpellings.ts` (read-patch-write under the article store's lock, atomic):
+ `applyTriageLearning` (the triage job, after a run: the heard spans its confirmation kept, each spelling's use),
+ `recordLearnPass`, `unlearnSpelling`, `promoteAlias`.
+- **The pass as a job** (`controller/reportLearn.ts`): `planLearn` (the names, the model, the cap, the last pass, a
+ pass due — never proposed, the terms changed, a week since the last; refused for a schedule that does not triage
+ or names no one) and `enqueueLearn`: one `report-draft` job, task `learn`, on the triage model's lane (`draft:local`
+ through the GPU arbiter, ollama unloaded at the end; `draft:api` for the extractor, metered, usage rows task
+ `learn`), over the newest build holding the scope; its log ends `@@report-draft {…, task: "learn", learn: {…}}`.
+- **When a pass runs**: a create of a schedule that triages and names someone, a change of its terms (the answers'
+ `learn: {jobId, names}`), `report-schedule {"action":"learn"}`, and a tick before tier 0 when one is due
+ (`TickSteps.learn`, the editor's `learnStep`, awaited; a failed pass is a warning on the tick, the triage runs on
+ what is learned; the tick line's `learn`).
+- **Ops** (`report-schedule`, COMMANDS.md regenerated): `learn {id, dryRun?}` → the plan and the job (dryRun: the
+ plan); `unlearn {id, spelling}` → removed and blocked (never relearned); `promote-alias {id, spelling, site?,
+ confirm?}` → the plan (`planAliasPromotion`: the spelling added as a trigger to the alias whose label or trigger is
+ the name — and to its regex suggestion as an escaped alternative when it does not match it — else a new alias
+ `{id: slug of the name, label, triggers: [name, spelling], suggestion: both escaped, useRegex, note: "learned by
+ watch <id> from <channel>/<recording> at m:ss"}`; the sites it could go to), then with `confirm` written through
+ the alias writer (`aliasesStore` `write{Global,Site}Aliases`, coerced as the editor's /aliases page saves) and the
+ spelling marked promoted. Refused when the alias already fires on it.
+- **umtool**: the series/watch page's **Learned spellings** panel (`components/series/LearnedSpellings.tsx`, read
+ by `lib/research/learned.ts`): one lit list (spelling → name, hits, source; tags **suggest removing** (`state`),
+ **idle**, **alias**), the lit spelling's proving line on the reader with its cite (the moment link), its facts and
+ uses; **Remove** and **Promote to search alias**, each plan-then-confirm (the promote plan: the **Alias list**
+ select — global or a site's — the alias as it will be written, **Confirm promote** / **Keep it**); **Propose
+ spellings**; the last pass and the dropped ones with their reasons. The triage page's tier 0 says "terms + N learned
+ (M by a learned spelling alone)" and a candidate a learned spelling brought reads `learned “…”`.
+ `/api/schedules` forwards `learn`, `unlearn`, `promote-alias` (a plan clears no cache).
+- **The umtool e2e stub** (`common/testing/schedule/opsStub.ts`): the real action and writer; a learn records a pass
+ at once (two spellings kept, one dropped); the triage stub names a candidate a learned spelling brought; promote
+ and unlearn are the real ones over the fixture (`<fixture>/search-aliases.json`, `<fixture>/sites`).
+- **Docs**: `umtool/docs/triage.md` "Learned spellings" (after main's R6.1/R6.2 sections, merged first), "What you
+ see" and "Where things live".
+
+**Read-only proof on the real corpus** (offline `tsx` over `export/.export-builds/jeralyzer/out` through
+`createCorpusTools` — the editor's path — no editor, no writes; the pilot's scope, terms and question from its live
+series.json, read only; the local model `qwen3:8b` on ollama, the GPU checked free before every call — 0% busy, no
+model loaded, no transcription process — none was seen, nothing stubbed). Four runs as the rules were calibrated
+(the model is not deterministic: each run proposes differently):
+
+| run | rules | proposed | in scope | kept |
+|---|---|---|---|---|
+| 1 | first cut: one yes keeps | 26 (16 names; "taking flack", "taking flak" not asked) | Melony 39 recordings, Melanie Mack 1,039, Gothics 240, cohost 50 | 4: **Melony** on "the packers beat melony steelers" (wrong), Melanie Mack, Gothics, cohost — the last two the terms already find |
+| 2 | + a spelling the terms find is not new | 14 (17 put aside as already found: Melanie Mack/Macs/Mackie, cohost, Gothixs, …) | Meloney 1, Melani 4, Gothics 240, Stix 94 | 4: **Meloney** on "a guy named dr. Robert meloney" (wrong), Melani, Gothics, Stix |
+| 3 | + every window read must agree; a stricter prompt | 19 | Gothics 240, Stix 94 | 0 (both judged not the name in their first window) |
+| 4 | the prompt as shipped | 19 | Melony 39, Meloney 1, Gothics 240, Stix 94 | **0**: each judged not the name ("a different person", "a group or style", "a separate person") |
+
+The count read all **23,194** transcribed recordings in scope (complete, no problem) in one scan for every phrase:
+**10–11 s**; a whole pass 36–52 s, 18–26 model calls, $0; ~1.3 GB RSS. The 15 phrases' proposals ("joinin the show",
+"no long on", "guesta host", …) never occur. The brief's example, "Melanie Mack", is already found by the pilot's
+terms (`Melanie Mac` as a substring, and `\bMelanie\b`) — so on this pilot the watch has nothing to learn from its
+own names today; the shipped rules trade recall (Gothics, Stix look right) for never learning on one window's yes.
+
+**Commits** (`ux/r63`, from `main` `7ab19c75`; `main` `51a6fa8d` merged before the final gates):
+
+| sha | what |
+|---|---|
+| `66aef2e9` | common, mcp, editor: the names, proposals, heard spans, the confirmation, the count (`countPhrases`), the query, the store and its one writer, the learn job and the tick's step, report-schedule learn / unlearn / promote-alias; tests (common +18, mcp +1); COMMANDS.md |
+| `af899040` | umtool: the Learned spellings panel, the triage page's learned candidates, `/api/schedules`' actions, the stub's pass; `learned-spellings.spec`, `lib/research/learned.test.ts` |
+| `b3d39256` | editor e2e: `report-draft.spec` (a pass over the fake model, then the tick's query carries it), `ops-api.spec` (learn's plan, promote-alias plan then confirm, unlearn) |
+| `e613df92` | the calibration on the proof: every window must agree, a spelling the terms find is known, the confirm prompt, a hyphenated word is not a phrase |
+| `c7e60ae1` | merge `main` `51a6fa8d` (board race 3, the R6.1/R6.2 docs) |
+| `1a5aeebd` | `umtool/docs/triage.md` Learned spellings; the ops example |
+| `3eff3e68`, `12f232e4` | `[Unreleased]` bullets |
+| (this commit) | this record; the status row |
+
+**Gates.**
+
+| Gate | Result |
+|---|---|
+| repo-wide `tsc --noEmit` | clean at `66aef2e9`, `af899040`, `e613df92` and on the merged tip |
+| common (`SETTINGS_FILE` at the primary's, read only) | **4190/4190** on the merged tip (+19: `triage/learned.test.ts` 14 — names, proposals, escaping, tier 0's learned candidates, heard spans, the confirmation's drops and keep, every window agreeing, an unread count, a pass, the cap, blocked, suggest removing, learnDue, the alias plan, a triage run that hears and confirms; `controller/learnedSpellings.test.ts` 5 — learn's plan and door, a create and a change of terms starting a pass, unlearn, promote-alias global and a site's in a temp dir, the tick's pass only when due and its failure a warning, a triage run's learning written). A first run had `envVars.test` red on the scratch proof script's `OUT` (removed; 9/9 alone, then the suite 4190/4190) |
+| mcp | **370/370** (+1: `countPhrases`, a three-page channel: counts, lines, examples newest first, a literal phrase, through the corpus tools with a date) |
+| editor unit | **304/304** |
+| umtool unit (`node --test umtool/lib/*.test.mjs umtool/lib/*/*.test.mjs umtool/report-to-video/*.test.mjs`) | 861 tests, 859 pass, 2 skipped, 0 fail |
+| `pnpm --filter umtool test` | **33/33** (+1, `lib/research/learned.test.ts`) |
+| `pnpm run test:scripts` | 1013 tests, 1011 pass, 2 skipped, 0 fail |
+| `archilyzer docs cli --check` / `settings example --check` | clean / clean |
+| capped editor `next build` (heavy slot, `MemoryMax=5G`) | exit 0; compiled 21.1 s, 49.6 s wall, 2.55 GB max RSS |
+| capped umtool `next build` (corpus linked inside the heavy slot, `MemoryMax=5G`) | exit 0; compiled 11.1 s, 37.6 s wall, 1.58 GB max RSS; the link removed |
+| editor e2e `report-draft.spec` + `ops-api.spec` (before the merge) | 27 tests: 26 passed, 1 failed, 1.9 min — the new ops-api test: "co-host" was taken for a phrase (`e613df92`); green in the full run below |
+| umtool `learned-spellings.spec` + `triage-first.spec` + `recurring.spec` (before the merge) | **18/18**, 1.4 min |
+| **full editor e2e** on the merged tip `12f232e4` (`export/public` linked from the primary, 0 dangling; queued, detached) | **716 tests: 703 passed, 1 failed, 12 skipped**, 22.6 min. Green among them: `report-draft.spec:505` (a watch learns a spelling over the fake model; the next tick's query carries it) and `ops-api.spec:1063` (learn's plan, promote-alias plan then confirm, unlearn). The red: `cookies-mode.spec:73` ("Saved" not visible within 5 s after Save settings) — not a known flake, and **not this lane's**: red 3 of 3 alone on the branch, and red 1 of 1 on `main` `51a6fa8d` checked out in this worktree (the same line); no settings or cookie code touched here |
+| **full umtool e2e** on the merged tip `12f232e4` (queued, detached, `R63_SHOTS`) | **548 tests: 542 passed, 0 failed, 6 skipped** (the song-data skips), 12.3 min — `learned-spellings.spec` 4/4, `triage-first.spec`, `recurring.spec` and `board.spec` green |
+
+**Screenshots** (`r63-shots/`, from the full umtool run with `R63_SHOTS`, 1366×768, dark and light, the e2e
+fixture over the stub): the watch page's Learned spellings with the lit spelling's proving line and a "suggest
+removing" tag (`learned-spellings`), the promote plan with its alias list and the alias as written
+(`learned-promote-plan`), the triage page's tier 0 and a learned candidate (`learned-triage`). **Keys**: the list is
+one Tab stop, `j`/`k` move the light (asserted in the spec), the detail's buttons follow it in Tab order, Escape
+closes a plan; Confirm takes the focus when a plan opens.
+
+**Found and left.**
+- **On the pilot the watch learns nothing yet.** Its names' mis-hearings either never occur, are already found by
+ its terms (`Melanie Mac`, `\bMelanie\b`), or were judged not the name in some window. Gothics (240 recordings) and
+ Stix (94) look like real mis-hearings of Gothix and Styx, but the 8B judge said no in one of their windows; under
+ the first rule it had also kept two plain errors. The rule shipped is the strict one; a looser one (a majority of
+ the windows) is a one-line change if the operator wants recall.
+- **Phrases are names by the brief's rule.** The pilot's nine phrases ("joining the show", "no longer on", …) cost
+ calls and gave no spelling that occurs and the terms do not already find ("cohost" is `co-?host`'s). Narrowing to capitalised alternatives is one line in `namesOf`.
+- **"taking flack" and "taking flak" are past the 16-name cap** on the pilot: said in the plan as not asked.
+- **The proof is not repeatable run to run**: the model proposes different spellings each time (ollama's default
+ sampling). What is learned is still only what the code and every window confirm.
+- **A spelling whose name leaves the terms stays, idle** (listed, not used); Remove clears it.
+- **The pilot's first pass**: the schedule `co-host-updates` was not touched. After rollout,
+ `pnpm ops report-schedule --json '{"action":"learn","id":"co-host-updates","dryRun":true}'` names what it will ask
+ (16 names); without `dryRun` the pass runs as a job (~1 min on the local model). The next tick (Mon) would run it
+ anyway: it has never proposed.