Archilyzer · Source

archilyzer

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

commit 5e07e4df807607f42f7bfc54c94ad45e04913260
parent 51423478c4e53e0fb5545bb3e370320763e313a4
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 14 Oct 2026 18:56:43 -0400

umtool: the partial states — a tick-partial card, the triage run's partial, a partial refresh and daily check (R6.1)

- Inbox kind tick-partial (Your call, "See what was missed"): the newest tick
  ended partial, its reason naming what the scan did not reach.
- The series page tones a partial tick and marks a partial triage run with
  what it did not reach; the triage page names it on tier 0.
- A refresh that ended partial is labelled so on the Overview.
- The daily check keeps what a capped scan did not reach; a partial check
  with nothing new still raises refresh-available, saying so;
  `umtool refresh --check` prints PARTIAL with the channels.

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

Diffstat:
Mumtool/app/series/[id]/page.tsx | 9++++++++-
Mumtool/bin/refresh.ts | 2+-
Mumtool/components/articles/RefreshSummary.tsx | 4+++-
Mumtool/components/series/TriageView.tsx | 9+++++++--
Mumtool/lib/articles/refresh.ts | 2+-
Mumtool/lib/inbox/groups.mjs | 6+++++-
Mumtool/lib/inbox/refresh.test.ts | 15+++++++++++++++
Mumtool/lib/inbox/refresh.ts | 22+++++++++++++++++++---
Mumtool/lib/inbox/schedules.mjs | 10++++++++--
Mumtool/lib/inbox/schedules.test.mjs | 11+++++++++++
Mumtool/lib/inbox/what.mjs | 1+
Mumtool/lib/research/triage-types.ts | 2++
Mumtool/lib/research/triage.ts | 3++-
13 files changed, 83 insertions(+), 13 deletions(-)

diff --git a/umtool/app/series/[id]/page.tsx b/umtool/app/series/[id]/page.tsx @@ -56,6 +56,8 @@ const TICK_TONE: Record<string, "on" | "info" | "open" | "blocking" | "neutral"> done: "on", "no-change": "info", quiet: "info", + // R6.1: a capped scan that found nothing — never quiet, the operator's call. + partial: "open", "held-by-cap": "open", failed: "blocking", interrupted: "blocking", @@ -309,7 +311,7 @@ function TriagePanel({ id, t }: { id: string; t: ScheduleTriage }) { </thead> <tbody> {t.runs.map((r) => ( - <tr key={r.k} data-triage-run={r.k} data-escalated={r.escalated ? "yes" : "no"}> + <tr key={r.k} data-triage-run={r.k} data-escalated={r.escalated ? "yes" : "no"} {...(r.partial ? { "data-triage-partial": "" } : {})}> <TD> <Link href={r.href} prefetch={false} className="ink-link font-mono text-[12px]"> {id} · {r.k} @@ -318,6 +320,11 @@ function TriagePanel({ id, t }: { id: string; t: ScheduleTriage }) { <TD className="whitespace-nowrap font-mono text-[11.5px]">{when(r.at)}</TD> <TD className="text-[12px]"> {r.status === "done" ? `${r.candidates} candidates · ${r.flagged} flagged · ${r.dismissed} dismissed` : r.status} + {r.partial && ( + <span className="block"> + <span className={badgeVariants({ variant: "open", size: "sm" })}>partial</span> <span className="text-text-2">{r.partial}</span> + </span> + )} </TD> <TD className="text-[12px]"> <span className={badgeVariants({ variant: r.escalated ? "meter" : "info", size: "sm" })}>{r.escalated ? "escalated" : "below"}</span> <span className="text-text-2">{r.why}</span> diff --git a/umtool/bin/refresh.ts b/umtool/bin/refresh.ts @@ -40,7 +40,7 @@ if (has("--check")) { console.log( c.status === "unchecked" ? `${c.article} i${c.iteration}: UNCHECKED — ${c.reason ?? c.error ?? "no corpus here holds its scope"}` - : `${c.article} i${c.iteration}: ${c.newCount} new recording${c.newCount === 1 ? "" : "s"} since ${c.since.slice(0, 10)}${c.titles.length ? ` (${c.titles.join(", ")})` : ""}${c.partial ? " — partial" : ""} · over ${c.corpus ?? c.source}`, + : `${c.article} i${c.iteration}: ${c.newCount} new recording${c.newCount === 1 ? "" : "s"} since ${c.since.slice(0, 10)}${c.titles.length ? ` (${c.titles.join(", ")})` : ""}${c.partial ? ` — PARTIAL (${c.unreached?.length ? `not reached: ${c.unreached.join(", ")}` : "a cap was hit"})` : ""} · over ${c.corpus ?? c.source}`, ); } for (const s of out.skipped) console.log(`${s.article}: ${s.why}`); diff --git a/umtool/components/articles/RefreshSummary.tsx b/umtool/components/articles/RefreshSummary.tsx @@ -16,6 +16,8 @@ import RefreshWatch from "./RefreshWatch"; const STATUS: Record<string, { label: string; variant: "neutral" | "on" | "blocking" | "state" | "info" | "meter" }> = { running: { label: "running", variant: "meter" }, "no-change": { label: "no change", variant: "info" }, + // R6.1: the search again was capped and found nothing — not "no change". + partial: { label: "partial", variant: "state" }, updated: { label: "updated", variant: "on" }, "held-by-cap": { label: "held by the cap", variant: "state" }, failed: { label: "failed", variant: "blocking" }, @@ -80,7 +82,7 @@ export default function RefreshSummary({ row, iterationsHref }: { row: RefreshRo {row.fetch.length ? `${fetched} fetch${fetched === 1 ? "" : "es"} done` : "no fetch"} {skipped.length ? ` · skipped: ${skipped.map((f) => `${f.channel} ${f.action} (${f.reason ?? f.status})`).join("; ")}` : ""} {row.build ? ` · build ${row.build.site ?? "none"} ${row.build.status}${row.build.reason ? ` (${row.build.reason})` : ""}` : ""} - {row.update?.usd ? ` · ${usd(row.update.usd)} spent` : !live && row.refresh === "no-change" && !row.update ? " · $0" : ""} + {row.update?.usd ? ` · ${usd(row.update.usd)} spent` : !live && (row.refresh === "no-change" || row.refresh === "partial") && !row.update ? " · $0" : ""} {row.update?.refusal ? ` · about ${usd(row.update.estimateUsd)} to update` : ""} </p> </Card> diff --git a/umtool/components/series/TriageView.tsx b/umtool/components/series/TriageView.tsx @@ -11,7 +11,7 @@ import { LitLine } from "@/components/ui/lit-line"; import { useHydrated } from "@/components/ui/use-hydrated"; import { triageHref, workHref } from "@/lib/hrefs"; import type { FlagMark, TriageRunView } from "@/lib/research/triage-types"; -import { thresholdWords, type TriageDismissal, type TriageFlag } from "yt-dlp-transcript-common/lib/report/draft/triage/types"; +import { partialWords, thresholdWords, type TriageDismissal, type TriageFlag } from "yt-dlp-transcript-common/lib/report/draft/triage/types"; import { cn } from "@/lib/utils"; // --------------------------------------------------------------------------- @@ -269,7 +269,12 @@ export default function TriageView({ initial }: { initial: TriageRunView }) { {t0.newBy === "id" ? "by id since the last run" : t0.newBy === "date" ? `since ${f.since ?? "the start"}` : "named"} {t0.scanned ? ` · ${t0.scanned} in scope` : ""} {t0.cut.length ? <span className="text-doubt-text"> · {t0.cut.length} past the cap</span> : null} - {t0.partial ? <span className="text-doubt-text"> · partial</span> : null} + {t0.partial ? ( + <span className="text-doubt-text" data-tier0-partial=""> + {" "} + · partial — {partialWords(t0)} + </span> + ) : null} </> ) : ( "not run" diff --git a/umtool/lib/articles/refresh.ts b/umtool/lib/articles/refresh.ts @@ -37,7 +37,7 @@ export type RefreshRow = { n: number; parent: number | null; status: Iteration["status"]; - // The refresh's own: running, no-change, updated, held-by-cap, failed, cancelled. + // The refresh's own: running, no-change, partial (R6.1), updated, held-by-cap, failed, cancelled. refresh: RefreshFile["status"] | null; summary: string; // changed: null when the refreshed iteration recorded no matching-line counts (not tracked). diff --git a/umtool/lib/inbox/groups.mjs b/umtool/lib/inbox/groups.mjs @@ -53,6 +53,9 @@ const KIND_CATEGORY = { // review gate, like a finished iteration. "tick-failed": "spend", "tick-held": "spend", + // R6.1: a tick whose scan hit a cap and found nothing — not quiet: the + // operator's call (narrow the scope, reset the triage, tick again). + "tick-partial": "spend", "edition-ready": "review", // R6: a watch found something: the operator's call, research it or not. "worth-researching": "spend", @@ -88,7 +91,7 @@ export function groupOf(d) { // Within a group: the brief's order first (proposals before failed runs), then // everything else as equals. -const KIND_RANK = { "worth-researching": 0, "research-proposal": 0, "iteration-failed": 1, "tick-held": 2, "tick-failed": 2, "iteration-ready": 0, "edition-ready": 0, "drafts-unreviewed": 1, "unreadable-notes": 0, "refresh-held": 2, "refresh-available": 2 }; +const KIND_RANK = { "worth-researching": 0, "research-proposal": 0, "iteration-failed": 1, "tick-held": 2, "tick-failed": 2, "tick-partial": 2, "iteration-ready": 0, "edition-ready": 0, "drafts-unreviewed": 1, "unreadable-notes": 0, "refresh-held": 2, "refresh-available": 2 }; const SEVERITY_RANK = { blocking: 0, open: 1, info: 2 }; // ONE primary action per decision, its button copy naming the result. @@ -103,6 +106,7 @@ const ACTION_LABEL = { "looks-done": "Mark done", "tick-failed": "Tick now", "tick-held": "Raise cap", + "tick-partial": "See what was missed", "edition-ready": "Review edition", "worth-researching": "Open the board", "claim-unadjudicated": "Adjudicate claim", diff --git a/umtool/lib/inbox/refresh.test.ts b/umtool/lib/inbox/refresh.test.ts @@ -146,6 +146,21 @@ test("the coverage rule: its own build gone, the research corpus holding the sco assert.ok(!rows.some((r) => r.piece === "a:articles/refresh-wide"), "an unchecked article gets no card"); }); +test("R6.1: a partial check is never a silent zero — nothing new in what it read still raises the card, saying what it did not reach", async () => { + const { readFile: rf, writeFile: wf } = await import("node:fs/promises"); + const file = mod.refresh.CHECK_FILE(); + const kept = JSON.parse(await rf(file, "utf8")); + const entry = kept.articles["refresh-gone"]; + assert.ok(entry, "the coverage test checked refresh-gone"); + kept.articles["refresh-gone"] = { ...entry, newCount: 0, newIds: [], titles: [], partial: true, unreached: ["Harbor Radio (stopped at page 1 of 2)"] }; + await wf(file, JSON.stringify(kept)); + const [graph, life, mutes] = await ctx(); + const rows = await mod.refresh.refreshDecisions(graph, life, mutes, { background: false }); + const card = rows.find((r) => r.kind === "refresh-available" && r.piece === "a:articles/refresh-gone"); + assert.ok(card, JSON.stringify(rows.map((r) => [r.kind, r.piece]))); + assert.match(card!.why, /^nothing new since \d{4}-\d{2}-\d{2} in what the check read · the check was partial — not reached: Harbor Radio \(stopped at page 1 of 2\); a Refresh reads the rest$/); +}); + test("the plan and the start are the editor's: a dry run, then report-draft refresh", async () => { const plan = await mod.articles.planArticleRefresh(fixture.REFRESH_ARTICLE, { fetch: false }); assert.equal(plan.article, fixture.REFRESH_ARTICLE); diff --git a/umtool/lib/inbox/refresh.ts b/umtool/lib/inbox/refresh.ts @@ -70,7 +70,10 @@ export type CheckEntry = { newIds: string[]; titles: string[]; source: string; + // R6.1: the check's scan hit a cap — `unreached` what it did not read. A + // partial check never claims "nothing new" (it raises the card, saying so). partial: boolean; + unreached?: string[]; error?: string; }; type CheckFile = { format: typeof CHECK_FORMAT; version: 1; articles: Record<string, CheckEntry> }; @@ -118,7 +121,10 @@ function enumerateOver(source: ShardSource): EnumerateFn { title: h.title ?? null, })), partial: e.result.truncated, - unreached: e.result.coverage?.channelsNotReached ?? [], + unreached: [ + ...(e.result.coverage?.channelStopped ? [`${e.result.coverage.channelStopped.channel} (stopped at page ${e.result.coverage.channelStopped.page} of ${e.result.coverage.channelStopped.pages})`] : []), + ...(e.result.coverage?.channelsNotReached ?? []), + ], }; }; } @@ -199,6 +205,7 @@ export async function checkArticle(article: string, now = new Date()): Promise<C titles: newIds.slice(0, 5).map((id) => c.rows.get(id)?.title ?? id), source: handle, partial: c.partial, + ...(c.partial ? { unreached: c.unreached } : {}), }; } catch (e) { return { ...base, status: "unchecked", reason: (e as Error).message, since: "", newCount: 0, newIds: [], titles: [], source: "", partial: false, error: (e as Error).message }; @@ -290,7 +297,9 @@ export async function refreshDecisions(graph: PieceGraph, life: LifecycleRead, m if (!pieces.includes(p)) continue; const c = kept.articles[article]; // An unchecked article (no corpus here holds its scope) claims nothing: no card. - if (!c || c.error || c.status === "unchecked" || c.newCount <= 0 || c.iteration !== read.current.report) continue; + // R6.1: a partial check with nothing new is NOT "nothing new": it raises + // the card, saying what the check did not reach. + if (!c || c.error || c.status === "unchecked" || (c.newCount <= 0 && !c.partial) || c.iteration !== read.current.report) continue; // A refresh made after the check already looked (or is looking). if (its.some((it) => it.kind === "refresh" && it.parent === c.iteration && Date.parse(it.createdAt) >= Date.parse(c.checkedAt))) continue; if (its.some((it) => it.kind === "refresh" && (it.status === "queued" || it.status === "running"))) continue; @@ -298,7 +307,14 @@ export async function refreshDecisions(graph: PieceGraph, life: LifecycleRead, m ...row, kind: REFRESH_AVAILABLE, target: `i${c.iteration}`, - why: `${plural(c.newCount, "new recording")} mention${c.newCount === 1 ? "s" : ""} this since ${c.since.slice(0, 10)}${c.titles.length ? `: ${c.titles.slice(0, 3).join(", ")}${c.newCount > 3 ? ", …" : ""}` : ""}`, + why: [ + c.newCount > 0 + ? `${c.partial ? "at least " : ""}${plural(c.newCount, "new recording")} mention${c.newCount === 1 ? "s" : ""} this since ${c.since.slice(0, 10)}${c.titles.length ? `: ${c.titles.slice(0, 3).join(", ")}${c.newCount > 3 ? ", …" : ""}` : ""}` + : `nothing new since ${c.since.slice(0, 10)} in what the check read`, + c.partial ? `the check was partial — ${c.unreached?.length ? `not reached: ${c.unreached.join(", ")}` : "a cap was hit"}; a Refresh reads the rest` : null, + ] + .filter(Boolean) + .join(" · "), href, severity: "open", at: Date.parse(c.checkedAt) || 0, diff --git a/umtool/lib/inbox/schedules.mjs b/umtool/lib/inbox/schedules.mjs @@ -6,6 +6,9 @@ // and nothing has ticked since -- Your call: Tick now // tick-held the newest tick was held by a cap (the day's, or the // job's over the policy's max) -- Your call: Raise cap +// tick-partial (R6.1) the newest tick's scan hit a cap or did not reach a +// channel and found nothing in what it read -- never quiet: +// Your call, the reason naming what it did not reach // edition-ready a series' edition is done and its article has nothing // current yet -- Review: read it, make it current // worth-researching (R6) a watch's tick whose triage escalated: the flags @@ -41,12 +44,15 @@ export function scheduleDecisions(views, how) { const call = v.call; if (call) { const held = call.status === "held-by-cap"; + const partial = call.status === "partial"; const est = call.estimateUsd !== undefined ? ` · up to ${usd(call.estimateUsd)} a tick` : ""; out.push({ ...base, - kind: held ? "tick-held" : "tick-failed", + kind: held ? "tick-held" : partial ? "tick-partial" : "tick-failed", target: call.at, - why: `${held ? "held by a cap" : call.status === "interrupted" ? "interrupted" : "failed"}${call.reason ? `: ${call.reason}` : ""}${held ? est : call.usd ? ` · ${usd(call.usd)} spent` : ""}`, + why: partial + ? `${call.reason ?? "partial"}${call.usd ? ` · ${usd(call.usd)} spent` : ""}` + : `${held ? "held by a cap" : call.status === "interrupted" ? "interrupted" : "failed"}${call.reason ? `: ${call.reason}` : ""}${held ? est : call.usd ? ` · ${usd(call.usd)} spent` : ""}`, href: held ? how.settingsHref : v.href, severity: "open", at: timeOf(call.at), diff --git a/umtool/lib/inbox/schedules.test.mjs b/umtool/lib/inbox/schedules.test.mjs @@ -91,3 +91,14 @@ test("a watch's escalated tick is Worth researching (Your call): the flags and w const bare = scheduleDecisions([{ ...watch, ticks: [tick(1)] }], how); assert.equal(bare[0].href, "/series/cowatch/triage/1"); }); + +test("R6.1: a partial tick is Your call (tick partial), its reason naming what the scan did not reach — never quiet", () => { + const d = scheduleDecisions( + [series({ editions: [], call: { at: "2026-10-21T10:00:00.000Z", status: "partial", reason: "partial — not reached: Jeremy Hambly, TheQuartering (Rumble); nothing flagged in what was read", usd: 0 } })], + how, + ); + const [row] = annotate(d, { pieceOf: () => null, lifecycleOf: () => "active" }); + assert.deepEqual([row.kind, row.group, row.action.label, row.action.href], ["tick-partial", "your-call", "See what was missed", "/series/cohost"]); + assert.equal(row.why, "partial — not reached: Jeremy Hambly, TheQuartering (Rumble); nothing flagged in what was read"); + assert.equal(whatOf("tick-partial"), "tick partial"); +}); diff --git a/umtool/lib/inbox/what.mjs b/umtool/lib/inbox/what.mjs @@ -14,6 +14,7 @@ export const WHAT = { "looks-done": "looks done", "tick-failed": "tick failed", "tick-held": "tick held by a cap", + "tick-partial": "tick partial", "edition-ready": "edition ready", "worth-researching": "worth researching", "refresh-available": "new recordings match", diff --git a/umtool/lib/research/triage-types.ts b/umtool/lib/research/triage-types.ts @@ -49,6 +49,8 @@ export type TriageRunRow = { dismissed: number; escalated: boolean; why: string; + /** R6.1: tier 0 was partial — what it did not reach ("not reached: …"). */ + partial: string | null; usd: { tier1: number; tier2: number }; href: string; }; diff --git a/umtool/lib/research/triage.ts b/umtool/lib/research/triage.ts @@ -1,6 +1,6 @@ import { readIteration, readIterationFile } from "yt-dlp-transcript-common/lib/report/iterations"; import { listTriageFiles, listTriageRuns, readTriageFile } from "yt-dlp-transcript-common/lib/report/draft/triage/store"; -import { DEFAULT_TRIAGE_THRESHOLD, precisionOf, suggestThreshold, type TriageFile, type TriageFlag, type TriageThreshold } from "yt-dlp-transcript-common/lib/report/draft/triage/types"; +import { DEFAULT_TRIAGE_THRESHOLD, partialWords, precisionOf, suggestThreshold, type TriageFile, type TriageFlag, type TriageThreshold } from "yt-dlp-transcript-common/lib/report/draft/triage/types"; import type { Schedule } from "yt-dlp-transcript-common/lib/report/schedule/types"; import { readScheduleById } from "yt-dlp-transcript-common/lib/report/schedule/store"; import { clock } from "yt-dlp-transcript-common/lib/search/window"; @@ -131,6 +131,7 @@ export async function readScheduleTriage(s: Schedule): Promise<ScheduleTriage> { dismissed: f.tier1?.dismissed.length ?? 0, escalated: t?.triage?.escalated ?? false, why: t?.triage?.capped ?? f.escalation?.why ?? f.summary, + partial: partialWords(f.tier0), usd: { tier1: f.cost.tier1, tier2: t?.triage?.usd.tier2 ?? 0 }, href: triageHref(s.id, f.k), };