Skip to content

Commit 1b3e22f

Browse files
pm-dispatch: a pending-changeset correction is confirmed by the dispatching seat's record, never by a maintainer wait (#30845)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoX8nvRQff2oqQnbG7NKDgZ8)_ Fixes #30271 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:`check-empty-changeset` 的 DELIBERATE CORRECTION 补救句现在点名由谁确认:派发席自己的记录(纯文字 diff 用 ACCEPT,其余用同 head 达档契约复审 PASS,出处 `landing-operations.md`),⛔ 不等维护者;dev 侧(`os-dev.md`)改为在 PR 正文申报 DELIBERATE CORRECTION、逐 note 引改后句、不请维护者确认;`execution-duties.md` 那行改为指向唯一成文处。判决不变:该类照旧拒收。 - 为什么改:规则早就在 `landing-operations.md`,但 dev 与门禁实际读到的文字只说「get it confirmed」不说由谁,本周三张安全修复 PR 在正文里请维护者确认,席位等到维护者答复才落地。维护者已说「changeset 改写确认都同意」;本 PR 只是把既有规则写进读者会看到的那几行。 - 风险与回滚:只改门禁的补救文案与其自测断言、两份内部指令文本;不改任何判决、schema 或运行时。回滚即 revert。 - 先看:`scripts/check-empty-changeset.mjs`(常量 `FOREIGN_CORRECTION_REMEDY` 与 `reportForeign` 的 DELIBERATE CORRECTION 段)、`.claude/agents/os-dev.md` L300–301(新两行,付账删原 L100)、`.claude/skills/pm-dispatch/references/execution-duties.md` L180。 - 两分钟验证:`node scripts/check-empty-changeset.mjs --self-test`,预期末行 `✓ check-empty-changeset --self-test: 167 assertions …`;`pnpm check:pm-skill-ratchet` 预期全绿且 `os-dev.md is 405 lines (ceiling 405; headroom 0)`。 - 需要你做的:无,席位落地(Tier S:`.claude/**` 加非受管脚本)。 ## What changes **`scripts/check-empty-changeset.mjs`** (card item 1 — the gate's remedy line) - `FOREIGN_CORRECTION_REMEDY` now names the confirmer by pointing at the record that confirms: "do NOT restore it -- declare the DELIBERATE CORRECTION on the PR, naming each note; the dispatching seat confirms it by its own record (its ACCEPT, or its same-head at-tier contract-review PASS: pm-dispatch references/landing-operations.md), never a maintainer wait". The one-source / two-renderings construction is untouched: the constant is still interpolated into `FOREIGN_TWO_CLASS_LINES`, which the body renders as indented lines and the `::error` annotation as one line, and the equality pin still reads the block back out of the rendered body. - The DELIBERATE CORRECTION paragraph of `reportForeign` says the same in prose (declare it, name each note, quote the corrected sentences; the dispatching seat confirms by ACCEPT or same-head at-tier PASS; do not ask the maintainer and do not wait) and keeps "this gate stays red either way". - The constant's docblock and the header's two-class table say why the confirmer is named. - **Verdict unchanged.** `scanForeign`, `--diff-filter=MD`, `--no-renames`, the merge-base derivation and both exemptions are not touched; the "D strength" fixture (a PR that adds its own changeset and rewrites a foreign one) is still refused by name. - Self-test kept in step: the routing assertion now looks for "the dispatching seat, by its own record" instead of "get it confirmed"; two assertions are added (the remedy carries the confirmer and `references/landing-operations.md`; the body says "Do not ask the maintainer to confirm it"); the D battery's floor moves 12 → 14 to match. **`.claude/agents/os-dev.md`** (card item 2 — the dev's side; the PR-body duties live here, under 「Definition of done」) - L300–301 replace the one line 「PR 改到已有的 `.changeset/*.md`:… 确认走 PR 文字。」 with two: the dev declares the DELIBERATE CORRECTION in the PR body, names each note and quotes the corrected sentences, and ⛔ does not ask the maintainer to confirm — the dispatching seat's record confirms (`landing-operations.md`). - Paid by deleting the former 资源纪律 item 5 「⛔ 永不按进程名杀(`pkill -f` …);记下你启动的 PID,只对它操作。」, which restates AGENTS.md › Multi-agent working discipline §8 word for word and is hook-enforced by `.claude/hooks/guard-process-kill.sh`; os-dev.md's own charter (L21) keeps only clauses a hook cannot enforce. Items 6 and 7 renumber to 5 and 6; nothing references them by number. 405 lines before and after, ceiling 405. **`.claude/skills/pm-dispatch/references/execution-duties.md`** (one home per rule) - L180 no longer restates the confirmation ("同 head 达档 PASS 或维护者原话") beside the home; it points at `landing-operations.md` and says the confirmation is the dispatching seat's own record. 188 lines before and after. **`.claude/skills/pm-dispatch/references/landing-operations.md`** — not changed: it is the rule's home (L14–17) and already says ⛔ 不等维护者, ACCEPT for a text-only diff, same-head at-tier PASS otherwise. ## Why The rule existed only where the seat reads it. The two texts a dev and the gate actually meet said "get it confirmed" with no confirmer, so devs wrote "please confirm" to the maintainer in PR bodies and the seat held the landings. The maintainer's 「changeset 改写确认都同意」 restates the rule; this PR moves the wording, not the verdict. ## Tests - `node scripts/check-empty-changeset.mjs --self-test` at `b297730a`: `✓ check-empty-changeset --self-test: 167 assertions over real temp git repos (real scan() path)`, exit 0 (the D battery registers 14 cases against its floor of 14). - `node scripts/check-empty-changeset.mjs --base origin/main`: exit 0 on this branch (it adds no changeset and changes none). - No ablation: the diff changes refusal text and instruction text, which the ablation rule excludes (配置、脚本、workflow、文档 ⛔ 不消融). ## Verification Derived at `b297730a` with `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` — 43 commands (17 direct node, 26 pnpm); each run in the foreground with stdin from /dev/null, its exit code landed on disk before any pipe, then reconciled: `✓ dispatch-gates --ran: 43 derived famil(ies) accounted for — 43 run, 0 NOT-MEASURED`. **All 43 exit 0 at `b297730a`.** The ran-list is at `skills-seat-2/r2026-11-06/out/30271-gates-ran-b297730a.list` in the project files. Two readings from the first sweep at `a566bb6d`, both resolved before the final sweep: `pnpm --filter @objectstack/lint run check:doc-formula-expressions` exited 3 (prerequisite: `@objectstack/formula` and `@objectstack/lint` not built in a fresh worktree; built under the verify lock, rerun exit 0 — not a finding), and `pnpm check:pm-skill-ratchet` exited 1 on the 120-byte line budget (os-dev.md L300–301 at 129B/132B, execution-duties.md L180 at 138B; shortened in `05ae6a85` and `b297730a`, rerun exit 0, every ceiling still at headroom 0). Not run locally, CI's own: `pnpm lint` (repo-wide eslint), `test:repo`, the type-check lanes, the 8 whole-tree families and the 11 wide-population families the derivation names; the PR's check-runs are the reading for those. Families named only when a changeset exists (7): not applicable, this PR carries `skip-changeset`. <details> <summary>The 43 derived commands with their exit codes at b297730</summary> - `node scripts/check-closing-keyword-parity.mjs :: exit 0` - `node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0` - `node scripts/check-comment-mask-corpus.mjs :: exit 0` - `node scripts/check-declaration-mirrors.mjs :: exit 0` - `node scripts/check-declaration-mirrors.mjs --self-test :: exit 0` - `node scripts/check-empty-changeset.mjs --base origin/main :: exit 0` - `node scripts/check-empty-changeset.mjs --self-test :: exit 0` - `node scripts/check-self-test-wired.mjs :: exit 0` - `node scripts/check-self-test-wired.mjs --self-test :: exit 0` - `node scripts/check-self-test-workflow-commands.mjs :: exit 0` - `node scripts/check-self-test-workflow-commands.mjs --self-test :: exit 0` - `node scripts/check-whole-set-label-write.mjs :: exit 0` - `node scripts/check-whole-set-label-write.mjs --self-test :: exit 0` - `node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0` - `node scripts/pm/bare-root-worklist.mjs --self-test :: exit 0` - `node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0` - `node scripts/pm/check-harness-current.mjs --self-test :: exit 0` - `pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0` - `pnpm check:agent-model-declared :: exit 0` - `pnpm check:agent-test-spelling :: exit 0` - `pnpm check:bash32-floor :: exit 0` - `pnpm check:changeset-gate-self-tests :: exit 0` - `pnpm check:ci-filter-parity :: exit 0` - `pnpm check:cli-command-ids :: exit 0` - `pnpm check:commit-card-trailers :: exit 0` - `pnpm check:cross-package-test-inputs :: exit 0` - `pnpm check:doc-authoring :: exit 0` - `pnpm check:driver-memory-census :: exit 0` - `pnpm check:entry-guard :: exit 0` - `pnpm check:gitlink-declared :: exit 0` - `pnpm check:nul-bytes :: exit 0` - `pnpm check:parse-guard :: exit 0` - `pnpm check:pm-dispatch-gates :: exit 0` - `pnpm check:pm-governed-merges :: exit 0` - `pnpm check:pm-skill-id-lint :: exit 0` - `pnpm check:pm-skill-ratchet :: exit 0` - `pnpm check:pnpm-filter-targets :: exit 0` - `pnpm check:pnpm-flag-spellings :: exit 0` - `pnpm check:ratchet-remedy-authority :: exit 0` - `pnpm check:refd-timer-probe :: exit 0` - `pnpm check:scripts-symbol-anchors :: exit 0` - `pnpm check:skill-frame-sync :: exit 0` - `pnpm check:watch-hint-literal :: exit 0` </details> ## Acceptance notes - **Card item 3 (security-fix PR bodies never narrate pre-fix behaviour) is deferred from this push on the seat's instruction.** Its home is `references/security-findings.md` §6, and seat 1's #30114 (branch `claude/project-thread-shi9ig`) rewrites the very line this edit would delete to pay for the addition and adds a §6 line of its own. Plan agreed with the seat: once #30114 merges, merge `origin/main` here and add the §6 line, paid by a deletion #30114 left alone, as its own commit on this PR. The exact line and payment were named to the seat before any edit. - **Residue, outside this card's surface (workflows):** `.github/workflows/pr-automation.yml` route 0 (the "This PR adds no changeset" message, near L727) still says "get it confirmed there in writing" and "the approver merges over it" without naming the confirmer. Left as is per the seat; a workflow edit is Tier H and not this card. - `skip-changeset`: the root package is `private: true` and `.claude/**` is on the no-publish fast track, so this PR releases nothing; the label is declared in the `pr_create` action. - The relay's `pr_create` carries no assignee and no reviewer by design; the harness's assignee/reviewer step is skipped (no GitHub MCP write tools were used). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No schema touched.) - [x] 2. Every name I added uses the casing for its kind. (No new identifier.) - [x] 3. No formatter ran; `pnpm lint` is CI's run. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset — this one publishes nothing (`skip-changeset`); both declaration lines are at the top. - [x] 6. `packages/spec` 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 (the 维护者速读 block is the repo's own Chinese form). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibxpHybSfTtRNdGnUZZ)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ebe0a98 commit 1b3e22f

4 files changed

Lines changed: 35 additions & 14 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,12 @@ model: opus
9797
4. **清理是任务的一步**:PR 开出后 `rm -rf <path>/node_modules && git worktree remove <path>`。
9898
- ⛔ 永不上来就 `--force`:拒绝移除说明有东西没提交,那是本容器未提交工作的唯一守卫。
9999
- 可能是你没推的工作,或路径打错敲进了别的 agent 的活 worktree;先去那里读 `git status`。
100-
5. ⛔ 永不按进程名杀(`pkill -f` 会带走并行 agent 的运行);记下你启动的 PID,只对它操作。
101-
6. **整条流水线在前台跑。** build 与 test 都是本任务的步骤:阻塞运行、读真实输出、继续。
100+
5. **整条流水线在前台跑。** build 与 test 都是本任务的步骤:阻塞运行、读真实输出、继续。
102101
- 宿主事实:你启动的后台作业、watcher、你请求的通知都不会唤醒你;结束一轮就是结束。
103102
- 每个可编译小步即 commit + push;有可展示内容即开 draft PR;接管只认远程分支最后 sha。
104103
- 带具名缺口的 PR 是交付进行中的常态,未读到的判决写 `NOT MEASURED: <family>, reason: …`。
105104
- 平台事实:容器把前台命令钉在约 10 分钟上限,超时 SIGTERM 杀掉(`exit 143`)。
106-
7. **排队不是停摆,在轮内主动等。** 持锁的是你不拥有的进程,其完成同样不会唤醒你。
105+
6. **排队不是停摆,在轮内主动等。** 持锁的是你不拥有的进程,其完成同样不会唤醒你。
107106
- 99 专指没排到,读作 NOT MEASURED;把间隔花在无锁工作上(写测试、changeset、PR 正文)。
108107
- 再取以同名续位,⛔ 不从队尾重排:`OS_VERIFY_LOCK_SLOT=<稳定名>` 在第一次尝试前就设好。
109108
- 没排到的调用把排位寄存,同名再来续原到达戳;不设它,每次离开都从队尾重排。
@@ -298,7 +297,8 @@ model: opus
298297
- 发布面动了要 changeset;`skip-changeset` 判据是没动:已发布 = 各包 `files[]` 实际发运内容。
299298
- 快速通道:`docs/adr/**` · `.claude/**` · `scripts/pm/**` · 仓根配置 · 私有包 · 注释,不发布。
300299
- 其余实测:构建后 grep `files[]` 所列路径找符号,带正控;符号零命中、正控命中 ⇒ 不发布。
301-
- PR 改到已有的 `.changeset/*.md`:⛔ 永不打 `skip-changeset`,门禁红着是对的,确认走 PR 文字。
300+
- 改已有 `.changeset/*.md`:⛔ 永不打 `skip-changeset`,红着是对的;正文申报 DELIBERATE CORRECTION。
301+
- 逐 note 点名并引改后句;⛔ 不请维护者确认,确认件是派发席记录(`landing-operations.md`)。
302302
- objectstack:`skip-changeset` 以 `pr_create` 的 `labels` 同笔申报;后发现的标签才走 `label-write.mjs`。
303303
- 范围 = 派发词点名的标签 + 上文判据下的 `skip-changeset`;禁写或交集为空 ⇒ 零写并报告。
304304
- 该腿的回读是中继回报的行:答案须列出每个送出的标签,缺者该笔 FAILED、不发后续动作。

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

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

178178
- 你是记录在案的复核人:对 GitHub 核验,⛔ 不对报告的自述核验。
179179
- 逐项判据展开在 `references/review-checklist.md`,每份报告对着它过。
180-
- 改到已有 `.changeset/*.md` 的 PR ⛔ 不打 `skip-changeset`;确认取同 head 达档 PASS 或维护者原话。
180+
- PR 改已有 `.changeset/*.md` ⛔ 不打 `skip-changeset`;确认件只认派发席记录(`landing-operations.md`)。
181181
- 绿色输出≠ 该绿证明了被测风险:拒收断言、全绿方向与时序、pin 翻转、边界后收益。
182182
- 触 `skills/**` 的 PR 加问整包价值密度:从整包加载的客户 agent 座位读,⛔ 不从作者座位读。
183183
- 超派发预算或小功能大扩写 ⇒ REWORK,⛔ 不因已经写好了放行。

‎.claude/skills/pm-dispatch/references/security-findings.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737

3838
- dev 把安全发现只写进终报私有字段 `security_findings`,⛔ 不进 `out_of_scope_findings`。
3939
- 报告评论里该字段只写 `withheld` 或 `none`。
40-
- 席位在会话与公告里处理它(第 3 节),⛔ 永不当 `out_of_scope_findings` 立卡。
4140

4241
## 6. 修复 PR
4342

4443
- 标题、正文与 changeset 只写加固规则,形如 「the door reads in the caller's scope first」。
44+
- 正文、验证、消融只写规则与计数(红、后复原);未守卫代码做什么只进 `security_findings`。
4545
- 契约复核记录停在规则层;机制只进复核者本地的 `security-note.md`,⛔ 不提交。
4646
- 修复要定契约的,交维护者。
4747

‎scripts/check-empty-changeset.mjs‎

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
// opposite (#18160, ruling D on #17712, 2026-09-14):
125125
//
126126
// COLLISION -> rename yours; restore theirs from base
127-
// DELIBERATE CORRECTION -> do NOT restore it; get it confirmed on the PR
127+
// DELIBERATE CORRECTION -> do NOT restore it; declare it on the PR, the seat's record confirms
128128
//
129129
// The second class is a PR that changed behaviour a PENDING release note
130130
// describes and corrected that note in the same stroke. It is refused exactly as
@@ -547,8 +547,17 @@ export const FOREIGN_REMEDY = 'rename yours; restore theirs from base';
547547
* `sum` / `avg` / `min` / `max` and rewrites
548548
* `.changeset/aggregate-field-type-compatibility.md`, whose base text stated
549549
* booleans were refused for exactly those four aggregates.
550+
*
551+
* The remedy NAMES the confirmer, by pointing at the record that confirms. A
552+
* remedy that only said "get it confirmed" sent devs to ask the maintainer in
553+
* the PR body and seats to hold the landing until the maintainer answered,
554+
* while the rule already placed the confirmation with the dispatching seat's
555+
* own record (pm-dispatch references/landing-operations.md): its ACCEPT for a
556+
* text-only diff, otherwise its same-head at-tier contract-review PASS. The
557+
* verdict is unchanged; only the way out is spelled so nobody waits.
550558
*/
551-
export const FOREIGN_CORRECTION_REMEDY = 'do NOT restore it -- say so on the PR and get it confirmed';
559+
export const FOREIGN_CORRECTION_REMEDY =
560+
'do NOT restore it -- declare the DELIBERATE CORRECTION on the PR, naming each note; the dispatching seat confirms it by its own record (its ACCEPT, or its same-head at-tier contract-review PASS: pm-dispatch references/landing-operations.md), never a maintainer wait';
552561

553562
// ONE source for the two-class remedy, rendered TWICE: as indented lines in the
554563
// human body, and joined into the single line a `::error` annotation has to be.
@@ -606,10 +615,13 @@ function reportForeign(rows) {
606615
'above is the one thing not to do: the note you rewrote describes behaviour THIS PR',
607616
'changed, so restoring it from the base republishes a sentence that is now false, and',
608617
'no label and no diff shape makes that safe. Correcting a pending release note is a',
609-
'decision about a release rather than a refactor -- say so on the PR, naming the note',
610-
'and what changed under it, and get it confirmed. That is the existing human path;',
611-
'this gate stays red either way, and staying red is what puts the decision in front of',
612-
'a person instead of routing around it.',
618+
'decision about a release rather than a refactor -- declare it on the PR as a',
619+
'DELIBERATE CORRECTION, naming each note and quoting the corrected sentences. Who',
620+
'confirms it is the dispatching seat, by its own record: its ACCEPT for a text-only',
621+
'diff, otherwise its same-head at-tier contract-review PASS (pm-dispatch',
622+
'references/landing-operations.md). Do not ask the maintainer to confirm it, and do',
623+
'not wait for one; this gate stays red either way, and staying red is what puts the',
624+
'correction in front of that record instead of routing around it.',
613625
].join('\n'),
614626
);
615627
for (const { file } of rows) {
@@ -688,7 +700,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
688700
'#6129: main drift must not move the verdict, in EITHER direction': 6,
689701
'#6129, the other half: a base branch that DELETES': 2,
690702
"A' (#17712): a changeset the PR did not add is neither modified nor deleted": 29,
691-
'D (#18160): the refusal names BOTH classes, body and annotation pinned equal': 12,
703+
'D (#18160): the refusal names BOTH classes, body and annotation pinned equal': 14,
692704
'#4690, one step later: no merge base at all is a failure': 1,
693705
'The consumer: this gate\'s own CI step (#6129)': 34,
694706
'The second consumer: where THIS SELF-TEST runs (#6509)': 12,
@@ -1454,9 +1466,18 @@ function selfTest() {
14541466
'D two-class: the body names the second class in the ruling\'s own terms, not as a generic caveat',
14551467
);
14561468
assert(
1457-
text.includes('there is no second command to run') && text.includes('get it confirmed'),
1469+
text.includes('there is no second command to run') && text.includes('the dispatching seat, by its own record'),
14581470
'D two-class: the second class is ROUTED to the confirmation path rather than to the restore',
14591471
);
1472+
assert(
1473+
FOREIGN_CORRECTION_REMEDY.includes('the dispatching seat confirms it by its own record')
1474+
&& FOREIGN_CORRECTION_REMEDY.includes('references/landing-operations.md'),
1475+
'D two-class: the remedy NAMES the confirmer by pointing at the record that confirms -- "get it confirmed" with no confirmer sent devs to the maintainer',
1476+
);
1477+
assert(
1478+
text.includes('Do not ask the maintainer to confirm it'),
1479+
'D two-class: the body says in words that the maintainer is not the confirmer -- the wait this remedy exists to end',
1480+
);
14601481

14611482
// The equality pin, taken against the REAL rendered body.
14621483
{

0 commit comments

Comments
 (0)