Archilyzer · Source

archilyzer

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

commit 51842a8d54ea6ecbaee2fde4671e9ecfdec00f13
parent fe411479e865bfbfdf99bc6f82ec48b6f8c8cb17
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 16 Oct 2026 16:52:04 -0400

common, umtool: a learned spelling added by hand — `report-schedule {"action":"add-spelling","id","spelling","means"}`: the spelling of a watched name counted in scope and its proving line found by code (proveByHand, no model, no judge), kept with source "hand" only when it occurs; a removed spelling added back lifts its block; "Add spelling" beside "Propose spellings" on the series page; COMMANDS.md

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

Diffstat:
MCOMMANDS.md | 2+-
Mcommon/controller/learnedSpellings.test.ts | 34++++++++++++++++++++++++++++++++++
Mcommon/controller/learnedSpellings.ts | 67+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mcommon/controller/reportLearn.ts | 25+++++++++++++++++++++++--
Mcommon/controller/reportScheduleOps.ts | 16+++++++++++++---
Mcommon/lib/report/draft/triage/confirm.ts | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
Mcommon/lib/report/draft/triage/learned.test.ts | 16+++++++++++++++-
Mcommon/lib/report/draft/triage/learned.ts | 4+++-
Meditor/app/api/ops/_reportSchedule.ts | 9+++++++--
Meditor/app/api/ops/report-schedule/route.ts | 5++++-
Mscripts/archilyzer-ops.mjs | 11++++++++---
Mumtool/app/api/schedules/route.ts | 7++++---
Mumtool/components/series/LearnedSpellings.tsx | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
13 files changed, 289 insertions(+), 19 deletions(-)

diff --git a/COMMANDS.md b/COMMANDS.md @@ -155,7 +155,7 @@ Drives a running editor over HTTP (`/api/ops/*`, the same actions its pages run) | `bench-verdicts` | bench-verdicts runs the verdict bench as a bench-verdicts job: {"models": \["…"\], "run"?, "reports"?: \["&lt;article&gt;"\], "window"? (seconds, default 60), "windowMode"? ("seconds" \| "turn": the cited speaker's turn, bounded by the window), "maxUsd"? (default 5), "limit"? (a stratified sample, by the operator's verdict), "itemsFrom"? (an earlier run's exact items; no reports, window, windowMode or limit with it)} -&gt; {jobId, run}. Every claim of the registry's fact-checks (or of "reports") with the operator's verdict and a citation with cues is asked of each model, one claim per call (the report's title, the claim's section, the claim, its quotes, the transcript in the window; never the findings or the verdict), and scored against the rulings. On draft:local when any model is local (through the GPU arbiter; unloaded at the end), else draft:api; the run stops at maxUsd, and an API run is refused past caps.daily. A "run" that exists continues with this call's models only (answered pairs are skipped; refused under another prompt version). Results stay local, in .generation/bench/verdicts/&lt;run&gt;/ (umtool's /tools/bench). The log ends with @@bench-verdicts {run, status, items, skipped, spentUsd, stopped?}. | `pnpm ops bench-verdicts --json '{"models":["claude-sonnet-5-5","qwen3:8b"],"maxUsd":5}' --wait` | | `frame-scan` | frame-scan reads a saved stream's frames for a profile's progress: {"slug", "id", "profile"? ("poker", the default), "everySeconds"? (default settings.generation.frames.everySeconds, 10), "from"?, "to"? (source seconds), "maxFrames"? (5000), "model"? (default the `frames` route's model), "maxUsd"? (default frames.maxUsd, at most caps.max), "hero"? (the hero's screen name, a hint), "framesPerAsk"? (1-8), "crop"? (\[x, y, w, h\] as fractions of the picture: the part read and hashed, e.g. the poker client beside a webcam), "fresh"? (read every frame again: another model or prompt), "evict"?, "rederive"?} -&gt; {jobId, model, queueKey}. The video's saved container is sampled (keyframes, one ffmpeg a half hour) into a frame cache on the channel's media side; near-duplicate frames are skipped; the rest are read by the vision model and the numbers the streamer said are read from the transcript; frame-scan.&lt;profile&gt;.json beside the video gets the readings and the derived series, events, segments and flags (a frame and a spoken number that disagree). On `frames` (API) or draft:local (a local vision model, through the GPU arbiter). The same body again resumes: read frames are never asked again. Refused when the video is not saved (persist-videos first) or past caps.daily; the run stops before an ask that would pass maxUsd. {"evict": true} removes the frame cache and answers at once; {"rederive": true} works the derived timeline out again from the readings the sidecar holds (no model, no frame; refused while a scan of the video runs) and answers {rederived: {before, after, tournaments, eventsByKind}}. The log ends with @@frame-scan {slug, id, profile, file, frames, kept, read, failed, readings, spentUsd, totalUsd, events, tournaments, flags, stopped?}. | `pnpm ops frame-scan --json '{"slug":"demo-channel","id":"dQw4w9WgXcQ","profile":"poker","maxUsd":2}' --wait`<br>`pnpm ops frame-scan --json '{"slug":"demo-channel","id":"dQw4w9WgXcQ","hero":"DemoHero","crop":[0.02,0.1,0.7,0.68],"from":3000,"to":3600}' --wait`<br>`pnpm ops frame-scan --json '{"slug":"demo-channel","id":"dQw4w9WgXcQ","evict":true}'`<br>`pnpm ops frame-scan --json '{"slug":"demo-channel","id":"dQw4w9WgXcQ","rederive":true}'` | | `mirror-scan` | mirror-scan pairs a mirror channel with the creator it copies: {"slug", "dryRun"?} -&gt; {jobId}. The channel's config names the creator's channels (mirror.of; channel-config's "mirrorOf"); refused without them. Each of the mirror's videos, dated by its recorded date (else its upload date), is matched with the creator's videos uploaded one day before to two after, by title words and duration (the index's records; no media, no network); per video the matches and a status: only-copy (no creator platform has it public), creator-deleted (removed on one platform, public on another), never-uploaded (missing on one platform, public on the rest) or creator-public. The other way: the creator's removed (deleted or private) uploads dated inside the mirror's window, and which the mirror holds. Written to transcripts/mirrors/&lt;slug&gt;.json (private: never published); the channel page's Mirror stage shows it. dryRun writes nothing. The log ends with @@mirror-scan {slug, dryRun, file?, of, missing?, window, videos, matched, byStatus, byPlatform, creatorRemoved: {inWindow, held, byChannel}}. | `pnpm ops mirror-scan --json '{"slug":"demo-vod-archive","dryRun":true}' --wait`<br>`pnpm ops mirror-scan --json '{"slug":"demo-vod-archive"}' --wait` | -| `report-schedule` | report-schedule keeps a recurring report on a cadence the editor ticks: {"action": "list" \| "create" \| "update" \| "pause" \| "resume" \| "delete" \| "tick-now" \| "reset-triage" \| "learn" \| "unlearn" \| "promote-alias", …}. create takes {"shape": "living" \| "series", "topic", "question"?, "channels", "case"?, "from"?, "terms"?, "regex"?, "cadence" ({"kind": "daily" \| "weekly" \| "every", "at": "HH:MM", "dow"?, "days"?} or "weekly mon 06:00"), "tz"?, "article"? (living), "autoMakeCurrent"? (living), "model"?, "maxUsd"?, "dryRun"?} -&gt; {plan, schedule?}: the plan names the first tick, the model and its cap. A living report is one article kept current: each tick fetches the scope (R4's stage 1) and refreshes it, the new iteration left ready (or made current with autoMakeCurrent); its first tick is its first sweep. A series makes an edition each tick: a new article &lt;series&gt;-&lt;date&gt; over the window since the last edition ("&lt;topic&gt; · week of &lt;date&gt;"); a window the terms (or, with none, any recording) do not match is a quiet edition: recorded, no article, $0. Ticks run as report-tick jobs, one at a time, never on an idle boot, held by the lane's gate (lane report-schedule); a window missed while the editor was down is ONE catch-up tick. A cap refusal ends a tick held-by-cap. update {"id", …} (a new cadence re-plans from now); pause / resume {"id"}; delete {"id", "confirm"?} answers the plan unless confirm is true; tick-now {"id"} -&gt; {jobId} (refused while a tick of it is queued or running); --wait prints the tick's @@report-tick {json}. list {"id"?} answers the schedules with their chip, call and spend, and the lane. A tick whose scan hit a cap (or did not reach a channel) and found nothing ends partial, naming what it did not reach — never quiet. reset-triage {"id", "k"?, "confirm"?} discards a schedule's triage state (its runs from run k on, default all; seen.json, so the next run counts new from its since; the quiet editions they covered): the plan unless confirm is true; refused while a tick runs. learn {"id", "dryRun"?} runs the proposal pass now (R6.3: learned spellings): the triage model lists likely mis-hearings of each name in the terms; each must occur in scope (an uncapped count) and the judge must say, quoting the line, that it means the name, before it joins the candidate query as an escaped literal ("terms + N learned"); the answer is the plan (the names it asks about) and the job (a report-draft job on the triage model's lane); dryRun answers the plan only. A create of a schedule that triages, a change of its terms, and a tick a week after the last pass start one too. unlearn {"id", "spelling"} removes a learned spelling (never learned again). promote-alias {"id", "spelling", "site"?, "confirm"?} writes it as a search alias (global, or the site's), a new alias or a trigger on the one for that name: the plan unless confirm is true. | `pnpm ops report-schedule --json '{"action":"create","shape":"series","topic":"Co-host updates","channels":["demo-channel"],"cadence":"weekly mon 06:00","dryRun":true}'`<br>`pnpm ops report-schedule --json '{"action":"create","shape":"watch","topic":"Co-host watch","channels":["demo-channel"],"terms":"co-host","cadence":"daily 06:00","dryRun":true}'`<br>`pnpm ops report-schedule --json '{"action":"list"}'`<br>`pnpm ops report-schedule --json '{"action":"tick-now","id":"co-host-updates"}' --wait`<br>`pnpm ops report-schedule --json '{"action":"delete","id":"co-host-updates","confirm":true}'`<br>`pnpm ops report-schedule --json '{"action":"reset-triage","id":"co-host-updates"}'`<br>`pnpm ops report-schedule --json '{"action":"learn","id":"co-host-updates","dryRun":true}'`<br>`pnpm ops report-schedule --json '{"action":"promote-alias","id":"co-host-updates","spelling":"Gothics"}'` | +| `report-schedule` | report-schedule keeps a recurring report on a cadence the editor ticks: {"action": "list" \| "create" \| "update" \| "pause" \| "resume" \| "delete" \| "tick-now" \| "reset-triage" \| "learn" \| "unlearn" \| "promote-alias" \| "add-spelling", …}. create takes {"shape": "living" \| "series", "topic", "question"?, "channels", "case"?, "from"?, "terms"?, "regex"?, "cadence" ({"kind": "daily" \| "weekly" \| "every", "at": "HH:MM", "dow"?, "days"?} or "weekly mon 06:00"), "tz"?, "article"? (living), "autoMakeCurrent"? (living), "model"?, "maxUsd"?, "dryRun"?} -&gt; {plan, schedule?}: the plan names the first tick, the model and its cap. A living report is one article kept current: each tick fetches the scope (R4's stage 1) and refreshes it, the new iteration left ready (or made current with autoMakeCurrent); its first tick is its first sweep. A series makes an edition each tick: a new article &lt;series&gt;-&lt;date&gt; over the window since the last edition ("&lt;topic&gt; · week of &lt;date&gt;"); a window the terms (or, with none, any recording) do not match is a quiet edition: recorded, no article, $0. Ticks run as report-tick jobs, one at a time, never on an idle boot, held by the lane's gate (lane report-schedule); a window missed while the editor was down is ONE catch-up tick. A cap refusal ends a tick held-by-cap. update {"id", …} (a new cadence re-plans from now); pause / resume {"id"}; delete {"id", "confirm"?} answers the plan unless confirm is true; tick-now {"id"} -&gt; {jobId} (refused while a tick of it is queued or running); --wait prints the tick's @@report-tick {json}. list {"id"?} answers the schedules with their chip, call and spend, and the lane. A tick whose scan hit a cap (or did not reach a channel) and found nothing ends partial, naming what it did not reach — never quiet. reset-triage {"id", "k"?, "confirm"?} discards a schedule's triage state (its runs from run k on, default all; seen.json, so the next run counts new from its since; the quiet editions they covered): the plan unless confirm is true; refused while a tick runs. learn {"id", "dryRun"?} runs the proposal pass now (R6.3: learned spellings): the triage model lists likely mis-hearings of each name in the terms; each must occur in scope (an uncapped count) and the judge must say, quoting the line, that it means the name, before it joins the candidate query as an escaped literal ("terms + N learned"); the answer is the plan (the names it asks about) and the job (a report-draft job on the triage model's lane); dryRun answers the plan only. A create of a schedule that triages, a change of its terms, and a tick a week after the last pass start one too. unlearn {"id", "spelling"} removes a learned spelling (never learned again). promote-alias {"id", "spelling", "site"?, "confirm"?} writes it as a search alias (global, or the site's), a new alias or a trigger on the one for that name: the plan unless confirm is true. add-spelling {"id", "spelling", "means"} adds a spelling by hand (no model): "means" is one of the names the terms watch; it is counted in scope and its proving line found by code, and kept (source hand) only when it occurs; a removed spelling added by hand is no longer blocked. | `pnpm ops report-schedule --json '{"action":"create","shape":"series","topic":"Co-host updates","channels":["demo-channel"],"cadence":"weekly mon 06:00","dryRun":true}'`<br>`pnpm ops report-schedule --json '{"action":"create","shape":"watch","topic":"Co-host watch","channels":["demo-channel"],"terms":"co-host","cadence":"daily 06:00","dryRun":true}'`<br>`pnpm ops report-schedule --json '{"action":"list"}'`<br>`pnpm ops report-schedule --json '{"action":"tick-now","id":"co-host-updates"}' --wait`<br>`pnpm ops report-schedule --json '{"action":"delete","id":"co-host-updates","confirm":true}'`<br>`pnpm ops report-schedule --json '{"action":"reset-triage","id":"co-host-updates"}'`<br>`pnpm ops report-schedule --json '{"action":"learn","id":"co-host-updates","dryRun":true}'`<br>`pnpm ops report-schedule --json '{"action":"promote-alias","id":"co-host-updates","spelling":"Gothics"}'` | | `audio-audit` | audio-audit decodes every audio file a channel holds, with error tolerance, and writes the verdict beside it in audio-integrity.json: {"slug" \| "platform" (every channel on it, e.g. "odysee"), "scope"? ("untranscribed", the default: videos with no transcript yet; "all": every video holding audio), "max"? (files decoded across the run), "force"? (decode again a file whose record is still its own)} -&gt; {jobIds, channels, refused}. One audio-audit job per channel on the audio-audit queue: one file at a time machine-wide, at idle I/O priority and nice 19. The verdict is clean, damaged (a gap, or under 98% of the container's duration decodes) or undecodable, with the decoded seconds, the gaps, the file's size and mtime and ffmpeg's version. The same body again resumes (a file whose record matches is skipped). A channel whose media is unreachable is refused; a drive that stops answering mid-run ends that channel's job with the sentence (failed), as do two decodes in a row past their deadline (a minute plus a tenth of the audio's length). Corrupt full sources are left to their retry. Damaged untranscribed files (and their salvage transcripts) are the report's corruptHeldAudio bucket, held out of the transcription lane: retry-bucket {"bucket": "corruptHeldAudio"} refetches them; a transcription of one salvages automatically. Each log ends with @@audio-audit {slug, scope, held, fresh, planned, checked, clean, damaged, undecodable, unmeasured, timedOut, corruptFullSource, stopped?}. | `pnpm ops audio-audit --json '{"platform":"odysee","scope":"untranscribed"}' --wait`<br>`pnpm ops audio-audit --json '{"slug":"demo-odysee","scope":"all","max":50}'` | ### Usage, flags and environment diff --git a/common/controller/learnedSpellings.test.ts b/common/controller/learnedSpellings.test.ts @@ -260,3 +260,37 @@ test("applyTriageLearning: a heard spelling the run confirmed is kept; a blocked assert.deepEqual(f?.dropped.map((d) => d.reason), ["no-hits"]); assert.equal(await applyTriageLearning({ ...base, owner: "no-such" }, paths, NOW), null); }); + +test("add-spelling (release 32): a spelling by hand — a watched name, proved by code, kept as hand; refusals; a removed one unblocked", async () => { + const paths = store(); + await createSchedule(parseCreate(WATCH), depsOf(paths)); + const proved: string[] = []; + const proveSpelling = async (i: { spelling: string; means: string; at: string }) => { + proved.push(i.spelling); + if (i.spelling === "Pya Tortlet") return { ok: false as const, reason: "no-hits" as const, why: "does not occur in scope (4 recordings counted)" }; + return { ok: true as const, spelling: learnedOf(i.spelling, { means: i.means, source: "hand" as const, at: i.at }) }; + }; + const d = { ...depsOf(paths), proveSpelling }; + // No prover: refused as not wired. + assert.match((await ask({ action: "add-spelling", id: "pia-watch", spelling: "pia tart lit", means: "Pia Tartlet" }, depsOf(paths))).error, /not wired/); + const out = await ask({ action: "add-spelling", id: "pia-watch", spelling: "pia tart lit", means: "Pia Tartlet" }, d); + assert.equal(out.ok, true, out.error); + assert.deepEqual([out.added.spelling, out.added.source, out.unblocked], ["pia tart lit", "hand", false]); + const f = await readLearned(paths, { shape: "watch", id: "pia-watch" }); + assert.deepEqual(f?.learned.map((l) => [l.spelling, l.source]), [["pia tart lit", "hand"]]); + // Refusals, each before any count: not a watched name, the name itself, the terms find it, learned already. + assert.match((await ask({ action: "add-spelling", id: "pia-watch", spelling: "pie tart", means: "Someone" }, d)).error, /one of the watched names: "Pia Tartlet"/); + assert.match((await ask({ action: "add-spelling", id: "pia-watch", spelling: "pia tartlet", means: "Pia Tartlet" }, d)).error, /the name itself/); + assert.match((await ask({ action: "add-spelling", id: "pia-watch", spelling: "the contest", means: "Pia Tartlet" }, d)).error, /terms already find/); + assert.match((await ask({ action: "add-spelling", id: "pia-watch", spelling: "Pia Tart Lit", means: "Pia Tartlet" }, d)).error, /learned "Pia Tart Lit" already/); + assert.match((await ask({ action: "add-spelling", id: "pia-watch", spelling: "a b c d e", means: "Pia Tartlet" }, d)).error, /too long/); + assert.deepEqual(proved, ["pia tart lit"]); + // Not in scope: refused with the count's words; nothing written. + assert.match((await ask({ action: "add-spelling", id: "pia-watch", spelling: "Pya Tortlet", means: "Pia Tartlet" }, d)).error, /not kept: does not occur in scope/); + // A removed spelling added back by hand: the block lifted. + await ask({ action: "unlearn", id: "pia-watch", spelling: "pia tart lit" }, depsOf(paths)); + const back = await ask({ action: "add-spelling", id: "pia-watch", spelling: "pia tart lit", means: "Pia Tartlet" }, d); + assert.deepEqual([back.ok, back.unblocked], [true, true]); + const g = await readLearned(paths, { shape: "watch", id: "pia-watch" }); + assert.deepEqual([g?.learned.length, g?.blocked.length], [1, 0]); +}); diff --git a/common/controller/learnedSpellings.ts b/common/controller/learnedSpellings.ts @@ -16,6 +16,11 @@ // plan, unless confirm — then the alias written // through the editor's alias writer (aliasesStore: // global, or one site's) and the spelling marked +// addSpellingByHand `report-schedule {"action":"add-spelling"}` (release +// 32 R2): a person's spelling of a watched name, counted +// in scope and its proving line found by code +// (triage/confirm.ts proveByHand), kept with source +// "hand" — no model, no judge // // Nothing here runs a model; the pass is controller/reportLearn.ts's job. @@ -29,6 +34,12 @@ import { coerceAliasConfig, type SearchAlias } from "../lib/searchAliases"; import { isValidSiteId, listSiteIds } from "../lib/site"; import { LEARNED_CAP, + SPELLING_MAX_CHARS, + SPELLING_MAX_WORDS, + coveredByTerms, + namesOf, + normSpelling, + termKeys, PASSES_KEPT, emptyLearned, learnedCite, @@ -44,6 +55,7 @@ import { } from "../lib/report/draft/triage/learned"; import { learnedFilePath, readLearned } from "../lib/report/draft/triage/learnedStore"; import type { TriageFile } from "../lib/report/draft/triage/types"; +import type { HandProof } from "../lib/report/draft/triage/confirm"; export class LearnedInputError extends Error {} @@ -239,3 +251,58 @@ export async function promoteAlias(id: string, spelling: string, site: string | ); return plan; } + +// ─── a spelling added by hand (release 32 R2) ─── + +/** Proves a hand spelling over the watch's scope (the editor binds it to its corpus: reportLearn.ts handProver). */ +export type HandProver = (i: { spelling: string; means: string; scope: { channels: string[]; from?: string; to?: string }; at: string }) => Promise<HandProof>; + +/** + * ADD A SPELLING BY HAND: `spelling` is how the transcripts write `means`, one of + * the names the watch's terms watch. Refused when it is not a spelling (words, + * at most SPELLING_MAX_WORDS), is the name itself, the terms already find it, it + * is learned already, or the watch is at its cap; then counted in scope and its + * proving line found (`prove`, code only) — refused when it does not occur. A + * spelling the operator removed is the operator's to add back: adding it by hand + * lifts the block. Answers what was kept. + */ +export async function addSpellingByHand( + id: string, + input: { spelling?: unknown; means?: unknown }, + deps: { paths: LearnedPathsFull; prove: HandProver; now?: () => Date }, +): Promise<{ added: LearnedSpelling; unblocked: boolean }> { + const spelling = normSpelling(input.spelling); + const means = typeof input.means === "string" ? input.means.trim() : ""; + if (!spelling) fail('"spelling" is how the transcripts write the name'); + const s = await scheduleOf(id, deps.paths); + const names = namesOf(s.scope.terms ?? null, s.scope.regex === true); + if (!names.length) fail(`"${id}" watches no name: its terms have no capitalised literal alternative`); + if (!names.includes(means)) fail(`"means" is one of the watched names: ${names.map((n) => `"${n}"`).join(", ")}`); + const key = spellingKey(spelling); + const words = key.split(" ").filter(Boolean).length; + if (!key || !/^[\p{L}\p{N}][\p{L}\p{N}' .&-]*$/u.test(spelling)) fail(`"${spelling}" is not a spelling (words only)`); + if (spelling.length > SPELLING_MAX_CHARS || words > SPELLING_MAX_WORDS) fail(`"${spelling}" is too long (at most ${SPELLING_MAX_WORDS} words, ${SPELLING_MAX_CHARS} characters)`); + if (key === spellingKey(means)) fail(`"${spelling}" is the name itself`); + if (termKeys(s).includes(key) || coveredByTerms(s.scope.terms, s.scope.regex === true)(spelling)) fail(`the terms already find "${spelling}"`); + const cur = await readLearned(deps.paths, s); + if (cur?.learned.some((l) => spellingKey(l.spelling) === key)) fail(`"${id}" has learned "${spelling}" already`); + if ((cur?.learned.length ?? 0) >= LEARNED_CAP) fail(`the watch keeps at most ${LEARNED_CAP} spellings: remove one first`); + const now = deps.now?.() ?? new Date(); + const proof = await deps.prove({ spelling, means, scope: { channels: s.scope.channels, ...(s.scope.from ? { from: s.scope.from } : {}) }, at: now.toISOString() }); + if (!proof.ok) fail(`"${spelling}" is not kept: ${proof.why}`); + const added = (proof as Extract<HandProof, { ok: true }>).spelling; + let unblocked = false; + await mutateLearned( + s, + deps.paths, + (f) => { + const blocked = f.blocked.filter((b) => spellingKey(b.spelling) !== key); + unblocked = blocked.length !== f.blocked.length; + const m = mergeLearned({ ...f, blocked }, { kept: [added], dropped: [], at: now.toISOString(), cap: LEARNED_CAP }); + if (!m.added.length) fail(`"${spelling}" is not kept: ${m.dropped.at(-1)?.why ?? "the watch refused it"}`); + return m.file; + }, + now, + ); + return { added, unblocked }; +} diff --git a/common/controller/reportLearn.ts b/common/controller/reportLearn.ts @@ -28,7 +28,7 @@ import { Meter, providerOf, structuredAnswer, unloadOllama } from "../lib/llm"; import { corpusCuesOf } from "../lib/report/draft/tasks/corpusCues"; import { usageOf } from "../lib/report/draft/tasks/run"; import { enumerateViaTools } from "../lib/report/draft/refresh/delta"; -import { countViaEnumerate, runLearnPass } from "../lib/report/draft/triage/confirm"; +import { countViaEnumerate, proveByHand, runLearnPass } from "../lib/report/draft/triage/confirm"; import { CONFIRM_WINDOWS, LEARNED_CAP, @@ -46,7 +46,7 @@ import { readLearned } from "../lib/report/draft/triage/learnedStore"; import { readScheduleById } from "../lib/report/schedule/store"; import { triagesFirst, type Schedule } from "../lib/report/schedule/types"; import { appendGenerationUsage, dailyCapRefusal, dayUsage, utcDay, type GenerationUsageRow } from "./generationUsage"; -import { recordLearnPass } from "./learnedSpellings"; +import { recordLearnPass, type HandProver } from "./learnedSpellings"; import { REPORT_DRAFT_JOB_KIND, REPORT_DRAFT_RESULT_MARKER, llmConfigOf, resolveCorpus, type ReportDraftDeps } from "./reportDraft"; export const LEARN_TASK = "learn" as const; @@ -246,3 +246,24 @@ export function learnStep(draft: ReportDraftDeps, calls: { enqueueLearn?: typeof }; }; } + +/** + * A spelling added by hand, proved over the corpus a sweep of the scope would + * read (release 32 R2): the count and the proving line, code only — no model, + * no job (a count is one scan). The editor binds this into `report-schedule + * {"action":"add-spelling"}` (controller/learnedSpellings.ts addSpellingByHand). + */ +export function handProver(deps: Pick<ReportDraftDeps, "paths" | "corpusTools" | "settings">): HandProver { + return async (i) => { + const gen = (deps.settings ?? getSettings)().generation; + const where = await resolveCorpus({}, i.scope.channels, deps.paths, gen); + const c = await deps.corpusTools(where.source); + try { + const count = c.countPhrases ? (a: Parameters<NonNullable<typeof c.countPhrases>>[0]) => c.countPhrases!(a) : c.listRecordings ? countViaEnumerate((a) => c.listRecordings!(a), enumerateViaTools(c)) : null; + if (!count) throw new Error("this corpus cannot count a spelling in scope (no listing)"); + return await proveByHand(i, { corpus: c, count }); + } finally { + await c.close().catch(() => {}); + } + }; +} diff --git a/common/controller/reportScheduleOps.ts b/common/controller/reportScheduleOps.ts @@ -32,6 +32,9 @@ // change of terms start one too // {"action": "unlearn", "id", "spelling"} (R6.3) remove a learned spelling; // it is never learned again +// {"action": "add-spelling", "id", (release 32 R2) a spelling added by +// "spelling", "means"} hand: counted in scope, its proving +// line found by code, kept as "hand" // {"action": "promote-alias", "id", (R6.3) a learned spelling as a // "spelling", "site"?, "confirm"?} search alias (global, or a // site's) through the alias @@ -58,12 +61,12 @@ import { } from "./reportSchedule"; import { enqueueTick, type TickDeps } from "./reportTick"; import { isReportScheduleArmed } from "./reportScheduleRunner"; -import { LearnedInputError, planPromoteAlias, promoteAlias, unlearnSpelling } from "./learnedSpellings"; +import { LearnedInputError, addSpellingByHand, planPromoteAlias, promoteAlias, unlearnSpelling, type HandProver } from "./learnedSpellings"; import { planLearn, type LearnPlan, type LearnTrigger } from "./reportLearn"; import { triagesFirst } from "../lib/report/schedule/types"; import { namesForPass } from "../lib/report/draft/triage/learned"; -export const REPORT_SCHEDULE_ACTIONS = ["list", "create", "update", "pause", "resume", "delete", "tick-now", "reset-triage", "learn", "unlearn", "promote-alias"] as const; +export const REPORT_SCHEDULE_ACTIONS = ["list", "create", "update", "pause", "resume", "delete", "tick-now", "reset-triage", "learn", "unlearn", "promote-alias", "add-spelling"] as const; export type ReportScheduleActionName = (typeof REPORT_SCHEDULE_ACTIONS)[number]; export const REPORT_SCHEDULE_BODY_KEYS = [ @@ -91,6 +94,7 @@ export const REPORT_SCHEDULE_BODY_KEYS = [ "threshold", "k", "spelling", + "means", "site", ] as const; @@ -136,7 +140,7 @@ async function learnAfter(id: string, trigger: LearnTrigger, s: { shape: string; /** One `report-schedule` ask. Input errors answer `{ok: false, error}` (a 400); nothing throws for them. */ export async function reportScheduleAction( body: Record<string, unknown>, - deps: TickDeps & { lane?: () => LaneView; enqueueLearn?: EnqueueLearnFn }, + deps: TickDeps & { lane?: () => LaneView; enqueueLearn?: EnqueueLearnFn; proveSpelling?: HandProver }, ): Promise<Ok | Refused> { const action = body.action; if (typeof action !== "string" || !(REPORT_SCHEDULE_ACTIONS as readonly string[]).includes(action)) { @@ -193,6 +197,12 @@ export async function reportScheduleAction( const out = await unlearnSpelling(id, String(body.spelling ?? ""), deps); return { ok: true, removed: out.removed, blocked: out.blocked }; } + case "add-spelling": { + const id = idOf(body); + if (!deps.proveSpelling) return { ok: false, error: "not wired: no corpus to count a spelling in (release 32) in this process" }; + const out = await addSpellingByHand(id, { spelling: body.spelling, means: body.means }, { paths: deps.paths, prove: deps.proveSpelling, ...(deps.now ? { now: deps.now } : {}) }); + return { ok: true, added: out.added, unblocked: out.unblocked }; + } case "promote-alias": { const id = idOf(body); const site = body.site === undefined || body.site === null || body.site === "" || body.site === "global" ? null : typeof body.site === "string" ? body.site.trim() : ""; diff --git a/common/lib/report/draft/triage/confirm.ts b/common/lib/report/draft/triage/confirm.ts @@ -349,3 +349,55 @@ export async function runLearnPass( const c = await confirmSpellings({ pending: p.proposed, question: i.question, scope: i.scope, at: i.at, ...(i.windows ? { windows: i.windows } : {}) }, d); return { proposed: p.proposed, kept: c.kept, dropped: [...p.dropped, ...c.dropped], counted: c.counted, judged: c.judged }; } + +// ─── a spelling added by hand (release 32 R2) ─── + +export type HandProof = { ok: true; spelling: LearnedSpelling } | { ok: false; reason: LearnedDropReason; why: string }; + +/** + * A spelling a PERSON says means a watched name: counted in scope (uncapped, the + * same count a proposal gets) and its proving line found by code — the first + * line holding it, in the newest recordings that do (up to `windows`). No judge: + * the person's word is the judge's. Not kept when it does not occur in scope, or + * when no line holding it could be read. + */ +export async function proveByHand( + i: { spelling: string; means: string; scope: { channels: string[]; from?: string; to?: string }; at: string; windows?: number }, + d: { corpus: Pick<CorpusToolsLike, "call">; count: CountPhrasesFn }, +): Promise<HandProof> { + const spelling = normSpelling(i.spelling); + const counted = await d.count({ phrases: [spelling], channels: i.scope.channels, ...(i.scope.from ? { date_from: i.scope.from } : {}), ...(i.scope.to ? { date_to: i.scope.to } : {}), examples: 10 }); + const c = counted.counts[spelling] ?? { recordings: 0, lines: 0, examples: [] }; + if (!c.recordings) { + return counted.complete + ? { ok: false, reason: "no-hits", why: `does not occur in scope (${counted.listed.toLocaleString("en-US")} recordings counted)` } + : { ok: false, reason: "unread", why: `not found in what the count read (partial: ${counted.problems.join("; ")})` }; + } + const ids = [...c.examples].sort((a, b) => String(b.date ?? "").localeCompare(String(a.date ?? ""))).slice(0, i.windows ?? CONFIRM_WINDOWS); + const parsed = parseTranscripts(await d.corpus.call("get_transcripts", { video_ids: ids.map((x) => x.id), query: spellingPattern(spelling), regex: true, link_style: "base", channels: i.scope.channels })); + for (const x of ids) { + const t = parsed.get(x.id); + const line = t?.lines.find((l) => l && holdsSpelling(l[1], spelling)); + if (!t || !line) continue; + const at = line[0]; + return { + ok: true, + spelling: { + spelling, + means: i.means, + quote: clean(line[1]), + recording: x.id, + channel: x.channelSlug ?? slugOfBase(t.momentBase), + title: t.title ?? x.title ?? x.id, + start: at, + ...(t.momentBase ? { url: `${t.momentBase}${Math.floor(at)}` } : {}), + hits: c.recordings, + lines: c.lines, + ...(counted.complete ? {} : { partial: true }), + source: "hand", + at: i.at, + }, + }; + } + return { ok: false, reason: "unread", why: `counted in ${c.recordings} recording(s), but no line holding it could be read` }; +} diff --git a/common/lib/report/draft/triage/learned.test.ts b/common/lib/report/draft/triage/learned.test.ts @@ -16,7 +16,7 @@ import path from "node:path"; import type { EnumeratedAnswer, EnumerateFn, ListFn } from "../refresh/delta"; import type { CorpusToolsLike } from "../tasks/types"; import { EXTRACT_SYSTEM } from "../tasks/sweep-pipeline"; -import { confirmSpellings, countViaEnumerate, keptByWindows, runLearnPass, type CountPhrasesFn } from "./confirm"; +import { confirmSpellings, countViaEnumerate, keptByWindows, proveByHand, runLearnPass, type CountPhrasesFn } from "./confirm"; import { checkHeard, judgeCandidates } from "./judge"; import { CONFIRM_SYSTEM, @@ -460,3 +460,17 @@ test("runTriage with learned spellings and names: terms + N learned, the heard s const back = await readTriageFile("pia-watch", f0.k, paths); assert.equal(back?.learning?.kept.length, 1); }); + +test("proveByHand (release 32): counted in scope, the proving line found by code, no model; no hits is refused", async () => { + const count = countViaEnumerate(listOver(RECS), enumerateOver(RECS)); + const corpus = corpusOver(RECS); + const at = "2026-10-16T12:00:00.000Z"; + const got = await proveByHand({ spelling: "Pia Tart Lit", means: "Pia Tartlet", scope: { channels: [CHAN] }, at }, { corpus, count }); + assert.equal(got.ok, true); + const l = (got as { spelling: LearnedSpelling }).spelling; + // The newest recording holding it first: d-04, its first line. + assert.deepEqual([l.spelling, l.means, l.recording, l.channel, l.start, l.quote, l.hits, l.source], ["Pia Tart Lit", "Pia Tartlet", "d-04", CHAN, 0, "pia tart lit could not make it tonight", 2, "hand"]); + assert.equal(l.url, `https://synth.example/?v=${CHAN}%2Fd-04&t=0`); + const none = await proveByHand({ spelling: "Pya Tortlet", means: "Pia Tartlet", scope: { channels: [CHAN] }, at }, { corpus, count }); + assert.deepEqual(none.ok ? null : none.reason, "no-hits"); +}); diff --git a/common/lib/report/draft/triage/learned.ts b/common/lib/report/draft/triage/learned.ts @@ -50,7 +50,9 @@ export const PASSES_KEPT = 10; export const SPELLING_MAX_WORDS = 4; export const SPELLING_MAX_CHARS = 48; -export type SpellingSource = "proposed" | "heard"; +// "hand" (release 32 R2): added by a person in umtool ("Add spelling"): counted in +// scope and its proving line found by code, no model; the person's word is the judge's. +export type SpellingSource = "proposed" | "heard" | "hand"; /** One tick's use of a spelling: the candidates it matched in triage run `k`, and how many were flagged. */ export type LearnedUse = { k: number; at: string; candidates: number; flagged: number }; diff --git a/editor/app/api/ops/_reportSchedule.ts b/editor/app/api/ops/_reportSchedule.ts @@ -11,8 +11,9 @@ import { } from "yt-dlp-transcript-common/controller/reportTick"; import type { ReportDraftDeps } from "yt-dlp-transcript-common/controller/reportDraft"; import { armReportSchedule } from "yt-dlp-transcript-common/controller/reportScheduleRunner"; -import { enqueueLearn, learnStep } from "yt-dlp-transcript-common/controller/reportLearn"; +import { enqueueLearn, handProver, learnStep } from "yt-dlp-transcript-common/controller/reportLearn"; import type { EnqueueLearnFn } from "yt-dlp-transcript-common/controller/reportScheduleOps"; +import type { HandProver } from "yt-dlp-transcript-common/controller/learnedSpellings"; import { createCorpusTools } from "yt-dlp-transcript-mcp/callTool"; import { SourceRegistry, enumerate } from "yt-dlp-transcript-mcp/research"; import { refreshEditor, researchEditor } from "./_researchEditor"; @@ -41,6 +42,9 @@ import { refreshEditor, researchEditor } from "./_researchEditor"; // when one is due; awaited (learnStep). `enqueueLearn` is // the same pass for the ops action and a create or a // change of terms (not awaited) +// proveSpelling release 32 R2: a spelling added by hand, counted over the +// corpus a sweep would read and its proving line found — +// code only (handProver), for `add-spelling` const countWindow: CountWindow = async (q) => { const paths = getPaths(); @@ -66,7 +70,7 @@ const countWindow: CountWindow = async (q) => { return { recordings: e.result.total, ...(e.result.truncated ? { partial: true, unreached } : {}) }; }; -export function reportScheduleDeps(): TickDeps & { enqueueLearn: EnqueueLearnFn } { +export function reportScheduleDeps(): TickDeps & { enqueueLearn: EnqueueLearnFn; proveSpelling: HandProver } { const paths = getPaths(); const draft: ReportDraftDeps = { paths, corpusTools: (source) => createCorpusTools({ source }), researchEditor, refreshEditor }; return { @@ -79,6 +83,7 @@ export function reportScheduleDeps(): TickDeps & { enqueueLearn: EnqueueLearnFn triage: triageStep(draft), learn: learnStep(draft), }, + proveSpelling: handProver(draft), enqueueLearn: async (id, trigger) => { const out = await enqueueLearn(id, trigger, draft); if (!out.ok) return out; diff --git a/editor/app/api/ops/report-schedule/route.ts b/editor/app/api/ops/report-schedule/route.ts @@ -10,7 +10,7 @@ export const dynamic = "force-dynamic"; // POST {"action": "list" | "create" | "update" | "pause" | "resume" | // "delete" | "tick-now" | "reset-triage" | "learn" | "unlearn" | -// "promote-alias", …} +// "promote-alias" | "add-spelling", …} // // A recurring report (umtool R5): a LIVING report (one article kept current — // each tick re-fetches the scope and refreshes it), a SERIES (a dated @@ -38,6 +38,9 @@ export const dynamic = "force-dynamic"; // model's lane. A create or a change of terms starts one too // (the answer's `learn`) // unlearn {id, spelling} -> {removed, blocked} never learned again +// add-spelling {id, spelling, means} -> {added, unblocked} (release 32) +// a spelling added by hand: counted in scope, its proving line +// found by code — no model; refused when it does not occur // promote-alias {id, spelling, site?, confirm?} -> {plan} | {promoted} // a learned spelling as a search alias (global, or a site's), // through the alias writer; the plan unless confirm diff --git a/scripts/archilyzer-ops.mjs b/scripts/archilyzer-ops.mjs @@ -476,7 +476,8 @@ const ACTIONS = [ // report-tick job. R6: a watch (no article until a triage finds something), // and triageFirst. R6.1: reset-triage discards a schedule's triage state. // R6.3: learn (the proposal pass), unlearn and promote-alias (a learned - // spelling as a search alias, plan then confirm). + // spelling as a search alias, plan then confirm). Release 32: add-spelling + // (a spelling added by hand, counted in scope by code). "report-schedule", // THE AUDIO AUDIT (release 31): every audio file a channel (or a platform's // channels) holds decoded with error tolerance, one at a time at idle @@ -1536,7 +1537,8 @@ export function usage() { "", 'report-schedule keeps a recurring report on a cadence the editor ticks:', ' {"action": "list" | "create" | "update" | "pause" | "resume" | "delete" |', - ' "tick-now" | "reset-triage" | "learn" | "unlearn" | "promote-alias", …}.', + ' "tick-now" | "reset-triage" | "learn" | "unlearn" | "promote-alias" |', + ' "add-spelling", …}.', ' create takes {"shape": "living" | "series", "topic",', ' "question"?, "channels", "case"?, "from"?, "terms"?, "regex"?, "cadence"', ' ({"kind": "daily" | "weekly" | "every", "at": "HH:MM", "dow"?, "days"?}', @@ -1575,7 +1577,10 @@ export function usage() { ' spelling (never learned again). promote-alias {"id", "spelling", "site"?,', ' "confirm"?} writes it as a search alias (global, or the site\'s), a new', " alias or a trigger on the one for that name: the plan unless confirm is", - " true.", + ' true. add-spelling {"id", "spelling", "means"} adds a spelling by hand', + ' (no model): "means" is one of the names the terms watch; it is counted in', + " scope and its proving line found by code, and kept (source hand) only", + " when it occurs; a removed spelling added by hand is no longer blocked.", "", "Env: ARCHILYZER_EDITOR_URL (default http://localhost:3001), WORKER_TOKEN,", " ARCHILYZER_AGENT (provenance of a tag write; default \"cli\").", diff --git a/umtool/app/api/schedules/route.ts b/umtool/app/api/schedules/route.ts @@ -6,18 +6,19 @@ import { readSchedules, scheduleAsk } from "@/lib/schedules"; export const dynamic = "force-dynamic"; const NO_STORE = { "cache-control": "no-store" }; -const ACTIONS = ["create", "update", "pause", "resume", "delete", "tick-now", "learn", "unlearn", "promote-alias"]; +const ACTIONS = ["create", "update", "pause", "resume", "delete", "tick-now", "learn", "unlearn", "promote-alias", "add-spelling"]; // RECURRING REPORTS (plans/umtool-redesign.md, R5). // // GET every schedule, read from the article store (no editor call) // POST { action: create | update | pause | resume | delete | tick-now | -// learn | unlearn | promote-alias, … } +// learn | unlearn | promote-alias | add-spelling, … } // -- the editor's `report-schedule` ops action, forwarded as sent: the // editor keeps the schedules and is their one writer (a create with // `dryRun: true` is its plan; a delete without `confirm: true` is its // plan; R6.3: a learn with `dryRun: true` and a promote-alias without -// `confirm: true` are plans). Answers the editor's JSON, or its +// `confirm: true` are plans; release 32: add-spelling, a spelling +// added by hand). Answers the editor's JSON, or its // refusal in its words. export async function GET() { try { diff --git a/umtool/components/series/LearnedSpellings.tsx b/umtool/components/series/LearnedSpellings.tsx @@ -26,11 +26,16 @@ import { cn } from "@/lib/utils"; // alias as it would be written, then Confirm // promote (`report-schedule promote-alias`) // "Propose spellings" runs the proposal pass now (`report-schedule learn`). +// "Add spelling" (release 32 R2) is the same by hand, with no model: the +// spelling and the watched name it means; the editor counts it in scope and +// finds its proving line by code (`report-schedule add-spelling`), and keeps it +// as "added by hand" only when it occurs. // Every write is the editor's, through POST /api/schedules; the page re-reads. // // Labels are contracts (e2e/learned-spellings.spec.ts): the list "Learned // spellings", the buttons "Remove", "Confirm remove", "Promote to search -// alias", "Confirm promote", "Keep it", "Propose spellings", the regions +// alias", "Confirm promote", "Keep it", "Propose spellings", "Add spelling" +// (its fields "spelling to add" and "the name it means"), the regions // "remove <spelling>" and "promote <spelling>", the select "Alias list". // --------------------------------------------------------------------------- @@ -73,6 +78,9 @@ export default function LearnedSpellings({ view }: { view: LearnedView }) { const [removing, setRemoving] = useState(false); const [plan, setPlan] = useState<PromotePlanView | null>(null); const [target, setTarget] = useState("global"); + const [adding, setAdding] = useState(false); + const [newSpelling, setNewSpelling] = useState(""); + const [means, setMeans] = useState(view.names[0] ?? ""); const lit: LearnedRow | null = view.rows.find((r) => r.spelling === litId) ?? view.rows[0] ?? null; const onLight = useCallback((d: LitDetail) => { setLitId(d.id); @@ -136,6 +144,7 @@ export default function LearnedSpellings({ view }: { view: LearnedView }) { <span className="font-mono text-meter">{r.hits}</span> recording{r.hits === 1 ? "" : "s"} {r.partial ? " at least" : ""} · {r.source} {r.source === "heard" && r.k ? ` (triage ${r.k})` : ""} + {r.source === "hand" ? " (by hand)" : ""} </small> </span> <span className="flex items-center gap-1"> @@ -164,7 +173,7 @@ export default function LearnedSpellings({ view }: { view: LearnedView }) { <p className="m-0 text-[12px] text-muted"> “{lit.spelling}” means {lit.means} · in <span className="font-mono text-meter">{lit.hits}</span> recording{lit.hits === 1 ? "" : "s"} {lit.lines ? ` (${lit.lines} line${lit.lines === 1 ? "" : "s"})` : ""} - {lit.partial ? ", at least" : ""} · {lit.source === "heard" ? `heard by the judge${lit.k ? ` in triage ${lit.k}` : ""}` : "proposed by the model"} · learned {day(lit.at)} + {lit.partial ? ", at least" : ""} · {lit.source === "heard" ? `heard by the judge${lit.k ? ` in triage ${lit.k}` : ""}` : lit.source === "hand" ? "added by hand" : "proposed by the model"} · learned {day(lit.at)} {lit.uses?.length ? ` · last ${lit.uses.length} run${lit.uses.length === 1 ? "" : "s"}: ${lit.uses.map((u) => `${u.flagged}/${u.candidates}`).join(", ")} flagged` : ""} {lit.idle ? " · idle: its name is no longer in the terms" : ""} {lit.promoted ? ` · promoted to ${lit.promoted.to === "global" ? "the global aliases" : `${lit.promoted.to}'s aliases`} (${lit.promoted.alias})` : ""} @@ -327,6 +336,9 @@ export default function LearnedSpellings({ view }: { view: LearnedView }) { > {busy === "learn" ? "Proposing…" : "Propose spellings"} </Button> + <Button size="sm" variant={adding ? "pressed" : "outline"} aria-expanded={adding} disabled={!hydrated || !view.names.length} data-learned-add="" onClick={() => setAdding(!adding)}> + Add spelling + </Button> <span> {view.rows.length} of {view.cap} kept {view.blocked.length ? ` · ${view.blocked.length} removed` : ""} @@ -340,6 +352,50 @@ export default function LearnedSpellings({ view }: { view: LearnedView }) { </span> )} </div> + {adding && ( + <form + aria-label="add a spelling" + data-learned-add-form="" + className="flex flex-wrap items-end gap-2 rounded-[3px] border border-seam-2 p-3 text-[12px]" + onSubmit={(e) => { + e.preventDefault(); + const sp = newSpelling.trim(); + if (!sp || !means) return; + void act("add", { action: "add-spelling", spelling: sp, means }, (b) => { + const a = b.added as { spelling?: string; hits?: number; partial?: boolean } | undefined; + setAdding(false); + setNewSpelling(""); + setLitId(a?.spelling ?? sp); + setStatus({ tone: "ok", text: `Added “${a?.spelling ?? sp}” → ${means}: in ${a?.hits ?? 0}${a?.partial ? " or more" : ""} recording${a?.hits === 1 ? "" : "s"}${b.unblocked ? " (no longer removed)" : ""}` }); + router.refresh(); + }); + }} + > + <label className="flex flex-col gap-1"> + <span className="text-muted">How the transcripts write it</span> + <input + aria-label="spelling to add" + value={newSpelling} + onChange={(e) => setNewSpelling(e.target.value)} + className="w-56 rounded-[3px] border border-seam-2 bg-panel px-2 py-1 text-[12.5px]" + /> + </label> + <label className="flex flex-col gap-1"> + <span className="text-muted">The name it means</span> + <select aria-label="the name it means" value={means} onChange={(e) => setMeans(e.target.value)} className="rounded-[3px] border border-seam-2 bg-panel px-2 py-1 text-[12.5px]"> + {view.names.map((n) => ( + <option key={n} value={n}> + {n} + </option> + ))} + </select> + </label> + <Button type="submit" size="sm" variant="outline" disabled={busy !== null || !newSpelling.trim() || !means}> + {busy === "add" ? "Counting…" : "Count and add"} + </Button> + <span className="basis-full text-muted">counted in the watch&apos;s scope; kept only when it occurs there</span> + </form> + )} {view.dropped.length > 0 && ( <details className="text-[12px]" data-learned-dropped=""> <summary className="cursor-pointer text-muted">Dropped, newest first ({view.dropped.length})</summary>