The tick walked the projects in order and stopped at its budget, from the top,
every time. So a project far enough down the list was never reached — not
"eventually", never.
Measured on prod while catching up the five-day outage: three consecutive
ticks each reported `posted: 30, capped: true`, and across all three Heidi's
wall went 0 → 0 → 0 correct links while the head of the list was re-sent its
same thirty moments. The janitor looked busy and was starving its own tail,
and the counters could not tell the difference: thirty posts is thirty posts
whether they are thirty projects moving forward or one project repeating.
Round-robin makes the budget a SHARE rather than a race — every project's
queue is built first, then one moment is taken from each in turn. Every wall
moves every tick, a project with a large backlog cannot hold the others
hostage, and an empty queue simply stops being asked, so unused turns are
reclaimed rather than reserved.
verify: tsc, lint (0 errors), test:unit 252/252.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
OrangeCat allows 30 writes per minute per user (rateLimitWriteAsync, sliding
60s window). This janitor fired its whole tick as fast as the event loop
allowed, so the first tick after the five-day publishing outage reported
exactly what the arithmetic predicts:
{"projects":9,"attempted":50,"posted":30,"skipped":0,"failed":20}
The first thirty landed, the bucket emptied, and the remaining twenty came
back 429 and were counted as failures. Not a flake to retry past — ANY backlog
over thirty burned the rest of its budget on refusals, every tick, and the
deterministic external ids meant the next day re-sent the same doomed twenty.
Paced at the neighbour's published limit with headroom (60000/30 = 2000ms →
2100ms), nothing is refused and nothing is wasted. The number comes from their
limiter, not from tuning until the errors stopped.
With a pace comes a clock, so the tick now also stops at 90s — under the
systemd timer's `curl -m 120`. A tick killed mid-flight reports nothing at
all: no counts, no debug_logs row, just a dead curl. Ending early and saying
`capped` keeps its account of itself intact, and the rest is picked up next
tick.
verify: tsc, lint (0 errors), test:unit 252/252 — the new test derives its
floor from the neighbour's documented limit rather than restating a constant.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>