Skip to content

Commit ef48d09

Browse files
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/coordinator.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
- 档位与 effort 的定法住 `execution-duties.md` 派发节:档位引 `dispatch-gates --tier`,effort 按卡难度。
3232
- 改技能(协议语义面)的卡恒契约复审档 `CONTRACT_REVIEW_TIER`;⛔ 不抄模型名。
33-
- 按派发令所写的 model 与 effort 开线程,⛔ 不等维护者原话;常设原话有则席位引作 `reason:`。
3433

3534
## 五、卡线程的 `needs_decision`(coordinator 收到时读;席位写分析时读)
3635

@@ -47,3 +46,4 @@
4746

4847
- 项目内对维护者用维护者的语言;GitHub 内容英文,照 SKILL.md 全体座位不变量。
4948
- 只在结果、阻塞或待裁决时向维护者汇报,与席位同规;例行进展进线程清单。
49+
- 转述线程 PR「无需你做」前自读其 `mergeable_state`;`dirty` ⇒ 退回线程先合 main,⛔ 不转述。

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
- 卡线程交回或其 PR 合入,席位当即告知 coordinator 释放槽位。
138138
- 档位与 effort 席位自推导 ⛔ 不等维护者原话:`--tier` 过路径,MANDATORY 即绑;effort 按难度。
139139
- 派发令写两者与推导(`--tier` 行或难度读数),协调者照令开线程;常设原话有则作 `reason:`。
140-
- 席位留认领文本、派发令、契约复核、ACCEPT 与落地;线程实施、开 draft PR、驱动 CI。
140+
- 席位留认领文本/派发令/契约复核/ACCEPT/落地;线程实施、开 draft PR、驱动 CI 与可合并。
141141
- 派发令由 coordinator 写进线程开场消息,`Writes:` 行逐字在内,⛔ 不落共享目录;卡上留指针。
142142
- coordinator 开线程即读线程分支交席位(读不到则线程自报);⛔ 线程不认领、不写 assignee。
143143
- 席位写 assignee+`pm:dispatched`+带该 `Branch:` 的认领;线程核对最新认领指向本分支方开工。

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153

154154
- 收集先扫 GitHub(各模式),标记评论在 = 报告完整;评论与返回消息皆无才进探活/判死。
155155
- 标记两种拼写等效(HTML 注释形、首行 `os-dev-report`);⛔ 永不把没收到失败通知读作还在跑。
156-
- 报告点名 PR ⇒ 会话席当即 `subscribe_pr_activity` 并记座位贴;中继开的 PR 永不自动挂会话。
156+
- 报告点名 PR ⇒ 会话席当即订阅、记座位贴,照落地 B 节看护;中继开的 PR 不自动挂会话。
157157
- ① Routine 席巡检首动作 `list_triggers` 确认 Routine 启用;项目席由事件与巡查 routine 唤醒。
158158
- ② Routine 席在飞期间主巡检间隔 ≤45 分钟,待命期 60–70;节奏维护者明示可改。
159159
- ③ 已派发未回报的 dev 逐个发状态询问;派发后 ~45 分钟无远程产出即到门槛。

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
- 该类仓的落地判据是已发布且探测通过,⛔ 不是 MERGED;跟到发布为止。
2323
- 合并后工作流不在 PR 检查清单上,读 PR 检查的规则对它全盲;按独立检查类登记分开读。
2424
- 人闸不是验证层的替代:答不了会不会坏的人闸只买延迟,⛔ 不以人闸代替探测。
25-
- 信任 suite/check 事件前先重读 PR 对象取 head:检查读数绑定该 head,⛔ 不绑事件带的 SHA。
2625
- 落地记账:座位贴落地清单即账本,逐轮即时记;确需全仓核对时首选 `head:claude/` 精确过滤。
2726
- 红/踢出处置在同一落地窗口内做:机器输入是 merge-queue triage workflow 的分诊评论。
2827
- 判据唯一来源是签名台账(锚点 issue),优先于现场判断;只有人工能升级台账。
@@ -54,7 +53,6 @@
5453
- CI success webhook 不可靠:⛔ 不坐等,也 ⛔ 不忙轮询;定点文本照定时器写法纪律。
5554
- undraft 撞 429 ⇒ 落地入等 `resets at` 态:该刻记卡,到点一次重试;⛔ 不报阻塞、不自定节奏。
5655
- 落地遭分类器拒 ⇒ 停手、报维护者、卡上记命令与拒因;⛔ 不换拼法、不退回 ccr 绕过。
57-
- 确认 MERGED 要两个读数:每轮同时读队列分支与 `origin/main`。
5856
- 落地评论 = 两个读数的探针表 + 一行状态变更(摘标/关卡/收口),⛔ 不复述 `## 席位核对`。
5957
- 契约复核 PASS 落地的 PR 到窗口时已 ready 且 auto-merge 在挂,见 `contract-review.md`。
6058
- 转 ready/入队前跑 `check-governed-merges.mjs --pr N`:受管面照两层;>3000 行(含生成物)照 Tier H。
@@ -74,6 +72,8 @@
7472
- 落地后再核一次落地判据本身:队列的合并同样走 os-regen,A 的静默吞并一样能发生。
7573
- MERGED 不是终点:发版后义务见 `release-aftercare.md`。
7674
- 会话席窗口内 PR 须在挂 `subscribe_pr_activity`,缺即补;⛔ 不早于报告,Routine 座位轮询。
75+
- PR 开出至 MERGED,每看一眼(唤醒/巡检/报告前)同读检查与 `mergeable_state`;`unknown` 即重读。
76+
- `dirty` ⇒ 当即合 `origin/main` 推新提交,⛔ 不等冲突通知;未见非 `dirty` ⛔ 不报无需你做。
7777
- MERGED 或关闭即退订,同刻把 `mode:cloud` 派的会话 `archive_session`。
7878
- 触发条件是卡终局且报告已收复核;⛔ 合并前不归档,误归档可 unarchive 但容器现场已失。
7979
- 暂停或交接时把在挂订阅清点进座位贴,⛔ 不留孤儿订阅。

0 commit comments

Comments
 (0)