Archilyzer · Source

archilyzer

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

commit 2c4281327ee4518c4c010adbe3de833061730d3d
parent df21626b9d8dd1755513f7a28293d1fea88026f0
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Wed, 18 Nov 2026 02:00:31 -0500

x-trending: /review lists the paused watches

A watch that cannot tick (a stale jar, the X alert, a cooldown, no profile) is a thing waiting on a person: /review has a Paused watches section, shown only when there is one, naming the topic, since when, the reason's sentence and that it resumes by itself at the first scan after Refresh cookies. Nothing is read while a watch is paused.

Co-Authored-By: Claude <noreply@anthropic.com>

Diffstat:
Mcommon/controller/xTrendingWatch.test.ts | 10++++++++++
Mcommon/controller/xTrendingWatch.ts | 13+++++++++++++
Mcommon/views/review.ts | 43+++++++++++++++++++++++++++++++++++++++++++
Meditor/app/review/lib/loadReview.ts | 11++++++++++-
Meditor/app/review/page.tsx | 53++++++++++++++++++++++++++++++++++++++++++++++++++++-
5 files changed, 128 insertions(+), 2 deletions(-)

diff --git a/common/controller/xTrendingWatch.test.ts b/common/controller/xTrendingWatch.test.ts @@ -18,6 +18,7 @@ import { disarmXTrendingWatch, isXTrendingWatchArmed, noteXTrendingWatchRead, + pausedXTrendingWatches, scanXTrendingWatches, xTrendingWatchFollowUp, type WatchRefusal, @@ -200,6 +201,14 @@ test("a stale jar PAUSES the watches, raises X's jar-age alert and enqueues noth let w = (await readXTrendingWatches(root(paths))).kettles; assert.deepEqual(w.paused && [w.paused.reason, w.paused.since], ["jar", "2026-11-18T10:00:00.000Z"]); assert.match(describeXTrendingWatch(w, T0), /PAUSED since 2026-11-18 10:00 UTC: X cookies were last refreshed 61 min ago/); + // /review's rows: the paused watches, by library and topic, each with its sentence. + assert.deepEqual( + (await pausedXTrendingWatches(paths)).map((r) => [r.slug, r.topic, r.title, r.reason, r.since, r.until]), + [ + ["lib", "kettles", "Kettles", "jar", "2026-11-18T10:00:00.000Z", "2026-11-20T10:00:00.000Z"], + ["lib", "saucers", "Saucers", "jar", "2026-11-18T10:00:00.000Z", "2026-11-20T10:00:00.000Z"], + ], + ); // Still stale ten minutes later: paused since the same moment, said once more to the alert, nothing enqueued. h.state.now = T0 + 10 * MIN; const still = await scanXTrendingWatches(h.deps); @@ -214,6 +223,7 @@ test("a stale jar PAUSES the watches, raises X's jar-age alert and enqueues noth assert.equal(h.ticks.length, 1); w = (await readXTrendingWatches(root(paths))).kettles; assert.equal(w.paused, undefined); + assert.deepEqual(await pausedXTrendingWatches(paths), []); }); test("the X alert, a cooldown and a missing profile pause too, each by its reason; only the jar raises the jar alert", async () => { diff --git a/common/controller/xTrendingWatch.ts b/common/controller/xTrendingWatch.ts @@ -52,6 +52,7 @@ import { type XTrendingWatch, type XTrendingWatchPauseReason, } from "../lib/xTrending/watch"; +import { pausedWatchRows, type PausedWatchRow } from "../views/review"; import { listChannelConfigs } from "./channels"; import { xTrendingHeld } from "./readXTrending"; @@ -318,6 +319,18 @@ export async function xTrendingWatchFollowUp( return ids.length > 0 ? { ids, shots: watch.shots, fresh: ids.length - owed, owed } : null; } +// The watches that are paused now, across every library — /review's section. +export async function pausedXTrendingWatches(paths: Paths): Promise<PausedWatchRow[]> { + const libraries = []; + for (const slug of await defaultLibraries(paths)) { + const root = path.join(paths.channelsDir, slug); + const watches = await readXTrendingWatches(root); + if (!Object.values(watches).some((w) => watchIsLive(w) && w.paused)) continue; + libraries.push({ slug, watches, topics: await readXTrendingTopics(root) }); + } + return pausedWatchRows(libraries); +} + // ─── arming (the editor's instrumentation, below the idle gate) ─── type Armed = { deps: WatchScanDeps; timer: ReturnType<typeof setInterval> | null; scanning: Promise<WatchScanResult> | null }; diff --git a/common/views/review.ts b/common/views/review.ts @@ -56,3 +56,46 @@ export function autoPausedRows(model: ChannelPriority): AutoPausedRow[] { } return rows; } + +// PAUSED WATCHES (lane x-trending-2): topics of an X trending library someone +// switched a watch on for, which the watch's scan cannot tick now — X's cookie +// jar is past its limit, the X alert is up, X is cooling down, there is no +// connected profile. It is here because what ends the pause is a PERSON's +// press (Refresh cookies on /cookies; the editor never refreshes X's jar by +// itself), and until someone makes it the watch reads nothing. +export type PausedWatchRow = { + slug: string; + topic: string; + title: string; + reason: string; + // ISO: when the pause began, and when the watch ends whether or not it resumes. + since: string; + until: string; + sentence: string; +}; + +export function pausedWatchRows( + libraries: ReadonlyArray<{ + slug: string; + topics: ReadonlyArray<{ id: string; title: string }>; + watches: Readonly<Record<string, { on: boolean; until: string; ended?: unknown; paused?: { reason: string; since: string; sentence: string } }>>; + }>, +): PausedWatchRow[] { + const rows: PausedWatchRow[] = []; + for (const lib of libraries) { + for (const [topic, w] of Object.entries(lib.watches)) { + if (!w.on || w.ended || !w.paused) continue; + rows.push({ + slug: lib.slug, + topic, + title: lib.topics.find((t) => t.id === topic)?.title ?? topic, + reason: w.paused.reason, + since: w.paused.since, + until: w.until, + sentence: w.paused.sentence, + }); + } + } + // Stable across renders. + return rows.sort((a, b) => a.slug.localeCompare(b.slug) || a.topic.localeCompare(b.topic)); +} diff --git a/editor/app/review/lib/loadReview.ts b/editor/app/review/lib/loadReview.ts @@ -16,7 +16,9 @@ import { getSettings } from "yt-dlp-transcript-common/lib/settings"; import { autoPausedRows, type AutoPausedRow, + type PausedWatchRow, } from "yt-dlp-transcript-common/views/review"; +import { pausedXTrendingWatches } from "yt-dlp-transcript-common/controller/xTrendingWatch"; import { getDuplicateReport } from "../../lib/requestCache"; // The half of the old actionable summary that is a HUMAN judgement rather than @@ -53,15 +55,21 @@ export type ReviewSummary = { // reading it costs nothing (getSettings is memoized and every other page on // this render already called it). autoPaused: AutoPausedRow[]; + // WATCHES OF X TRENDING TOPICS THAT ARE PAUSED (lane x-trending-2): a watch + // runs only while X's cookie jar is fresh, and only a person refreshes it. + // Read from each library's own watch.json (a library is in no index). + pausedWatches: PausedWatchRow[]; }; export async function loadReviewSummary(paths: Paths): Promise<ReviewSummary> { - const [duplicates, duplicateOverrides, mediaScan, mediaScanOverrides] = + const [duplicates, duplicateOverrides, mediaScan, mediaScanOverrides, pausedWatches] = await Promise.all([ getDuplicateReport(paths), readDuplicateOverrides(paths), readMediaScanReport(paths), readMediaScanOverrides(paths), + // A library that cannot be read must not take the page down. + pausedXTrendingWatches(paths).catch(() => []), ]); return { duplicates, @@ -69,5 +77,6 @@ export async function loadReviewSummary(paths: Paths): Promise<ReviewSummary> { mediaScan, mediaScanOverrides, autoPaused: autoPausedRows(getSettings().channelPriority), + pausedWatches, }; } diff --git a/editor/app/review/page.tsx b/editor/app/review/page.tsx @@ -13,7 +13,7 @@ import type { DuplicateOverrides, DuplicateReport, } from "yt-dlp-transcript-common/lib/duplicates"; -import type { AutoPausedRow } from "yt-dlp-transcript-common/views/review"; +import type { AutoPausedRow, PausedWatchRow } from "yt-dlp-transcript-common/views/review"; import { loadReviewSummary } from "./lib/loadReview"; import { ResumeAutoPausedButton } from "./components/ResumeAutoPausedButton"; import { RunDuplicateDetectionButton } from "./components/RunDuplicateDetectionButton"; @@ -46,6 +46,7 @@ export default async function ReviewPage() { <div className="flex flex-col gap-6"> <h1 className="text-2xl font-semibold">Review</h1> <AutoPausedSection rows={review.autoPaused} /> + <PausedWatchesSection rows={review.pausedWatches} /> <XRunConsole initial={xRun} /> <DuplicatesSection report={review.duplicates} @@ -59,6 +60,56 @@ export default async function ReviewPage() { ); } +// WATCHES OF X TRENDING TOPICS THAT ARE PAUSED (lane x-trending-2). +// +// A watch reads a topic's trending page every so often — but only while X's +// cookie jar is under its limit, and the editor never refreshes that jar by +// itself (a refresh loads X). So a watch someone switched on stops reading +// the moment the jar goes stale, and what starts it again is a person's press +// on /cookies. That is a thing waiting on a human, which is what this page +// lists; the dashboard's X banner says the jar is stale, this says what is +// not being read because of it. +// +// RENDERED ONLY WHEN THERE IS SOMETHING TO SAY, like the section below it. +function PausedWatchesSection({ rows }: { rows: PausedWatchRow[] }) { + if (rows.length === 0) return null; + const when = (iso: string) => iso.slice(0, 16).replace("T", " "); + return ( + <section aria-label="paused watches" className="flex flex-col gap-2"> + <div className="flex items-center justify-between flex-wrap gap-2"> + <h2 className="text-lg font-semibold">Paused watches ({rows.length})</h2> + <Link href="/cookies" className="text-sm underline hover:text-foreground"> + Cookies + </Link> + </div> + <ul className="flex flex-col gap-2"> + {rows.map((row) => ( + <li + key={`${row.slug}/${row.topic}`} + aria-label={`paused watch ${row.slug} ${row.topic}`} + className="border border-border rounded-md p-3 flex flex-col gap-1 text-sm" + > + <div className="flex items-center gap-2 flex-wrap"> + <Link href={`/channels/${row.slug}`} className="font-medium underline hover:text-foreground"> + {row.title} + </Link> + <span className="text-muted-foreground"> + {row.slug} · paused since {when(row.since)} UTC · the watch ends {when(row.until)} UTC + </span> + </div> + <span>{row.sentence}</span> + <span className="text-xs text-muted-foreground"> + {row.reason === "jar" + ? "It resumes by itself at the first scan after Refresh cookies on /cookies. Nothing is read while it is paused." + : "It resumes by itself at the first scan that finds this gone. Nothing is read while it is paused."} + </span> + </li> + ))} + </ul> + </section> + ); +} + // CHANNELS THE MACHINE PAUSED WHILE NOBODY WAS LOOKING. // // The storage watch forces a channel to `paused` when the drive its media is on