Skip to content

Commit 58ab03d

Browse files
feat(pm): fold a claim or a verdict into one label-write relay stroke (#31583)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb2sqG6tEYhknTqiiUaxjRwX)_ Fixes #31551 ## 维护者速读 - 改了什么:认领(评论+标签+指派)与验收落地(评论+转正式+开自动合并)各合成一次中继写入,不再分几笔先后发。 - 为什么改:分笔发送会留下“评论已发、标签未改”的半态,且多占写入节流的名额。 - 风险与回滚:只改两个 PM 写入脚本与两行流程文字,不碰中继本身;回滚即撤回本 PR,旧的分笔写法仍可用。 - 先看:`scripts/pm/label-write.mjs` 中的 `foldStroke`,以及 `post-stamped.mjs` 新导出的 `judgeBody`。 - 两分钟验证:运行 `node scripts/pm/label-write.mjs --self-test`,看到 196 条通过、14 组。 - 需要你做的:按治理层级审阅本 PR(含 `.claude/**` 改动,保持草稿)。 ## What changes - `scripts/pm/post-stamped.mjs`: the body checks (render, signature first line, claim keyed lines, record lines, decision facets, vacant ledger) move into one exported `judgeBody`. `main` calls it; behaviour is unchanged. - `scripts/pm/label-write.mjs`: new `--comment-file FILE` sends the stamped comment, the label diff and the assignee change as ONE fleet-write dispatch (the `--release` shape, via `releaseActions`). `--land` (pull requests only, needs `--comment-file`) appends `pr_ready` and `automerge_enable` to the same stroke. The comment is judged by `judgeBody`, so the signature first line and the one-clock `{{NOW}}` stamp hold. RELAY-ONLY: a direct route is refused (exit 3). - Read-back, one printed line per part: `④ labels`, `④ assignees`, `④ comment` (plus the stamp-drift and byte-class lines from post-stamped's verdict), and with `--land` `④ pull` (draft judged; REST `auto_merge` printed, not judged, the executor's landed check judges the arming). Any mismatch exits 4 and is never repaired; an unreadable read exits 3. - No new relay op and no change to `scripts/pm/fleet-write/ops.mjs`: the fold uses `issue_comment`, `labels_*`, `assignees_*`, `pr_ready` and `automerge_enable` as they are. - Two pm-dispatch procedure lines (claim atomic pair, partial-landing release) and one landing line now name the one-stroke form. Line-neutral. ## Why A claim or a verdict went out as two or three separate writes, each paced and read back on its own. Between them the card sat half-written. Folding them into one dispatch keeps pacing (the executor still spaces each write), keeps every read-back, and keeps the signature check. ## Verification - `node scripts/pm/label-write.mjs --self-test`: 171 cases / 13 batteries before, 196 / 14 after. The new battery pins the claim fold, the verdict fold, a refusal for each part that fails read-back (labels, assignee, comment, pr_ready), unsigned / typed-stamp / bad-keyed-line refusals, `--land` on an issue, the direct-route refusal, no-run, failure and dry run. - `node scripts/pm/post-stamped.mjs --self-test`: 753 / 26 before, 761 / 27 after (the one-judge battery). - `node scripts/pm/fleet-write/dispatch.mjs --self-test`: 358 / 30, including the no-run conformance. - `node scripts/pm/dispatch-gates.mjs --commands`: 40 derived, 40 run, all exit 0; `--ran` reconciles 0 NOT-MEASURED. Clause-②: no Metadata-protocol: none ## 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; eslint passes on both changed scripts (`--no-inline-config`, the `pnpm lint` flags). - [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. (except the required `维护者速读` block) - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jQze2kJDxaxMsAW2kY --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 467a01f commit 58ab03d

5 files changed

Lines changed: 370 additions & 49 deletions

File tree

‎.claude/skills/pm-dispatch/references/dispatch-runbook.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
- 全量 = 会话、分支、文件面、交付物、串行约束;成员卡各留一行指针指向锚卡。
3434
- 标签翻转照旧逐卡执行:省的是评论正文写量,不是状态写入。
3535
- 验收与解锁扫描的读侧不变,仍逐卡读。
36-
- 写序:标签翻转只在认领评论写成功之后,两笔不原子。
37-
- 评论失败而标签已翻即制造一记真半状态;顺序反了就带重试义务,重试未成即回滚标签。
36+
- 写序:认领一笔 `label-write --comment-file`,评论排首、标签随后;执行器首败即停,标签不先翻。
37+
- 评论存而标签未翻 ⇒ 非零退出;补标签用不带 `--comment-file` 的 `label-write`,⛔ 不重发评论。
3838

3939
## 巡查常设项(每席巡查与总监席摘要)
4040

‎.claude/skills/pm-dispatch/references/execution-duties.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767

6868
- 归属 = session ID,⛔ 不认作者字段;`Account:` 派生自 assignee,不等即半态、持卡席下笔补正。
6969
- 卡 assignee 归 PM,dev 恒不写;PR 派认领账号,交棒同笔改;在飞 PR = `head:claude/` 正文点名本卡。
70-
- 部分落地(PR 带 `Refs #N (item k)`,⛔ 不 `Fixes`)即释放:合入同笔回 `pm:queue` + 清 assignee。
70+
- 部分落地(PR 带 `Refs #N (item k)`,⛔ 不 `Fixes`)即一笔释放:`Release:`+回 `pm:queue`+清 assignee。
7171
- `Release:` 行点名已落与余项;余项整落 `ui/**` 外他席树 ⇒ 点名其改标,拆分加 `pm:retriage`。
72-
- 派发前按序执行原子对:① Assign @me,并把 `pm:dispatched` 与摘 `pm:queue` 放进同一次标签写入。
72+
- 派发原子对一笔 `label-write`:① `--assign` @me 加 `pm:dispatched` 摘 `pm:queue`,`--comment-file` 带②。
7373
- step ① 之后获得 assignee 的直接弃出本批。
7474
- ② 认领评论照抄 SKILL.md 模板:`Branch:`、`Clause-②:`、`Metadata-protocol:` 各占一行且行首。
7575
- 条款②入队闸门只读认领评论且只读行首键:句中提及与另发评论皆读不到,卡即不可读。

‎.claude/skills/pm-dispatch/references/landing-operations.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@
4848

4949
- 车道 PM 的权责三件:验收(复核清单)、首次入队、确认 MERGED;落地执行在案判决,非自批。
5050
- 首次入队:ACCEPT 后挂 6–9 分钟 flip 定点,到点核门禁 job 结论。
51-
- 绿即经中继 op `pr_ready` + `automerge_enable` 落地,拼写见 `rest-channel.md`;未绿按阶梯重挂定点。
51+
- 绿即落地评论与 `pr_ready`+`automerge_enable` 一笔中继:`label-write --land`;未绿按阶梯重挂定点。
5252
- 写节流拒(exit 10) ⇒ 待 `node scripts/pm/write-pace.mjs --status` 现空槽再重试。
5353
- CI success webhook 不可靠:⛔ 不坐等,也 ⛔ 不忙轮询;定点文本照定时器写法纪律。
54-
- undraft 撞 429 ⇒ 落地入等 `resets at` 态:该刻记卡,到点一次重试;⛔ 不报阻塞、不自定节奏。
54+
- undraft 429 ⇒ 卡记 `resets at`,到点一次重试裸 op(`rest-channel.md`),⛔ 不重发评论、不报阻塞。
5555
- 落地遭分类器拒 ⇒ 停手、报维护者、卡上记命令与拒因;⛔ 不换拼法、不退回 ccr 绕过。
5656
- 落地评论 = 两个读数的探针表 + 一行状态变更(摘标/关卡/收口),⛔ 不复述 `## 席位核对`。
5757
- 转 ready/入队前跑 `check-governed-merges.mjs --pr N`:受管面照两层;>3000 行(含生成物)照 Tier H。

0 commit comments

Comments
 (0)