Repository navigation
Commit 03de83b
docs(pm-dispatch): card-thread backend (mode:thread), coordinator scheduling and per-card dispatch effort (#25214)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg9z6YdKhg4XiDHyZQgU6TJV)_
Fixes #25185
Clause-②: no
Metadata-protocol: none
## What changed
Four `.claude/**` files, 29 insertions and 26 deletions by GitHub's
count, no code.
1. **A third dispatch backend, `mode:thread`** — `SKILL.md` args table
(`mode:` row and the `batch:` row, which now counts card threads), the
claim template's `Container & model:` line, `os-dev.md`'s "GitHub is the
report's source of truth under every mode" line, and a new section
〈卡线程(`mode:thread`)〉 in `references/dispatch-runbook.md` beside the
`mode:cloud` section. The rules it carries, each from the maintainer's
words quoted on the card:
- A seat whose session is a project thread dispatches M and up,
`priority:p1` and `security` cards as one thread per card; S-class
mechanical cards stay an in-seat subagent (a thread re-clones and
re-reads the skill first); a card under the disclosure ruling (record
5323310017) stays in-seat too; a card thread counts against `batch`.
- The project's coordinator schedules card threads across every seat, p1
first, under a project-wide cap equal to the sum of the seats' `batch`
terms; seats hand it candidates at any time with priority, order file
and suggested effort, and tell it when a thread hands back or its PR
merges.
- The seat keeps the claim, the assignee, the order, the contract
review, ACCEPT and landing; the thread implements, opens the draft PR
and drives CI. The order lives in the project's shared folder
(`/mnt/project-files/`, one `dispatch-N.md` per card under the seat's
folder). Claim mechanics changed after the first contract review (record
6341183860): the thread's first act is to report its designated push
branch to the seat and wait; the seat writes the assignee and
`pm:dispatched`, then posts the Claim carrying that `Branch:`, in
AGENTS.md's order; the thread starts only after that, posts no claim and
never writes the assignee. `claude/issue-N-slug` remains the branch
convention; a project-thread session can push only its own designated
branch (measured: the session's harness names that branch and forbids
any other), so the claim records that branch as the platform exception.
The coordinator sets a thread's model and effort only on the
maintainer's explicit word, so the seat attaches that message.
- Environment notes, one line each: the worktree is still built (the
main-checkout hooks block edits in the primary checkout); the repo's
`.claude/agents` types did not load in a project thread (measured), so
the thread reads `os-dev.md`; container restarts kill local background
loops, so the seat waits on server-side signals.
2. **Dispatch effort by difficulty** — two lines in
`references/execution-duties.md` 〈派发〉 and the `effort:` field in the
claim template: effort is chosen per card beside the model tier, written
into the claim and the order and passed explicitly, never left unset.
Grading as the card proposed, unchanged by measurement: S mechanical
`medium`; M `high` (the default); L/XL, `security`, p1, the contract
review and four-axis analysis `xhigh`; `max` only when the maintainer
names it. The card's `Container & model:` reader
(`readContainerModelLine`) still reads the `model:` slot with the new
field present; this PR's own claim (comment 6335635315) carries the new
shape and passed `post-stamped`.
The maintainer's words, verbatim and untranslated, as the card quotes
them: 「你能识别到在项目的环境下工作吗?此时就每张卡开新线程。」 · 「立一张卡,修改 skills,包括派任务时要求根据任务的难度来选择
effort」 · 「还是需要你来总体调度,因为要优先派 p1」 · 「规则类的应该进仓库」 · on the S/M boundary
「同意」. The ruling-thread rule left this PR after the first contract
review; it is card #25216.
## How the line ratchet was paid
`check:pm-skill-ratchet` holds every file here at a shrink-only ceiling.
The new text needed +17 lines in `dispatch-runbook.md` and +2 in
`execution-duties.md`. The maintainer left the choice (「你自己决定 :抬上限 /
删旧内容 / 压缩」) and the spec seat preferred deletion, so **no ceiling
moved**: both files land exactly at their ceilings (241 and 188) by
deleting lines whose rule is already stated in another file of the same
corpus. Reviewers, each deletion with the surviving home of its rule:
`dispatch-runbook.md` (16 deleted, 2 merged into 1):
- 「种子与消费者注记在 `ensure-pm-labels.sh`」 → SKILL.md 〈机械守卫索引〉 names that
script as the authority.
- 「机械年龄告警在半状态巡查脚本」 → SKILL.md 〈机械守卫索引〉 `check-half-states.mjs` row.
- 「⛔ 不设第二个标签区分维护者裁与座位定级」 → `state-machine.md` (the hold-comment line).
- 「每批约定:≤5 张同族卡、同上下文逐张读」 → SKILL.md 〈入口与角色〉 「批 = …≤5 张同族卡」.
- 「在飞认领照认领协议由原认领者跟完」 → `seat-post-protocol.md` (subtree reclaim) and
SKILL.md 状态模型 「在飞卡跟到 MERGED」.
- 「第三读数(…)出自车道盘点」 → `seat-lifecycle.md` 读数三.
- 「机械半边:旗标由半状态巡查 report-only 浮出…」 → the same file's 〈落卡与裁决记录细则〉 「机械两旗
report-only,归半状态巡查」 line, kept.
- 「终报以 issue 评论交付,带 `os-dev-report` 标记」 → `os-dev.md` lines 17–18.
- 「生产侧条款在 os-dev 定义」 → a pointer with no rule of its own.
- 「重放形态可以完全正常…monitor 按自己的 deadline 触发」 → `os-dev.md` 〈干净收尾〉 item 1; the
identity triple that follows it is kept.
- 「抢先翻 ready 会撞上 agent 的收尾推送,故先探活后翻」 → `execution-duties.md` 〈收集〉 「先探活后翻
ready」.
- 「推分支 → 开 draft PR → 立即交报告的契约住 os-dev 定义」 → `os-dev.md` Definition of
done; 「派发令只带增量」 → `execution-duties.md` 〈派发〉.
- 「三分区各自的 dev 义务单源见 SKILL.md 与 os-dev 定义,派发词 ⛔ 不复述」 →
`execution-duties.md` 「标准非协商条款 ⛔ 不抄进派发词」.
- 「模型标识只禁内容工件…」 and 「豁免:`.claude/agents/*` frontmatter 的 `model:`」 →
AGENTS.md (commit-message paragraph of Multi-agent discipline),
`os-dev.md` 285–286 and its frontmatter comment, `execution-duties.md`
「解析顺序…以 os-dev 定义 frontmatter 注释为权威」.
- 「⛔ 仓内任何文件不得另立第三份,`check:skill-frame-sync` 全树扫;os-dev 定义没带就停下索取」 →
`os-dev.md` 356–357 and SKILL.md 〈机械守卫索引〉 `check:skill-frame-sync` row.
- Merged: 「四轴框架块…整段现取现粘」 + 「该块自黑体句起、至推荐约束句止,整段逐字粘贴」 → one line carrying
both bounds and the verbatim rule.
`execution-duties.md` (2 deleted):
- 「每条工作项写进派发令时都是 dev 首先证伪的前提」 → `os-dev.md` rule 6 (the dev verifies
every premise regardless), and the same section's 「标准非协商条款 ⛔ 不抄进派发词」
says not to restate it in the order.
- 「云会话 `SendMessage` not-reachable 是设计非故障,⛔ 不复测」 → `dispatch-runbook.md`
〈云卡四课〉 「roster 不可达与 `SendMessage` 同裁,`ListAgents` 同列不到,⛔ 不复测」, kept.
Every line added or edited is at most 120 bytes (the ratchet's max-line
rule); the four-axis frame was not touched (`check:skill-frame-sync` and
`check:skill-frame-freshness` green).
## Landing and the claim's model line
- `.claude/**` is **Tier S** under AGENTS.md Prime Directive 14, not a
human merge as the card's first sentence says: the owning seat lands
this PR after a `## Contract review` record for its head with
`Served-tier: CONTRACT_REVIEW_TIER` and a PASS verdict, plus all-green
checks. The PR stays a draft until then.
- The claim's `Container & model:` line says `model: default`;
`dispatch-gates --tier` prints MANDATORY `CONTRACT_REVIEW_TIER` for
`SKILL.md` and `os-dev.md`. The seat corrected this mid-card: the
maintainer switched this thread to that tier (「切换到 fable」, 08:08Z) and
the whole diff was re-read at it before this PR opened; that re-read
found and fixed one contradiction in the `mode:` row (S+M ⇒ subagent
against M+ ⇒ thread; now 「席位是项目线程时 M 及以上、p1、`security` 一律 `thread`」).
## Open questions for the contract review (settled in round 2)
1. AGENTS.md's 「the dispatch posts the `Claim:`」: settled. The seat
posts the claim and writes the assignee; the thread posts neither. This
card's own round-1 claim and assignee were written by the thread under
the round-1 order, before this rule existed; they stand as the record.
2. SKILL.md 红线 「⛔ GitHub 之外永不维护任何跟踪状态」: a card that waits for a
coordinator slot is not yet claimed (the claim needs the thread's
branch), so its only GitHub trace is its `pm:queue` label and priority.
The coordinator's queue is a view derived from those labels and
rebuildable from GitHub at any time; the order files are inputs, not
state. Once a thread opens, the card carries assignee, `pm:dispatched`
and the Claim like any other dispatch.
3. The ruling-thread line: dropped from this PR; card #25216 carries the
maintainer's word and has to be reconciled with 「总监席是唯一裁决者」 there.
4. The branch name: `claude/issue-N-slug` stays the convention; the
designated thread branch is recorded as the measured platform exception.
The Duplicate Fix Guard is advisory. Whether AGENTS.md §2 itself should
name the exception is a Tier H question the seat has taken to the
maintainer; this PR touches no Tier H file.
## Gates
Round 2, head e704856: `dispatch-gates --commands --repo
objectstack-ai/objectstack` derived the same 22 families, each run with
its exit code captured before any pipe, all 22 exit 0; `--ran` 22/22, 0
NOT-MEASURED. `check:skill-frame-freshness` and `check:pm-skill-ratchet`
exit 0 (`dispatch-runbook.md` 240/241, `execution-duties.md` 188/188,
`SKILL.md` 319/319, `os-dev.md` 404/404). Round 1 at b301b37: the same
22, all 0; `check:doc-formula-expressions` first exited 3 (unbuilt
`@objectstack/lint`), rebuilt under the verify lock and re-run to 0.
CI's remaining families are the PR's check-runs. No published package
moved (`.claude/**` is a fast-track non-published path), so
`skip-changeset` rides this PR's create.
## 维护者速读(草稿)
**改了什么:** pm-dispatch 技能加了第三种派发后端 `mode:thread`:席位在项目线程里跑时,M
及以上、p1、security 的卡每张开一个线程,由 coordinator 跨席位按 p1 优先统一调度,总并发 = 各席 batch
之和;S 级机械小改仍用席内子 agent。派单按难度选 effort(S medium、M
high、L/XL/p1/security/契约复核/四轴 xhigh、max 只凭你点名)。认领与 assignee
仍由席位写,线程先报分支再开工。行数上限没动,用删掉 18 条已在别处写明的旧规则抵账。
**为什么改:** 你 10-22 在项目里定的这几条规则(「规则类的应该进仓库」)。
**风险与代价(含回滚):** 纯规则文本,不碰代码与门禁;回滚即 revert 本 PR。AGENTS.md §2
的分支约定是否要写明项目线程的例外,属 H 档,席位已另报给你。
**席位意见:**
**你要做的:** 无;`.claude/**` 是 Tier S,席位做完契约复核后自行落地。
## Acceptance notes
- The dispatch order's claim template carried `Thread-read: none (no
comments yet)`; `post-stamped` refuses that spelling (H50 compares it
for equality against one id or `none`). The seat has already corrected
its template; noted here, not filed.
- The dispatch order said the PR body starts with the attribution block
linking the seat thread; the session's own attribution requirement names
this card thread. This body follows the session's requirement; the
deviation from the order is reported in the `os-dev-report`.
- The attribution block's first line is an HTML comment the session
requires as the body's first line; `os-dev.md` 〈干净收尾〉 forbids HTML
comments in GitHub text. Measured on an earlier card thread's PR, the
relay read-back keeps it byte for byte. Reported as a deviation, not
hidden.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01NVBPkGXNnJayvXnCjcXpFb)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3a440b0 commit 03de83b
4 files changed
Lines changed: 28 additions & 26 deletions
File tree
- .claude
- agents
- skills/pm-dispatch
- references
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
| 325 | + | |
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
23 | | - | |
24 | 21 | | |
25 | 22 | | |
26 | | - | |
27 | 23 | | |
28 | 24 | | |
29 | 25 | | |
| |||
48 | 44 | | |
49 | 45 | | |
50 | 46 | | |
51 | | - | |
52 | 47 | | |
53 | 48 | | |
54 | 49 | | |
| |||
58 | 53 | | |
59 | 54 | | |
60 | 55 | | |
61 | | - | |
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
| |||
110 | 104 | | |
111 | 105 | | |
112 | 106 | | |
113 | | - | |
114 | 107 | | |
115 | 108 | | |
116 | 109 | | |
| |||
122 | 115 | | |
123 | 116 | | |
124 | 117 | | |
125 | | - | |
126 | 118 | | |
127 | 119 | | |
128 | 120 | | |
| |||
134 | 126 | | |
135 | 127 | | |
136 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
137 | 148 | | |
138 | 149 | | |
139 | 150 | | |
| |||
168 | 179 | | |
169 | 180 | | |
170 | 181 | | |
171 | | - | |
172 | 182 | | |
173 | 183 | | |
174 | 184 | | |
175 | | - | |
176 | 185 | | |
177 | 186 | | |
178 | 187 | | |
179 | 188 | | |
180 | 189 | | |
181 | 190 | | |
182 | 191 | | |
183 | | - | |
184 | | - | |
185 | 192 | | |
186 | 193 | | |
187 | 194 | | |
188 | | - | |
189 | 195 | | |
190 | 196 | | |
191 | 197 | | |
| |||
201 | 207 | | |
202 | 208 | | |
203 | 209 | | |
204 | | - | |
205 | | - | |
| 210 | + | |
206 | 211 | | |
207 | | - | |
208 | 212 | | |
209 | 213 | | |
210 | 214 | | |
211 | | - | |
212 | | - | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
90 | 89 | | |
91 | 90 | | |
92 | 91 | | |
93 | | - | |
| 92 | + | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
| |||
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
| 118 | + | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
0 commit comments