Skip to content

Commit 3dc33c5

Browse files
chore(pm): delete the uncalled ci-failure tool, its lint step and the battery reads of it (#31752)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb7qLD3BDysX3VtRXifhPn3Z)_ Refs #29471 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么:** 删掉没人调用的 PM 工具 `scripts/pm/ci-failure.mjs`(4,035 行),以及 lint 里专门跑它自测的那一步;另一个保留工具的自测里有 2 条断言专门检查这个被删文件,一并删掉,那组自测的下限从 18 降到实测的 16。 - **为什么改:** 卡 #29471 的目标是让 `scripts/pm` 30 天内净减行数;维护者已按裁决 6730023204(A)同意删除这个工具和那几条断言。删掉后它们守的配对关系本身就不存在了,不是削弱检查。 - **风险与回滚:** 只删工具脚本和注释,不动产品代码;保留的检查(巡检侧的 4 条镜像断言)一字未改。合计 +26/−4,115 行。回滚即 revert 本 PR。 - **先看:** `scripts/pm/check-governed-merges.mjs`(第 18989 组自测:去掉读被删文件的断言、下限 18→16);`scripts/check-self-test-workflow-commands.mjs`(端到端用例改用 `lane-verdict.mjs`);`.github/workflows/lint.yml`(删掉的那一步)。 - **两分钟验证:** 运行 `node scripts/pm/check-governed-merges.mjs --self-test`,预期退出 0、打印 616 条断言(删除前 618)。 - **需要你做的:** 本 PR 动了 `.github/workflows/lint.yml`,属 Tier H:请受管批准人审批。 ## What changes Family T3 of #29471, as ruled (record 6730023204, letter A) and claimed (6730060298, amended 6730080794 and 6730147563). - **Deleted** `scripts/pm/ci-failure.mjs` (4,035 lines). Re-measured on `origin/main` `f2abd476` before deleting: nothing imports it, no skill, agent text, `package.json` script, `dispatch-gates.data.mjs` note or `write-pace.mjs` `WIRED_WRITE_TOOLS` entry names it, and its only runner was its own `lint.yml` step. - **`.github/workflows/lint.yml`:** the `PM ci-failure self-test` step and its comment block are gone (−52). The two comments that named the tool (the step-name-quoting rationale, the self-test workflow-commands rationale) no longer point at it. - **`scripts/pm/check-governed-merges.mjs`, battery `#18989`:** the `consumer` reading of the deleted file and the two assertions on it are gone; the readability assertion keeps its patrol half (renamed `the-patrol-file-is-readable-so-the-mirror-can-be-pinned-at-all`). The battery floor moves 18 → 16, the measured landed count. Every patrol-side assertion is byte-identical. The comments at the plan's header, at the structural pin, at the main-invocation guard, and the two importer clauses of the `--self-test` success line no longer name the importer. - **`scripts/check-self-test-workflow-commands.mjs`:** the end-to-end battery's target moves to `scripts/ci/lane-verdict.mjs`, a self-test CI runs unconditionally whose code mints a workflow-command token (so the prefilter selects it) and whose output prints that token mid-line in prose (`a red gate is named in an ::error:: annotation`), the shape the scan must read as innocent. The battery is renamed to say so; its floor (5) is unchanged. The header prose, the refusal text and the success line follow. - **`scripts/check-platform-checklist.mjs`:** the battery-attribution comment now compares against `check-governed-merges.mjs`, which opens batteries by name. ## Why The card's target is a net-negative `scripts/pm` over 30 days. The tool had no caller; the three assertions that read it pinned a pair (importer and plan) that stops existing with it, so dropping them weakens no live check. ## Verification All at head `23639351` (after merging `origin/main` `90cea476`), unless noted. - `node scripts/pm/check-governed-merges.mjs --self-test`: exit 0, 616 assertions (618 on `f2abd476`). Battery `#18989` registered **18** cases before and **16** after, read from the floor gate's own message with the pin raised to 99 on a committed tree and restored byte-identical. - `node scripts/check-self-test-workflow-commands.mjs --self-test`: exit 0, 8 batteries, 38 cases. The new target, probed among the 36 candidates: `lane-verdict.mjs --self-test` 85 ms, 2,255 bytes, one line carrying a mid-line `::error::`, scan findings 0. - Derived gate set (`node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`): 56 commands, all exit 0, rerun in full on the final head; `--ran` reconciliation: 56 derived, 56 run, 0 NOT-MEASURED. `pnpm check:pm-dispatch-gates` 427 s; `pnpm check:type-check-debt` under the verify lock, VERDICT command-exit 0. - `node scripts/check-platform-checklist.mjs --changed-from origin/main`: exit 0, 0 anchored files. - `ui/scripts/__tests__/check-governed-queue-guard.test.ts` (the one test file naming a touched script): 10/10 pass. ## Acceptance notes Stale prose left in staying files outside the ruled surface (report-only, per the order), file:line at `23639351`: - `scripts/pm/check-half-states.mjs`:934, :1029, :20807, :30492, :30540, :30596, :30651 (comments) and :36754 (a case name) - `scripts/pm/dispatch-gates.mjs`:2203, :2213 (a dated population note) - `scripts/import-prerequisite.mjs`:224 - `scripts/check-workflow-step-name-quoting.mjs`:23 - `docs/audits/2026-09-self-test-shape-census.md`:376 (a dated audit) No gate, row or constant is added; one battery floor is lowered by ruling. Governed Tier H (`.github/workflows/lint.yml`): the PR stays draft for a governed approver. No changeset: nothing published moves (`scripts/**` and a workflow only). --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jTQzoQLuSgqcLVzJog)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent bda38ab commit 3dc33c5

5 files changed

Lines changed: 26 additions & 4115 deletions

File tree

‎.github/workflows/lint.yml‎

Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,58 +1673,6 @@ jobs:
16731673
node scripts/check-self-test-wired.mjs --self-test
16741674
node scripts/check-self-test-wired.mjs
16751675
1676-
# ci-failure self-test (#9898). Fifth member of the PM self-test family
1677-
# above, and until now the odd one out: `scripts/pm/ci-failure.mjs` — the
1678-
# one command from "a check is red" to "here is the failing assertion" —
1679-
# shipped a `--self-test` that NO job ran, so it executed only when a
1680-
# human or an agent typed it.
1681-
#
1682-
# This tool is worth the second because the rot it would hide is the exact
1683-
# defect its own card was about. The file was found near-complete but
1684-
# NEVER RUN LIVE: node 22's `fetch` ignores HTTPS_PROXY, so behind an agent
1685-
# container's proxy every read answered 401 and the tool's own transport
1686-
# probe reported PREREQUISITE NOT MET (exit 3) — and looked right doing it.
1687-
# ⇒ A retrieval tool that has stopped working presents as a tool correctly
1688-
# declining to work. Nothing about that shape reads as broken, which is
1689-
# what makes an unrun self-test the wrong economy here specifically.
1690-
#
1691-
# The self-test is also materially larger than when the card was filed:
1692-
# #9966/PR #10157 corrected the transport probe (a healthy `/rate_limit`
1693-
# was greening containers whose repo-scoped reads are refused — the fourth
1694-
# measured container class) and added nine cases, which is why this step
1695-
# was deliberately ordered AFTER that fix. Wiring a false green into a
1696-
# required job would have pinned it as CI-enforced truth.
1697-
#
1698-
# Beyond the pure predicates it pins the LIVE WIRING: `resolveStep` is run
1699-
# against the real `.github/workflows/` tree, so reshaping the workflows
1700-
# until no step name resolves to a `run:` block reddens here rather than
1701-
# silently degrading every gate failure from "here is the command" into
1702-
# "no substitute available".
1703-
#
1704-
# Unconditional and un-`if:`-ed — an exemption is precisely what a
1705-
# self-test must not have, or the gap moves. (Five self-tests in this job
1706-
# do carry one since #19498: each cost minutes on every product PR, and
1707-
# each was moved by the ruling quoted in the selector's header. This one
1708-
# costs seconds and is not among them.)
1709-
#
1710-
# NO NETWORK, measured rather than assumed (#9898), because a self-test
1711-
# that reached GitHub would put this required context at the mercy of API
1712-
# availability — a far worse trade than the rot it prevents. Under
1713-
# `strace -f` with full egress available the run makes ZERO `socket()` and
1714-
# ZERO `connect()` calls (the live walk, traced identically, makes 3 and
1715-
# 3), and it exits 0 inside an empty network namespace where the live walk
1716-
# exits 3. The `--self-test` branch is chosen before the transport probe
1717-
# and never re-execs, and its two readers are injected. ~0.14 s.
1718-
#
1719-
# Invoked as `node` rather than through a `pnpm check:*` alias, same as
1720-
# the release-rehearsal step above: this card's declared file surface is
1721-
# this workflow alone, and dispatch-gates.mjs derives gate families from
1722-
# either spelling.
1723-
- name: PM ci-failure self-test
1724-
id: pm-ci-failure-self-test
1725-
continue-on-error: true
1726-
run: node scripts/pm/ci-failure.mjs --self-test
1727-
17281676
# os-regen-merge self-test (#12893). Mirrors the `Verify-lock entry-point
17291677
# self-test` step above 1:1 — same directory, same split between the tool
17301678
# and its self-test. `scripts/pm/os-regen-merge.sh` is the mechanized merge
@@ -4140,8 +4088,8 @@ jobs:
41404088
# YAML at that point (a space + hash starts a comment inside a plain
41414089
# scalar), so the step's real parsed name is not the text an author
41424090
# wrote -- the CI log names the step something else entirely, and
4143-
# anything that resolves a step by its name text (scripts/pm/ci-failure.mjs)
4144-
# cannot find it. This repo names issue numbers in step names as a
4091+
# anything that resolves a step by its name text cannot find it.
4092+
# This repo names issue numbers in step names as a
41454093
# matter of style, so the shape is likely to recur. Deliberately NOT a
41464094
# YAML-parser-level name comparison -- see the header of
41474095
# scripts/check-workflow-step-name-quoting.mjs for why grep-level is
@@ -4560,8 +4508,8 @@ jobs:
45604508
# population: that one asks whether CI RUNS
45614509
# each self-test, this one asks what each self-test PRINTS while it does.
45624510
#
4563-
# The defect it closes was live on every PR in this repo. A line of
4564-
# `scripts/pm/ci-failure.mjs`'s self-test prose named a workflow-command
4511+
# The defect it closes was live on every PR in this repo. A line of a PM
4512+
# tool's self-test prose (a tool since deleted) named a workflow-command
45654513
# token literally, inside backticks, as documentation of what that tool
45664514
# anchors on. The runner does not know a token is being quoted: it parsed
45674515
# it and minted `annotation_level: failure` on a check run whose

‎scripts/check-platform-checklist.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ let plannedStatusReachedVerdict = false;
11031103
// silences that battery exactly as effectively as zeroing it, so the roster's
11041104
// own size is pinned beside it.
11051105
//
1106-
// The attribution differs from `scripts/pm/ci-failure.mjs`, whose rows open a
1106+
// The attribution differs from `scripts/pm/check-governed-merges.mjs`, whose rows open a
11071107
// battery by name so a stray assertion lands in a declared bucket: here each
11081108
// battery is a FUNCTION returning its own `checked`, so a row cannot be filed
11091109
// under the wrong battery in the first place, and the roster's job is the

‎scripts/check-self-test-workflow-commands.mjs‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* ## The defect, measured rather than supposed
1111
*
12-
* `scripts/pm/ci-failure.mjs --self-test` printed a line of prose that NAMES a
12+
* A PM tool's `--self-test` (a tool since deleted) printed a line of prose that NAMES a
1313
* workflow-command token, inside backticks, as documentation of what the tool
1414
* anchors on. The runner does not know the token is being quoted. It parsed it
1515
* and minted a real annotation:
@@ -341,7 +341,7 @@ function main() {
341341
if (candidates.length === 0) {
342342
refuse(
343343
'not one of the self-tests CI runs even MENTIONS a workflow-command token, which this tree ' +
344-
'contradicts (`scripts/pm/ci-failure.mjs` documents what it anchors on). The prefilter is ' +
344+
'contradicts (`scripts/ci/lane-verdict.mjs` mints the annotations it reports). The prefilter is ' +
345345
'broken, and a broken prefilter reads exactly like a clean tree (#4690).',
346346
);
347347
}
@@ -430,7 +430,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
430430
'current form, line start only': 3,
431431
'innocent output': 4,
432432
'prefilter reads CODE, never prose': 5,
433-
'end to end on the real defect site': 5,
433+
'end to end on a real self-test that prints workflow-command prose': 5,
434434
'the population is imported, never re-walked': 9,
435435
'the scripts/ population is declared here': 6,
436436
});
@@ -526,10 +526,14 @@ function selfTest() {
526526
'a script with no token at all selected',
527527
);
528528

529-
// ── End to end: the real tree's real defect site, run for real ───────────
530-
battery('end to end on the real defect site');
529+
// ── End to end: a real self-test CI runs, run for real ──────────────────
530+
// The original defect site is deleted. `lane-verdict.mjs` stands in for it:
531+
// its code mints `::error::`, so the prefilter selects it, and its self-test
532+
// PRINTS prose naming that token mid-line, which is exactly the shape the
533+
// scan must read as innocent.
534+
battery('end to end on a real self-test that prints workflow-command prose');
531535
{
532-
const target = 'scripts/pm/ci-failure.mjs';
536+
const target = 'scripts/ci/lane-verdict.mjs';
533537
const source = existsSync(join(ROOT, target)) ? readFileSync(join(ROOT, target), 'utf8') : null;
534538
ok(source !== null, `${target} is missing, so the end-to-end case verified nothing`);
535539
ok(source !== null && isCandidate(target, source), `${target} is no longer selected by the prefilter — the end-to-end case below would run nothing`);
@@ -766,7 +770,7 @@ function selfTest() {
766770
console.log(
767771
'check-self-test-workflow-commands --self-test: both measured parse rules pinned (legacy form ' +
768772
'anywhere in a line, current form only at line start), the innocent-output and Perl-namespace ' +
769-
'cases, the comment mask in both directions, one end-to-end run of the real defect site, and the ' +
773+
'cases, the comment mask in both directions, one end-to-end run of a real self-test that prints workflow-command prose, and the ' +
770774
'imported population held against the live tree with no second walk taken here, and the '
771775
+ 'scripts/ population this gate declares to the dispatch derivation held set-equal to that walk' +
772776
` — ${declaredBatteries.length} declared batteries, ${totalCases} cases registered, every battery` +

0 commit comments

Comments
 (0)