Repository navigation
Commit 58ab03d
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
- scripts/pm
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
0 commit comments