Repository navigation
Commit 8784ccb
fix(fleet-write): re-run once the failed jobs of a read-only check workflow, check-links.yml first (#31620)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb1TRaih3bEfi4rktaCKDryh)_
Fixes #31582
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:席位经中继重跑失败 job 的名单,从只有 `ci.yml` 改为审过的只读检查白名单,首个新成员是
`check-links.yml`(Check Documentation Links);pm-dispatch
读数表写明先读日志、按三步清基础设施红。
- 为什么改:日志自称"一个链接都没查"的基础设施红,过去只能等人手点重跑,挡住入队;维护者要求这类问题席位自己处理。
- 风险与回滚:只读检查重跑一次只多花 runner 时间,五道围栏(只一次、head 等于 PR 当前 head、pull_request
事件、attempt 1、已完成且失败)一道未动;回滚即 revert 本 PR。
-
先看:`scripts/pm/fleet-write/ops.mjs`(名单与只读定义)、`scripts/pm/fleet-write/validate.mjs`(名单与只读自测)、`platform-readings.md`
第 285–291 行。
- 两分钟验证:`node scripts/pm/fleet-write/validate.mjs --self-test`,应见 364
cases pass;`node scripts/pm/rerun-failed.mjs --self-test`,应见 32 cases
pass。
- 需要你做的:无,席位落地。
## What changes
- `scripts/pm/fleet-write/ops.mjs`: `RERUN_FAILED_WORKFLOWS` is a
reviewed allowlist, `['.github/workflows/ci.yml',
'.github/workflows/check-links.yml']`. The docblock states the read-only
definition every entry after `ci.yml` meets (no `secrets.*` but
`GITHUB_TOKEN`, no `environment:`, a `permissions:` block covering every
job, no write scope) and the reading that admitted each entry. The
header's workflow and head fence text no longer says the list is
`ci.yml` alone. Every fence (workflow, event, once, failed, head, alone,
grant) is unchanged.
- `scripts/pm/fleet-write/validate.mjs` self-test: the list is pinned
exactly; the existing "file on disk that runs on `pull_request`" case is
kept; a new case reads each entry after `ci.yml` from its own file and
requires zero read-only breaches; a control case shows the definition
fails on `ci.yml`, `validate-deps.yml` and `release.yml`; a run of each
listed workflow passes all five fences. The battery floor goes 33 to 36.
- `scripts/pm/rerun-failed.mjs` self-test: a run of each listed workflow
passes the seat-side fences and is dispatched once, with
`check-links.yml` listed and `lint.yml` not (floor 11 to 12). The wiring
case now refuses any workflow-path array literal in this file, not only
the old one-entry spelling. The header and usage say "a listed workflow"
instead of `ci.yml`.
- `.claude/skills/pm-dispatch/references/platform-readings.md`: the
re-run lines now state the seat's duty to read the log first. A red
whose own log says it measured nothing is the seat's to clear and never
the maintainer's click. The order is (1) one relay re-run, (2) when it
is refused, the base lacks a landed fix, or the PR is conflicted,
`pr_update_branch` or the dev merges main, (3) only a second red that
measured something is real. The landing note names the step taken. The
file stays at 458 lines (ceiling 458) with every line at or under 120
bytes.
## Tests
<details><summary>Self-tests, green at the final head</summary>
```text
✓ fleet-write/validate self-test: 364 cases pass across 18 batteries
✓ rerun-failed self-test: 32 cases pass across 5 batteries
```
</details>
<details><summary>Red with a deliberately wrong entry, through
ablation-replace (restore proved: blob equals HEAD, git diff HEAD
empty)</summary>
```text
+ validate-deps.yml (pull_request, issues write):
validate exit 1: 2 of 364 failed (the exact list; every entry after ci.yml READ-ONLY)
rerun-failed exit 0 (it pins membership of check-links.yml and absence of lint.yml, not the whole list)
+ release.yml (no pull_request trigger, NPM_TOKEN, environment):
validate exit 1: 4 of 364 failed (exact list; file runs on pull_request; READ-ONLY; the all-fences control that uses release.yml as its unlisted path)
+ lint.yml (turbo cache secrets, a write scope):
validate exit 1: 3 of 364 failed (exact list; READ-ONLY; the workflow fence's lint.yml refusal)
rerun-failed exit 1: 2 of 32 failed (each listed workflow accepted, lint.yml not listed; the seat-side lint.yml refusal)
```
</details>
## Acceptance notes
- Entries measured against the read-only definition (every
`pull_request` workflow on `158cc2aa`, read by the self-test's own
predicate). These meet it: `check-links.yml` (added), plus
`governed-surface-guard.yml`, `pr-body-guards.yml`,
`os-create-smoke.yml`, `scaffold-e2e.yml`, `pack-smoke-optin.yml`,
`upgrade-harness-optin.yml` and `spec-liveness-check.yml` (not added).
The two guards judge live PR state (reviews, body), so a re-run
re-judges governance; it does not recover a check that measured nothing.
The four smokes and the liveness check have no measured infra-red
incident behind them, and the order adds an entry only with a reading. A
later PR adds one with its reading. Every other `pull_request` workflow
breaches the definition (a write scope, or a secret other than
`GITHUB_TOKEN`).
- `ci.yml` stays the first entry by the ruling that made the op; it
reads the turbo remote-cache secrets, so the read-only definition is
checked on the entries after it.
- Step (2) reads "behind" as "the base lacks a landed fix". That keeps
it consistent with `platform-readings.md` L88, which says being behind
alone is no queue veto and never a reason to send `pr_update_branch`.
- The acceptance live check (`rerun-failed.mjs --run RUN_ID` on a
check-links run dispatches once, a second attempt is refused) is the
seat's after landing; this PR dispatches no live re-run.
## Verification
Derived gates for this diff (`dispatch-gates.mjs --commands`), each run
at the final head with its exit code and reconciled with `--ran`: see
the os-dev report on the card.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jTEjfqGjVA7q5WXAGd)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent efbe1a0 commit 8784ccb
4 files changed
Lines changed: 71 additions & 25 deletions
File tree
- .claude/skills/pm-dispatch/references
- scripts/pm
- fleet-write
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| 285 | + | |
| 286 | + | |
285 | 287 | | |
286 | | - | |
287 | | - | |
288 | | - | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
242 | | - | |
243 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
| |||
249 | 250 | | |
250 | 251 | | |
251 | 252 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
256 | 258 | | |
257 | 259 | | |
258 | 260 | | |
| |||
828 | 830 | | |
829 | 831 | | |
830 | 832 | | |
831 | | - | |
832 | | - | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
833 | 850 | | |
834 | | - | |
| 851 | + | |
835 | 852 | | |
836 | 853 | | |
837 | 854 | | |
| |||
896 | 913 | | |
897 | 914 | | |
898 | 915 | | |
899 | | - | |
| 916 | + | |
900 | 917 | | |
901 | 918 | | |
902 | 919 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
1059 | | - | |
| 1059 | + | |
1060 | 1060 | | |
1061 | 1061 | | |
1062 | 1062 | | |
| |||
1600 | 1600 | | |
1601 | 1601 | | |
1602 | 1602 | | |
1603 | | - | |
| 1603 | + | |
1604 | 1604 | | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
1605 | 1624 | | |
1606 | 1625 | | |
1607 | 1626 | | |
| |||
1615 | 1634 | | |
1616 | 1635 | | |
1617 | 1636 | | |
| 1637 | + | |
1618 | 1638 | | |
1619 | 1639 | | |
1620 | 1640 | | |
| |||
0 commit comments