From 0f2acde51f1cd83bc265914eb4680cf85308cd79 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 10 Sep 2026 10:50:24 +0000 Subject: [PATCH 1/3] docs(agents): scope the force-push ban to shared branches, with five unshared criteria Multi-agent discipline section 3 said never force-push, unconditionally, while its own rationale (a parallel agent's work) was scoped to shared branches, and the partof-closing-keyword gate's RULE 2 can only be satisfied by rewriting a commit message. The rule now bans force-pushing a SHARED branch and lists the five criteria that make a branch provably unshared before --force-with-lease is allowed; bare --force stays banned. os-dev.md names RULE 2 of check:partof-closing-keyword on the line that already carried its substance (net zero; the model-free trailer clause it displaces survives in AGENTS.md). The AGENTS.md line ceiling moves 1068 -> 1074, exactly the ruled net budget, recorded in the ratchet's own ledger form. Claude-Session: https://claude.ai/code/session_01YKEjmbYNvYWJvWGSWx26zK Co-authored-by: Claude --- .claude/agents/os-dev.md | 2 +- AGENTS.md | 10 ++++++++-- scripts/pm/check-skill-line-ratchet.mjs | 16 +++++++++++++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index 178963a15d6..671cceec54a 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -280,7 +280,7 @@ model: opus - ⛔ 不写否定式的关单句,它照样关掉点名的卡:解析器无视否定,只匹配关键词 + `#`。 - 关键词是 `fix/fixes/fixed/close/closes/closed` 与 `resolve/resolves/resolved`;让它们远离其它卡号。 - 写 `# is not addressed here`、`out of scope: #` 或 `# remains open`。 -- 卡片关系只在 PR 正文声明一次:commit ⛔ 不带卡片 trailer,其 trailer pair 一律 model-free。 +- 卡片关系只在 PR 正文声明:commit ⛔ 不带卡片 trailer(`check:partof-closing-keyword` RULE 2 阻断)。 - 标题与散文用英文(见 AGENTS.md);引用的中文裁决保持原文不译,改写引文就是改写裁决。 - 受管面(见 AGENTS.md)PR 正文带 `## 维护者速读(草稿)` 节,中文、业务角度,席位意见留空。 - 五段固定:改了什么/为什么改/风险与代价(含回滚)/席位意见/你要做的;席位定稿成评论。 diff --git a/AGENTS.md b/AGENTS.md index 084beb4c1ec..94cac72c99d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -467,8 +467,14 @@ Even inside your own worktree, operate defensively: pays a rebuild lap per landing; and a breaking changeset's ADR-0087 disposition is base-relative, so a stacked card's two bases demand contradictory markers. A multi-card change uses a **trunk branch**: correct the trunk's disposition to `registered` before it merges, and pay the rebase laps. ⛔ No gate or merge-policy change is made for it. -3. **Never `git push --force` / `--force-with-lease`, and never push `main`.** A - force-push can clobber a parallel agent's work; `main` is shared — land all via PR. +3. **Never force-push a *shared* branch, and never push `main`.** A force-push can + clobber a parallel agent's work; `main` is shared — land all via PR. A branch is + unshared, and `--force-with-lease` allowed, only while ALL FIVE hold: ① it is named + `claude/issue-*`; ② this worktree created it; ③ nobody else has ever pushed it (the + author and committer sets of `git log origin/` are you alone); ④ no open PR + on it carries a reviewer or an approval (one does ⇒ a new branch and a fresh PR + instead); ⑤ the push spells `--force-with-lease=:` — + ⛔ never bare `--force`. One criterion failing ⇒ the branch is shared. 4. **Verify the current branch before every commit/push** (`git rev-parse --abbrev-ref HEAD`). HEAD may have been switched by another agent — if it isn't your feature branch, stop and re-checkout before pushing. diff --git a/scripts/pm/check-skill-line-ratchet.mjs b/scripts/pm/check-skill-line-ratchet.mjs index 6e5be775d1c..424956ca609 100644 --- a/scripts/pm/check-skill-line-ratchet.mjs +++ b/scripts/pm/check-skill-line-ratchet.mjs @@ -1052,7 +1052,21 @@ export const CEILINGS = new Map([ // bullet is already typeset at the surrounding block's 90-byte prose width, and // AGENTS.md is not a CROSS_FILE_MOVES destination, so no `ruledRaises` record // applies. Landed count, headroom 0, same convention. - ['AGENTS.md', 1068], + // + // 1068 → 1074 (card #16851): Multi-agent discipline §3 narrowed from an + // unconditional force-push ban to "never force-push a SHARED branch", plus the + // five criteria that make a branch provably unshared before `--force-with-lease` + // is allowed — the ban's own rationale (a parallel agent's work) was already + // scoped that way, and check-partof-closing-keyword RULE 2 can only be satisfied + // by rewriting a commit message, so the unconditional wording had already been + // broken once in practice. +6 lines, exactly the ruled budget: two lines cannot + // carry five criteria, and the item measures 0 lossless rewrap headroom at the + // list's ~90-byte prose width. Maintainer ruling, verbatim and untranslated: + // 「其他同意」 (decision batch #111 item 4, 2026-09-10, on analysis 5615846806 + // option A; recorded by the director on #16851 comment 5617189215, which also + // rules the net budget of 6). AGENTS.md is not a CROSS_FILE_MOVES destination, + // so no `ruledRaises` record applies. Landed count, headroom 0, same convention. + ['AGENTS.md', 1074], // #9965: root CLAUDE.md is the other repo-root instruction file — same read // path (every seat session), same governance (Prime Directive #14). It is // structurally growth-prone in the way the ratchet is built for: it exists to From 17fa921328bd00eb35e8470ded972132e5f4b9c5 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 10 Sep 2026 10:59:05 +0000 Subject: [PATCH 2/3] docs(agents): leave os-dev.md untouched; the RULE 2 naming is reported, not paid The partof-closing-keyword gate cites os-dev.md's card-trailer sentence verbatim (its self-test holds the corner-bracket quotation to the rules file), so naming RULE 2 on that line cannot be paid inside the declared surface without also editing the gate. The dispatch's fallback for an unpayable line is to report it, so os-dev.md returns to its base blob and the finding goes in the PR body and the report. Claude-Session: https://claude.ai/code/session_01YKEjmbYNvYWJvWGSWx26zK Co-authored-by: Claude --- .claude/agents/os-dev.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index 671cceec54a..178963a15d6 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -280,7 +280,7 @@ model: opus - ⛔ 不写否定式的关单句,它照样关掉点名的卡:解析器无视否定,只匹配关键词 + `#`。 - 关键词是 `fix/fixes/fixed/close/closes/closed` 与 `resolve/resolves/resolved`;让它们远离其它卡号。 - 写 `# is not addressed here`、`out of scope: #` 或 `# remains open`。 -- 卡片关系只在 PR 正文声明:commit ⛔ 不带卡片 trailer(`check:partof-closing-keyword` RULE 2 阻断)。 +- 卡片关系只在 PR 正文声明一次:commit ⛔ 不带卡片 trailer,其 trailer pair 一律 model-free。 - 标题与散文用英文(见 AGENTS.md);引用的中文裁决保持原文不译,改写引文就是改写裁决。 - 受管面(见 AGENTS.md)PR 正文带 `## 维护者速读(草稿)` 节,中文、业务角度,席位意见留空。 - 五段固定:改了什么/为什么改/风险与代价(含回滚)/席位意见/你要做的;席位定稿成评论。 From a73fac3075ac52555287d872b270d61e490ed723 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 10 Sep 2026 11:21:48 +0000 Subject: [PATCH 3/3] docs(agents): dev definition defers force-push to AGENTS.md section 3; runbook names RULE 2 The dev-agent definition carried its own unconditional force-push ban, a twin of the sentence AGENTS.md section 3 just narrowed; it now defers to section 3 (net zero, one line in place). The dispatch runbook's delivery bullet now says the closing keyword goes only in the PR body under partof-closing-keyword RULE 2 (net zero, one line in place), so the rule a dev hit alongside section 3 is named where a PM composes a dispatch. The gate's own citation of os-dev.md stays byte-identical. Claude-Session: https://claude.ai/code/session_01YKEjmbYNvYWJvWGSWx26zK Co-authored-by: Claude --- .claude/agents/os-dev.md | 2 +- .claude/skills/pm-dispatch/references/dispatch-runbook.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index 178963a15d6..5c53ce1e97a 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -65,7 +65,7 @@ model: opus - 就地修欠两样:认领申报的文件面同轮增补;PR 正文点名该修复并附证据。 - 优先扩展一个守卫关掉整个类;任一条不成立 ⇒ 回默认:无 assignee 立单、列出、不碰。 - 本轮改动令其变假或触碰的已发布缺陷必修;其余立卡并记明已发布面,PR 照常落地。 -4. ⛔ 永不编辑 `content/docs/releases/`、force-push、推 `main`、合并任何东西。 +4. ⛔ 永不编辑 `content/docs/releases/`、推 `main`、合并任何东西;force-push 只按 AGENTS.md §3。 - 用户可见的改动需要 `.changeset/*.md`。 5. **Contract-first。** 修复若诱使你在消费端加宽容回退(`??` 别名、宽松解析),缺陷在上游。 - 去生产者或 spec 修,或返回 `needs_decision`。 diff --git a/.claude/skills/pm-dispatch/references/dispatch-runbook.md b/.claude/skills/pm-dispatch/references/dispatch-runbook.md index 2146dd78c2a..75550d15a9c 100644 --- a/.claude/skills/pm-dispatch/references/dispatch-runbook.md +++ b/.claude/skills/pm-dispatch/references/dispatch-runbook.md @@ -119,7 +119,7 @@ - 二、派发词必带自驱条款:云会话回合一结束即停摆等 poke。 - ⛔ 不为提问或中期汇报结束回合;开放选择按裁决与评估轴自裁,记入终报 `open_questions`。 - 合法回合终点只有两个:推送完成加终报,或硬阻塞详报。 -- 三、交付通道:dev 自开 draft PR(`Fixes #`,正文含验证记录)。 +- 三、交付通道:dev 自开 draft PR(`Fixes #` 只写正文,`partof-closing-keyword` RULE 2,含验证记录)。 - 终报以 issue 评论交付,带 `os-dev-report` 标记。 - 未 attach 的姊妹仓够不着,跨仓跟进卡由 PM 代立。 - trigger 定时会话维持降级通道:推送 outcome branch,终报走最后一条会话消息,PM 代开 draft PR。