Skip to content

Commit 5d60e2a

Browse files
committed
tooling(pm): re-pin the measured closed-issue update rate at 415.1/day
`MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY` was measured 2026-08-31 at 188.3/day and the divisor staleness alarm now reads a factor of ~2.1 against it on this board. Re-measured by hand over the endpoint the constant's own docblock prescribes (`GET /repos/{repo}/issues?state=closed&sort=updated`, read 2026-09-06T21:59Z): 400 rows / 0.964d = 415.1/day, re-read at depth 800 rows / 2.051d = 390.1/day and 1200 rows / 3.092d = 388.0/day. The pin takes the 400-row window, the docblock's own convention. Self-test cases that pinned 188.3 — the window arithmetic, the synthetic stream fixtures and the clause wording — move with it; three prose sites that quoted the old divisor in the present tense are corrected in place. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox
1 parent 0ea5f9d commit 5d60e2a

1 file changed

Lines changed: 53 additions & 46 deletions

File tree

scripts/pm/check-half-states.mjs

Lines changed: 53 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12592,12 +12592,13 @@ async function listRecentlyMergedPullRequests(stats = {}, nowMs = Date.now()) {
1259212592
* a card-only stream would need. ⚖️ The `~6 pages for 3 days` this note used to
1259312593
* quote was the pinned divisor's arithmetic and it never described this board:
1259412594
* measured 2026-09-06 the horizon sits at ~13 pages, because the LEADING rows
12595-
* run at ~414 updates/day against the pinned 188.3 (the derivation is in
12596-
* `CLOSED_ISSUE_WINDOW_PAGE_CEILING`, and it is why the old 12 bound).
12595+
* run at ~414 updates/day against the 188.3 pinned at the time (the derivation
12596+
* is in `CLOSED_ISSUE_WINDOW_PAGE_CEILING`, and it is why the old 12 bound).
1259712597
* Constants here are deliberately NOT self-updating (H8's rule): they are
12598-
* CHECKED against what a sweep observes, never overwritten by it — which is
12599-
* why the divisor below still reads 188.3 and this note states the disagreement
12600-
* instead of quietly editing it.
12598+
* CHECKED against what a sweep observes, never overwritten by it — so that
12599+
* disagreement was closed the one way it can be, by a HAND re-measure and
12600+
* re-pin (#16419: the divisor below now reads 415.1), never by a sweep quietly
12601+
* editing it.
1260112602
*/
1260212603
export const CLOSED_ISSUE_WINDOW_DAYS = 3;
1260312604

@@ -12624,8 +12625,9 @@ export const CLOSED_ISSUE_WINDOW_DAYS = 3;
1262412625
*
1262512626
* The 3-day horizon that day sat at ~2026-09-03T16:5xZ — PAST page 12's oldest
1262612627
* row by about an hour. So the old ceiling missed the horizon by roughly one
12627-
* page, and the leading 1,200 rows ran at ~414 updates/day against the pinned
12628-
* 188.3: the divisor is a factor of ~2.2 light exactly where it is spent.
12628+
* page, and the leading 1,200 rows ran at ~414 updates/day against the 188.3
12629+
* pinned that day: the divisor WAS a factor of ~2.2 light exactly where it is
12630+
* spent, and #16419 re-pinned it by hand at 415.1 for that reason.
1262912631
*
1263012632
* ## 40, and the unit it is chosen in
1263112633
*
@@ -12658,15 +12660,15 @@ export const CLOSED_ISSUE_WINDOW_PAGE_CEILING = 40;
1265812660
* differ by ~17x on this board and confusing them is precisely the defect this
1265912661
* window carried (see the docblock above).
1266012662
*
12661-
* read 2026-08-31T03:36Z, `GET /repos/{repo}/issues?state=closed&sort=updated`
12662-
* window 400 rows spanning 2.125 days
12663-
* rate 400 / 2.125 = ~188 closed-issue update events/day
12664-
* (re-read at depth: 800 rows / 4.209d = ~190/day, 1200 rows / 5.496d = ~218/day)
12663+
* read 2026-09-06T21:59Z, `GET /repos/{repo}/issues?state=closed&sort=updated`
12664+
* window 400 rows spanning 0.964 days
12665+
* rate 400 / 0.964 = ~415 closed-issue update events/day
12666+
* (re-read at depth: 800 rows / 2.051d = ~390/day, 1200 rows / 3.092d = ~388/day)
1266512667
*/
12666-
export const MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY = 188.3;
12668+
export const MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY = 415.1;
1266712669

1266812670
/** WHEN `MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY` was measured. */
12669-
export const MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY_AT = '2026-08-31';
12671+
export const MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY_AT = '2026-09-06';
1267012672

1267112673
/**
1267212674
* H22's premise, in the shape `classifyRatePremise` judges (#16393).
@@ -12851,7 +12853,7 @@ async function listRecentlyClosedIssues(
1285112853
// Every row this pass READ, projected to the one stamp the observed update
1285212854
// rate is counted over (#16393). ⛔ Deliberately the rows READ and not the
1285312855
// rows ADMITTED: the pin this rate is checked against was measured over the
12854-
// RAW stream (400 rows / 2.125 days), while `out` holds only the in-window
12856+
// RAW stream (400 rows / 0.964 days), while `out` holds only the in-window
1285512857
// closures — a strictly smaller population over a strictly shorter span. Rate
1285612858
// them against each other and the difference between two quantities reads as
1285712859
// drift in one of them, which is the #4690 inversion with the numbers the
@@ -18067,10 +18069,12 @@ async function selfTest() {
1806718069
t('windows: …and 2.73d at the rate measured 8 days later — same cap, 25% more window', Number(windowCoverageDays(300, MEASURED_COMMITS_PER_DAY).toFixed(2)), 2.73);
1806818070
t('windows: …which is why H23\'s cap became a TIME cap', COMMIT_WINDOW_DAYS, 3);
1806918071
// ⛔ H22's is the one whose DIVISOR was the surprise: its rows are consumed by
18070-
// closed-issue UPDATE activity, not by closures, and the two differ ~17x. The
18071-
// old 4-page cap read as a closure window and was nothing of the kind.
18072-
t('windows: H22\'s old 4-page cap bought only 2.12d of UPDATE recency', Number(windowCoverageDays(400, MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY).toFixed(2)), 2.12);
18073-
t('windows: …and the honest divisor is ~17x the closure rate it read as', Number((MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY / 10.7).toFixed(1)), 17.6);
18072+
// closed-issue UPDATE activity, not by closures, and the two differ ~39x at
18073+
// the divisor re-pinned 2026-09-06, against the ~10.7 closures/day measured
18074+
// when the defect was found. The old 4-page cap read as a closure window and
18075+
// was nothing of the kind.
18076+
t('windows: H22\'s old 4-page cap bought only 0.96d of UPDATE recency at the 2026-09-06 rate', Number(windowCoverageDays(400, MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY).toFixed(2)), 0.96);
18077+
t('windows: …and the honest divisor is ~39x the closure rate it read as', Number((MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY / 10.7).toFixed(1)), 38.8);
1807418078
t('windows: …which is why H22\'s cap became a CLOSURE-time cap', CLOSED_ISSUE_WINDOW_DAYS, 3);
1807518079
t('windows: …and its horizon is seen by 12 consecutive runs', sweepOverlap(CLOSED_ISSUE_WINDOW_DAYS), 12);
1807618080
// #13499 — H8's window is no longer a page cap at all, so the arithmetic that
@@ -18240,10 +18244,11 @@ async function selfTest() {
1824018244
// Direction 1 — the floor case: a recent closure is admitted.
1824118245
t('H22 window: a 1-day-old closure is inside', issueClosedWithinWindow(closed13606(1, 1), CH), true);
1824218246
// Direction 2 — the row the OLD 4-page cap structurally could not reach. The
18243-
// cap covered ~2.12d of UPDATE recency, so a card closed 2.5 days ago and
18244-
// untouched since fell out of it: not late, GONE. Measured cost at the time
18245-
// of the repair: 19 residue carriers closed within 3 days were missed.
18246-
t('H22 window: the old 4-page cap reached only ~2.1 days of update-recency', windowCoverageDays(400, MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY) < 2.5, true);
18247+
// cap covered ~0.96d of UPDATE recency at the divisor pinned 2026-09-06
18248+
// (~2.12d at the one pinned when the repair landed), so a card closed 2.5
18249+
// days ago and untouched since fell out of it: not late, GONE. Measured cost
18250+
// at the time of the repair: 19 residue carriers closed within 3 days missed.
18251+
t('H22 window: the old 4-page cap reached only ~1.0 days of update-recency', windowCoverageDays(400, MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY) < 2.5, true);
1824718252
t('H22 window: …but the 3-day closure horizon admits that card', issueClosedWithinWindow(closed13606(2, 2.5), CH), true);
1824818253
// …and the window still HAS an edge; a boundary that admits everything is none.
1824918254
t('H22 window: a 4-day-old closure is outside', issueClosedWithinWindow(closed13606(3, 4), CH), false);
@@ -18463,28 +18468,30 @@ async function selfTest() {
1846318468
// different quantities against each other and report the difference as drift.
1846418469
const ratePage16393 = (daysAgo) => Array.from({ length: 100 }, (_, i) => closed13606(i, daysAgo, daysAgo));
1846518470
const rateStream16393 = (step) =>
18466-
closedStream(Array.from({ length: 20 }, (_, i) => ratePage16393(step * (i + 1))));
18471+
closedStream(Array.from({ length: 30 }, (_, i) => ratePage16393(step * (i + 1))));
1846718472

18468-
// 2x the pin: 0.25-day steps, so the horizon falls on page 131300 rows
18469-
// read across a 3.0-day span is ~433.3/day against a pin of 188.3.
18473+
// 2x the pin: 0.11-day steps, so the horizon falls on page 282800 rows
18474+
// read across a 2.97-day span is ~942.8/day against a pin of 415.1.
1847018475
const driftedStats16393 = {};
18471-
const driftedRows16393 = await listRecentlyClosedIssues(driftedStats16393, NOW13606, rateStream16393(0.25));
18472-
t('#16393 stream: the pass stops on the first page past the horizon', driftedStats16393.closedPages, 13);
18473-
t('#16393 stream: …and the rate is over the rows READ', Math.round(driftedStats16393.closedRateObserved * 100) / 100, 433.33);
18476+
const driftedRows16393 = await listRecentlyClosedIssues(driftedStats16393, NOW13606, rateStream16393(0.11));
18477+
t('#16393 stream: the pass stops on the first page past the horizon', driftedStats16393.closedPages, 28);
18478+
t('#16393 stream: …and the rate is over the rows READ', Math.round(driftedStats16393.closedRateObserved * 100) / 100, 942.76);
1847418479
t('#16393 stream: ⛔ …not over the rows ADMITTED, which is a different number', Math.round(observedRatePerDay(driftedRows16393, 'updated_at') * 100) / 100 === Math.round(driftedStats16393.closedRateObserved * 100) / 100, false);
1847518480
t('#16393 stream: …a board running 2x the pin FIRES the alarm', h22Premise(driftedStats16393.closedRateObserved).state, 'drifted');
18476-
t('#16393 stream: …and the factor is stated so it can be acted on', h22Premise(driftedStats16393.closedRateObserved).message.includes('a factor of 2.30'), true);
18477-
t('#16393 stream: …with both rates beside it', h22Premise(driftedStats16393.closedRateObserved).message.includes('observed ~433.3 closed-issue updates/day') && h22Premise(driftedStats16393.closedRateObserved).message.includes('= 188.3/day'), true);
18481+
t('#16393 stream: …and the factor is stated so it can be acted on', h22Premise(driftedStats16393.closedRateObserved).message.includes('a factor of 2.27'), true);
18482+
t('#16393 stream: …with both rates beside it', h22Premise(driftedStats16393.closedRateObserved).message.includes('observed ~942.8 closed-issue updates/day') && h22Premise(driftedStats16393.closedRateObserved).message.includes('= 415.1/day'), true);
1847818483
// ⛔ The rule that makes this an alarm rather than a self-healing constant.
18479-
t('#16393 stream: ⛔ a drifted sweep does NOT rewrite the pin', MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY, 188.3);
18480-
t('#16393 stream: …nor its date', MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY_AT, '2026-08-31');
18484+
t('#16393 stream: ⛔ a drifted sweep does NOT rewrite the pin', MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY, 415.1);
18485+
t('#16393 stream: …nor its date', MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY_AT, '2026-09-06');
1848118486

18482-
// 1x the pin: 0.625-day steps, horizon on page 5 — 500 rows over 2.5 days is
18483-
// 200/day, a factor of 1.06, and the alarm stays silent.
18487+
// 1x the pin: 0.25-day steps, horizon on page 13 — 1300 rows over 3.0 days is
18488+
// ~433.3/day, a factor of 1.04, and the alarm stays silent. ⚖️ It is the very
18489+
// stream that ran 2x the pin until the 2026-09-06 re-measure: the board moved
18490+
// by that much in six days, and the fixture did not move at all.
1848418491
const okStats16393 = {};
18485-
await listRecentlyClosedIssues(okStats16393, NOW13606, rateStream16393(0.625));
18486-
t('#16393 stream: an in-band board reaches its horizon in five pages', okStats16393.closedPages, 5);
18487-
t('#16393 stream: …and observes a rate at the pin', Math.round(okStats16393.closedRateObserved * 100) / 100, 200);
18492+
await listRecentlyClosedIssues(okStats16393, NOW13606, rateStream16393(0.25));
18493+
t('#16393 stream: an in-band board reaches its horizon in thirteen pages', okStats16393.closedPages, 13);
18494+
t('#16393 stream: …and observes a rate at the pin', Math.round(okStats16393.closedRateObserved * 100) / 100, 433.33);
1848818495
t('#16393 stream: …which raises NO alarm', h22Premise(okStats16393.closedRateObserved).state, 'ok');
1848918496
t('#16393 stream: a board with nothing dateable observes no rate at all', (await (async () => { const s = {}; await listRecentlyClosedIssues(s, NOW13606, closedStream([[{ number: 1, updated_at: 'nope' }]])); return s.closedRateObserved; })()), null);
1849018497
t('#16393 stream: …and an empty board likewise', (await (async () => { const s = {}; await listRecentlyClosedIssues(s, NOW13606, closedStream([])); return s.closedRateObserved; })()), null);
@@ -18495,22 +18502,22 @@ async function selfTest() {
1849518502
// a verdict through it would go red on a calendar date rather than on a
1849618503
// defect — the permanently-red gate this repo retires.
1849718504
const clause16393 = (observed, extra = {}) => h22RatePremiseClause(observed, { nowMs: NOW13606, ...extra });
18498-
t('#16393 clause: a drifted divisor is marked loud', clause16393(433.33).startsWith('⚠️ RATE PREMISE DRIFTED'), true);
18499-
t('#16393 clause: …and names the re-measure act', clause16393(433.33).includes('re-pinned by hand, from a fresh measurement'), true);
18500-
t('#16393 clause: an expired pin is marked loud too', clause16393(188.3, { nowMs: Date.parse('2026-11-01T00:00:00Z') }).startsWith('⚠️ RATE PREMISE EXPIRED'), true);
18505+
t('#16393 clause: a drifted divisor is marked loud', clause16393(942.76).startsWith('⚠️ RATE PREMISE DRIFTED'), true);
18506+
t('#16393 clause: …and names the re-measure act', clause16393(942.76).includes('re-pinned by hand, from a fresh measurement'), true);
18507+
t('#16393 clause: an expired pin is marked loud too', clause16393(415.1, { nowMs: Date.parse('2026-11-01T00:00:00Z') }).startsWith('⚠️ RATE PREMISE EXPIRED'), true);
1850118508
t('#16393 clause: an unobserved rate is marked loud, never silent', clause16393(null).startsWith('⚠️ RATE PREMISE UNOBSERVED'), true);
18502-
t('#16393 clause: an in-band divisor is NOT marked loud', clause16393(200).includes('⚠️'), false);
18509+
t('#16393 clause: an in-band divisor is NOT marked loud', clause16393(433.33).includes('⚠️'), false);
1850318510
// ⛔ …but it still SPEAKS. A check that is only visible when it fires cannot
1850418511
// be told apart from a check somebody deleted — `renderRatePremise`'s rule.
18505-
t('#16393 clause: …and still speaks, so a deleted check cannot pass for a healthy board', clause16393(200).startsWith('rate premise OK'), true);
18506-
t('#16393 clause: …naming both rates even when it agrees', clause16393(200).includes('observed ~200.0/day') && clause16393(200).includes('= 188.3/day'), true);
18512+
t('#16393 clause: …and still speaks, so a deleted check cannot pass for a healthy board', clause16393(433.33).startsWith('rate premise OK'), true);
18513+
t('#16393 clause: …naming both rates even when it agrees', clause16393(433.33).includes('observed ~433.3/day') && clause16393(433.33).includes('= 415.1/day'), true);
1850718514

1850818515
// ---- The clause on the summary line. Only time-INDEPENDENT properties are
1850918516
// asserted here, for the reason above; the verdict wording is pinned by the
1851018517
// builder cases.
18511-
t('#16393 summary: the clause rides inside H22\'s own window clause', saidBy('h22Window', win13606({ closedPages: 6, closedRateObserved: 433.33 })).includes('RATE PREMISE'), true);
18512-
t('#16393 summary: ⛔ …and not in a neighbour\'s', saidBy('h23Window', win13606({ closedPages: 6, closedRateObserved: 433.33 })).includes('RATE PREMISE'), false);
18513-
t('#16393 summary: it names the pinned constant beside the number already quoted', saidBy('h22Window', win13606({ closedPages: 6, closedRateObserved: 433.33 })).includes('`MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY`'), true);
18518+
t('#16393 summary: the clause rides inside H22\'s own window clause', saidBy('h22Window', win13606({ closedPages: 6, closedRateObserved: 942.76 })).includes('RATE PREMISE'), true);
18519+
t('#16393 summary: ⛔ …and not in a neighbour\'s', saidBy('h23Window', win13606({ closedPages: 6, closedRateObserved: 942.76 })).includes('RATE PREMISE'), false);
18520+
t('#16393 summary: it names the pinned constant beside the number already quoted', saidBy('h22Window', win13606({ closedPages: 6, closedRateObserved: 942.76 })).includes('`MEASURED_CLOSED_ISSUE_UPDATES_PER_DAY`'), true);
1851418521
// A sweep that never ran the pass says UNOBSERVED — which outranks every
1851518522
// other verdict, so this case does not move with the calendar.
1851618523
t('#16393 summary: a bare line reports the divisor UNCHECKED, not agreed with', saidBy('h22Window', summaryLine({}, 0)).includes('RATE PREMISE UNOBSERVED'), true);

0 commit comments

Comments
 (0)