Skip to content

Commit 99b4deb

Browse files
os-steveclaude
andauthored
tooling(pm): name the sweeper's third file in the patrol's adopt list (#15000)
The half-state patrol's documented sibling install listed two files to copy (`scripts/pm/check-half-states.mjs` and the workflow) while the sweeper has imported `../invoked-as.mjs` since before that list was written. A repo that followed it verbatim installed a patrol that cannot start. Measured on a clean two-file copy of this repo's own files: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../scripts/invoked-as.mjs' imported from '.../scripts/pm/check-half-states.mjs' exit 1 The same copy with `scripts/invoked-as.mjs` added runs the sweeper's `--self-test` to `2062 cases pass`, exit 0. The failure is loud rather than silent — the job's final step turns the run red and the anchor is rewritten with the "THE SWEEP DID NOT RUN" body — but the adopter still gets a dead patrol, and the next two adopters in the fleet would each get one. Three comment/wiring corrections, all in the workflow; the sweeper is not touched, so this repo's sweep behaviour is byte-identical by construction: - the adopt list names three files, with the measurement that decides it; - the "No `pnpm install`" note states the sweeper's real import set (`node:` builtins plus the one repo-local helper) instead of "nothing but `node:process` and global `fetch`" — that sentence is what an adopter checks the copy list against, so a stale one re-creates the defect; - `scripts/invoked-as.mjs` joins the `pull_request` path filter, so a change to it gets the same pre-merge proof the other two files get. The adopted objectui copy has carried that row since its port. Part of #14881 Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox Co-authored-by: Claude <noreply@anthropic.com>
1 parent e58ea8b commit 99b4deb

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

.github/workflows/half-state-patrol.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,24 @@ name: Half-State Patrol
8787
#
8888
# To adopt, in the sibling repo:
8989
#
90-
# 1. copy `scripts/pm/check-half-states.mjs` and this file, unchanged;
90+
# 1. copy THREE files, unchanged: `scripts/pm/check-half-states.mjs`,
91+
# `scripts/invoked-as.mjs` (the sweeper imports it — see below), and this
92+
# file;
9193
# 2. open one `tracking`-labeled anchor issue there and set the repository
9294
# VARIABLE `HALF_STATE_ANCHOR_ISSUE` to its number
9395
# (Settings → Secrets and variables → Actions → Variables).
9496
#
97+
# ⚠️ Step 1 said TWO files until 2026-09-03, and the sweeper has imported
98+
# `../invoked-as.mjs` since well before that — so the documented install was a
99+
# patrol that could not start. Measured on a clean two-file copy of this repo's
100+
# own files: `ERR_MODULE_NOT_FOUND … /scripts/invoked-as.mjs`, exit 1, before a
101+
# single predicate runs; the same copy with the helper added passes the
102+
# sweeper's 2,062-case `--self-test`. It fails LOUDLY rather than silently (the
103+
# job's last step turns the run red and the anchor is rewritten with "THE SWEEP
104+
# DID NOT RUN"), which is the one mercy in it — but a repo adopting this file by
105+
# following the list above installed a dead patrol. ⛔ Do not shorten this list
106+
# again from memory: the import is what decides it, not this comment.
107+
#
95108
# That is the whole install. The swept repo needs no configuration at all: it is
96109
# `github.repository`, so the copy reads the board it lives in — a hardcoded
97110
# default was how a copied file could have swept THIS repo and written the
@@ -129,6 +142,13 @@ on:
129142
pull_request:
130143
paths:
131144
- 'scripts/pm/check-half-states.mjs'
145+
# The sweeper imports this helper, so a change to it can break the patrol
146+
# without touching either file beside it — and the PR-time proof this
147+
# trigger exists to give would not run. Same reasoning as the adopt list
148+
# above, one layer down: an undeclared dependency is undeclared in every
149+
# place that has to name it. (The adopted objectui copy carries this row
150+
# already; upstream is catching up to its own port.)
151+
- 'scripts/invoked-as.mjs'
132152
- '.github/workflows/half-state-patrol.yml'
133153

134154
# Least privilege: this job reads the repo and writes exactly one issue BODY.
@@ -190,9 +210,14 @@ jobs:
190210
with:
191211
node-version: '22'
192212

193-
# No `pnpm install`: the sweeper imports nothing but `node:process` and
194-
# global `fetch`. Installing the workspace here would buy nothing and would
195-
# give a scheduled patrol a lockfile it could fail on.
213+
# No `pnpm install`: the sweeper imports only `node:` builtins
214+
# (`process`, `child_process`, `fs`, `url`), global `fetch`, and the one
215+
# repo-local helper `../invoked-as.mjs` — no npm dependency, so installing
216+
# the workspace here would buy nothing and would give a scheduled patrol a
217+
# lockfile it could fail on. ⚠️ That repo-local import is why the adopt
218+
# list above copies THREE files; this sentence read "imports nothing but
219+
# `node:process` and global `fetch`" until 2026-09-03, which is the claim
220+
# an adopter would have checked the copy list against.
196221
- name: Run the live sweep
197222
id: sweep
198223
env:

0 commit comments

Comments
 (0)