Skip to content

Commit 034c09a

Browse files
committed
pm(half-states): name the POPULATION each H22 docblock number was measured on
H22 pages the closed-card window through `closedWindowPagePath`. The scheduled patrol runner's stream comes back card-only; the byte-identical request from a proxied agent container comes back 49.6% pull requests. Four prose sites in `scripts/pm/check-half-states.mjs` quoted container-stream numbers while describing the patrol's stream, so the measurement recipe they carry, followed correctly, yields the wrong number. Rewrites, prose only — ⛔ no constant moves (139.4 and 40 stay): - the ⚠️ Cost note under `CLOSED_ISSUE_WINDOW_DAYS`: the 46% PR share is named as a container reading, the patrol's own 5-page / 428-closure run is quoted as the runner-side measurement, and the note now carries the re-measure RECIPE (filter pull requests out BEFORE counting; rate the card-only slice); - the same docblock's present-tense "the divisor below now reads 415.1", restated as history against the 139.4 the file now carries; - `CLOSED_ISSUE_WINDOW_PAGE_CEILING`'s derivation: the 4,000-row / 12.8-day read is named as container-taken, with the runner-side headroom (about twice the ~4.3x derived) added as a note, not a change; - `listRecentlyClosedIssues`'s `rateRows` comment: the pin's population stated as it now stands, and why READ rows are comparable to it on the runner and not from a container. The population difference is MEASURED through the sweep's own numbers; the runner's permission block as its mechanism is ⛔ not claimed — the runner's raw response was never read. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MCLBsUgfykL74aU716rzVK
1 parent 8fa3fe6 commit 034c09a

1 file changed

Lines changed: 70 additions & 21 deletions

File tree

scripts/pm/check-half-states.mjs

Lines changed: 70 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16635,18 +16635,44 @@ async function listRecentlyMergedPullRequests(stats = {}, nowMs = Date.now()) {
1663516635
* needs a different shape (a residue census like H39's, which counts rather than
1663616636
* lists) and is not this window's job.
1663716637
*
16638-
* ⚠️ Cost note: 46% of the rows this stream returns are PULL REQUESTS, filtered
16639-
* out after paging. The horizon is therefore reached in roughly twice the pages
16640-
* a card-only stream would need. ⚖️ The `~6 pages for 3 days` this note used to
16641-
* quote was the pinned divisor's arithmetic and it never described this board:
16642-
* measured 2026-09-06 the horizon sits at ~13 pages, because the LEADING rows
16643-
* run at ~414 updates/day against the 188.3 pinned at the time (the derivation
16644-
* is in `CLOSED_ISSUE_WINDOW_PAGE_CEILING`, and it is why the old 12 bound).
16645-
* Constants here are deliberately NOT self-updating (H8's rule): they are
16646-
* CHECKED against what a sweep observes, never overwritten by it — so that
16647-
* disagreement was closed the one way it can be, by a HAND re-measure and
16648-
* re-pin (#16419: the divisor below now reads 415.1), never by a sweep quietly
16649-
* editing it.
16638+
* ⚠️ Cost note — and the POPULATION every number in it is counted on, which
16639+
* is the half this note had wrong (#17626). The `46% of the rows are PULL
16640+
* REQUESTS` it opened with is a CONTAINER reading: the byte-identical
16641+
* `GET /repos/{repo}/issues?state=closed&sort=updated` page comes back 49.6%
16642+
* pull requests to a proxied agent container (read 2026-09-11T04:22:36Z, 12
16643+
* pages / 1,200 rows) and CARD-ONLY to the scheduled patrol runner, so the
16644+
* "roughly twice the pages" it derived is a container's bill and never this
16645+
* sweep's. The runner side is measured through the sweep's OWN numbers rather
16646+
* than from its response, which no seat can read: the 2026-09-11T01:55:32Z run
16647+
* (34552285557, `2f8ad091`) reports 5 pages, 428 in-window closures and reach
16648+
* 2026-09-07, and 428 in-window closures cannot come out of 5 PR-inclusive
16649+
* pages at all — only ~250 of those 500 rows would be cards. The 2026-09-09
16650+
* run is the same shape at 6 pages. ⛔ WHY the two streams differ is NOT
16651+
* claimed here: the runner's raw response was never read. The population
16652+
* difference itself is measured.
16653+
*
16654+
* ⭐ RE-MEASURE RECIPE, and it is the operative half of this note: a container
16655+
* read is NOT the patrol's stream. Filter pull requests OUT of every page
16656+
* BEFORE counting pages or rating rows, and quote the card-only slice. On the
16657+
* 2026-09-11T04:22:36Z read that slice gives 5 pages / 426 rows / ~139.4 per
16658+
* day against 9 pages / 426 / ~256.2 per day on the whole stream — the slice
16659+
* reproduces the runner's own 5 pages, the raw stream does not. ⛔ Never pin,
16660+
* and never cost a horizon, from the raw stream.
16661+
*
16662+
* ⚖️ The `~6 pages for 3 days` this note quoted before that was the pinned
16663+
* divisor's arithmetic and it never described this board: measured 2026-09-06
16664+
* FROM A CONTAINER the horizon sat at ~13 pages, because the leading rows of
16665+
* that PR-inclusive read ran at ~414 updates/day against the 188.3 pinned at
16666+
* the time (the derivation is in `CLOSED_ISSUE_WINDOW_PAGE_CEILING`, and it is
16667+
* why the old 12 bound). ⛔ That ~13 and today's 5 are not a population
16668+
* comparison: the two readings are five days AND one population apart, and the
16669+
* decomposition is in `MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY`. Constants here
16670+
* are deliberately NOT self-updating (H8's rule): they are CHECKED against what
16671+
* a sweep observes, never overwritten by it — so that disagreement was closed
16672+
* the one way it can be, by a HAND re-measure and re-pin, never by a sweep
16673+
* quietly editing it. #16419 re-pinned 415.1 on 2026-09-06 from the container
16674+
* stream; #17254 re-pinned on 2026-09-11 from the card-only slice, and the
16675+
* divisor below now reads 139.4.
1665016676
*/
1665116677
export const CLOSED_ISSUE_WINDOW_DAYS = 3;
1665216678

@@ -16682,7 +16708,20 @@ export const CLOSED_ISSUE_WINDOW_DAYS = 3;
1668216708
* 4,000 rows reached 12.8 days on the read above (~312/day averaged over that
1668316709
* depth), against a 3-day horizon: ~4.3x headroom, and headroom measured on
1668416710
* the whole depth the cap can actually be spent on rather than on a pinned
16685-
* rate. 40 REST calls is also the budget this sweep gets for the pass, which
16711+
* rate.
16712+
*
16713+
* ⚠️ POPULATION, and it is why ~4.3x is a floor rather than the reading: the
16714+
* read above was taken from a proxied agent container, whose pages carry 49.6%
16715+
* pull requests, while the patrol runner pages the same URL CARD-ONLY (the
16716+
* measurement, the recipe and the boundary are in the ⚠️ Cost note under
16717+
* `CLOSED_ISSUE_WINDOW_DAYS`). 40 pages return 4,000 rows either way, but only
16718+
* ~2,000 of the rows above were cards, so on the runner the same ceiling
16719+
* reaches ABOUT TWICE as far back — ~25 days rather than 12.8, ~8x headroom
16720+
* against the 3-day horizon rather than ~4.3x. ⛔ A note, not a change: the
16721+
* direction is more headroom and not less, 40 is unchanged, and re-deriving it
16722+
* would need a card-only read at depth that nobody has taken.
16723+
*
16724+
* 40 REST calls is also the budget this sweep gets for the pass, which
1668616725
* is the OTHER thing a quota backstop is: ⛔ not a number to raise again the
1668716726
* next time it binds. A pass that binds it is reporting that the board's
1668816727
* closed-issue activity has grown past what one sweep can page — the remedy
@@ -16922,14 +16961,24 @@ async function listRecentlyClosedIssues(
1692216961
let reachedMs = null;
1692316962
// Every row this pass READ, projected to the one stamp the observed update
1692416963
// rate is counted over (#16393). ⛔ Deliberately the rows READ and not the
16925-
// rows ADMITTED: the pin this rate is checked against was measured over the
16926-
// RAW stream (400 rows / 0.964 days), while `out` holds only the in-window
16927-
// closures — a strictly smaller population over a strictly shorter span. Rate
16928-
// them against each other and the difference between two quantities reads as
16929-
// drift in one of them, which is the #4690 inversion with the numbers the
16930-
// right way up. Projected rather than retained whole because one field is all
16931-
// the instrument reads, and these pages are the largest thing this sweep
16932-
// holds.
16964+
// rows ADMITTED: the pin this rate is checked against is measured over the
16965+
// whole stream this pager consumes (500 rows / 3.586 days, read 2026-09-11),
16966+
// while `out` holds only the in-window closures — a strictly smaller
16967+
// population over a strictly shorter span. Rate them against each other and
16968+
// the difference between two quantities reads as drift in one of them, which
16969+
// is the #4690 inversion with the numbers the right way up.
16970+
// ⚠️ POPULATION, and it is why this says READ rather than "every row the
16971+
// endpoint returns": on the patrol runner that stream is CARD-ONLY, so these
16972+
// rows are cards and the rate is counted on the same population the pin was.
16973+
// The byte-identical request from a proxied agent container comes back 49.6%
16974+
// pull requests and `rateRows` would count those too — a rate on one
16975+
// population checked against a pin on another, which is #17626. ⛔ So a hand
16976+
// re-measure filters pull requests out BEFORE counting; the recipe is in the
16977+
// ⚠️ Cost note under `CLOSED_ISSUE_WINDOW_DAYS`. The earlier reading here,
16978+
// `RAW stream (400 rows / 0.964 days)`, described the 188.3 pin and not the
16979+
// 139.4 `MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY` now carries.
16980+
// Projected rather than retained whole because one field is all the
16981+
// instrument reads, and these pages are the largest thing this sweep holds.
1693316982
const rateRows = [];
1693416983
let page = 1;
1693516984
for (; page <= CLOSED_ISSUE_WINDOW_PAGE_CEILING; page++) {

0 commit comments

Comments
 (0)