Archilyzer · Source

archilyzer

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

commit d91b49b05c80e06d8b238c8e4cf4374b81c0db18
parent 772085506b06929e347b1bf7ddc6ec58f8f141fc
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Fri, 23 Oct 2026 11:28:07 -0400

pacing guard: docs and record -- OPERATING (the X alert, the fresh-jar rule, the gaps), CHANGELOG, plans/pacing-guard.md, COMMANDS regenerated; a fetch-chat that only normalizes is not a network job

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

Diffstat:
MCOMMANDS.md | 2+-
MOPERATING.md | 19+++++++++++++++++++
Mcommon/controller/fetchLiveChat.ts | 3+++
Mcommon/jobs/streamCommand.ts | 12+++++++++---
Meditor/CHANGELOG.md | 3+++
Meditor/app/api/ops/recheck-service/route.ts | 5+++--
Meditor/app/channels/[slug]/socialActions.ts | 9++++++---
Aplans/pacing-guard.md | 116+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mscripts/archilyzer-ops.mjs | 8+++++---
9 files changed, 165 insertions(+), 12 deletions(-)

diff --git a/COMMANDS.md b/COMMANDS.md @@ -151,7 +151,7 @@ Drives a running editor over HTTP (`/api/ops/*`, the same actions its pages run) | `tts` | tts speaks a line with a local text-to-speech engine and a STOCK voice, as a job on the `tts` queue: {"text": "..."} or {"file": "/abs/script.txt"} (UTF-8, at most 20,000 characters), "engine" (kokoro \| orpheus \| espeak-ng), "voice" (one of the engine's stock voices; kokoro: af\_heart, bm\_george, ...; orpheus: leah, zac, ...), "speed" (0.5-2; orpheus has none) — defaults from settings.tts (kokoro, af\_heart, 1) — and "out" (an absolute .wav path the result is copied to, never inside the corpus). The expressive tags &lt;laugh&gt; &lt;chuckle&gt; &lt;sigh&gt; &lt;cough&gt; &lt;sniffle&gt; &lt;groan&gt; &lt;yawn&gt; &lt;gasp&gt; are performed by orpheus and stripped for the others; any other &lt;...&gt; is refused. Numbers, years, money and times are spoken (2024: "twenty twenty-four"). The result is {wav, seconds, engine, voice, cached, durationMs, waitedMs, sha, sampleRate, speed, disclosure}: wav is the 48 kHz mono WAV the editor wrote (out, or its cache), disclosure the line a narrated export carries. The same ask again is answered from the cache (cached: true, no engine run). Kokoro and orpheus need `archilyzer tts setup [--engine orpheus]` first; orpheus runs on the GPU (a local llama-server the editor starts and stops) and waits while a transcription holds it. With --wait the result is printed on stdout. | `pnpm ops tts --json '{"text":"In 2024 the archive spoke."}' --wait`<br>`pnpm ops tts --json '{"file":"/abs/script.txt","voice":"bm_george","out":"/abs/line.wav"}' --wait` | | `settings` | settings patches settings.json through the editor's one writer: {"patch": {"&lt;top-level key&gt;": value, …}} (SETTINGS.md). A block's keys merge one level; an array, a scalar or an object nested in a block replaces. Refused before anything is written: an unknown key; a key another writer owns (channelPriority, autoQueue, workers, storage — the refusal names it); a value the schema would not keep as sent (clamped, dropped), named with what would be saved. Answers the saved values. | `pnpm ops settings --json '{"patch":{"minFreeDiskGB":20}}'` | | `clear-platform-hold` | clear-platform-hold clears a platform's rate-limit hold, backoff and raised pace, as the lane strip's Clear hold: {"platform"}. Answers the sentence. | | -| `recheck-service` | recheck-service asks a service whose cookie refresh alert is up ONE request through its own path, as the dashboard banner's Recheck: {"service"} ("rumble", "youtube", "odysee", "archive.today" or a forum host). Waits for it: {jobId, result: "clean" \| "stale" \| "failed", message}; "clean" clears the alert (and a yt-dlp service's backoff, as any clean request). dismiss-service clears a service's cookie alert by hand: {"service"}. rerun-service-jobs retries every job a service's cookie alert stopped, once it is OK again: {"service"} -&gt; {jobIds, skipped}. --wait follows them. | `pnpm ops recheck-service --json '{"service":"rumble"}'` | +| `recheck-service` | recheck-service asks a service whose cookie refresh alert is up ONE request through its own path, as the dashboard banner's Recheck: {"service"} ("rumble", "youtube", "odysee", "archive.today", "x" or a forum host). Waits for it: {jobId, result: "clean" \| "stale" \| "failed", message}; "clean" clears the alert (and a yt-dlp service's backoff, as any clean request). For "x" it sends X NO request: clean when the login on disk was renewed after the alert (Refresh cookies on /settings). dismiss-service clears a service's cookie alert by hand: {"service"}. rerun-service-jobs retries every job a service's cookie alert stopped, once it is OK again: {"service"} -&gt; {jobIds, skipped}. --wait follows them. | `pnpm ops recheck-service --json '{"service":"rumble"}'` | | `dismiss-service` | — | | | `rerun-service-jobs` | — | | | `workers` | workers switches transcription workers as /workers does: {"op": "enable" \| "disable" \| "drain", "ids": \[...\]} — the live pool; a restart restores the launch default. An unknown id is named; the others still apply. | `pnpm ops workers --json '{"op":"disable","ids":["parakeet-cpu"]}'` | diff --git a/OPERATING.md b/OPERATING.md @@ -73,6 +73,13 @@ pnpm ops dismiss-service --json '{"service":"rumble"}' Cloudflare's challenge words; no real sample yet) → open odysee.com. A forum's browser check, captcha or login wall, by host → Connect forum session on the thread's channel page. archive.today's check page → Connect archive session (Settings). A Connect that ends on a cleared page clears the banner too. +- **X** (`"service":"x"`): a Cloudflare challenge, a 401/403 or a login wall in gallery-dl's output — even + on a run that exits 0 — fails the fetch (posts read so far kept) and raises it; one is enough. **While it + is up, no X job starts**: every fetch, older walk, X search, capture or import on X is refused with its + sentence, and the refused jobs are listed for **Re-run stopped jobs**. Pass X's check by hand (Connect X + account on /settings and clear it in the window; with the browser login, open x.com in that browser), + press **Refresh cookies**, then **Recheck** — which sends X *no* request: it clears when the login on disk + was renewed after the alert was raised. - The job it stopped says so in its log: `stopped: Rumble cookies look stale — open rumble.com in …, then Recheck on the dashboard.` `archilyzer doctor` lists it under "service cookies". - The state is `transcripts/.service-cookies.json` (`common/lib/serviceCookies.ts`); never hand-edit it. @@ -261,6 +268,18 @@ pnpm ops capture-posts --json '{"slug":"example-x","ids":["<postId>"]}' --wait - An X, Bluesky or XenForo URL makes a social channel (its handle derived from the URL). `"older": true` walks back below the oldest archived post and resumes from its saved place; `"full": true` re-walks the timeline. +- **Pacing is enforced, not advised** (plans/pacing-guard.md). Every job that asks a platform waits its + platform queue's gap after the previous one there ended — `pacing.jobGapSeconds`: X 300 s, forums and + Bluesky 60 s, everything else 20 s (set on /settings) — and its /jobs row and log say so (`waiting 4m12s: X + jobs are spaced 5 min apart (pacing.jobGapSeconds.twitter)`). Thirteen fetches queued in one loop run five + minutes apart and stop at the first challenge. A queue override of `""` (immediate) is refused for any + such job. +- **X only on a fresh jar.** With the connected profile as the login source, a job aimed at X is refused — + at enqueue and again when its queue reaches it — unless the cookies were refreshed within + `social.x.maxCookieAgeMinutes` (60; 0 = off): `X cookies were last refreshed 16 days ago (limit 60 min): + press Refresh cookies (or Connect X account) on /settings, then fetch again.` Refreshing is a click on + /settings — it loads x.com — so the editor never refreshes on its own. With the browser login the age + cannot be read; the job logs that and proceeds. - `capture-posts` saves a screenshot and the attached media of named posts (and a linked X Article). - A **forum thread** keeps two positions (`posts-state.json` `forum`): **Fetch posts** catches up from the last page to the newest held post, then continues the history from where it stopped, down to page 1 — `"pages": N` caps diff --git a/common/controller/fetchLiveChat.ts b/common/controller/fetchLiveChat.ts @@ -297,6 +297,9 @@ export async function runFetchChatJob(opts: FetchChatJobOpts): Promise<StreamAct paths, channelSlug: slug, videoId, + // A replay already on disk is only normalized: no request, so no gap and + // no network guard (plans/pacing-guard.md). + ...(plan.kind === "normalize" ? { network: false as const } : {}), fn: async (onLog, signal) => { if (plan.kind === "normalize") { onLog(`The chat replay of ${videoId} is on disk; normalizing it (no network).`); diff --git a/common/jobs/streamCommand.ts b/common/jobs/streamCommand.ts @@ -79,6 +79,12 @@ type CommonOpts = { // queued background work without interrupting a running one. The auto-download // runner marks its per-video units background so a clicked Sync preempts them. background?: boolean; + // THIS job asks no platform, though its kind may (a fetch-chat whose replay + // is already on disk only normalizes it). `false` skips the network guard + // and the queue gap (plans/pacing-guard.md) and leaves no end for the next + // job's gap; absent, the kind decides (`network` in jobs/jobKinds.ts). Only + // ever `false`: a caller cannot make a job network that its kind is not. + network?: false; }; export type RunManagedCommandOpts = CommonOpts & { @@ -385,8 +391,8 @@ export async function runManagedFunction( // THE NETWORK GUARD (jobs/networkGuard.ts, plans/pacing-guard.md): a job // that asks a platform never runs unqueued, and one aimed at X needs a fresh // cookie jar and no raised X alert. Asked here and again at the start. - const network = await guardNetworkJob(opts); - if (!network.ok) return { ok: false, error: network.error }; + const network = opts.network === false ? null : await guardNetworkJob(opts); + if (network && !network.ok) return { ok: false, error: network.error }; const registry = getRegistry(); await ensureJobsDir(opts.paths); const { id, logPath, record } = makeJob( @@ -479,7 +485,7 @@ export async function runManagedFunction( // there ended (jobs/queueGap.ts), then is guarded once more: a jar can // go stale during a five-minute wait. Only a job that reached its work // counts as an end for the next one's gap. - const network = kindIsNetwork(opts.kind); + const network = opts.network !== false && kindIsNetwork(opts.kind); const guard = async () => { const res = await guardNetworkJob({ ...opts, job: { id } }); if (!res.ok) throw new Error(res.error); diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## [Unreleased] +- **Jobs that ask a site are spaced apart, and X jobs start only on fresh cookies.** On 2026-10-23 thirteen X fetches queued in one loop ran less than a second apart on a cookie jar refreshed 16 days earlier; X answered with a Cloudflare challenge and the account needed a human verification. Now every job that sends requests to a platform waits after the previous one on the same platform ended — 5 minutes for X, 1 minute for forums and Bluesky, 20 seconds for everything else — and its row on /jobs and its log say so: "waiting 4m12s: X jobs are spaced 5 min apart (pacing.jobGapSeconds.twitter)". The gaps are on /settings beside the download sleep (`pacing.jobGapSeconds`), and the last job's end is remembered across a restart. With the connected X profile, a job that asks X is refused — when it is queued and again when its turn comes — unless the cookies were refreshed within the last hour: "X cookies were last refreshed 16 days ago (limit 60 min): press Refresh cookies (or Connect X account) on /settings, then fetch again." The limit is in the X account section of /settings (`social.x.maxCookieAgeMinutes`, 0 turns it off). The editor never refreshes the cookies itself, because a refresh loads x.com. With the browser login the age cannot be read; the job says so and runs. A job that asks a site can no longer be run "(immediate)": the queue picker leaves the option out, and `"queueKey": ""` from `pnpm ops` is refused with a sentence. Needs a restart of the editor. +- **An X challenge stops X.** When gallery-dl prints a Cloudflare challenge, a 401 or 403, or a login wall, the fetch now fails even if gallery-dl exits cleanly (the posts it read are kept), and the dashboard shows an **X needs fresh cookies** banner. While it is up, every X job (Fetch posts, the older walk, an X search, Capture posts, Import one post, Check deleted posts, the scheduler's fetches) is refused before it asks anything, and the refused jobs are listed for **Re-run stopped jobs**. Pass X's check by hand, press **Refresh cookies** on /settings, then **Recheck**: for X it sends no request and clears the banner when the login on disk is newer than the challenge. `pnpm ops get services` and `archilyzer doctor` list it as `x`. Needs a restart of the editor. +- **A podcast feed's download-missing no longer probes every episode back to back.** A probe — the metadata request that tells the download filter an episode's title — now waits the sleep between downloads like any download; only an episode decided without any request skips it. To keep that cheap, a channel with a download filter whose playlist is a feed's episode files reads its feed once per run and records every episode's title, so an episode the filter declines costs no request at all. Release 9 had let a declined video skip the sleep, and a feed channel's run then made about 1,150 probes with no gap. Needs a restart of the editor. - **A clip in a fact-check video can stamp and count more than once.** The clip editor's **Count & stamp** box is now **Marks**, on every clip: a list of the clip's marks, each its own stamp and its own step of the tally at its own second — its verdict picked by this cut's words (Episodes, Grift…), when it lands (**Set at playhead**, Shift+S for the selected mark), how long it stays, whether it is drawn, how much it counts, what it says, **Remove**. **Add mark at playhead** (Shift+M) adds one under a new id; **Clear** removes them all. Two stamps on one clip that would sit on each other are refused, saying where the second may land. From a terminal: `umtool set <project> <clip> mark.add=Episodes@190.2`, `mark.remove=<id>`, `mark.verdict=…`, `marks=<json>`; `umtool show` lists them. A clip with one mark is written as before, so an existing video renders the same. - **Walk a report video's clips in umtool's clip editor with the on-screen chrome drawn over them, no build.** Under the clip editor's player, **Live preview** draws the cut's deck over the playing clip, in step with the playhead: the clip's date title and subtitle, the timeline with its pip and flags, the tally as it stands at that moment (stepping when a stamp lands), the stamp, the posts, the QR, and the finale's page on the last clip. A trimmed edge, a moved stamp or new words show about a second after they are saved; an unsaved nudge moves the picture at once. **Title** and **Subtitle** under the picture edit the clip's on-screen words, shown as they are typed. A line under the picture says what the preview does not do (the build snaps each edge to a silence and crossfades the clips). **Render this clip** makes the clip with its chrome exactly as the build would, in a minute or two, and plays it in place (`node umtool/report-to-video/build-video.mjs <manifest> --skip-fetch --clip-preview <id>`). The On-screen preview now draws the finale too. Needs a restart of umtool. - **A long report video with on-screen chrome is no longer stopped partway through its build.** umtool gave a build two minutes per clip (a whole-cut take one minute), which a 36-clip, 25-minute cut with its panel, posts column and stamps outruns: drawing those alone takes over half an hour. A build or take of a cut with on-screen chrome now gets five times the cut's length when that is longer. Needs a restart of umtool. diff --git a/editor/app/api/ops/recheck-service/route.ts b/editor/app/api/ops/recheck-service/route.ts @@ -4,11 +4,12 @@ import { ops, opsFail, reqString } from "../_lib"; export const dynamic = "force-dynamic"; -// POST { service: "rumble" | "youtube" | "odysee" | "archive.today" | <forum host> } +// POST { service: "rumble" | "youtube" | "odysee" | "archive.today" | "x" | <forum host> } // // The cookie refresh banner's Recheck: ONE request through the service's own // path (a yt-dlp metadata request for its last clean video; a forum page -// through the host's profile; archive.today's request again), as a one-step +// through the host's profile; archive.today's request again; for X no request +// at all — the login on disk, renewed since the alert), as a one-step // job (kind `recheck-service-cookies`) the answer waits for: // { ok, jobId, result: "clean" | "stale" | "failed", message }. "clean" // clears the alert. diff --git a/editor/app/channels/[slug]/socialActions.ts b/editor/app/channels/[slug]/socialActions.ts @@ -235,9 +235,12 @@ export async function fetchPostsAction( } } - // queueKeyForUrl() already routes x.com / bsky.app to platform:x.com / - // platform:bsky.app, so per-platform serialization and the existing 429 - // backoff come free with no new queue plumbing. + // downloadQueueKey() puts an X channel on `platform:twitter` (x.com is + // detected as twitter), Bluesky on `platform:bluesky`, a forum thread on + // `platform:xenforo`: one fetch per platform at a time, spaced by + // `pacing.jobGapSeconds`, and — for X — refused on a stale jar or a raised X + // alert (common/jobs/networkGuard.ts, plans/pacing-guard.md). The video + // downloads' 429 backoff does NOT apply to post fetchers. const key = resolveQueueKey(downloadQueueKey(config), queueKey); return runManagedFunction({ diff --git a/plans/pacing-guard.md b/plans/pacing-guard.md @@ -0,0 +1,116 @@ +# Pacing guard — no unpaced network job, X only on a fresh jar, a challenge stops X + +Lane `lane/pacing-guard`, 2026-10-23. + +## Why + +On the night of 2026-10-23 an agent queued `fetch-posts` for 13 X accounts in one loop. The registry runs +one job per queue and starts the next the moment one ends, so they ran ~0.6 s apart on a cookie jar exported +16 days earlier. X answered with a Cloudflare challenge; gallery-dl printed `[twitter][warning] Cloudflare +challenge`, exited 0, read nothing, and every job ended `done`. The operator had to pass a human verification +on the account. + +Operator, verbatim: "Let's be more cautious- only start X downloads with a recent cookie refresh", "yeah never +do that, be very careful not to do that thing on any sort of site", "This should be enforced in Archilyzer, not +just an AI standing rule". + +The same night a podcast feed channel's (`platform:megaphone.fm`) download-missing probed ~1,150 episodes with +yt-dlp back to back to learn their titles for the download filter. + +## What is enforced + +All of it in code, in the one job funnel (`runManagedFunction`, `common/jobs/streamCommand.ts`), driven by a +declarative flag on the kind. + +1. **`network` on a job kind** (`common/jobs/jobKinds.ts`). 40 kinds that send requests to a platform declare + `network: true` (fetch-posts, capture-posts, import-post, check-post-availability, sync, download-*, + import-one, import-archive-org, metadata-scan, store-playlist, refresh-metadata, fetch-window(s), + record-live, persist-*, fetch-chat, auto-download-unit, the availability checks, import-page, + save-page-now, wayback-scan, browser-lookup, find-copy, fetch-copies, whisper-video, transcribe-one, + check-kept-deleted, import-media, recheck-service-cookies …); the two offline kinds on a platform queue + (import-forum-pages, reextract-pages) declare `false`. `jobKinds.test.ts` fails if a platform-queue kind + declares neither. A caller may mark one job `network: false` (a fetch-chat whose replay is already on disk + only normalizes it); never the other way. +2. **No unpaced network job** (`common/jobs/networkGuard.ts`). A queue override of `""` (immediate) is refused + for a network kind, before any job exists. `QueueControl` no longer offers "(immediate)" on an action whose + default is a `platform:` queue. +3. **The gap between jobs on a platform queue** (`common/jobs/queueGap.ts`, `common/lib/jobGap.ts`). A network + job on `platform:<p>` does not begin until `pacing.jobGapSeconds[p]` (else the built-in for p, else + `default`) after the previous network job there ENDED. Built in: default 20, twitter 300, xenforo 60, + bluesky 60; only keys the operator sets are stored. While it waits, the job is `running` (its queue slot + held) and its log and /jobs row say `waiting 4m12s: X jobs are spaced 5 min apart + (pacing.jobGapSeconds.twitter)`. Only a job that got past its guards counts as an end, so a refused job does + not make the next one wait. The last end per queue is in memory and in `.jobs/queue-gaps.json`, so a restart + is not a free pass. Cancel aborts the wait; Drain ends the job `done` without asking anything. +4. **X only on a fresh jar.** Before a network job aimed at X (its queue is `platform:twitter`, or its channel's + platform is twitter) is queued, and again when its queue starts it (and once more after its gap), with the + `"profile"` login source: refused unless the exported jar's mtime is within `social.x.maxCookieAgeMinutes` + (absent 60, 0 off) and it carries an auth_token. The sentence: `X cookies were last refreshed 16 days ago + (limit 60 min): press Refresh cookies (or Connect X account) on /settings, then fetch again.` With the + `"browser"` source the age cannot be read: the job logs that and proceeds. Nothing refreshes the jar + automatically — `refreshXCookies` loads x.com/home, itself a request to X. +5. **A challenge stops X.** `GalleryDlStream` records the first stderr line with a challenge word + (`cloudflare`, `challenge`, `just a moment`, `captcha`) or an AUTH_ERROR_PATTERNS match on a warning/error + line, on ANY exit code. The timeline walk, the older/search windows and the media capture then fail (posts + read so far kept; `needsCookies`, an `error`) and raise **X as a cookie-alert service** (`"x"`, label "X", + family `x`; `lib/serviceCookies.ts`) — one signal is enough. **While the X alert is raised, every X job is + refused before it starts** with `X answered with a challenge at HH:MM UTC (<line>) and its cookie alert is + up, so no X job starts: …, then Recheck on the dashboard.`, and the refused job is recorded on the alert for + **Re-run stopped jobs**. A clean gallery-dl run notes a clean request (clears a pending one, remembers the + last good URL). **Recheck for X sends X no request**: clean when the login on disk (the profile jar, or the + browser's x.com auth_token last-sent time) was renewed after the alert was raised. The dashboard banner, `pnpm + ops get services`, `recheck-service`, `dismiss-service`, `rerun-service-jobs` and `archilyzer doctor` carry + it like the other services. +6. **A probe is a request.** Release 9 B2 let a video the download filter declined after only its metadata + prefetch skip `sleepBetweenDownloadsSeconds`; now only an outcome with no attempt at all skips it + (`madeNoRequest`, `common/ytdlp/runYtdlp.ts`). To keep that cheap: a channel with a download filter, no + known platform, and a playlist that is mostly direct media files (a feed's enclosures) reads its feed ONCE per + download run and writes each unscanned episode's title into the metadata-scan store + (`common/controller/feedTitlePrefilter.ts`); `settledByTitleFilterIds` then declines a filtered episode + with no request. + +Settings: `pacing.jobGapSeconds` (on /settings beside the download sleep: every platform, X, forums, Bluesky; +a value equal to the built-in is not stored) and `social.x.maxCookieAgeMinutes` (the X account section). +SETTINGS.md regenerated. Test-only: `E2E_JOB_GAP_SECONDS` and `E2E_X_MAX_COOKIE_AGE_MINUTES` replace the +BUILT-IN values (the e2e server sets both to 0); a value written into settings.json still applies. + +## The lanes + +The auto-download lane's units (`auto-download-unit`) ride the platform queues and are network jobs, so they +wait `max(the lane's own gap, the queue gap)`: the lane already waits `sleepBetweenDownloadsSeconds` (+ the +adaptive pace) after a unit settles before it queues the next on that platform. With the operator's 30 s sleep +the 20 s default adds nothing; with the shipped default sleep (10 s) a YouTube unit starts 20 s after the last +instead of 10. Other effects: a scheduler tick's syncs on one platform start 20 s apart; imports on archive.org's +queue (import-page, save-page-now, import-archive-org) 20 s apart; a channel's X fetches 5 min apart. The +transcription, digest, backfill and clip-window lanes are not on `platform:` queues and are unchanged. + +## Verified + +- `pnpm typecheck` clean. `pnpm --filter yt-dlp-transcript-common test`: 5005 pass, 0 fail, 2 skipped (the two + autoRunner computeLeafPending failures seen on main did not reproduce here). `pnpm test:scripts`: 1446 pass, + 0 fail. `pnpm --filter editor test`: 370 pass. Docs: `archilyzer settings example --check`, `docs cli + --check`, `docs env --check`, `docs files --check` clean. +- `common/jobs/pacingGuard.test.ts` reproduces the night through the real funnel, the real fetch controller and + the real gallery-dl fetcher against a fake binary: 13 `fetch-posts` on `platform:twitter`; job 1 meets the + Cloudflare warning (exit 0) → job 1 `failed`, the X alert raised, jobs 2–13 refused at their start without + spawning gallery-dl (one gallery-dl run in all), all 13 on the alert, a fourteenth refused at enqueue; with + no challenge the 13 start ≥ 300 s apart on a fake clock and the second's log carries the waiting line; a + 16-day-old jar is refused at enqueue and a jar that went stale while a job was queued refuses it at start; + `""` is refused for a network kind and allowed for an offline one. +- Unit tests: `jobs/queueGap.test.ts`, `jobs/networkGuard.test.ts`, `jobs/jobKinds.test.ts` (every platform + kind decided), `lib/serviceCookies.test.ts` (X), `controller/recheckServiceCookies.test.ts` (X asks nothing), + `controller/feedTitlePrefilter.test.ts`, `ytdlp/managedDownloadsSleep.test.ts` (a probe sleeps), + `controller/fetchPosts.test.ts` (an auth failure now fails the fetch). +- e2e (written, NOT run in the lane — the orchestrator runs the suite): `cookie-alerts.spec` (a stale jar's + sentence, `""` refused, the fake gallery-dl's `challenged_user` answers with the challenge → the job fails, + the next fetch is refused, the X banner, Recheck stale then clean after the jar is refreshed, then a fetch + runs), `pacing.spec` (two download-missing jobs on `platform:youtube` with a 6 s gap: the /jobs row and the + log), `queues.spec` (no "(immediate)" on Sync; an empty custom queue is refused — replaces "empty queue runs + immediately"). + +## Not done + +- A Bluesky or forum jar-age rule (X only, as asked). The forum's own challenge alert already existed; it still + only logs and does not refuse the next forum job (a forum fetch has `retryOnBlock`). +- The X Article/screenshot half of capture-posts loads pages through the profile, not gallery-dl; a challenge + page there is not yet recognised (its media download through gallery-dl is). diff --git a/scripts/archilyzer-ops.mjs b/scripts/archilyzer-ops.mjs @@ -1056,9 +1056,11 @@ export function usage() { "", 'recheck-service asks a service whose cookie refresh alert is up ONE request', ' through its own path, as the dashboard banner\'s Recheck: {"service"}', - ' ("rumble", "youtube", "odysee", "archive.today" or a forum host). Waits', - ' for it: {jobId, result: "clean" | "stale" | "failed", message}; "clean"', - " clears the alert (and a yt-dlp service's backoff, as any clean request).", + ' ("rumble", "youtube", "odysee", "archive.today", "x" or a forum host).', + ' Waits for it: {jobId, result: "clean" | "stale" | "failed", message};', + " \"clean\" clears the alert (and a yt-dlp service's backoff, as any clean", + ' request). For "x" it sends X NO request: clean when the login on disk', + ' was renewed after the alert (Refresh cookies on /settings).', 'dismiss-service clears a service\'s cookie alert by hand: {"service"}.', 'rerun-service-jobs retries every job a service\'s cookie alert stopped, once', ' it is OK again: {"service"} -> {jobIds, skipped}. --wait follows them.',