Repository navigation
Commit ef48d09
docs(pm-dispatch): read mergeable_state on every look at a watched PR (#26627)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoUNHdbnxosZ6e5sg2uZhGxc)_
No card: the maintainer authorized this `.claude/` tooling PR directly
in the project chat, replying 「同意」 to the proposal "update the
pm-dispatch skill so any agent watching or landing a PR checks mergeable
state on every look, not only CI checks, merges main itself when
conflicted, and never reports nothing-needed-from-you without confirming
mergeability".
## 维护者速读
- 改了什么:pm-dispatch 看护 PR 时,每看一眼都同时读 CI 与
`mergeable_state`;冲突(`dirty`)当即合 main;未确认可合并不报「无需你做」。
- 为什么改:一个 PR 冲突了好几个小时,线程只看 CI、一直说「在等 CI」,冲突通知没到,是你先发现的。
- 风险与回滚:只改四个 `.claude/` 文件的规则文字,每个文件行数不变;回滚 = revert 本 PR。
- 先看:`landing-operations.md` B 节新增两行,`coordinator.md` 第七节新增一行。
- 两分钟验证:读 diff 的 5 行增改;`pnpm check:pm-skill-ratchet` 绿。
- 需要你做的:os-zhuang 批准即可,批准后由本线程合入。
## What changes
- `references/landing-operations.md` §B (the watch from PR open to
MERGED) gains two rules:
- every look at a PR (event wake, patrol, before a report) reads
`mergeable_state` beside the checks, and `unknown` is re-read;
- `dirty` ⇒ merge `origin/main` and push a new commit at once, without
waiting for a conflict notice; no "nothing needed from you" report
without a settled non-`dirty` reading.
- `references/coordinator.md` §七: before relaying a thread's "this PR
needs nothing from you", the coordinator reads that PR's
`mergeable_state` itself; `dirty` ⇒ send it back to the thread to merge
main instead of relaying.
- `references/dispatch-runbook.md` card-thread section: the thread
drives CI **and mergeability**.
- `references/execution-duties.md` collect section: the
subscribe-on-report line now points at landing-operations §B for how the
watch reads a PR.
`behind` is deliberately left alone: `platform-readings.md` already
rules that a PR behind `main` still enters the queue and owes no
`pr_update_branch`, so only `dirty` asks for a merge.
## Why
A cleanup PR sat in merge conflict while its thread said it was watching
CI. Two PRs had landed on `main` that edited the same skill files.
Conflict notices are best effort and often never arrive, and the
existing `mergeable_state` reads in the skill fire only at arming time
and when an enqueue fails. The maintainer noticed the conflict before
any agent did.
## Ratchet funding (line-neutral per file, no ceiling moved)
Every file sits at headroom 0, so each added line is paid by deleting a
line whose content another text already carries:
- `landing-operations.md` −「信任 suite/check 事件前先重读 PR 对象取 head…」: carried
by `platform-readings.md`'s last queue-section line
(`check_suite.completed` names a stale head ⇒ re-read the current head
before use).
- `landing-operations.md` −「确认 MERGED 要两个读数…」: carried by AGENTS.md
Multi-agent §7 ("Always read *two* things: the queue branch **and**
`origin/main`") and `platform-readings.md` (「落地检查恒两个读数」).
- `coordinator.md` −「按派发令所写的 model 与 effort 开线程…」: carried by
`dispatch-runbook.md`'s card-thread section (「档位与 effort 席位自推导 ⛔
不等维护者原话」 and 「派发令写两者与推导…协调者照令开线程;常设原话有则作 `reason:`」).
- `dispatch-runbook.md` and `execution-duties.md`: edited in place, same
line count, every line ≤ 120 bytes.
## Verification
Derived gate list (`node scripts/pm/dispatch-gates.mjs --commands`, 17
commands) run on head 08225fc; results are in the review comment below.
Clause-②: no
Metadata-protocol: none
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(n/a, no spec change)
- [x] 2. Every name I added uses the casing for its kind. (n/a)
- [x] 3. No formatter ran (markdown-only diff; eslint reads none of
these files).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset. (publishes
nothing: `skip-changeset`)
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (n/a)
- [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 (the 维护者速读 block and
the verbatim ruling quotes excepted, per AGENTS.md Communication).
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L9qibvepenMLGwN7rQgFH4
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibvepenMLGwN7rQgFH4)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5dcbdb4 commit ef48d09
4 files changed
Lines changed: 5 additions & 5 deletions
File tree
- .claude/skills/pm-dispatch/references
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| 49 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
57 | | - | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
| |||
74 | 72 | | |
75 | 73 | | |
76 | 74 | | |
| 75 | + | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
0 commit comments