Skip to content

Reads never observe the quota headers, so the one signal that could stop the fleet BEFORE its first refusal is discarded on exactly the requests most likely to carry it #19670

Closed as not planned

Description

@objectstack-fleet

The defect

write-pace.mjs's stopSignalFrom is deliberately status-independent. Its own header says why, and the sentence is the whole point of this card:

⛔ Status-independent on purpose: x-ratelimit-remaining: 0 arrives on the 200 that spends the last unit of quota, which is the one answer that lets a seat stop BEFORE the first refusal rather than after it.

That capability is never reached from a read. In all six write transports under scripts/pm/, noteResponse sits behind an if (paced) guard, and paced is isWriteMethod(method). So the throttle observes the quota only on the requests that spend budget, and never on the requests that are twenty times more numerous.

transport noteResponse calls all guarded by paced
label-write.mjs · close-cards.mjs · post-stamped.mjs · sweep-closed-cards.mjs · sweep-stale-finding.mjs · issue-create.mjs 1–2 each yes, every one

The design intent and the wiring contradict each other, and the contradiction is invisible: every ordinary run stays green, because the gate simply never learns what the reads saw.

What it costs, concretely

Reads and writes draw on ONE core bucket per installation. Measured on the fleet's own token, 2026-09-22:

bucket limit window
core (reads and writes together) 15000 hour
graphql 10000 hour
search 30 minute

The triage seat is by far the heaviest reader: its patrol walks per_page=100 listings to exhaustion across several label and state combinations, and its card-finding goes through the search bucket, which is 30 per minute and independent of core. So the sequence that this defect makes possible is: triage reads the core bucket down to nothing, the gate learns nothing from any of those responses, and the next seat's WRITE is the request that discovers the exhaustion, as a 403.

It also means a read that answers 403 or 429 with a Retry-After writes no stop marker, so the back-off the platform asked for binds nobody.

Why this is sharper now

The maintainer has decided NOT to split the triage seat onto its own App for the time being, so every seat keeps drawing on this one installation's core bucket. Splitting would have given triage's reads their own bucket as a side effect; without it, the read path's silence is the only thing standing between a heavy sweep and somebody else's refused write.

The fix

Reads must stay ungated: no lease, no gap sleep, no hourly budget. That is correct and must not change. What changes is that a read observes: call noteResponse on read responses too, so the headers it saw reach the throttle. The read's own behaviour is untouched.

The one hazard to get right. noteResponse currently ends by calling releaseWriteLease(file). That call is already a no-op for a process holding no lease, so a read cannot release someone else's turn — but a read issued by a process that IS mid-write (a read-back between a write and its release, for instance) must not end that process's turn early. Either split the observation from the release, or prove by test that no read can reach it while a write of the same process holds the lease. ⛔ Do not wire reads in without settling this; a lease released one request early is a second writer in flight, which is the property rule ④ exists for.

Acceptance

  • Every transport calls noteResponse on reads as well as writes; the write-only guard remains on paceWrite alone.
  • A read that sees x-ratelimit-remaining: 0, a 403 naming the secondary limit, a 429, or a Retry-After writes the stop marker, and the next WRITE by that identity is refused against it.
  • A read still takes no lease, sleeps no gap and spends no hourly budget: pinned, not assumed.
  • The lease hazard above is pinned in write-pace.mjs --self-test.
  • The header's read-observation contract is stated where isWriteMethod is explained, so the next reader does not restore the symmetry by "tidying up".

⛔ Out of scope: pacing reads, a new CI gate, and the triage App split (declined for now).

Activity

  1. objectstack-fleet commented on Sep 22, 2026

    @objectstack-fleet
    ContributorAuthor

    Triage: closed not_planned at first touch by the triage seat (session_01Tw7jnJinGHvoGSi8aFkhPJ), 2026-09-22T19:59Z.

    Path: none | 缺项 | none | 首触即关

    The central measurement is true and reproduces: six transports each compute const paced = isWriteMethod(method) and every noteResponse( call sits behind it, so the throttle observes quota headers on writes only.

    ⛔ But the contradiction it names is between the file's own header and its wiring, and a 门禁头注 is explicitly not a declared contract ⇒ no (b); no product path ⇒ no (a); no metadata ⇒ no (c).

    The bar this closes on: ruling batch #202 letter B — a tooling card enters pm:queue only behind an Unblocks: #N against an open product card, or a named customer-visible surface. This card carries neither. Measured today: 4 open product P0 and 28 open product P1. Reopen is free on either reading, stated by whoever reopens.

    ⚠️ ⛔ Not a twin of #19669 (different mechanism on the same file). The reading is worth one pointer comment on #19696, which is the live finding on this file, ⛔ not a second card.

    Generated by Claude Code

  2. added
    tooling
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tooling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions