commit 7725475feca61d4c1b67e8e2cf91c6b743687478
parent 657a8282227916d581c5cb45a0ddacdc807ae98e
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Wed, 18 Nov 2026 21:59:49 -0500
plans: x-followups review 2 -- the rulings as rulings (one machine-wide cap, what counts, deferred not failed, a deleted count rebuilt or refused, gone needs one read of every tab, the Latest press, which jobs ask X); the guide, the ops help and the changelog say what changed
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
5 files changed, 119 insertions(+), 31 deletions(-)
diff --git a/COMMANDS.md b/COMMANDS.md
@@ -361,12 +361,15 @@ get x-session [<slug>] is the X login an X job would use and whether one
looksAuthenticated, cookiesUpdatedAt, ageMinutes, maxAgeMinutes
(social.x.maxCookieAgeMinutes; 0 = off), the X cookie alert if it is up,
allowed, and reason (the refusal an X job would get); and X's JOB CAP:
- login (whose count it is), cap {lastHour, perHour: 12, lastDay, perDay:
- 150, reached, nextAt?} - at most 12 X jobs start in any 60 minutes and
- 150 in any 24 hours, per X login, over every kind of X job; a job past
- it is refused before it starts with the time the next may start. The
- numbers are constants of the code (common/lib/xJobRule.ts): no setting,
- option or queue raises them. <slug> names a
+ cap {lastHour, perHour: 12, lastDay, perDay: 150, reached, nextAt?} -
+ at most 12 X jobs start in any 60 minutes and 150 in any 24 hours ON
+ THIS MACHINE: one count over every kind of X job, whatever the login
+ source, cookie spec or channel. A job past it is refused when queued,
+ with the time the next may start; one that meets it when its queue
+ starts it ends done, deferred (not failed). A library's media-only
+ capture is not counted. The numbers are constants of the code
+ (common/lib/xJobRule.ts): no setting, option or queue raises them.
+ <slug> names a
channel whose own cookiesFromBrowser may decide the source. Nothing is
asked of X: a refresh is Refresh cookies / Connect X account on
/settings. Ask it before queueing fetch-posts or capture-posts on X.
diff --git a/OPERATING.md b/OPERATING.md
@@ -533,13 +533,26 @@ pnpm ops capture-posts --json '{"slug":"example-x","ids":["<postId>"]}' --wait
channel or a library, `read-x-trending`, `import-post` of an X post, an availability check of an X channel, an
X run, an X lead archived with a fetch — is refused with a `queueKey` other than `platform:twitter`, when it is
queued and again where it runs. On another queue it ran beside the job on X's and outside the gap between X jobs.
-- **X's job cap: 12 in any 60 minutes, 150 in any 24 hours, per X login.** Over every kind of X job together
- (each channel of an X run is one). A job past it is refused before it starts, with the time the next may start;
- nothing queues behind it. The scheduler skips X channels while it is reached and a trending watch waits, as for
- a cooldown. `pnpm ops get x-session` shows the count (`cap`). **The two numbers are constants of the code**
+- **An X channel's jobs that ask X nothing are not X's.** Its transcriptions (`transcribe-one`, whisper-video's
+ hand-off), windows cut from a saved copy (`clips:saved-video`), an import of a local file and an archive.org
+ import run on their own queues. Its clip windows, an import of an x.com address (into any channel) and its
+ kept-videos check run on X's queue. `record-live` of an X channel is refused (a recording would hold X's queue
+ for hours), and so is `redownload-incomplete-bucket` on one (the transcription queue).
+- **X's job cap: 12 in any 60 minutes, 150 in any 24 hours, on this machine.** ONE count over every kind of X
+ job together (each channel of an X run is one), whatever the login source, cookie spec or channel. A job past
+ it is refused when it is queued, with the time the next may start; nothing queues behind it. **A job that meets
+ it when its queue starts it ends `done`, deferred** (`[deferred] …` in its log, `deferred` on the job): it did
+ not run, it is not a failed sync, and nothing queues it again before that time. The scheduler skips X channels
+ while it is reached and a trending watch waits, as for a cooldown. `pnpm ops get x-session` shows the count
+ (`cap`). **What counts:** a job that can ask x.com with the login or X's cookies — every X job but a trending
+ library's media-only capture (screenshots, articles, avatars and context off, not a keep capture), which takes
+ files from X's media hosts with no cookie and no page: it runs on X's queue under X's gap, cooldown and the
+ watch's jar rule, and the cap neither counts nor holds it. **The two numbers are constants of the code**
(`common/lib/xJobRule.ts`): no setting, channel option, environment variable, flag or queue raises them, and
changing them is a code change. The count is kept in `transcripts/.x-session/job-starts.json`; if that file
- cannot be read no X job starts until it is repaired. X's own gap (5 minutes) already means 12 jobs an hour, so
+ cannot be read no X job starts until it is repaired. If it is gone, the last 24 hours are counted again from
+ the job records (`.jobs/<id>.meta.json`, `xStarts`); if X's queue ended a job in that time and the records
+ cannot be read (or none is left), no X job starts. X's own gap (5 minutes) already means 12 jobs an hour, so
the hourly cap bites only if that gap is lowered; the daily cap bites sooner: an X run over more than 150
channels, more than 150 X channels on a daily sync, or two topics watched at 30 minutes (a tick is a read and
usually a capture: about 96 jobs a day per topic) each reach it.
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -5,18 +5,38 @@
- A job that asks X is refused on any queue but `platform:twitter`, when it is queued and where it runs: a posts
fetch in any mode, a resumed backfill, a Sync, a capture, a trending read, an import of an X post, an
availability check, an X run. A job moved to another queue used to run beside the one on X's, with no gap.
- - **At most 12 X jobs start in any 60 minutes and 150 in any 24 hours, per X login**, over every kind together.
- A job past the cap is refused before it starts and says when the next may start. The scheduler skips X
- channels meanwhile and a trending watch waits. `pnpm ops get x-session` shows the count.
+ - **At most 12 X jobs start in any 60 minutes and 150 in any 24 hours, on this machine**, over every kind
+ together. It is one count, whatever the login source, cookie spec or channel: switching the login source or
+ respelling a cookie spec no longer starts a fresh count. A job past the cap is refused when you queue it and
+ says when the next may start. The scheduler skips X channels meanwhile and a trending watch waits.
+ `pnpm ops get x-session` shows the count.
+ - A job that meets the cap when its queue starts it ends **deferred**, not failed. It did not run, it is no
+ strike against its channel's sync, and nothing queues it again before the time it gives. The /jobs row says
+ "deferred".
+ - Only a job that can ask x.com with the login or X's cookies counts. A trending watch's media-only capture,
+ which downloads files from X's media servers with no cookie and no page, does not count and is not held by the
+ cap. It still runs on X's queue, after X's gap.
- The numbers are constants of the code (`common/lib/xJobRule.ts`). No setting, option, environment variable,
- flag or queue changes them. The count survives a restart, and an unreadable count stops every X job.
+ flag or queue changes them. The count survives a restart, and an unreadable count stops every X job. If the
+ count's file is deleted, the last day's X jobs are counted again from the job records. If X jobs ran and
+ their records cannot be read, every X job is refused.
+ - An X channel's jobs that never ask X run on their own queues again: a transcription (whisper-video's hand-off
+ to it included), clip windows cut from a saved copy, a local file's import, an archive.org import. An X clip
+ window, an import of an x.com address and an X channel's kept-videos check now run on X's queue. Recording an X
+ live stream stays refused, because it would hold X's queue for hours.
- The Add-channel form's Fetch details no longer starts gallery-dl against X for an X address: it reads the
handle off the URL. `pnpm archilyzer posts check` refuses an X channel as `posts fetch` does.
- **A trending read covers Top and Latest in one job, and can reach the page's end.**
- After Top is read, the read presses the page's Latest tab and reads it under the same caps. `"tabs"` on
`read-x-trending` and on a watch picks one tab; the channel page's form has the same choice.
- - A Latest tab that cannot be opened ends the read `Top read; Latest not read: <why>`. It is still a read.
- - "Gone" is said per tab: gone from Latest while Top still shows it, or gone from the page.
+ - A Latest tab that cannot be opened ends the read `Top read; Latest not read: <why>`. It is still a read. The
+ read presses only the page's own tab, inside its tab list. If the press leaves the trending page, the read
+ stops there: `Top read; Latest not read: the page changed`. A click that fails is the same kind of ending. If
+ the read runs out of time inside Latest, Top's read is kept: `Top read; Latest stopped at the deadline`.
+ - "Gone" is said per tab: gone from Latest while Top still shows it, or gone from the page. **Gone from the
+ page** needs one read in which every tab that showed the post was read to its end without it. Marks from
+ different reads stay per tab. A post seen before tabs were read counts as the Top tab's, so a complete Latest
+ read no longer calls it gone.
- The caps are higher so a read can reach the end, which is what lets it say a post is gone: 20 scrolls and
200 posts per tab by default (were 8 and 60), at most 40 and 400. A read's deadline is 2 minutes plus 12 s per
scroll per tab: 10 minutes for both tabs at the defaults.
diff --git a/plans/x-trending.md b/plans/x-trending.md
@@ -381,9 +381,9 @@ of X's summary; no shipped module imports `common/testing` (`common/architecture
and 60); maxima 40 and 400. A read's deadline is `120 s + tabs × scrolls × 12 s` (`readDeadlineMs`): 6 minutes for
one tab at 20 scrolls (what a read always had), 10 for both tabs at the defaults, 18 for both at the maximum.
-**R2. X jobs run on X's queue only, under an immutable cap per login.** `common/lib/xJobRule.ts` holds the rule
-and its numbers: 12 X jobs started in any rolling 60 minutes, 150 in any rolling 24 hours, per X login, over
-every kind of X job. No setting, config key, environment variable, option, flag or queue changes them.
+**R2. X jobs run on X's queue only, under an immutable cap.** `common/lib/xJobRule.ts` holds the rule
+and its numbers: 12 X jobs started in any rolling 60 minutes, 150 in any rolling 24 hours, over every kind of X
+job — ONE count for the machine (review 2 below; it was per login as first built). No setting, config key, environment variable, option, flag or queue changes them.
- The network guard treats a job as X's when its queue is X's OR its channel is on X (a job on another
platform's queue used to be taken for that platform's and met none of X's rules); refuses any queue but
`platform:twitter` at enqueue and at the start; refuses at enqueue when the cap is reached; and checks and
@@ -391,9 +391,9 @@ every kind of X job. No setting, config key, environment variable, option, flag
each of its channels is one start.
- Where X is about to be asked the code asks again (`xJobContextRefusal`: a job of the editor's, on X's queue):
`fetchPosts`, `capturePosts`, `importPost`, `checkPostAvailability`, `runXTrendingRead`.
-- The count is `transcripts/.x-session/job-starts.json`, per login, written under its lock, kept across a
- restart; a file that cannot be read refuses every X job; a clock set back never frees a start early. Its clock
- is the queue gap's.
+- The count is `transcripts/.x-session/job-starts.json` (`common/jobs/xJobCap.ts`), written under its lock,
+ kept across a restart; a file that cannot be read refuses every X job; a clock set back never frees a start
+ early. Its clock is the queue gap's.
- The scheduler skips X posts channels while the cap is reached; a watch's tick is skipped as for a cooldown.
- A job replayed at boot re-enters through its action and the same funnel, so both rules hold for it.
@@ -422,6 +422,54 @@ other trends of the same story, with names and post counts (could propose pages
and the page's `disclaimer`. A failed answer of ANY of the page's own operations (the badge poll included) makes a
read assert nothing about the page's end: conservative, left so.
+## Review 2 rulings (19 Nov), as built in `lane/x-followups`
+
+These are rulings, not reasons.
+
+- **ONE CAP FOR THE MACHINE.** Every counted X start is counted together, whatever the login source, the
+ cookie spec or the channel. A count keyed by a config string gave the same X account a fresh 12/150 for a
+ flipped source, a respelled spec or a channel's own spec. A count file of the first shape (one list per login)
+ is read as the sum of its lists. `get x-session` shows the one count and names no login.
+- **WHAT COUNTS.** A job counts only if it can ask x.com with the login or X's cookies. One predicate,
+ `xJobCounts`, decides from the job's own plan at its start (its kind, its spec, its channel), never from a flag
+ a caller passes. A trending library's capture of media only (screenshots, articles, avatars and context off by
+ name; no thread shot, no avatars-only or context-only run, not a keep capture) takes files from X's two media
+ hosts with no cookie, no page and no logged-in fallback, so it does not count and the cap does not hold it. It
+ still runs on X's queue, under X's gap, X's cooldown and the watch's jar rule. A capture that could fall back to
+ the login counts. So do reads, fetches, imports, availability checks and each channel of an X run. The
+ transcription worker counts nowhere.
+- **DEFERRED, NOT FAILED.** A job that reaches the cap at its start (it passed its enqueue while slots remained)
+ ends `done` with `deferred: {until, sentence}` on its record and meta and `[deferred] …` in its log. It is no
+ failure and no strike, and raises no banner. The scheduler folds it as neither success nor failure: the
+ failures stay, and the channel is not eligible before `until` (`foldScheduledSyncOutcome`). Nothing re-queues
+ it by itself. (A status of its own was not added: a new terminal status would reach every reader of job
+ statuses. `done` + `deferred` is what the /jobs row and the job page show as "deferred".)
+- **A DELETED COUNT IS REBUILT, OR REFUSES.** With `job-starts.json` absent, the last 24 hours of counted starts
+ are rebuilt from the job records: every meta of X's queue carries `xStarts` (the starts it was counted for,
+ `[]` for none); a meta from before that counts once at its start when its kind and plan count. The rebuilt
+ count is written. If X's queue gap records an X job's end in the last 24 hours and the records cannot be listed,
+ a record of that day cannot be read, or no record of an X job is left, every X job is refused until they can be
+ (at the latest until that end is a day old). A corpus where no X job ever ran starts at zero.
+- **GONE FROM THE PAGE NEEDS ONE READ OF EVERY TAB.** A post is gone from the page only when every tab that
+ showed it was read to its end without it IN THE SAME READ, and no tab of that read shows it. Marks from
+ different reads stay per tab ("gone from Latest at <time>") and never combine. A sighting from before tabs
+ were read names no tab and was the opening tab's (the source's first known tab, else "Top"): only a complete
+ read of that tab, or a read that cannot name its own tab, judges it.
+- **THE LATEST PRESS IS THE PAGE'S OWN TAB.** Role `tab` only, looked up inside the page's tab list, by the exact
+ name the trend answer gave; never a link or a button. After the press the page must still be the trending page
+ (host and path), or the read stops at once, closes the browser and ends `Top read; Latest not read: the page
+ changed`. A press that fails (a throw, not actionable, a look-up deadline) is `Top read; Latest not read:
+ <why>`. The read's deadline inside Latest keeps Top's read: `Top read; Latest stopped at the deadline`, Latest's
+ `pageEnd` false. None is a strike. The wait for Latest's answer has its own 20 s wall clock. A tab the read says
+ was not read gives the library nothing.
+- **WHICH JOBS ASK X** (`xJobAsksX`). X's queue (and its old clip queue) whatever the kind; an import of one URL
+ by that URL's host; an X channel's job unless its work asks no platform: `transcribe-one`, windows cut from the
+ saved copy (`clips:saved-video`), `import-media` of a local file, `import-archive-org`. Those pass off X's
+ queue (the transcription and every whisper-video's hand-off to it had been refused). X clip windows, an import
+ of an x.com address and an X channel's `check-kept-deleted` are queued on X's queue. `record-live` of an X
+ channel stays refused (it would hold X's queue for hours), and so does `redownload-incomplete-bucket` on one.
+ A caller's `network: false` (fetch-chat's replay on disk) still skips the guard, as before.
+
## Open
- The END of a timeline is confirmed by no capture yet (above). The parser is built so that a change is
@@ -429,7 +477,8 @@ read assert nothing about the page's end: conservative, left so.
- The first real read stopped at the old post cap (60) after three scrolls. With 200 posts and 20 scrolls per
tab a read can reach a page's end; whether a busy page has one within the caps is still to be seen.
- X's daily job cap (150) is below what the app can ask for at its own defaults: two topics watched at 30
- minutes, an X run over more than 150 channels, or more than 150 X channels on a daily sync. The cap refuses the
- excess; raising it is the operator's code change.
+ minutes (a watch's media-only capture no longer counts, so a topic is nearer 48 jobs a day than 96), an X run
+ over more than 150 channels, or more than 150 X channels on a daily sync. The cap refuses the excess; raising it
+ is the operator's code change.
- Whether a watch may keep the jar fresh by itself is the operator's to rule; until then the jar rule
above stands.
diff --git a/scripts/archilyzer-ops.mjs b/scripts/archilyzer-ops.mjs
@@ -1317,12 +1317,15 @@ export function usage() {
" looksAuthenticated, cookiesUpdatedAt, ageMinutes, maxAgeMinutes",
" (social.x.maxCookieAgeMinutes; 0 = off), the X cookie alert if it is up,",
" allowed, and reason (the refusal an X job would get); and X's JOB CAP:",
- " login (whose count it is), cap {lastHour, perHour: 12, lastDay, perDay:",
- " 150, reached, nextAt?} - at most 12 X jobs start in any 60 minutes and",
- " 150 in any 24 hours, per X login, over every kind of X job; a job past",
- " it is refused before it starts with the time the next may start. The",
- " numbers are constants of the code (common/lib/xJobRule.ts): no setting,",
- " option or queue raises them. <slug> names a",
+ " cap {lastHour, perHour: 12, lastDay, perDay: 150, reached, nextAt?} -",
+ " at most 12 X jobs start in any 60 minutes and 150 in any 24 hours ON",
+ " THIS MACHINE: one count over every kind of X job, whatever the login",
+ " source, cookie spec or channel. A job past it is refused when queued,",
+ " with the time the next may start; one that meets it when its queue",
+ " starts it ends done, deferred (not failed). A library's media-only",
+ " capture is not counted. The numbers are constants of the code",
+ " (common/lib/xJobRule.ts): no setting, option or queue raises them.",
+ " <slug> names a",
" channel whose own cookiesFromBrowser may decide the source. Nothing is",
" asked of X: a refresh is Refresh cookies / Connect X account on",
" /settings. Ask it before queueing fetch-posts or capture-posts on X.",