Repository navigation
Commit e92487f
fix(release): resolve a run-list count above a short page by walking the unfiltered runs (#33298)
Fixes #33195
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:稳定发布「在途」读取器(快照通道 stable-lane 与发布在途回填守卫共用)遇到 GitHub
状态过滤「总数比这一页列出的多、页又没满」并且重读三次仍不一致时,不再直接判 NOT MEASURED,而是往回翻 31
天内的不过滤运行列表、逐个按 id
读状态:找到被过滤漏掉的真实在途运行就照常判在途并拒绝;找不到就把「计数指向的运行不存在」连同翻过的范围写进读数行后放行。
- 为什么改:11-11 与 11-14 两次每日快照都因「计数 2、只列出本运行」被拒并报假卡;实测两次 release.yml
都只有本运行活着,而上一次加的重读修复(#32467)在 11-14 三次重读都没消掉这个多出来的 1。
- 风险与回滚:仍是 fail-closed:翻页任一页读不到、行没有创建时间、60 页内既没到 31
天边界也没到历史起点、或本运行重试预算已用尽,都照旧拒绝;只动两个脚本,不动 workflow 与 `version` 脚本链;回滚即还原本
PR。
- 先看:`scripts/release-pending-publish.mjs` 的 `readWholeRunList` /
`resolveShortPage` / `walkRunList`(放行条件就在 `resolveShortPage` 的 proof
分支);`scripts/ci/snapshot-next.mjs` 的 `readStableLane`
合并段;`collectWaitingRuns` 的 `jobs: null`。
- 两分钟验证:`node scripts/release-pending-publish.mjs --self-test && node
scripts/ci/snapshot-next.mjs --self-test`,预期 161 例 / 36 组、197 例 / 23
组全过。
- 需要你做的:无,席位落地。
## What changes
The ruling is A on #33195 (Ruling-ref 6879496577, recorded in
6879884762).
- `scripts/release-pending-publish.mjs`, `readWholeRunList`: the re-read
ladder is unchanged. When it ends with a status filter's `total_count`
still above a page that is NOT full, the new `resolveShortPage` takes
over. It walks the workflow's unfiltered run list newest first
(`page=N`, 100 each) with `walkRunList`, back at most `RUN_WALK_DAYS`
(31) or to the start of history. Every walked run whose row carries the
filtered status and is not on the page is read by id. A direct read in
that status is a row that lagged the filter, and it is added to the runs
judged. The readings line then records one of three proofs:
- `count N over page M names no run: the walk of K runs back to DATE
(BOUND, P pages) found none other`
- `... found L more in STATUS [ids], whose row(s) lagged the filter`
- the same, plus `the other X name(s) no run`
- Still throws, as before: a count above a FULL page; a count that is no
number; a spent retry budget before the ladder ends. Newly throws: an
unread walk page (5xx after the retries, or any non-200); a walk row
with no `created_at`; a walk that reaches neither bound within
`RUN_WALK_MAX_PAGES` (60); a candidate the direct read cannot answer.
Each is the reader's own NOT MEASURED, which `publishInFlight` maps to
`unreadable` and `stable-lane` to NOT MEASURED.
- `collectPublishRuns` / `publishInFlight` take an optional `now`
(default `Date.now()`) that dates the walk's bound.
- `collectWaitingRuns`: a run it does not read past its status now
carries `jobs: null` (NOT READ), never `[]`. `judgeWaitingRuns` reads
`jobs` only for `waiting` runs, which are always read, so the sweep is
unchanged; the new pin covers it.
- `scripts/ci/snapshot-next.mjs`, `readStableLane`: it passes `now` to
both readers. The merge reads `null` as NOT READ: the first reading that
read the jobs speaks for the run, empty list included. A run still in
flight whose jobs neither reader read has them read here. That is an
older version commit's push run, which only the waiting reader probes. A
publish running in such a run now refuses instead of merging as a run
holding no job; the readings line names the runs read this way.
`stableLane` takes an optional `now` for the self-test.
## Tests
Both self-tests drive the real readers over stubbed Actions APIs.
- `release-pending-publish --self-test`: 153 → 161 cases, 36 batteries.
The in-flight listing battery is renamed to what it now pins, and its
floor goes 7 → 14. Its case "a count still above the page on every read
the ladder allows -> unreadable" becomes:
- the 11-14 reading: count 2 over the calling run alone, a walk listing
no other run in progress → clear, with the proof line; no completed row
read; the queued filter read after it;
- a dispatch run the rows left out but the walk lists → read by id, jobs
read, publish in flight;
- a walk row in progress whose direct read says completed → not added;
- a walk explaining part of the excess → that run judged, the rest
recorded as naming no run;
- an unread walk page → unreadable, for the publish and the image alike;
- a walk reaching neither bound in 60 pages → unreadable;
- a walk stopping at the 31-day bound → the proof names the bound;
- a walk row with no `created_at` → unreadable.
The earlier "count over an empty page → unreadable" case now pins the
unread-walk branch. The waiting-runs battery gains: "a version-commit
push run in flight → jobs null, not read; the sweep leaves it
untouched".
- `snapshot-next --self-test`: 194 → 197 cases, 23 batteries. The
stable-lane battery floor goes 13 → 16. The pinned "a count still above
the page after every re-read the run allows THROWS" becomes three cases:
- ⭐ the 11-14 reading passes, with the proof on the readings line;
- ⛔ a walk finding a run in progress the rows left out → its jobs are
read, and its stable publish refuses;
- ⛔ an unread walk page still THROWS (NOT MEASURED).
Plus ⛔ an older version commit's push run in flight, found by the
waiting reader alone → its jobs are read in `readStableLane`, and its
publish refuses.
No ablation: `.claude/agents/os-dev.md` (标准条款) exempts scripts from
ablation.
## Acceptance notes
**Measured vs documented-only (the 31-day bound and the walk):**
- Documented by GitHub, NOT measured here: a job held at an environment
fails after 30 days, and a run can be re-run only within 30 days of its
first attempt. Those two windows are the only ways a run created earlier
than the bound can newly ENTER `in_progress` or `queued`. `RUN_WALK_DAYS
= 31` is that plus one day of margin.
- Measured, 2026-11-14:
- A run stuck in a status since before the bound is already a row on the
filter's page: ci.yml's `in_progress` filter lists run 31118082788,
created 2026-08-06 (attempt 2), still `in_progress`.
- At both refusals (runs 42938356503 on 11-11 and 43540146973 on 11-14),
no release.yml run other than the lane's own was alive. That comes from
a sweep of all 3,564 release.yml runs created 10-12..11-14 (paged by
`page=N`; no other run's last update falls after the lane run started).
So the walk would have explained both as phantom counts.
- 135 samples of the `in_progress` filter on ci.yml, lint.yml and
fleet-write.yml: 18 counts one above the page. In 4 the filter's rows
lagged (the unfiltered list showed the run), so the count was the true
witness. In 14 the count named no run either list showed.
- In 75 id-level samples, the unfiltered newest page never omitted a
live run the filter listed. The one difference was a run the filter
still listed 2 s after it completed.
- The unfiltered listing pages without the 1,000-result cap: page 36
answers rows from 2026-10-11, `total_count` 15062.
- release.yml created about 108 runs a day over those 33 days, so a
31-day walk is about 34 pages. It is read only on a day the ladder ends
short (2 of 8 lane days so far). The 60-page cap leaves the rate room to
nearly double.
- Not measured: whether GitHub ever deletes a run mid-walk (offset
paging would skip one row), and whether the unfiltered rows can lag a
run newly entering `in_progress` (no sample showed it).
**Fence:** the `annotate-shipped` path, `.github/workflows/**` and the
root `package.json` `version` script are untouched. `git diff --stat`
covers the two files only.
**No changeset:** the root package is private, and `scripts/` ships in
no package's `files[]` (precedent #32467, same two files,
`skip-changeset`).
## Verification
Head `463bb2f1`.
<details><summary>Both self-tests</summary>
```text
node scripts/release-pending-publish.mjs --self-test exit 0
✓ release-pending-publish self-test: 161 cases across 36 batteries pass.
node scripts/ci/snapshot-next.mjs --self-test exit 0
snapshot-next: self-test OK -- 197 case(s) across 23 batteries
```
</details>
<details><summary>Derived gates: 32 derived, 32 run, 0 unrun, every exit
0</summary>
`node scripts/pm/dispatch-gates.mjs --commands` at `463bb2f1` (merge
base `199e36244`, 2 paths, +300 / -66) named 32 commands. Each was run
and its exit captured before any pipe, all 0:
- check-closing-keyword-parity (+self-test), check-comment-mask-corpus,
check-declaration-mirrors (+self-test)
- check-self-test-wired (+self-test), check-self-test-workflow-commands
(+self-test), check-whole-set-label-write (+self-test)
- ci/plan-test-core-shards --self-test, ci/snapshot-next --self-test,
pm/bare-root-worklist --self-test, release-pending-publish --self-test
- `pnpm check:` agent-test-spelling, bash32-floor, ci-filter-parity,
cli-command-ids, cross-package-test-inputs, driver-memory-census,
entry-guard, gitlink-declared, nul-bytes, parse-guard, pm-dispatch-gates
(fast tier, 2205 cases, 404 s), pnpm-filter-targets,
pnpm-flag-spellings, ratchet-remedy-authority, refd-timer-probe,
scripts-symbol-anchors, watch-hint-literal
`--ran`: "32 derived famil(ies) accounted for — 32 run, 0 NOT-MEASURED".
NOT MEASURED locally, left to CI: the type-check steps and `Plan Test
Core shards` that the derivation names as CI-only shell.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_017xRBcRZn9wGkMSrznVX4JS)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent b96dd30 commit e92487f
2 files changed
Lines changed: 300 additions & 66 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1522 | 1522 | | |
1523 | 1523 | | |
1524 | 1524 | | |
1525 | | - | |
1526 | | - | |
| 1525 | + | |
| 1526 | + | |
1527 | 1527 | | |
1528 | | - | |
1529 | | - | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
1530 | 1535 | | |
1531 | | - | |
| 1536 | + | |
1532 | 1537 | | |
1533 | 1538 | | |
1534 | 1539 | | |
| |||
1538 | 1543 | | |
1539 | 1544 | | |
1540 | 1545 | | |
1541 | | - | |
1542 | | - | |
| 1546 | + | |
| 1547 | + | |
1543 | 1548 | | |
1544 | 1549 | | |
1545 | 1550 | | |
1546 | 1551 | | |
1547 | | - | |
1548 | | - | |
1549 | | - | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
1550 | 1555 | | |
1551 | 1556 | | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
1552 | 1571 | | |
1553 | 1572 | | |
1554 | | - | |
| 1573 | + | |
1555 | 1574 | | |
1556 | 1575 | | |
1557 | 1576 | | |
1558 | 1577 | | |
1559 | 1578 | | |
1560 | 1579 | | |
1561 | 1580 | | |
1562 | | - | |
1563 | | - | |
1564 | | - | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
1565 | 1584 | | |
1566 | | - | |
| 1585 | + | |
1567 | 1586 | | |
1568 | 1587 | | |
1569 | 1588 | | |
| |||
1573 | 1592 | | |
1574 | 1593 | | |
1575 | 1594 | | |
1576 | | - | |
| 1595 | + | |
1577 | 1596 | | |
1578 | 1597 | | |
1579 | 1598 | | |
| |||
1593 | 1612 | | |
1594 | 1613 | | |
1595 | 1614 | | |
1596 | | - | |
| 1615 | + | |
1597 | 1616 | | |
1598 | 1617 | | |
1599 | 1618 | | |
| |||
1876 | 1895 | | |
1877 | 1896 | | |
1878 | 1897 | | |
1879 | | - | |
1880 | | - | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
1881 | 1902 | | |
1882 | 1903 | | |
1883 | 1904 | | |
| |||
1892 | 1913 | | |
1893 | 1914 | | |
1894 | 1915 | | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
1895 | 1921 | | |
1896 | 1922 | | |
1897 | 1923 | | |
| |||
1938 | 1964 | | |
1939 | 1965 | | |
1940 | 1966 | | |
1941 | | - | |
1942 | | - | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
1943 | 1985 | | |
1944 | 1986 | | |
1945 | 1987 | | |
1946 | 1988 | | |
1947 | | - | |
| 1989 | + | |
1948 | 1990 | | |
1949 | 1991 | | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
1950 | 2000 | | |
1951 | 2001 | | |
1952 | 2002 | | |
| |||
0 commit comments