From c193c437c8ee1cc2396c95ade3bb2bb1c36dbf70 Mon Sep 17 00:00:00 2001 From: os-zhuang Date: Thu, 6 Aug 2026 00:18:46 +0000 Subject: [PATCH] =?UTF-8?q?docs(os-dev):=20skip-changeset=20=E7=A1=AC?= =?UTF-8?q?=E6=AD=A5=E9=AA=A4=E6=94=B9=E4=B8=BA=E3=80=8C=E5=85=88=E5=9B=9E?= =?UTF-8?q?=E8=AF=BB=E3=80=81=E5=86=99=E5=B9=B6=E9=9B=86=E3=80=8D,?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=20PUT-only=20=E7=9A=84=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E9=9D=A2=20(#5684)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #5650 落地的措辞是「**Add** the one label instead of writing the label set」。 意图正确,但 os-dev 手上唯一能写标签的工具(MCP `issue_write` 的 `labels`)是 整集 PUT——照字面执行 `labels: ['skip-changeset']` 恰好就是该句要禁止的整集 抹除(#5683 受控实验:同秒两条 unlabeled + 一条 labeled;写并集则零 unlabeled)。 改为可执行处方:先回读当前标签集 → 写并集(现有集 + skip-changeset)→ 写后 回读确认(原有闭环保留),并记入工具面事实:`POST /issues/{n}/labels` 不可达 (容器无 gh CLI、匿名 curl 不可写),回读须走 REST `GET /pulls/{n}`, `issue_read get_labels` 解析不了 PR 号。 同句内两处把写入称作 POST 的措辞随之改为 write——同一条款内的命名一致性, 否则条款一边说唯一写法是整集 PUT、一边让读者去找一条不可达的 POST。 条款其余要素(硬步骤地位、Auto Label 不会代挂、双向竞态预期、回读进报告) 未动。 --- .claude/agents/os-dev.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index 9820f2e3f9..f33af4e36b 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -138,13 +138,20 @@ Definition of done, in order: moment the PR exists. Nothing applies it for you: `.github/labeler.yml` has no rule for it, and in every 2026-08-05 case (#5533/#5538/#5542/#5624/#5642/#5645) the label came from an agent, never from - `github-actions[bot]`. **Add** the one label instead of writing the label set - — a set-write wipes the `size/*` / `documentation` / `tests` the bots just - applied, and CI's own write can wipe yours back (#5533's lasted one second). - Then read the labels back once the bots have settled and quote that list in - the report; the read, not the POST, is what closes this step. Check Changeset - re-reads the labels live in its first step (#5580), so the first run is a race - between that step and your POST, decided by runner start-up — and it is + `github-actions[bot]`. **Read the labels back first, then write the union** — + the existing set + `skip-changeset` — because `issue_write`'s `labels` field + is a whole-set PUT: `labels: ['skip-changeset']` alone wipes the `size/*` / + `documentation` / `tests` the bots just applied, and CI's own write can wipe + yours back (#5533's lasted one second). Tool surface, not style: #5683 + measured it — the bare set emitted two `unlabeled` events in one second, the + union write only `labeled`. The additive `POST /issues/{n}/labels` is out of + reach (no `gh` CLI, unauthenticated `curl` cannot write), so read with REST + `GET /repos/{owner}/{repo}/pulls/{n}` — `issue_read get_labels` cannot + resolve a PR number. Then read the labels back once the bots have settled and + quote that list in the report; the read, not the write, is what closes this + step. Check Changeset re-reads the labels live in its first step (#5580), so + the first run is a race between that step and your write, decided by runner + start-up — and it is attested both ways: #5542 labelled correctly and still logged a red `opened` run, while #5650's label landed 41 s ahead of the re-read and that same `opened` run went green. So land the label fast, and read the first run's