Repository navigation
Commit b3103a9
fix(pm): H4 prose and the pm:blocked readings release a PR target on merge, never on close (#28031)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D9bpbnMYZSP81qLAuSGbxeh)_
Fixes #27989
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:`Blocked-by:` 目标是 PR 时,三处读器从「关闭即放」改为「合并才放」:H4 散文半边把「关而未合并」单独成桶、渲染
`CLOSED UNMERGED`、不再说「due back in pm:queue」;SKILL.md 的 `pm:blocked`
行改为「关单(PR 则合并,关而未合并不放)时放回」;platform-readings.md 改为 PR 判合并走
`pull_request_read`/REST,不再点名 `issue_read`。
- 为什么改:解析器已给废弃 PR 打 `unmerged: true`,但 H4 散文子句仍按 `state === 'closed'`
分桶,把卡在废弃 PR 上的卡报成「条件已满足、该回队」;MCP `issue_read` 实测分不出合并与废弃(记录 6516593752)。
- 风险与回滚:只有 report-only
行文与规则文本,无新门禁、无标签写入;两处规则行各自行数持平(319/319、458/458),字节在天花板内。回滚 = revert 本 PR
的一个 commit。
- 先看:`scripts/pm/check-half-states.mjs` `proseBlockerClause`(新 docblock
段落与 `abandoned` 桶)→ 9 个 `H4 prose PR:` 钉子 → 两行规则文本 diff。
- 两分钟验证:`node scripts/pm/check-half-states.mjs --self-test && pnpm
check:pm-skill-ratchet && pnpm check:pm-skill-id-lint`,预期全绿。
- 需要你做的:无。本 PR 欠契约复核(席位以 CONTRACT_REVIEW_TIER 出记录),落地档以
`GOVERNED_SURFACES` 登记为准(`--branch` 预读:Tier S,`.claude/**` ×2),席位落地。
## What changes
After the unlock sweep learned that a `Blocked-by:` line can name a PR,
and that a PR target releases on **merged**, three readers still spoke
of a PR target as "closed". Card items 1–3; items 4 and 5 are read
below.
**Item 1 — `proseBlockerClause` (H4 prose half),
`scripts/pm/check-half-states.mjs`.** The resolver
`blockerResolutionFromRow` already keeps `state: 'closed'` for an
abandoned PR and marks it `unmerged: true`, but the clause bucketed
every `closed` row as a satisfied condition and told the seat the card
was "due back in `pm:queue`" — for a prose-named PR that closed without
merging, a release that never happened. Now:
- `namedProseCandidates` renders such a row as `` `#N` CLOSED UNMERGED
(closed_at) ``.
- The verdict has an `abandoned` bucket. A merged PR (closed, no mark)
still reads "ALREADY CLOSED … due back in `pm:queue`" — the released
direction is unchanged. All-abandoned reads "closed UNMERGED — an
abandoned attempt releases nothing … the block still stands; the target
wants re-pointing". Mixed readings count only merges/issue closes as
expired, and an abandoned close beside an open target no longer claims
"They all still read OPEN".
- Nine `H4 prose PR:` pins drive the measured `GET /issues/N` shapes
(#27888 merged, #27296 closed unmerged, the same rows H19's battery
pins) through the sweep's own projection into the clause. Report-only:
H4 writes no label, and the clause still ends with "fix it by writing
the `Blocked-by: #N` line".
**Item 2 — `.claude/skills/pm-dispatch/SKILL.md`, the `pm:blocked`
status row.** 「#N 关闭时由解锁扫描或 `scheduled-full-run-card.yml` 刷新放回」 → 「#N
关单(PR 则合并,关而未合并不放)时由解锁扫描或 `scheduled-full-run-card.yml` 放回」, agreeing
with `state-machine.md` 「合并才放,关而未合并 ⛔ 不放」. In-row, 319 lines kept. The
row sits at the file's `MAX_TABLE_ROW_BYTES` ceiling (341), so three
words were tightened in the same row to pay for the new clause:
「刷新放回」→「放回」, 「工已完、PR 被外部门禁卡住的」→「工已完而被门禁卡住的」, 「正文或线程行首」→「双通道行首」 (the term
the hold/blocked line below already uses), 「挂本态直至其」→「直至其」. No rule was
dropped.
**Item 3 —
`.claude/skills/pm-dispatch/references/platform-readings.md`.** The
unlock-scan line named `issue_read` + `merged_at`; measurement
6516593752 shows MCP `issue_read` on a PR number answers `state:
"closed"` with no `pull_request` key, so it cannot tell a merge from an
abandonment. The line now reads 「解锁扫描 `list_issues` 列卡、逐目标直读,⛔
不加常设评论读;PR 合并走 `pull_request_read`/REST。」 — exactly 120 bytes, the
`MAX_LINE_BYTES` ceiling, which is why the REST read is named without
its `merged_at` field and `issue_read` is excluded by omission rather
than by a ⛔ clause. 458 lines kept.
**Item 4 — read, not edited.** Triage 6516946612 rules: no new gate;
triage's `unlock` scan already lists a closed-unmerged PR target as not
released; at most the `pm:blocked` row says so. The row now says
「关而未合并不放」; `state-machine.md` is untouched and H26 is not extended.
**Item 5 — H28 wording.** Not touched: the diff does not reach H28.
## Verification
- `node scripts/pm/check-half-states.mjs --self-test` → 5098 cases pass
(was 5089).
- Ablation, three legs, each restored to the committed file afterwards
(`git diff` empty): (A) the `closed` bucket counts unmerged rows again →
6 of the new pins red; (B) the render drops the `UNMERGED` word → 1 red;
(C) the all-abandoned branch removed → 1 red. The two merged-PR pins pin
the direction that was already right and are not reachable by an
ablation of this diff.
- `pnpm check:pm-skill-id-lint` → 105 files clean. `pnpm
check:pm-skill-ratchet` → green (SKILL.md row 341/341, platform-readings
line 120/120). `node scripts/check-skills-token-ratchet.mjs` → green.
- Gate families from `node scripts/pm/dispatch-gates.mjs --commands
--changed`: 58 commands, all run serially on the committed head 45763c7
in a fresh worktree after `pnpm install --frozen-lockfile
--ignore-scripts` and the `@objectstack/lint...` build, each exit code
captured before any pipe; all 58 exit 0; `dispatch-gates --ran`
reconciliation: 58 derived, 58 run, 0 NOT-MEASURED, 0 UNRUN (exit 0);
the derivation recomputed after the commit is the same 58.
- `node scripts/pm/check-governed-merges.mjs --branch
claude/project-thread-vo8914` → governed `.claude/**` ×2, Tier S;
`scripts/pm/check-half-states.mjs` not on the register.
- The project-context step "assign and request a review from the
requester at PR creation" was not performed: SKILL.md 〈路径分叉〉 says
「`pr_create` 不请不派」; the hand-off is the seat's after ACCEPT.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes on the touched script.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset. (nothing
publishes; `skip-changeset`)
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_016WV4d17R6AtQwLrxguoYs1
Co-authored-by: Claude <noreply@anthropic.com>1 parent cc5586d commit b3103a9
3 files changed
Lines changed: 49 additions & 6 deletions
File tree
- .claude/skills/pm-dispatch
- references
- scripts/pm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2357 | 2357 | | |
2358 | 2358 | | |
2359 | 2359 | | |
2360 | | - | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
2361 | 2364 | | |
2362 | 2365 | | |
2363 | 2366 | | |
| |||
2373 | 2376 | | |
2374 | 2377 | | |
2375 | 2378 | | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
2376 | 2389 | | |
2377 | 2390 | | |
2378 | | - | |
| 2391 | + | |
| 2392 | + | |
2379 | 2393 | | |
2380 | 2394 | | |
2381 | 2395 | | |
2382 | 2396 | | |
2383 | 2397 | | |
2384 | | - | |
| 2398 | + | |
| 2399 | + | |
2385 | 2400 | | |
| 2401 | + | |
2386 | 2402 | | |
2387 | 2403 | | |
2388 | 2404 | | |
| |||
2407 | 2423 | | |
2408 | 2424 | | |
2409 | 2425 | | |
2410 | | - | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
2411 | 2432 | | |
2412 | 2433 | | |
2413 | 2434 | | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
2414 | 2442 | | |
2415 | 2443 | | |
2416 | 2444 | | |
| |||
24992 | 25020 | | |
24993 | 25021 | | |
24994 | 25022 | | |
| 25023 | + | |
| 25024 | + | |
| 25025 | + | |
| 25026 | + | |
| 25027 | + | |
| 25028 | + | |
| 25029 | + | |
| 25030 | + | |
| 25031 | + | |
| 25032 | + | |
| 25033 | + | |
| 25034 | + | |
| 25035 | + | |
| 25036 | + | |
| 25037 | + | |
24995 | 25038 | | |
24996 | 25039 | | |
24997 | 25040 | | |
| |||
0 commit comments