Skip to content

Commit b43f451

Browse files
hotlongclaude
andauthored
docs(agents,pm-dispatch): bind a gate-union run to a commit — run it after the final commit and quote HEAD (#8550) (#8635)
The dev-seat contract said which gates to run and never when. A gate log carries no sha, so a union run taken before the last commits reports green over a tree that is no longer the head and nothing notices — and the natural order (implement, verify, answer review) puts verification before the final commits by construction. Ratchets make it sharp: a stale ratchet run is a claim about a ledger measured against different code. os-dev.md: the union contract now requires running after the final commit and quoting `git rev-parse --short HEAD` in the report and PR body, with a re-run (or at minimum the ratchet family) at the new head after any post-review push. Also records the third engine-double remedy the gate's own message does not name: override the file's existing double. review-checklist.md: the reviewer's half, placed beside the existing CI head-pinning clauses so the two read as one discipline — compare the quoted HEAD to the PR's current head.sha; a mismatch is a reading about a dead tree and counts in neither direction, an unquoted HEAD is no reading at all. Claude-Session: https://claude.ai/code/session_018WuTtyckQa1VcXwgd52JpN Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6cb81c7 commit b43f451

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

‎.claude/agents/os-dev.md‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ quote.
135135
- A new fake engine's `delete()` opens with `assertEngineDeleteDispatch(options)` from
136136
`@objectstack/objectql` — never a hand-mirrored id/multi check, which has exactly the hole
137137
`check:engine-double-contract` names. Copy one of the pinned fakes the gate lists on a
138-
green run.
138+
green run. Needing a double the file does not already have? The gate's message offers
139+
"pin the new one rather than raising it", but a third remedy it does not name is usually
140+
better: **override the file's existing double** instead of declaring a second one — then
141+
there is no new double to pin and no ledger to touch at all.
139142

140143
## Local verification scope — targeted gates locally, the full farm is CI's job
141144

@@ -156,6 +159,21 @@ reads the real gate-job conclusions after your report. ⛔ Not licence to skip t
156159
families — they are the cheap half you still owe; what you no longer owe is waiting for CI
157160
before reporting.
158161

162+
**Run the union AFTER your final commit, and quote `git rev-parse --short HEAD` from that
163+
run** — in the report's `tests` field and in the PR body, both. A gate log carries no sha,
164+
so a union run taken before the last commit reports green over a tree that is no longer the
165+
head and **nothing anywhere notices**: neither you re-reading your own transcript nor the
166+
PM reading the PR body can tell a covering run from a stale one, and the natural order
167+
(implement, verify, then answer review) puts the verification before the last commits by
168+
construction — so the failure lands hardest on the PRs that got the most review, which is
169+
the wrong way round. Ratchets are why this bites: a stale ordinary-lint run is usually
170+
still true, but a stale **ratchet** run is a claim about a ledger measured against
171+
different code, and the ratchets are precisely the gates a late commit moves. On any
172+
post-review push, re-run the union — or at minimum the ratchet family — at the new head
173+
**before** the report or the PR body is updated. An unquoted HEAD is not a small omission:
174+
it makes a green union unreviewable, so quote it even when the union and the final commit
175+
were obviously the same tree.
176+
159177
## Standard clauses live HERE, not in your dispatch prompt
160178

161179
The prompt carries only per-card deltas (ruling quotes, the 裁决 / PM-机制假设partition,

‎.claude/skills/pm-dispatch/references/review-checklist.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@
5050
`head_sha` —— 不一致的 run 是关于一个死提交的读数,绿与红**双向都不入账**:旧
5151
head 的绿会把「新推送未验」读成「消费者干净」,旧 head 的红会把当前 head 已修
5252
掉的缺陷重新挂回 PR。
53+
- **dev 本地跑的门禁并集,同样先钉 head —— 同一条纪律,不是第二条**:dev 的契约
54+
要求在**最后一次提交之后**跑并集,并把那一跑的 `git rev-parse --short HEAD` 抄
55+
进报告与 PR 正文;复核就读这个 HEAD 与 PR 当前 `head.sha` 比一次。对不上 ⇒ 那
56+
份「本地全绿」是关于一棵死树的读数,与上一条同理**双向都不入账**;正文没抄
57+
HEAD ⇒ 按**没有读数**处理(既不是绿也不是红),以门禁 job 结论为准。门禁日志不
58+
带 sha,所以这个抄写是唯一能把一次绿绑到一棵树上的东西 —— 而复核轮之后又推了提
59+
交、报告里的 HEAD 却没跟着动,正是它要抓的那一形:补跑并集(至少棘轮族)再更报
60+
告,棘轮恰恰是最后一次提交会动的那一族。
5361
- **被取代 head 上的 run 永不重跑**:非当前 head 上的 `cancelled` 结论零动作 ——
5462
新推送自带全套 run。重跑烧掉一整个重量级周期,还能忠实复现一个已被当前 head 修
5563
掉的缺陷、给绿 PR 挂上假红;实测两次误重跑都源于读到 `cancelled` 没先比对

0 commit comments

Comments
 (0)