Archilyzer · Source

archilyzer

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

commit 0d5d753ef58de675350a110a761e658a05ae112c
parent e76ce789a01653a792d83b8d340762772a3e21a4
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Mon, 26 Oct 2026 07:47:20 -0400

Docs: COMMANDS.md regenerated (job resume-interrupted, fetch-chat-backlog, channel-config's subLangs and chat); the recipe check reads every pnpm ops job usage line's verbs

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

Diffstat:
MCOMMANDS.md | 11++++++++++-
Mcommon/bin/cli-docs.ts | 7+++++--
Mscripts/archilyzer-ops.mjs | 18+++++++++++++++++-
3 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/COMMANDS.md b/COMMANDS.md @@ -103,7 +103,7 @@ Drives a running editor over HTTP (`/api/ops/*`, the same actions its pages run) | action | what it does | example | |---|---|---| | `channel-priority` | channel-priority sets channels' priority, as the /channels deck's tier control does: {"slugs", "tier": "normal" \| "low" \| "paused"} sets the base tier; with "operation" (sync, transcription, download, digest, backfill) it pins that operation's tier, "tier": null clearing it back to the base; "preset": "sync-only" \| "clear" is the deck's two shortcuts and takes no tier. A manual change clears an automatic pause. {"focus": {"kind": "site", "siteId"} \| {"kind": "channels", "slugs"} \| {"kind": "none"}} alone is the deck's focus bar: those channels lead every lane (a site focus follows its membership); "none" ends it. | `pnpm ops channel-priority --json '{"slugs":["x"],"operation":"download","tier":"paused"}'`<br>`pnpm ops channel-priority --json '{"focus":{"kind":"site","siteId":"x"}}'` | -| `channel-config` | channel-config changes a channel as its Configure form does: {"slug"} and any of "patch" (form field names; "" clears one), "sites" (the WHOLE membership set: \[{"siteId", "groupId"? \| "newGroupName"?}\], \[\] = on no site; an unknown site id is refused), "excludeFromBuild" and "excludeFromCleanup" (set to the value given, not toggled). A VOD mirror's recorded date: "patch": {"recordedDateTitlePattern": "&lt;regex with named groups year, month, day&gt;"} (CHANNEL.md, recordedDate). A mirror's creator channels: "patch": {"mirrorOf": "&lt;slug&gt;, &lt;slug&gt;"} (CHANNEL.md, mirror; then mirror-scan). | `pnpm ops channel-config --json '{"slug":"x","patch":{"downloadFilterExclude":"rerun"}}'`<br>`pnpm ops channel-config --json '{"slug":"x","sites":[{"siteId":"anilyzer"}]}'`<br>`pnpm ops channel-config --json '{"slug":"x","sites":[],"excludeFromBuild":true}'` | +| `channel-config` | channel-config changes a channel as its Configure form does: {"slug"} and any of "patch" (form field names; "" clears one), "sites" (the WHOLE membership set: \[{"siteId", "groupId"? \| "newGroupName"?}\], \[\] = on no site; an unknown site id is refused), "excludeFromBuild" and "excludeFromCleanup" (set to the value given, not toggled). A VOD mirror's recorded date: "patch": {"recordedDateTitlePattern": "&lt;regex with named groups year, month, day&gt;"} (CHANNEL.md, recordedDate). A mirror's creator channels: "patch": {"mirrorOf": "&lt;slug&gt;, &lt;slug&gt;"} (CHANNEL.md, mirror; then mirror-scan). Caption languages and the live chat: "patch": {"subLangs": "en.\*", "chat": "with-download" \| "later" \| "never"} (CHANNEL.md, subLangs and chat). | `pnpm ops channel-config --json '{"slug":"demo-yt","patch":{"chat":"later","subLangs":"en.*"}}'`<br>`pnpm ops channel-config --json '{"slug":"x","patch":{"downloadFilterExclude":"rerun"}}'`<br>`pnpm ops channel-config --json '{"slug":"x","sites":[{"siteId":"anilyzer"}]}'`<br>`pnpm ops channel-config --json '{"slug":"x","sites":[],"excludeFromBuild":true}'` | | `site-config` | site-config sets two keys of a site as its form does: {"siteId"} and any of "citedChannels" (the WHOLE cited scope, channel slugs: what the site's reports may cite without publishing the channel; \[\] clears it; a slug the pool holds is dropped) and "publishAuto" ("off" \| "build" \| "preview" \| "production", the publish lane's policy; a deploying one needs a Pages project, a private site is clamped to "build"). Only those two keys; an unknown site or channel is refused before anything is written. Answers the saved values. | `pnpm ops site-config --json '{"siteId":"anilyzer","citedChannels":["critic-channel"]}'`<br>`pnpm ops site-config --json '{"siteId":"anilyzer","publishAuto":"build"}'` | | `articles-config` | articles-config sets an article's audience and its place in the published list (transcripts/reports/index.json), through the article registry: {"id"} and any of "audience" ("public" \| "private"; absent in report.json = private), "published" (true = listed, false = a draft) and "position" (its place in the list, 0 = first; publishing with none keeps a listed article where it is, else puts it last). Refused before anything is written: an unknown article, a position on a draft or out of range, publishing an article whose report.json has problems (listed). Answers the article as saved. | `pnpm ops articles-config --json '{"id":"demo-article","published":true}'`<br>`pnpm ops articles-config --json '{"id":"demo-article","audience":"public","position":0}'` | | `delete-article` | delete-article deletes an article, as `archilyzer reports delete <id>` does: {"id"}, "dryRun"? (answer the plan — every path with its size, what is kept and why — and write nothing), "force"? (unpublish it, and drop a site page naming it with no report of its own, first). It removes the article's directory (report, video, history, notes, iterations), each iteration's video project under settings.generation.projectsRoot and its staged exports. Refused with the plan (409): a published article or such a site page without "force"; a queued or running iteration, force or not. | `pnpm ops delete-article --json '{"id":"demo-article","dryRun":true}'`<br>`pnpm ops delete-article --json '{"id":"demo-article","force":true}'` | @@ -186,6 +186,7 @@ Drives a running editor over HTTP (`/api/ops/*`, the same actions its pages run) | `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}'` | | `fetch-chat` | fetch-chat fetches ONE video's live chat replay and nothing else: {"slug", "id"} — the chat-only yt-dlp pass (the channel's cookies, the platform's pace) on the platform's download queue, then live\_chat.cues.json. YouTube only: another platform answers "no chat fetcher for &lt;platform&gt;" (info, no job), as do a chat already here and fresh and a video never live. A pass that finds no replay ends done and says so. | `pnpm ops fetch-chat --json '{"slug":"demo-yt","id":"<videoId>"}' --wait` | | `find-clips` | find-clips runs the clip finder's chain for ONE video as one job: {"slug", "id", "target"? (the cut's seconds), "segment"? (one umtool found, "s2"), "project"? (the umtool project a run makes), "whilePaused"?, "dryRun"?}. Persist the source video, the corpus transcript, word timings (data/&lt;id&gt;/words.json), the chat replay (YouTube), diarization — each step skipped when its output exists, named in the log — then umtool's clip finder (POST UMTOOL\_URL/api/report/clips {mode: "new"}), followed to the end. "whilePaused": true runs this one video past the holds: the two transcriptions during a pause-all on a worker the pause alone switched off, and its diarization in the job when the backfill lane is held. "dryRun": true answers each step's plan and starts nothing. With --wait the result — {project, url, created, segments: \[{id, from, to, why}\], steps} — is printed on stdout. | `pnpm ops find-clips --json '{"slug":"demo-yt","id":"<videoId>","dryRun":true}'`<br>`pnpm ops find-clips --json '{"slug":"demo-yt","id":"<videoId>","target":600}' --wait`<br>`pnpm ops find-clips --json '{"slug":"demo-yt","id":"<videoId>","segment":"s2","whilePaused":true}' --wait` | +| `fetch-chat-backlog` | fetch-chat-backlog fetches a channel's stream chats after its downloads: {"slug", "dryRun"?, "limit"?, "queueKey"?} — every held video whose metadata says it was a stream (live\_status was\_live / post\_live) and whose chat is not here, newest first, one at a time through fetch-chat's pass with the batch downloads' gap between two, as one fetch-chat-backlog job on the platform's download queue; a raw replay already here is only normalized. It stops on a rate limit, a held platform, three failures in a row, a drain or "limit" chats; a re-run skips the chats here and the streams known to have none (chat-backlog.json), and a restart resumes it. The download lane queues it by itself (25 a run) for a channel whose "chat" is "later" once it has nothing left to download. "dryRun": true counts from the disk and starts nothing: chats, normalizeOnly, have, settled, notStreams, ids (the first 50). | `pnpm ops fetch-chat-backlog --json '{"slug":"demo-yt","dryRun":true}'` | ### Usage, flags and environment @@ -201,6 +202,7 @@ Usage: pnpm ops <action> [--json '<body>' | --file <path>] [--wait] [--limit <n>] pnpm ops job cancel|drain|promote|force-release|retry <id>... [--wait] pnpm ops job retry-failed [--wait] + pnpm ops job resume-interrupted [<id>...] [--dry-run] [--wait] pnpm ops job wait <id>... [--wait-timeout <seconds>] pnpm ops get settings [<key>] pnpm ops get storage | sites | workers | auto-queue | scheduler @@ -236,6 +238,13 @@ job <verb> <id>... is a /jobs row's button: cancel (a running job is Each id is answered in "results"; one that could not be acted on makes the answer ok: false without stopping the rest. --wait follows the jobs a retry started. job wait <id>... follows jobs already running. +job resume-interrupted does by hand what the editor does at boot: re-queues + the jobs a restart interrupted (the last 24 h, or the ids named) whose kind + resumes on a re-run — an archive.org import, a download-missing, a posts + fetch, a persist, a transcription batch… Each once; never one interrupted + twice in a row, a dry run or a full posts re-walk; one superseded by a + newer job is left. --dry-run lists what it would re-queue (wouldResume) + and why the rest are not (notResumed), and changes nothing. get settings [<key>] is settings.json as the editor reads it (migrated and defaulted; a secret is "<redacted>"), or one top-level key of it. diff --git a/common/bin/cli-docs.ts b/common/bin/cli-docs.ts @@ -200,8 +200,11 @@ export function unknownCommandsIn( ): string[] { const actions = new Set(opsActions(opsUsage)); const nouns = new Set([...opsUsage.matchAll(/pnpm ops get ([a-z][a-z-]*)/g)].map((m) => m[1])); - // `pnpm ops job <verb> <id>` (a /jobs row's button): the verbs its usage line lists. - const jobVerbs = new Set((/pnpm ops job ([a-z|-]+)/.exec(opsUsage)?.[1] ?? "").split("|").filter(Boolean)); + // `pnpm ops job <verb> <id>` (a /jobs row's button, retry-failed, + // resume-interrupted, wait): the verbs every `pnpm ops job …` usage line lists. + const jobVerbs = new Set( + [...opsUsage.matchAll(/pnpm ops job ([a-z|-]+)/g)].flatMap((m) => m[1].split("|")).filter(Boolean), + ); const bad = new Set<string>(); for (const m of markdown.matchAll(/pnpm ops ([^\s`'"]+)(?:[ \t]+([^\s`'"]+))?/g)) { const [, word, next] = m; diff --git a/scripts/archilyzer-ops.mjs b/scripts/archilyzer-ops.mjs @@ -1272,7 +1272,9 @@ export function usage() { ' recorded date: "patch": {"recordedDateTitlePattern": "<regex with named', ' groups year, month, day>"} (CHANNEL.md, recordedDate). A mirror\'s', ' creator channels: "patch": {"mirrorOf": "<slug>, <slug>"} (CHANNEL.md,', - ' mirror; then mirror-scan).', + ' mirror; then mirror-scan). Caption languages and the live chat:', + ' "patch": {"subLangs": "en.*", "chat": "with-download" | "later" |', + ' "never"} (CHANNEL.md, subLangs and chat).', "", 'site-config sets two keys of a site as its form does: {"siteId"} and any of', ' "citedChannels" (the WHOLE cited scope, channel slugs: what the site\'s', @@ -1358,6 +1360,20 @@ export function usage() { " job), as do a chat already here and fresh and a video never live. A pass", " that finds no replay ends done and says so.", "", + 'fetch-chat-backlog fetches a channel\'s stream chats after its downloads:', + ' {"slug", "dryRun"?, "limit"?, "queueKey"?} — every held video whose', + " metadata says it was a stream (live_status was_live / post_live) and whose", + " chat is not here, newest first, one at a time through fetch-chat's pass", + " with the batch downloads' gap between two, as one fetch-chat-backlog job", + " on the platform's download queue; a raw replay already here is only", + " normalized. It stops on a rate limit, a held platform, three failures in", + ' a row, a drain or "limit" chats; a re-run skips the chats here and the', + " streams known to have none (chat-backlog.json), and a restart resumes it.", + ' The download lane queues it by itself (25 a run) for a channel whose', + ' "chat" is "later" once it has nothing left to download. "dryRun": true', + " counts from the disk and starts nothing: chats, normalizeOnly, have,", + " settled, notStreams, ids (the first 50).", + "", 'find-clips runs the clip finder\'s chain for ONE video as one job: {"slug",', ' "id", "target"? (the cut\'s seconds), "segment"? (one umtool found, "s2"),', ' "project"? (the umtool project a run makes), "whilePaused"?, "dryRun"?}.',