Skip to content

Commit af2221d

Browse files
objectstack-fleet[bot]claudehuangyiirene
authored
docs(agents): port objectstack's model-free commit-trailer rule into the multi-agent section (objectui#9441) (#10922)
Fixes #9441 Clause-②: no — `AGENTS.md` is an agent-facing convention, not a published contract, accept set or public surface ## What objectui's root `AGENTS.md` gains objectstack's model-free commit-trailer rule, as ruled on the card (ruling A, comment 5724938982, text only, no hook). One new bullet in `### 多 agent 协作纪律(并行修改本仓库,务必遵守)`, placed right after the bullet that begins 「每次 commit/push 前先确认当前分支」, which is that section's commit-hygiene neighbour. - The two sentences of objectstack `AGENTS.md`'s paragraph beginning `**Commit message:**` are quoted verbatim, with exactly one clause removed: `, and the pre-push hook refuses a model identifier in that pair`. objectui has no such hook and the ruling adds none (option B was declined). - A short warning says, per commandment #9, that nothing in this repository enforces the rule, that it works through the harness's own precedence sentence (the ruling's words are quoted), and that squash landing keeps `Co-authored-by` (pointing at objectui#9666). objectui#9666 remains open: its ruling-C sentence (the cross-repo force-push line) is a separate card, serialised after this one by the claim. ## Premise checks (on `origin/main` 733fd5a, before editing) - **H1, objectui carries none of the rule.** `git grep -n -iE 'Claude-Session|model-free|Co-authored-by' BASE -- AGENTS.md CLAUDE.md` exit 1, zero lines. Control: `git grep -c AGENTS BASE -- AGENTS.md` answers 5, exit 0. - **H2, the source text.** objectstack `origin/main` df3ba164, the paragraph anchored by `**Commit message:**`. The port was compared mechanically: source paragraph whitespace-flattened, the one clause removed (it occurs exactly once), result byte-equal to the new quote line: `MATCH`. - **H3, no hook in objectui.** No `.githooks/`, no `core.hooksPath`, no husky / lefthook / simple-git-hooks key in `package.json`, and no file under `.github`, `scripts` or `.claude` names `Co-authored-by` or `Claude-Session` (git grep exit 1). Control leg: objectstack's `.githooks/pre-push` pipes the pushed refs into `scripts/check-commit-card-trailers.mjs`, whose header names "a model identifier in the trailer pair" as its second finding class. - **H4, placement.** The multi-agent discipline section exists under the heading above; the bullet sits with the other commit/push bullets. - **The squash claim.** The last 40 commits on `main` are all single-parent squash landings: 40 carry a `Co-authored-by` line, 0 carry `Claude-Session`, and none names a model. That count is today's reading and is deliberately NOT written into the file (commandment #9); the file points at objectui#9666 instead. ## Verification, at `4259546d` | check | exit | verdict line | |:--|--:|:--| | `node scripts/check-control-bytes.mjs` | 0 | `check-control-bytes: OK (scanned 9180 tracked text file(s); skipped 85 binary).` | | `node scripts/check-new-cross-file-line-citations.mjs` | 0 | `VERDICT new-cross-file-line-citations: 0 new citation(s), enforcement report-only -> exit 0` | | `node scripts/check-shell-escape-residue.mjs` | 0 | `OK (5/5 root(s) resolved -- AGENTS.md: 1 file(s), 15 fence(s); ...)` | | `node scripts/check-doc-links.mjs` | 0 | `Links are valid across 17 scan roots.` | | `node scripts/check-changeset-presence.mjs` | 0 | `No source or published contract of a released package changed in this range, so no changeset is owed.` | | `node scripts/check-governed-queue-guard.mjs --test AGENTS.md` | 3 | `GOVERNED — 1 of 1 path(s) are on a governed surface` (so: draft, waiting for an authorized approval) | - **Tests that read `AGENTS.md`**, derived from the ledger rather than recalled: `markdownTestInputsAmong(['AGENTS.md'])` in `scripts/markdown-test-inputs.mjs` names five readers (entries `./*` and `AGENTS.md`). All five ran in one call, `pnpm exec vitest run --maxWorkers=2` over `check-doc-links`, `check-installed-spec-pin-claims`, `check-required-check-set`, `check-shell-escape-residue` and `dollar-dialect-alias-census` (all under `scripts/__tests__/`): `Test Files 5 passed (5)`, `Tests 260 passed (260)`, verify-lock `VERDICT command-exit 0`. - **Control-byte self-scan** over the diff: `grep -naP` for C0/DEL bytes exit 1 (no hits); control leg on a constructed byte, 1 hit. - **Not run locally, owned by CI:** `pnpm lint` (repo-wide; this diff touches no linted source) and the full `pnpm test`. - No changeset: the gate above says none is owed, and `AGENTS.md` ships in no package. ## Acceptance notes - This branch's only commit ends with the model-free pair it describes (`Claude-Session` + `Co-authored-by: Claude`). The harness's attribution reminder in this session asked for a model-named co-author line; the commit followed the rule instead. That is the precedence the ruling relies on, used once. - Observation, not filed: once this lands, its squash commit is a free reading for the question objectui#9666 left open (does the squash composer drop `Claude-Session`, or did those seats never write one?). The branch commit carries both lines. Carrier: the seat that lands this PR. Session: `https://claude.ai/code/session_01EBx9rvB7dufCz4at53x35U` ## 维护者速读(草稿) **改了什么**:在 objectui 根目录 `AGENTS.md` 的「多 agent 协作纪律」一节里加了一条:agent 的提交信息结尾统一用两行不带模型名的署名(会话链接 + 通用的 Claude 共同作者),PR、评论、changeset、文档和代码注释里也不写模型名。正文直接照抄 objectstack 仓已有的同一条规则,只删掉了「由 pre-push 钩子拦截」那半句,因为本仓没有、也不加这个钩子。 **为什么改**:objectstack 仓早已写明这条规则,objectui 的 `AGENTS.md` 却一个字没提,在本仓干活的 agent 就可能照着工具的默认提示写上模型名;而合并时这行署名会原样进入 `main` 的历史,事后不改写。您 9 月 18 日在本卡上裁定方案 A:只补文字,不加门禁。 **风险与代价(含回滚)**:只改给 agent 读的说明文字,不影响任何代码、测试或发版。代价是本仓仍然没有机械拦截,效果取决于 agent 读到并照做;另外两个仓各存一份同文规则,以后改一边要记得同步另一边。回滚:revert 本 PR 唯一的那个 commit(5 行)即可。 **席位意见**: **你要做的**:看一眼这 5 行 diff,同意就在本 PR 上点 Approve;之后翻 ready、入队由席位完成。 --- _Generated by [Claude Code](https://claude.ai/code/session_01EBx9rvB7dufCz4at53x35U)_ Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: 黄怡 <huangyi@hotoa.com>
1 parent dd3f7e1 commit af2221d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎AGENTS.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,11 @@ AGENTS.md 的「只跑受影响的包」指的是**用上面的路径过滤缩
322322
- **绝不 `git push --force`/`--force-with-lease`,绝不推 `main`**(会覆盖并行 agent 的工作;`main` 共享,一律走 PR)。**禁令不按「这条分支是不是只有我一个人用」分档**:那个判断评估错的时候没有任何症状,而错掉的代价正是本节要防的那类静默丢工作 —— 所以它一律绝对,单人 feature 分支同样不例外。**要把自己的分支同步到当前 `main`,合规路线是 merge,不是 rebase**:`git fetch origin && git merge origin/main`,解完冲突照常 push。代价只是一个 merge commit —— 本仓 PR 一律 `--squash` 入队合并,它不会留到 `main` 上;换来的是任何一次 push 都不重写已经推上去的历史。**「要同步分支」从来不是 force-push 的理由**,别用 `git rebase origin/main` + `--force-with-lease` 去「把历史弄干净」。(入队合并本身并不要求你同步 —— 队列会在当前 `main` 上重建,见下面「不必为了合并去 rebase 其他在途分支」那条;主动同步的价值在于提前撞出别人刚落地的破坏。)
323323
- **能 push 分支,却删不掉远端 ref —— 而且失败之后 git 打印的是一张成功回执。** 实测(objectui#6756,同一会话里两个 agent 独立撞到、签名相同):任何删除 ref 的 push 都被 agent proxy 以 `error: RPC failed; HTTP 403` 拒绝,且没有旁路 —— GitHub MCP 工具面只有 `create_branch`、**没有对应的 delete**,容器内也没有 `gh` CLI。⚠️ 要命的是紧接其后的最后一行:`Everything up-to-date` —— 只看输出尾部、或把「最后一行非空」当成功的调用方,会把**被拒绝的删除读成已完成的删除**。⇒ 代价不是「不整洁」,而是**认领信号被污染**:同一张卡改名重开留下的孤儿分支,在席位平时读的任何界面上都看不见(不在卡上、不在 PR 列表、不在任何队列视图),只有按卡号做前缀 glob 才现形 —— `git ls-remote --heads origin 'refs/heads/claude/issue-<n>-*'`;实测一次险些被读成「另一个席位在并行做同一张卡」,而那正是认领纪律要防的唯一一件事。**以下四点未测,别当结论用**:403 出自代理策略 / token scope / 分支保护中的哪一层、其他席位或环境是否删得掉、tag 是否同样受限、仓内还有多少陈旧 `claude/*` 分支。⛔ 本条只记录能力缺口,**不**授权任何分支清理、普查或生命周期策略 —— 那是维护者的决定。
324324
- **每次 commit/push 前先确认当前分支**(`git rev-parse --abbrev-ref HEAD`);HEAD 可能被别的 agent 切走 —— 不是你的分支就停下重新 checkout。
325+
- **提交信息以 model-free 的 trailer pair 收尾 —— 与 `../objectstack` 的 `AGENTS.md` 是同一条规则(objectui#9441,维护者裁决 A,评论 5724938982)。** 下面是那边以 `**Commit message:**` 开头的那两句,逐字照录、不译;唯一的删改是去掉了 `, and the pre-push hook refuses a model identifier in that pair` 这一分句 —— 本仓没有那个钩子,裁决也不加:
326+
327+
> **Commit message:** an agent commit ends with the model-free trailer pair `Claude-Session: https://claude.ai/code/session_<id>` and `Co-authored-by: Claude <noreply@anthropic.com>`; no model identifier lands in a PR title or body, a comment, a changeset, a doc or a code comment. Two exemptions: a harness-written `Co-Authored-By` trailer (REPORTING: not declared a deviation; landed history is not rewritten) and a verbatim maintainer ruling preserved as a quotation block.
328+
329+
⚠️ **本仓没有任何东西强制它**(依诫条 #9 明说):没有 pre-push 钩子,也没有读提交信息的门禁。它靠 harness 自己的优先级句生效(裁决原话:「The harness's own precedence rule does the enforcing.」)—— harness 的署名提醒让位于 `CLAUDE.md` / `AGENTS.md` 里关于这几行的规则,两者冲突时照本条写。squash 入队保留 `Co-authored-by`(objectui#9666),所以分支 commit 上写的那一行会原样落进 `main` 的历史。
325330
- 改**共享文件**(barrel/注册表):编辑→`git add`→commit 一气呵成,并核验提交确实含你的改动(`git show HEAD:<file> | grep <你的改动>`);真冲突只重加*你自己*那几行,其余交给 PR 合并。
326331
- **要做反向验证(删掉修复 → 看预期的钉子变红 → 还原)就先把修复 commit 掉。** 提交之后,还原是 `git checkout <你的分支> -- <path>`,对着一个真实存在的 commit 取回;直接对**未提交**的改动做同一个删除(`git checkout origin/main -- <path>`)则没有任何还原点 —— 工作区就是唯一副本,而 `git stash` 一律禁用(共享 stash 栈,见本节上面「绝不 `git stash`」那条),改动当场就没了。同一天两次踩实:#4278(PR #4293)、#4243(PR #4299),两次都靠会话 transcript 逐行重打才找回来 —— transcript 不全就是净损失。#4243 那次是先 commit、再重跑一遍反向验证,最终那组红绿数字才可信。
327332
- **本仓由 ruleset 强制走合并队列(merge queue):直接合并会被 405 拒绝。** 实测(objectui#3243,对 15/15 全绿、`mergeable_state: clean`、非 draft 的 PR #3241):

0 commit comments

Comments
 (0)