Skip to content

Commit cfdd0e9

Browse files
os-litantclaude
andauthored
docs(agents): scope the force-push ban to shared branches, with five unshared criteria (#17398)
* 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 <noreply@anthropic.com> * 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 <noreply@anthropic.com> * 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 <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 613d35a commit cfdd0e9

4 files changed

Lines changed: 25 additions & 5 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ model: opus
6565
- 就地修欠两样:认领申报的文件面同轮增补;PR 正文点名该修复并附证据。
6666
- 优先扩展一个守卫关掉整个类;任一条不成立 ⇒ 回默认:无 assignee 立单、列出、不碰。
6767
- 本轮改动令其变假或触碰的已发布缺陷必修;其余立卡并记明已发布面,PR 照常落地。
68-
4. ⛔ 永不编辑 `content/docs/releases/`、force-push、推 `main`、合并任何东西。
68+
4. ⛔ 永不编辑 `content/docs/releases/`、推 `main`、合并任何东西;force-push 只按 AGENTS.md §3。
6969
- 用户可见的改动需要 `.changeset/*.md`。
7070
5. **Contract-first。** 修复若诱使你在消费端加宽容回退(`??` 别名、宽松解析),缺陷在上游。
7171
- 去生产者或 spec 修,或返回 `needs_decision`。

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
- 二、派发词必带自驱条款:云会话回合一结束即停摆等 poke。
120120
- ⛔ 不为提问或中期汇报结束回合;开放选择按裁决与评估轴自裁,记入终报 `open_questions`。
121121
- 合法回合终点只有两个:推送完成加终报,或硬阻塞详报。
122-
- 三、交付通道:dev 自开 draft PR(`Fixes #<n>`,正文含验证记录)。
122+
- 三、交付通道:dev 自开 draft PR(`Fixes #<n>` 只写正文,`partof-closing-keyword` RULE 2,含验证记录)。
123123
- 终报以 issue 评论交付,带 `os-dev-report` 标记。
124124
- 未 attach 的姊妹仓够不着,跨仓跟进卡由 PM 代立。
125125
- trigger 定时会话维持降级通道:推送 outcome branch,终报走最后一条会话消息,PM 代开 draft PR。

‎AGENTS.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,14 @@ Even inside your own worktree, operate defensively:
467467
pays a rebuild lap per landing; and a breaking changeset's ADR-0087 disposition is base-relative, so a stacked card's
468468
two bases demand contradictory markers. A multi-card change uses a **trunk branch**: correct the trunk's disposition
469469
to `registered` before it merges, and pay the rebase laps. ⛔ No gate or merge-policy change is made for it.
470-
3. **Never `git push --force` / `--force-with-lease`, and never push `main`.** A
471-
force-push can clobber a parallel agent's work; `main` is shared — land all via PR.
470+
3. **Never force-push a *shared* branch, and never push `main`.** A force-push can
471+
clobber a parallel agent's work; `main` is shared — land all via PR. A branch is
472+
unshared, and `--force-with-lease` allowed, only while ALL FIVE hold: ① it is named
473+
`claude/issue-*`; ② this worktree created it; ③ nobody else has ever pushed it (the
474+
author and committer sets of `git log origin/<branch>` are you alone); ④ no open PR
475+
on it carries a reviewer or an approval (one does ⇒ a new branch and a fresh PR
476+
instead); ⑤ the push spells `--force-with-lease=<branch>:<sha you last pushed>` —
477+
⛔ never bare `--force`. One criterion failing ⇒ the branch is shared.
472478
4. **Verify the current branch before every commit/push**
473479
(`git rev-parse --abbrev-ref HEAD`). HEAD may have been switched by another agent —
474480
if it isn't your feature branch, stop and re-checkout before pushing.

‎scripts/pm/check-skill-line-ratchet.mjs‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,21 @@ export const CEILINGS = new Map([
10521052
// bullet is already typeset at the surrounding block's 90-byte prose width, and
10531053
// AGENTS.md is not a CROSS_FILE_MOVES destination, so no `ruledRaises` record
10541054
// applies. Landed count, headroom 0, same convention.
1055-
['AGENTS.md', 1068],
1055+
//
1056+
// 1068 → 1074 (card #16851): Multi-agent discipline §3 narrowed from an
1057+
// unconditional force-push ban to "never force-push a SHARED branch", plus the
1058+
// five criteria that make a branch provably unshared before `--force-with-lease`
1059+
// is allowed — the ban's own rationale (a parallel agent's work) was already
1060+
// scoped that way, and check-partof-closing-keyword RULE 2 can only be satisfied
1061+
// by rewriting a commit message, so the unconditional wording had already been
1062+
// broken once in practice. +6 lines, exactly the ruled budget: two lines cannot
1063+
// carry five criteria, and the item measures 0 lossless rewrap headroom at the
1064+
// list's ~90-byte prose width. Maintainer ruling, verbatim and untranslated:
1065+
// 「其他同意」 (decision batch #111 item 4, 2026-09-10, on analysis 5615846806
1066+
// option A; recorded by the director on #16851 comment 5617189215, which also
1067+
// rules the net budget of 6). AGENTS.md is not a CROSS_FILE_MOVES destination,
1068+
// so no `ruledRaises` record applies. Landed count, headroom 0, same convention.
1069+
['AGENTS.md', 1074],
10561070
// #9965: root CLAUDE.md is the other repo-root instruction file — same read
10571071
// path (every seat session), same governance (Prime Directive #14). It is
10581072
// structurally growth-prone in the way the ratchet is built for: it exists to

0 commit comments

Comments
 (0)