commit 55937d4fd642e761eeb3de6a9e60eaa9a1f7c16b parent 84bbd4beccc6168ce9ce3d793a65e4585f04f7b2 Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st> Date: Sat, 21 Nov 2026 02:46:31 -0500 editor: Clean without checking, the channel's always-unchecked switch, and a rate-limited clean that defers and retries - Cleanup stage: "Clean without checking…" counts what it would remove (no request to the source), states it, and runs on a second click as the job "Clean audio without checking" (new kind clean-audio-unchecked). A checkbox sets the channel's cleanAudioWithoutChecking (hint on Twitch/Kick only). - cleanAudioAction runs unchecked when the channel key is on; every clean job goes through runCleanAudioJob: a rate-limited checked clean ends deferred with its counts and queues one retry on the channel queue (it waits on /jobs; cancelling it cancels the retry), gives up after 2, and any other failure to verify ends failed with no retry. - Replay: the unchecked kind replays unchecked only with its explicit "button" flag. - ops: cleanup {"unchecked": true, "dryRun"?}, channel-config {"cleanAudioWithoutChecking"}. - JobRunContext.setPaced for a job's own wait. Docs: OPERATING.md, CHANNEL.md and COMMANDS.md regenerated, editor CHANGELOG. Co-Authored-By: Claude <noreply@anthropic.com> Diffstat:
19 files changed, 448 insertions(+), 18 deletions(-)
diff --git a/CHANNEL.md b/CHANNEL.md @@ -45,6 +45,7 @@ Regenerate this file with `pnpm --filter yt-dlp-transcript-common exec tsx bin/f | `excludeFromCleanup` | config | Leave this channel's reclaimable bytes out of the aggregate "cleanable data" total on /cleanup and its badge. The per-channel cleanup sweeps stay available; only the running total changes. | | `excludeFromCompaction` | config | Keep this channel's saved videos out of compaction (`compact-saved-videos`, a re-encode to AV1 that becomes the active copy): neither the selector nor an explicit list touches them. For a channel whose stored bytes are kept as evidence. Absent = false. | | `cleanAfterCaptureUnverified` | config | Let clean-after-capture (settings `diarization.cleanAfterCapture`) delete this channel's audio with NO availability check. Only for a channel with no `url`: with no source there is nothing to list, so the automatic per-video clean holds every such channel ("no source to check: clean by hand") unless this is true. The manual Clean audio sweep is unaffected. Absent/false = held. | +| `cleanAudioWithoutChecking` | config | Every clean of this channel's transcribed audio runs WITHOUT the availability check: the Clean audio button, the /cleanup row, `pnpm ops cleanup` and clean after capture alike ask the source nothing, so the audio of a video no longer available anywhere is removed too (it is no longer pinned do-not-clean). Every other protection holds: do-not-clean marks, the keep-latest window, the speaker holds (awaiting diarization / voice fingerprint), untranscribed videos, an unreachable or moving media drive. Those jobs run as "Clean audio without checking". For a platform whose VODs expire by design (Twitch, Kick), where "gone from the source" is the normal state; never set by platform. Absent/false = checked. Set on the channel's Cleanup stage or with `pnpm ops channel-config {"cleanAudioWithoutChecking": true}`. | | `syncIntervalMinutes` | config | Auto-sync cadence: the scheduler syncs this channel when `now - lastSyncedAt >= syncIntervalMinutes`. Absent = inherit the global default; 0 = auto-sync off (still manually syncable); positives clamp to [1, 44640] (~31 days). A missing `url`, or a `sync` tier of paused in the channel-priority document, also disables auto-sync. AN INSTAGRAM CHANNEL is synced seldom, because every sync is a logged-in read: absent = every 12 hours at the most often (the global default when that is longer), and a value of its own is never under 240 (4 hours); 0 still turns it off (`common/jobs/syncScheduler.ts`). | | `fullSweepIntervalMinutes` | config | Full-sweep cadence: a sync upgrades itself to a full sweep when `now - lastFullSweepAt >= fullSweepIntervalMinutes`. Absent = inherit `syncScheduler.fullSweepIntervalMinutes`; 0 = never sweep (every sync is a paged walk); positives clamp to [1, 44640]. | | `skipLiveDownloads` | config | Per-channel override for the global `skipLiveDownloads`. Absent = inherit; false = allow downloading currently-live / upcoming videos. | diff --git a/COMMANDS.md b/COMMANDS.md @@ -128,7 +128,7 @@ Drives a running editor over HTTP (`/api/ops/*`, the same actions its pages run) |---|---|---| | `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-rank` | channel-rank places one channel in the order every lane and the sync scheduler follow inside a tier (one rank per channel, 0 first; unranked channels come after every ranked one, by slug): {"slug"} and exactly one of "rank": <n> (before any channel holding it) or null (unranked), "top": true, "bottom": true, "before": "<slug>", "after": "<slug>" (a ranked channel; immediately next to it, a tie on its rank included). The channels after it move down only as far as they must. Only the rank moves — no tier, override or lane changes, unlike /channels' "Add to top". Refused: an unknown channel, an unranked anchor, a channel paused for every operation. Answers {slug, rank, order: \[{slug, rank}, …\]}. | `pnpm ops channel-rank --json '{"slug":"x","top":true}'`<br>`pnpm ops channel-rank --json '{"slug":"x","after":"other-channel"}'`<br>`pnpm ops channel-rank --json '{"slug":"x","rank":null}'` | -| `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": "<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). Caption languages and the live chat: "patch": {"subLangs": "en.\*", "chat": "with-download" \| "later" \| "never"} (CHANNEL.md, subLangs and chat). Manual downloads: "patch": {"downloadMode": "manual"} — only videos you add (import-video, the video page) are downloaded; the download lane, a sync's new uploads and download-missing leave the channel alone; "" (or "auto") is automatic (CHANNEL.md, downloadMode). | `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","patch":{"downloadMode":"manual"}}'`<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", "excludeFromCleanup" and "cleanAudioWithoutChecking" (every clean of the channel skips the availability check; set to the value given, not toggled). A VOD mirror's 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). Caption languages and the live chat: "patch": {"subLangs": "en.\*", "chat": "with-download" \| "later" \| "never"} (CHANNEL.md, subLangs and chat). Manual downloads: "patch": {"downloadMode": "manual"} — only videos you add (import-video, the video page) are downloaded; the download lane, a sync's new uploads and download-missing leave the channel alone; "" (or "auto") is automatic (CHANNEL.md, downloadMode). | `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","patch":{"downloadMode":"manual"}}'`<br>`pnpm ops channel-config --json '{"slug":"x","sites":[{"siteId":"anilyzer"}]}'`<br>`pnpm ops channel-config --json '{"slug":"x","sites":[],"excludeFromBuild":true}'`<br>`pnpm ops channel-config --json '{"slug":"x","cleanAudioWithoutChecking":true}'` | | `create-site` | create-site is the New site form: {"siteId", "siteTitle"} and any of its fields — "headerTitle" (default the title), "siteDescription", "homeTagline", "wordmarkLead", "accent" (an id or "#rrggbb"), "siteUrl", "cloudflareProject", "hubUrl", "audience" ("private" \| "public"; default PRIVATE), "listed" (default FALSE), "publishAuto", "search", "archives", "duplicates", "transcriptDownloads", "pwa", "archiveMaxMB" (null = the global default), "groups" (\[{"id", "name", "selectedByDefault"?, "description"?, "inline"?}\]), "defaultGroupId", "channels" (slugs, or {"slug", "groupId"?}: the pool), "citedChannels" (slugs), "socialLinks" (\[{"label", "url", "svg"}\], null = inherit), "relatedSites". Saved by the form's action (its validation, its sentences). An existing id is refused (409) unless "update": true — the site page's Save with the keys given changed, every other key kept — one read-modify-write under the site's lock. An unknown channel, or a channel's groupId naming no group of the site, is refused. Answers {siteId, created, site}. | `pnpm ops create-site --json '{"siteId":"demo-site","siteTitle":"Demoalyzer","channels":["demo-yt"]}'`<br>`pnpm ops create-site --json '{"siteId":"demo-site","update":true,"homeTagline":"Every stream, searchable"}'` | | `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}'` | @@ -204,7 +204,7 @@ Drives a running editor over HTTP (`/api/ops/*`, the same actions its pages run) | `delete-file` | delete-file deletes one file of one video, as its Files list does: {"slug", "id", "file"}. A tiered media file goes with its bytes on the media drive (never a bare link); refused while that drive is not answering. No undo. | | | `do-not-clean` | do-not-clean sets one video's "Do not clean" marker: {"slug", "id", "keep"?: true}; "keep": false removes it. (keep-videos is the bulk form.) | | | `drop-saved-alternate` | drop-saved-alternate deletes one saved alternate of one video, as its "Drop this alternate" button does: {"slug", "id", "file", "dryRun"?}. "file" is a name `get saved-alternates` lists under "alternates"; the active copy, an unlisted name and any path are refused, and so is a store being moved. The file goes from the store and its entry from saved-video.json (the rest of the pointer is untouched); one already gone is cleaned from the pointer ("existed": false). "dryRun": true answers the same and changes nothing. No undo. An ORIGINAL ("keptAs": "original", the source of a compacted copy) needs "confirmOriginal": true; the compacted copy is read back from disk (size, sha256, container, length) before it goes; a video not freshly checked on its platform needs a review of this copy recorded first; and nothing goes while a download or persist of the video is queued or running, or while it is being compacted. A FORMER original ("former-original") needs its own "confirmFormerOriginal": true, and the same gone/review rule. | | -| `cleanup` | cleanup runs one of a channel's cleanup sweeps as a job: {"slug", "sweep": "transcribed" (audio of transcribed videos — the /cleanup total) \| "extra-formats" \| "wrong-format" \| "failed-transcriptions" (clears the list; deletes nothing)}. Do-not-clean videos are skipped; `get cleanup <slug>` says what each would reclaim. | `pnpm ops cleanup --json '{"slug":"x","sweep":"transcribed"}' --wait` | +| `cleanup` | cleanup runs one of a channel's cleanup sweeps as a job: {"slug", "sweep": "transcribed" (audio of transcribed videos — the /cleanup total) \| "extra-formats" \| "wrong-format" \| "failed-transcriptions" (clears the list; deletes nothing)}. Do-not-clean videos are skipped; `get cleanup <slug>` says what each would reclaim. "unchecked": true (transcribed only) is "Clean without checking": the source is not asked, so the audio of videos no longer available anywhere goes too; every other protection holds; the job is "Clean audio without checking". With "dryRun": true it answers what it would remove — {plan: {videos, files, bytes, protected, awaitingDiarization, awaitingVoiceprint, inspected}} — and starts nothing. A checked clean the source rate-limits ends deferred and retries itself on the channel queue after at least 15 min (twice at most), then gives up. | `pnpm ops cleanup --json '{"slug":"x","sweep":"transcribed"}' --wait`<br>`pnpm ops cleanup --json '{"slug":"x","sweep":"transcribed","unchecked":true,"dryRun":true}'` | | `diarize` | diarize runs a channel's "Diarize speakers" as a job: {"slug"}. Every video still holding audio with no current diarization.json is diarized, and a diarized one without voice fingerprints gets them from its own turns — the voiceprint backfill, one channel at a time. Runs while the Speakers lane is paused; nothing is deleted. | `pnpm ops diarize --json '{"slug":"x"}' --wait` | | `web-search` | web-search searches the web (DuckDuckGo's HTML page) and answers the results: {"query", "n"?: 6 (at most 20)} -> {results: \[{title, url, snippet}\]}. Read only, through the editor's one web queue: one request at a time, 3 s apart, backing off on a 429 or 503. For context; a web page is never cited as what someone said. | `pnpm ops web-search --json '{"query":"second shop opening","n":5}'` | | `web-fetch` | web-fetch reads one web page as plain text: {"url", "maxChars"?: 12000 (at most 60000)} -> {page: {url, finalUrl, status, contentType, title?, text, truncated}}. http and https only; a private or loopback host (by name, by address, or by what its name resolves to, every redirect checked) is refused before any request, and so is a page that is not text (a PDF, an image). Read only, on the same web queue as web-search. | `pnpm ops web-fetch --json '{"url":"https://example.com/news/item","maxChars":4000}'` | diff --git a/OPERATING.md b/OPERATING.md @@ -1096,6 +1096,35 @@ pnpm ops diarize --json '{"slug":"example"}' --wait # one channe decode is recorded in `audio-integrity.json` and skipped until a different file is there. - **A render gets the cores**: render mode holds the Speakers lane with transcription and download. +## Clean audio without checking + +```sh +pnpm ops cleanup --json '{"slug":"example","sweep":"transcribed","unchecked":true,"dryRun":true}' # what it would remove +pnpm ops cleanup --json '{"slug":"example","sweep":"transcribed","unchecked":true}' --wait # Clean without checking +pnpm ops channel-config --json '{"slug":"example","cleanAudioWithoutChecking":true}' # always, for this channel +``` + +- **Clean audio checks first**: before deleting a transcribed video's audio it asks the source whether the video is + still there (`verifyAvailabilityBeforeClean`), and pins one that is gone as do-not-clean. On Twitch and Kick VODs + expire by design, so "gone" is the normal state there and the check keeps audio nobody wants kept. +- **Clean without checking** (the Cleanup stage, `"unchecked": true`) skips that check and asks the source nothing, so + the audio of videos no longer available anywhere is removed too. Every other protection holds: do-not-clean, the + keep-latest window, awaiting diarization or voice fingerprint, untranscribed videos, and a media drive that is + unreachable or being moved. The page shows the dry plan's numbers first (`dryRun`: files, bytes, videos, what it + keeps) and asks; the job is titled "Clean audio without checking". A Retry of that job is unchecked only when it was + the button's. +- **`cleanAudioWithoutChecking`** on a channel (CHANNEL.md; the Cleanup stage's checkbox) makes every clean of it + unchecked: Clean audio, the /cleanup row, `cleanup` over ops and clean after capture. Off unless set; never set by + platform. Clean after capture still holds a URL-less channel (`cleanAfterCaptureUnverified`) and a whole-recording + one (`diarization.cleanWholeRecordingAudio`) — those holds are not the availability check. +- **A checked clean the source rate-limits** (HTTP 429 on the channel listing or on a confirmation probe) deletes + nothing it could not verify and ends **deferred** on /jobs, with its counts. It queues one retry of itself on the + channel's queue, not before 15 minutes or the platform's cooldown (the one downloads and Sync share), whichever is + later; the retry waits on /jobs ("waiting …: retrying a clean the source rate-limited") and holds the channel queue + while it does. Cancel that job to cancel the retry. After 2 retries the next rate limit ends the job **failed**: + "Gave up: rate-limited … It needs a person". A failure that is not a rate limit (a network error, an extractor + break) ends failed, "Could not verify availability …", and retries nothing. + ## Record a live stream; import a file ```sh diff --git a/common/jobs/jobKinds.test.ts b/common/jobs/jobKinds.test.ts @@ -211,6 +211,7 @@ const STILL_MEDIA = [ "scan-media", "scan-media-channel", "clean-audio-transcribed", + "clean-audio-unchecked", "clean-extra-audio-formats", "remove-wrong-format-audio", "reports-prepare", @@ -448,3 +449,11 @@ test("compact-saved-videos is a drainable, replayable media ingest kind the boot assert.equal(isIngestKind("compact-saved-videos"), true); assert.equal(kindIsNetwork("compact-saved-videos"), false); }); + +test("lane clean-unverified: the unchecked clean is its own kind, so its title says so", () => { + assert.equal(jobKindLabel("clean-audio-transcribed"), "Clean audio"); + assert.equal(jobKindLabel("clean-audio-unchecked"), "Clean audio without checking"); + assert.equal(getJobKind("clean-audio-unchecked")?.replayable, true); + assert.equal(isDrainableKind("clean-audio-unchecked"), false); + assert.equal(kindIsNetwork("clean-audio-unchecked"), false); +}); diff --git a/common/jobs/jobKinds.ts b/common/jobs/jobKinds.ts @@ -430,6 +430,19 @@ const JOB_KINDS: Record<string, JobKindMeta> = { queueKeyStrategy: "custom", needsMedia: true, }, + // The same sweep with the availability verdict skipped (lane + // clean-unverified): the one-off "Clean without checking" button, or any + // clean of a channel whose config sets cleanAudioWithoutChecking. Its own + // kind so the job list's title says so. The same media guard, the same + // channel queue; replayed unchecked only with the explicit flag in its spec. + "clean-audio-unchecked": { + kind: "clean-audio-unchecked", + label: "Clean audio without checking", + drainable: false, + replayable: true, + queueKeyStrategy: "custom", + needsMedia: true, + }, // Speaker-diarization backfill over a channel's retained audio. The capture // lane's catch-all: it picks up everything the post-transcribe hook missed // (videos transcribed before the feature, or with the inline hook off — which diff --git a/common/jobs/registry.ts b/common/jobs/registry.ts @@ -188,7 +188,9 @@ export type JobRecord = { // A JOB THAT ENDED DEFERRED (review 2, ruling R-b): X's job cap was reached // when its queue started it, so it did not run — not a failure. It ends // `done` with this: the sentence, and when the next X job may start. - // Nothing re-queues it by itself. + // Nothing re-queues it by itself. ALSO (lane clean-unverified): a checked + // Clean audio the source rate-limited — it deleted nothing it could not + // verify and queued its own retry for `until` (controller/cleanAudioJob.ts). deferred?: { until: number; sentence: string }; }; diff --git a/common/jobs/streamCommand.ts b/common/jobs/streamCommand.ts @@ -129,6 +129,12 @@ export type JobRunContext = { // recorded on the record and its sidecar as `handedOffTo`, so a caller // waiting for the work follows it there. handOff: (jobId: string) => void; + // A WAIT THIS JOB IS SITTING OUT after its queue started it, drawn on /jobs + // as the queue gap's is ("waiting 4m12s: <reason>", JobRecord.pacedUntil / + // pacedReason); undefined clears it. Used by a rate-limited clean's queued + // retry (controller/cleanAudioJob.ts). Optional: a job's own test contexts + // need not provide it. + setPaced?: (wait?: { until: number; reason: string }) => void; }; export type RunManagedFunctionOpts = CommonOpts & { @@ -520,6 +526,10 @@ export async function runManagedFunction( record.handedOffTo = jobId; persistMeta(); }, + setPaced: (w) => { + record.pacedUntil = w?.until; + record.pacedReason = w?.reason; + }, }; // THE GUARD AGAIN, NOW THAT THE QUEUE HAS STARTED THE JOB (see diff --git a/common/views/pipeline/stageStatus.ts b/common/views/pipeline/stageStatus.ts @@ -144,6 +144,7 @@ const JOB_KIND_TO_STAGE: Record<string, StageId> = { // but is the same work this card is about, so it lights this card too. "diarize-channel": "speakers", "clean-audio-transcribed": "cleanup", + "clean-audio-unchecked": "cleanup", "purge-superseded-auto-subs": "cleanup", "clean-extra-audio-formats": "cleanup", "remove-wrong-format-audio": "cleanup", diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,24 @@ # Changelog ## [Unreleased] +- **Clean audio without checking, and a rate-limited clean that says so.** + - The channel page's Cleanup stage has **Clean without checking…** beside Clean audio. It first counts what it would + remove (files, bytes, videos, and what it keeps; no request to the source) and asks: "Remove N audio file(s) (X) + from M transcribed video(s)? The source is not asked, so the audio of videos no longer available anywhere is + removed too." Every other protection holds: do-not-clean, keep-latest, awaiting diarization or voice fingerprint, + untranscribed videos, an unreachable or moving media drive. The job is titled **Clean audio without checking**. + CLI: `pnpm ops cleanup --json '{"slug":"x","sweep":"transcribed","unchecked":true,"dryRun":true}'` (the counts), + then without `dryRun`. + - New channel key `cleanAudioWithoutChecking` (off unless set): every clean of the channel runs unchecked — the + button, /cleanup, `pnpm ops cleanup` and clean after capture. A checkbox on the Cleanup stage sets it; Twitch and + Kick channels show a hint, nothing is set by platform. CLI: `pnpm ops channel-config --json + '{"slug":"x","cleanAudioWithoutChecking":true}'`. + - A checked clean the source rate-limits (HTTP 429 on the listing or a confirmation probe) still deletes nothing it + could not verify, and now ends **deferred** with its counts instead of a plain done. It queues one retry on the + channel's queue, not before 15 minutes or the platform's cooldown, whichever is later; the retry waits on /jobs + and cancelling it cancels the retry. After two retries it ends failed, "Gave up: rate-limited", for a person. A + failure that is not a rate limit ends failed, "Could not verify availability", with no retry. A rate-limited + listing now records the platform cooldown, as Sync does. - **umtool: the gap mark's border is the deck's accent colour.** - The operator picked variant B. The border is drawn in the deck's accent, the colour of the deck's accent rule and the dots in its source line, at full opacity. The box behind the text is near-black at 90 %, and the text diff --git a/editor/app/api/ops/_writes.test.ts b/editor/app/api/ops/_writes.test.ts @@ -266,6 +266,34 @@ test("cleanup refuses an unknown sweep and a traversing slug, before any job", a assert.deepEqual(await corpus.listJobIds(), []); }); +test("cleanup unchecked dryRun answers the confirmation's plan and starts nothing; misuse is refused", async () => { + const cleanup = await route("cleanup"); + const dry = await callPost(cleanup, { slug: SLUG, sweep: "transcribed", unchecked: true, dryRun: true }); + assert.equal(dry.status, 200, JSON.stringify(dry.body)); + assert.equal(dry.body.dryRun, true); + const plan = dry.body.plan as Record<string, unknown>; + for (const k of ["inspected", "videos", "files", "bytes", "protected", "awaitingDiarization", "awaitingVoiceprint"]) { + assert.equal(typeof plan[k], "number", k); + } + const wrongSweep = await callPost(cleanup, { slug: SLUG, sweep: "extra-formats", unchecked: true }); + assert.equal(wrongSweep.status, 400); + assert.match(String(wrongSweep.body.error), /"unchecked" applies to the "transcribed" sweep only/); + const checkedDry = await callPost(cleanup, { slug: SLUG, sweep: "transcribed", dryRun: true }); + assert.equal(checkedDry.status, 400); + assert.match(String(checkedDry.body.error), /give "unchecked": true/); + const notBool = await callPost(cleanup, { slug: SLUG, sweep: "transcribed", unchecked: "yes" }); + assert.equal(notBool.status, 400); + assert.deepEqual(await corpus.listJobIds(), []); +}); + +test("channel-config refuses a cleanAudioWithoutChecking that is not a boolean, writing nothing", async () => { + const cfgRoute = await route("channel-config"); + const res = await callPost(cfgRoute, { slug: SLUG, cleanAudioWithoutChecking: "on" }); + assert.equal(res.status, 400); + const cfg = JSON.parse(await readFile(path.join(corpus.transcripts, "channels", SLUG, "config.json"), "utf8")); + assert.equal("cleanAudioWithoutChecking" in cfg, false); +}); + test("relocate dryRun answers each channel's preview and moves nothing", async () => { const relocate = await route("relocate"); const res = await callPost(relocate, { slugs: [SLUG, "no-such"], root: elsewhere, dryRun: true }); diff --git a/editor/app/api/ops/channel-config/route.ts b/editor/app/api/ops/channel-config/route.ts @@ -7,6 +7,7 @@ import { } from "../../../channels/components/channelConfigToForm"; import { setChannelExclusionsAction, + setCleanAudioWithoutCheckingAction, updateChannelAction, } from "../../../channels/actions"; import { @@ -26,8 +27,10 @@ export const dynamic = "force-dynamic"; // sites?: [{ siteId, groupId? | newGroupName? }], // excludeFromBuild?: boolean, // excludeFromCleanup?: boolean, +// cleanAudioWithoutChecking?: boolean, // } -// — at least one of patch / sites / excludeFromBuild / excludeFromCleanup. +// — at least one of patch / sites / excludeFromBuild / excludeFromCleanup / +// cleanAudioWithoutChecking. // // The patch keys are the FORM's field names, not ChannelConfig's, because the // form is what validates them: `downloadFilterInclude` / `downloadFilterExclude` @@ -43,10 +46,12 @@ export const dynamic = "force-dynamic"; // // The two exclusions are the /channels rack's build and cleanup toggles, set // to a value rather than flipped, since a caller cannot see the switch. +// `cleanAudioWithoutChecking` is the Cleanup stage's "Always clean this +// channel without checking" (CHANNEL.md), set the same way. export async function POST(request: Request) { return ops( request, - ["slug", "patch", "sites", "excludeFromBuild", "excludeFromCleanup"], + ["slug", "patch", "sites", "excludeFromBuild", "excludeFromCleanup", "cleanAudioWithoutChecking"], async (body) => { const slug = reqSlug(body, "slug"); const patch = body.patch; @@ -59,14 +64,16 @@ export async function POST(request: Request) { const sites = readSiteMemberships(body); const excludeFromBuild = optBool(body, "excludeFromBuild"); const excludeFromCleanup = optBool(body, "excludeFromCleanup"); + const cleanAudioWithoutChecking = optBool(body, "cleanAudioWithoutChecking"); if ( patch === undefined && sites === undefined && excludeFromBuild === undefined && - excludeFromCleanup === undefined + excludeFromCleanup === undefined && + cleanAudioWithoutChecking === undefined ) { throw new OpsInputError( - 'nothing to change — give "patch", "sites", "excludeFromBuild" or "excludeFromCleanup"', + 'nothing to change — give "patch", "sites", "excludeFromBuild", "excludeFromCleanup" or "cleanAudioWithoutChecking"', ); } // KEYS FIRST, CHANNEL SECOND. A misspelled field is a fact about the @@ -92,6 +99,10 @@ export async function POST(request: Request) { const saved = await updateChannelAction(slug, undefined, fd); if (saved?.error) return actionResponse(saved); } + if (cleanAudioWithoutChecking !== undefined) { + const set = await setCleanAudioWithoutCheckingAction(slug, cleanAudioWithoutChecking); + if (set?.error) return actionResponse(set); + } return actionResponse( await setChannelExclusionsAction(slug, { excludeFromBuild, diff --git a/editor/app/api/ops/cleanup/route.ts b/editor/app/api/ops/cleanup/route.ts @@ -1,10 +1,13 @@ +import { NextResponse } from "next/server"; import { cleanAudioAction, + cleanAudioUncheckedAction, cleanExtraAudioFormatsAction, clearFailedTranscriptionsAction, + planCleanAudioUncheckedAction, removeWrongFormatAudioAction, } from "../../../channels/[slug]/whisperActions"; -import { jobResponse, oneOf, ops, reqSlug } from "../_lib"; +import { jobResponse, oneOf, ops, opsFail, OpsInputError, optBool, reqSlug } from "../_lib"; export const dynamic = "force-dynamic"; @@ -27,6 +30,15 @@ export const dynamic = "force-dynamic"; // keep-latest window and audio still awaiting diarization; every one deletes // through the media tier's remover (removeMediaFile), never a bare link. // `get cleanup <slug>` says what each would reclaim. +// +// CLEAN WITHOUT CHECKING (lane clean-unverified): "unchecked": true with +// "transcribed" is the Cleanup stage's "Clean without checking" — the +// availability check is skipped and the source is not asked, so the audio of +// videos no longer available anywhere goes too; every other protection holds. +// "dryRun": true (unchecked only) answers the confirmation's numbers — +// {plan: {inspected, videos, files, bytes, protected, awaitingDiarization, +// awaitingVoiceprint}} — and starts nothing. A channel whose config sets +// cleanAudioWithoutChecking runs "transcribed" unchecked without the flag. const SWEEPS = { transcribed: cleanAudioAction, "extra-formats": cleanExtraAudioFormatsAction, @@ -35,9 +47,23 @@ const SWEEPS = { } as const; export async function POST(request: Request) { - return ops(request, ["slug", "sweep"], async (body) => { + return ops(request, ["slug", "sweep", "unchecked", "dryRun"], async (body) => { const slug = reqSlug(body, "slug"); const sweep = oneOf(body, "sweep", Object.keys(SWEEPS) as (keyof typeof SWEEPS)[]); + const unchecked = optBool(body, "unchecked") ?? false; + const dryRun = optBool(body, "dryRun") ?? false; + if (unchecked && sweep !== "transcribed") { + throw new OpsInputError('"unchecked" applies to the "transcribed" sweep only'); + } + if (dryRun && !unchecked) { + throw new OpsInputError('"dryRun" is the unchecked clean\'s plan — give "unchecked": true (`get cleanup <slug>` estimates the others)'); + } + if (unchecked && dryRun) { + const r = await planCleanAudioUncheckedAction(slug); + if (!r.ok) return opsFail(r.error); + return NextResponse.json({ ok: true, dryRun: true, plan: r.plan }); + } + if (unchecked) return jobResponse(await cleanAudioUncheckedAction(slug)); return jobResponse(await SWEEPS[sweep](slug)); }); } diff --git a/editor/app/channels/[slug]/components/stages/CleanWithoutChecking.tsx b/editor/app/channels/[slug]/components/stages/CleanWithoutChecking.tsx @@ -0,0 +1,148 @@ +"use client"; + +import { useState } from "react"; +import { StreamActionLog } from "yt-dlp-transcript-common/components/StreamActionLog"; +import { formatBytes } from "yt-dlp-transcript-common/lib/format"; +import type { AudioCleanPlan } from "yt-dlp-transcript-common/controller/cleanAudioFromTranscribed"; +import { cancelJobAction } from "../../../../jobs/actions"; +import { setCleanAudioWithoutCheckingAction } from "../../../actions"; +import { useHydrated } from "../../../../operations/components/useOperationsStatus"; +import { + cleanAudioUncheckedAction, + planCleanAudioUncheckedAction, +} from "../../whisperActions"; + +// Platforms whose VODs expire by design, where "gone from the source" is the +// normal state and the availability check protects nothing. A hint only: the +// key is never set by platform. +const EXPIRING_VOD_PLATFORMS = new Set(["twitch", "kick"]); + +const plural = (n: number, one: string, many = `${one}s`) => `${n} ${n === 1 ? one : many}`; + +// The confirmation's sentence, from the dry plan (no network, no deletes). +export function confirmationText(plan: AudioCleanPlan): { ask: string; kept: string } { + return { + ask: + `Remove ${plural(plan.files, "audio file")} (${formatBytes(plan.bytes)}) from ${plural(plan.videos, "transcribed video")}? ` + + "The source is not asked, so the audio of videos no longer available anywhere is removed too.", + kept: + `Kept: ${plan.protected} marked do not clean or in the keep-latest window, ` + + `${plan.awaitingDiarization} awaiting diarization, ${plan.awaitingVoiceprint} awaiting voice fingerprint. ` + + "Videos with no transcript are not touched.", + }; +} + +// "Clean without checking": a one-off clean of this channel's transcribed +// audio with the availability check skipped. Two steps: the plan is computed +// first and stated, then a second button runs it. +export function CleanWithoutCheckingSection({ slug }: { slug: string }) { + const hydrated = useHydrated(); + const [plan, setPlan] = useState<AudioCleanPlan | null>(null); + const [error, setError] = useState<string | null>(null); + const [busy, setBusy] = useState(false); + const ask = async () => { + setBusy(true); + setError(null); + const r = await planCleanAudioUncheckedAction(slug); + setBusy(false); + if (r.ok) setPlan(r.plan); + else setError(r.error); + }; + const text = plan ? confirmationText(plan) : null; + return ( + <div aria-label="clean without checking section" className="flex flex-col gap-2 rounded border border-border p-3"> + <div> + <h4 className="text-sm font-semibold">Clean without checking</h4> + <p className="text-xs text-muted-foreground"> + The same clean, without asking the source whether each video is still there. + </p> + </div> + {!plan && ( + <div> + <button + type="button" + onClick={ask} + disabled={!hydrated || busy} + className="rounded border border-border bg-card px-3 py-1 text-sm hover:bg-accent disabled:opacity-50" + > + {busy ? "Counting…" : "Clean without checking…"} + </button> + </div> + )} + {error && ( + <p role="alert" className="text-sm text-destructive"> + {error} + </p> + )} + {plan && text && ( + <div role="group" aria-label="confirm clean without checking" className="flex flex-col gap-2"> + {plan.files === 0 ? ( + <p className="text-sm">Nothing to remove: no transcribed video here holds audio a clean would take.</p> + ) : ( + <p className="text-sm font-medium">{text.ask}</p> + )} + <p className="text-xs text-muted-foreground">{text.kept}</p> + <div className="flex flex-wrap items-start gap-2"> + {plan.files > 0 && ( + <StreamActionLog + trigger={() => cleanAudioUncheckedAction(slug)} + cancelAction={cancelJobAction} + buttonLabel={`Remove ${plural(plan.files, "file")} without checking`} + runningLabel="Cleaning…" + label="Clean without checking" + /> + )} + <button + type="button" + onClick={() => setPlan(null)} + className="rounded border border-border px-3 py-1 text-sm hover:bg-accent" + > + Cancel + </button> + </div> + </div> + )} + </div> + ); +} + +// The channel key cleanAudioWithoutChecking, set to a value. +export function AlwaysCleanWithoutCheckingToggle({ + slug, + on, + platform, +}: { + slug: string; + on: boolean; + platform: string; +}) { + const hydrated = useHydrated(); + const [pending, setPending] = useState(false); + return ( + <div className="flex flex-col gap-1"> + <label className="flex items-center gap-2 text-sm"> + <input + type="checkbox" + checked={on} + disabled={!hydrated || pending} + onChange={async (e) => { + setPending(true); + await setCleanAudioWithoutCheckingAction(slug, e.target.checked); + setPending(false); + }} + aria-label="always clean this channel without checking" + /> + Always clean this channel without checking + </label> + <p className="text-xs text-muted-foreground"> + Every clean of this channel — the buttons here, /cleanup, pnpm ops and clean after capture — deletes audio + without asking the source whether the video is still there, so a video removed upstream loses its only copy. + </p> + {!on && EXPIRING_VOD_PLATFORMS.has(platform) && ( + <p className="text-xs text-muted-foreground"> + Twitch and Kick VODs expire on their own, so a check here mostly finds them gone. + </p> + )} + </div> + ); +} diff --git a/editor/app/channels/[slug]/components/stages/CleanupStage.tsx b/editor/app/channels/[slug]/components/stages/CleanupStage.tsx @@ -18,6 +18,10 @@ import { import { persistKeptAction } from "../../persistActions"; import { backupSavedVideosAction } from "../../../../saved-videos/backupActions"; import { VideoIdList } from "../VideoIdList"; +import { + AlwaysCleanWithoutCheckingToggle, + CleanWithoutCheckingSection, +} from "./CleanWithoutChecking"; type Props = { slug: string; @@ -47,6 +51,10 @@ type Props = { // sweep holds audio back for any transcribed video without a sidecar, so the // backfill button that clears that hold belongs next to it. diarizationEnabled: boolean; + // The channel's cleanAudioWithoutChecking (every clean skips the + // availability check), and its platform, for the expiring-VOD hint. + cleanWithoutChecking: boolean; + platform: string; }; export function CleanupStage({ @@ -65,6 +73,8 @@ export function CleanupStage({ savedBytes, backupConfigured, diarizationEnabled, + cleanWithoutChecking, + platform, }: Props) { const defaultQueueKey = `channel:${slug}`; const [cleanQueue, setCleanQueue] = useState(defaultQueueKey); @@ -114,6 +124,11 @@ export function CleanupStage({ title="Clean audio for transcribed videos" desc="Delete audio.* files in any video directory that has a transcript.json (whisper output). YouTube videos with only auto-sub .vtt files have no audio and are skipped automatically. While diarization is on, a video awaiting its speakers or voice fingerprints keeps its audio." /> + {cleanWithoutChecking && ( + <p className="text-sm font-medium"> + This channel cleans without checking: the source is not asked. + </p> + )} <ReclaimEstimate bytes={transcribedAudioBytes} /> <StreamActionLog trigger={() => cleanAudioAction(slug, cleanQueue)} @@ -131,6 +146,8 @@ export function CleanupStage({ /> } /> + {!cleanWithoutChecking && <CleanWithoutCheckingSection slug={slug} />} + <AlwaysCleanWithoutCheckingToggle slug={slug} on={cleanWithoutChecking} platform={platform} /> </div> {supersededAutoSubsIds.length > 0 && ( <SupersededAutoSubsSection diff --git a/editor/app/channels/[slug]/page.tsx b/editor/app/channels/[slug]/page.tsx @@ -823,6 +823,8 @@ export default async function ChannelDetailPage({ savedBytes={savedTotals.bytes} backupConfigured={settings.savedVideoBackup.dest.trim() !== ""} diarizationEnabled={settings.diarization.enabled} + cleanWithoutChecking={config!.cleanAudioWithoutChecking === true} + platform={config!.platform ?? detectUrlPlatform(config!.url ?? "") ?? ""} /> ); } diff --git a/editor/app/channels/[slug]/whisperActions.ts b/editor/app/channels/[slug]/whisperActions.ts @@ -19,7 +19,16 @@ import { } from "yt-dlp-transcript-common/controller/channels"; import { runWhisperBatch } from "yt-dlp-transcript-common/controller/whisperBatch"; import { clearFailedTranscriptions } from "yt-dlp-transcript-common/controller/failedTranscriptions"; -import { cleanAudioFromTranscribed } from "yt-dlp-transcript-common/controller/cleanAudioFromTranscribed"; +import { + planAudioClean, + type AudioCleanPlan, + type UncheckedReason, +} from "yt-dlp-transcript-common/controller/cleanAudioFromTranscribed"; +import { + runCleanAudioJob, + uncheckedReasonFor, + type CleanRetry, +} from "yt-dlp-transcript-common/controller/cleanAudioJob"; import { diarizeAll } from "yt-dlp-transcript-common/controller/diarizeAll"; import { purgeSupersededAutoSubs } from "yt-dlp-transcript-common/controller/purgeSupersededAutoSubs"; import { checkKeptDeleted } from "yt-dlp-transcript-common/controller/checkKeptDeleted"; @@ -27,6 +36,7 @@ import { cleanExtraAudioFormats } from "yt-dlp-transcript-common/controller/clea import { removeWrongFormatAudio } from "yt-dlp-transcript-common/controller/removeWrongFormatAudio"; import { verifyTranscripts } from "yt-dlp-transcript-common/controller/verifyTranscripts"; import { + JobDeferredError, runManagedFunction, type StreamActionResult, } from "yt-dlp-transcript-common/jobs/streamCommand"; @@ -294,25 +304,83 @@ export async function removeWrongFormatAudioAction( }); } +// "Clean audio": the checked sweep — unless the channel's config sets +// cleanAudioWithoutChecking, when it runs as "Clean audio without checking" +// (its own job kind, so the job list says so). `retry` is a rate-limited +// clean's queued retry (controller/cleanAudioJob.ts), never a caller's. export async function cleanAudioAction( slug: string, queueKey?: string, + retry?: CleanRetry, ): Promise<StreamActionResult> { const paths = getPaths(); + const config = await readChannelConfig(paths, slug).catch(() => null); + const byChannel = uncheckedReasonFor(config); + if (byChannel) return runCleanAudio(slug, queueKey, byChannel); + return runCleanAudio(slug, queueKey, undefined, retry); +} + +// "Clean without checking": the one-off, explicit unchecked sweep. The source +// is not asked; every other protection of the sweep holds. +export async function cleanAudioUncheckedAction( + slug: string, + queueKey?: string, +): Promise<StreamActionResult> { + return runCleanAudio(slug, queueKey, "button"); +} + +// The confirmation's numbers: what a clean without checking would remove now +// (controller planAudioClean — no network, no deletes). +export async function planCleanAudioUncheckedAction( + slug: string, +): Promise<{ ok: true; plan: AudioCleanPlan } | { ok: false; error: string }> { + try { + return { ok: true, plan: await planAudioClean({ channelSlug: slug, paths: getPaths() }) }; + } catch (err) { + return { ok: false, error: (err as Error).message }; + } +} + +function runCleanAudio( + slug: string, + queueKey: string | undefined, + unchecked?: UncheckedReason, + retry?: CleanRetry, +): Promise<StreamActionResult> { + const paths = getPaths(); + const kind = unchecked ? "clean-audio-unchecked" : "clean-audio-transcribed"; + // A retry runs on the CHANNEL's queue, whatever queue the request took. + const key = retry ? channelQueueKey(slug) : resolveQueueKey(channelQueueKey(slug), queueKey); return runManagedFunction({ - kind: "clean-audio-transcribed", - queueKey: resolveQueueKey(channelQueueKey(slug), queueKey), + kind, + queueKey: key, paths, channelSlug: slug, - spec: { kind: "clean-audio-transcribed", slug, params: { queueKey } }, - fn: async (onLog, signal) => { - await cleanAudioFromTranscribed({ + spec: { + kind, + slug, + params: { queueKey, ...(unchecked ? { unchecked } : {}), ...(retry ? { retry } : {}) }, + }, + fn: async (onLog, signal, _setProgress, ctx) => { + const out = await runCleanAudioJob({ channelSlug: slug, paths, + jobId: ctx.jobId, + ...(unchecked ? { unchecked } : {}), + ...(retry ? { retry } : {}), onLog, signal, + deps: { + enqueueRetry: async (next) => { + const r = await cleanAudioAction(slug, undefined, next); + return r.ok ? { ok: true, jobId: r.jobId } : { ok: false, error: r.error }; + }, + ...(ctx.setPaced ? { setPaced: ctx.setPaced } : {}), + }, }); safeRevalidate([`/channels/${slug}`]); + if (out.end === "deferred") throw new JobDeferredError(out.sentence, out.until); + if (out.end === "failed") throw new Error(out.sentence); }, }); } diff --git a/editor/app/channels/actions.ts b/editor/app/channels/actions.ts @@ -642,6 +642,25 @@ export async function setChannelExclusionsAction( return undefined; } +// CLEAN WITHOUT CHECKING, ALWAYS (lane clean-unverified): set this channel's +// cleanAudioWithoutChecking to a stated value — the Cleanup stage's checkbox +// and `channel-config {"cleanAudioWithoutChecking"}`. `false` removes the key +// (absent = checked, the default). Through patchChannelConfig only. +export async function setCleanAudioWithoutCheckingAction( + slug: string, + on: boolean, +): Promise<ActionResult> { + const paths = getPaths(); + const existing = await readChannelConfig(paths, slug); + if (!existing) return { error: `Channel "${slug}" not found` }; + await (on + ? patchChannelConfig(paths, slug, { cleanAudioWithoutChecking: true }) + : patchChannelConfig(paths, slug, {}, { unset: ["cleanAudioWithoutChecking"] })); + revalidatePath(`/channels/${slug}`); + revalidatePath("/cleanup"); + return undefined; +} + // Toggle whether this channel's reclaimable bytes count toward the aggregate // "cleanable data" total on the /cleanup page (and its sidebar badge). The // cleanup sweeps themselves stay available regardless; this only flips the diff --git a/editor/app/jobs/jobReplayRegistry.ts b/editor/app/jobs/jobReplayRegistry.ts @@ -34,6 +34,7 @@ import { import { checkKeptDeletedAction, cleanAudioAction, + cleanAudioUncheckedAction, cleanExtraAudioFormatsAction, diarizeChannelAction, clearFailedTranscriptionsAction, @@ -533,10 +534,26 @@ export const JOB_REPLAY_HANDLERS: Record<string, ReplayHandler> = { const { queueKey } = params(spec); return purgeSupersededAutoSubsAction(spec.slug, queueKey); }, + // A Retry is a person's: a fresh request (a rate-limited clean's `retry` + // chain is not carried), and the channel's cleanAudioWithoutChecking, as it + // is NOW, decides checked or not. "clean-audio-transcribed": (spec) => { const { queueKey } = params(spec); return cleanAudioAction(spec.slug, queueKey); }, + // UNCHECKED ONLY WITH THE SAME EXPLICIT FLAG (lane clean-unverified): the + // button's run says `unchecked: "button"` and replays unchecked; a run the + // channel key made unchecked replays through cleanAudioAction, so a key + // turned off since is a checked clean; a spec with neither is refused. + "clean-audio-unchecked": async (spec) => { + const { p, queueKey } = params(spec); + if (p.unchecked === "button") return cleanAudioUncheckedAction(spec.slug, queueKey); + if (p.unchecked === "channel-setting") return cleanAudioAction(spec.slug, queueKey); + return { + ok: false, + error: "This clean without checking carries no unchecked flag to replay it with — run Clean audio or Clean without checking instead.", + }; + }, "diarize-channel": (spec) => { const { queueKey } = params(spec); return diarizeChannelAction(spec.slug, queueKey); diff --git a/scripts/archilyzer-ops.mjs b/scripts/archilyzer-ops.mjs @@ -82,6 +82,7 @@ // pnpm ops channel-config --json '{"slug":"x","patch":{"downloadMode":"manual"}}' // pnpm ops channel-config --json '{"slug":"x","sites":[{"siteId":"anilyzer"}]}' // pnpm ops channel-config --json '{"slug":"x","sites":[],"excludeFromBuild":true}' +// pnpm ops channel-config --json '{"slug":"x","cleanAudioWithoutChecking":true}' // pnpm ops create-site --json '{"siteId":"demo-site","siteTitle":"Demoalyzer","channels":["demo-yt"]}' // pnpm ops create-site --json '{"siteId":"demo-site","update":true,"homeTagline":"Every stream, searchable"}' // pnpm ops site-config --json '{"siteId":"anilyzer","citedChannels":["critic-channel"]}' @@ -116,6 +117,7 @@ // pnpm ops settings --json '{"patch":{"minFreeDiskGB":20}}' // pnpm ops lane --json '{"lane":"publish","action":"drain"}' // pnpm ops cleanup --json '{"slug":"x","sweep":"transcribed"}' --wait +// pnpm ops cleanup --json '{"slug":"x","sweep":"transcribed","unchecked":true,"dryRun":true}' // pnpm ops workers --json '{"op":"disable","ids":["parakeet-cpu"]}' // pnpm ops get job <jobId> --tail 20 // pnpm ops get jobs --failed --slug x @@ -1624,7 +1626,14 @@ export function usage() { ' "transcribed" (audio of transcribed videos — the /cleanup total) |', ' "extra-formats" | "wrong-format" | "failed-transcriptions" (clears the', ' list; deletes nothing)}. Do-not-clean videos are skipped; `get cleanup', - ' <slug>` says what each would reclaim.', + ' <slug>` says what each would reclaim. "unchecked": true (transcribed', + ' only) is "Clean without checking": the source is not asked, so the audio', + ' of videos no longer available anywhere goes too; every other protection', + ' holds; the job is "Clean audio without checking". With "dryRun": true it', + ' answers what it would remove — {plan: {videos, files, bytes, protected,', + ' awaitingDiarization, awaitingVoiceprint, inspected}} — and starts nothing.', + ' A checked clean the source rate-limits ends deferred and retries itself', + ' on the channel queue after at least 15 min (twice at most), then gives up.', "", 'relocate moves channels\' media to a location: {"slugs", "locationId" |', ' "root"}. "dryRun": true answers each channel\'s preview (bytes to copy,', @@ -1743,8 +1752,10 @@ export function usage() { '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', + ' site; an unknown site id is refused), "excludeFromBuild",', + ' "excludeFromCleanup" and "cleanAudioWithoutChecking" (every clean of the', + ' channel skips the availability check; set to the value given, not', + ' toggled). A VOD mirror\'s', ' 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,',