From 97b1740f1d27c5993060ae877fedba2538a226a3 Mon Sep 17 00:00:00 2001 From: os-zhuang Date: Wed, 5 Aug 2026 22:01:35 +0000 Subject: [PATCH 1/2] =?UTF-8?q?docs(os-dev):=20PR=20=E6=94=B6=E5=B0=BE?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E5=A2=9E=E8=A1=A5=20`skip-changeset`=20?= =?UTF-8?q?=E7=A1=AC=E6=AD=A5=E9=AA=A4,=E4=BB=A5=E5=9B=9E=E8=AF=BB=20PR=20?= =?UTF-8?q?labels=20=E4=B8=BA=E9=97=AD=E7=8E=AF=20(#5559)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 测试-only / 工作流-only / `.claude/`-only 的 PR 不写 changeset,靠 `skip-changeset` 标签豁免 Check Changeset。此前收尾清单对这一步只字未提,dev 在 PR 正文「声明」了 标签却没有真正挂上,#5533/#5538 两例各烧一轮门禁红并由 PM 手工兜底 —— 「声明了 ≠ 执行了」正是 declared ≠ enforced 的 agent 版。 新增条目把它写成与「PR 正文以 Fixes 开头」同级的硬步骤,并按实测校正了三处认知: - 没有任何自动化会替你挂:`.github/labeler.yml` 九条规则里没有 `skip-changeset`, 2026-08-05 六例(#5533/#5538/#5542/#5624/#5642/#5645)的该标签全部来自 agent, `github-actions[bot]` 一次都没挂过 —— 它只负责 `size/*`、`documentation`、 `tests`、`ci/cd`。 - 只「加一个标签」,不要整集写入:整集写入会把 bot 刚挂的 `size/*` / `documentation` / `tests` 抹掉(#5533/#5538/#5642/#5645 的 agent `unlabeled` 事件即此),反向也成立 —— #5533 的标签 15:46:44 落、15:46:45 就被 `github-actions[bot]` 的写入抹掉,只活了一秒。 - 闭环是回读而不是 POST:Check Changeset 在 PR 打开后数秒就实时读一次标签 (#5580),`opened` run 通常早于标签落地 —— #5542 的 dev 做对了全套,仍留下 一条红 `opened` run,之后每一次 run 才被标签豁免。所以要在 bot 平息后回读 标签、并把读到的列表写进报告。 --- .claude/agents/os-dev.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index 84fa45e036..570bb0becc 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -132,6 +132,22 @@ Definition of done, in order: failure with backoff). - **Draft** PR to `main`, body starting `Fixes #`, explanatory prose in Chinese per repo convention. +- **`skip-changeset` label — your step, not CI's; the read-back is the proof.** + A test-only / workflow-only / `.claude/`-only PR releases nothing and writes + no changeset, so it needs the `skip-changeset` label — apply it yourself the + 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 labels live seconds after the PR opens (#5580), so expect its + `opened` run to have started before your label lands — #5542 did this right + and still logged one red `opened` run, which the label then exempted on every + later run. Declaring the label in the PR body is not applying it: #5533 and + #5538 each said so in prose and each still cost a PM hand-fix. - Tear down anything you started (dev servers on random ports). **Reverse verification — decide the expected direction BEFORE you run it.** From a0a1cd2709291dd2e15c1608c7f8a0d927f14553 Mon Sep 17 00:00:00 2001 From: os-zhuang Date: Wed, 5 Aug 2026 22:06:24 +0000 Subject: [PATCH 2/2] =?UTF-8?q?docs(os-dev):=20=E9=A6=96=20run=20=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E6=8C=89=E5=AE=9E=E6=B5=8B=E6=94=B9=E6=88=90=E5=8F=8C?= =?UTF-8?q?=E5=90=91=E7=AB=9E=E6=80=81,=E4=B8=8D=E5=86=8D=E9=A2=84?= =?UTF-8?q?=E8=AE=BE=E4=B8=BA=E7=BA=A2=20(#5559)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 本 PR(#5650)自己按新硬步骤执行时,实测结果与原措辞相反:标签 22:03:54 落地, `opened` run(workflow run 31051251795,创建于 22:03:38)的 Check Changeset job 直到 22:04:35 才启动并做实时标签回读 —— 早于回读 41 秒落地的标签被读到,该 run 直接 **success**,并非预设的红。 于是这一句改为如实描述竞态:首 run 的颜色取决于 runner 启动耗时与 POST 落地 的先后,两个方向都有实例(#5542 红、#5650 绿)。指导语随之从「预期会红」改为 「尽快落标签,把首 run 的颜色当信息而不是自己的判决」。 预设方向被自己的实测证伪时如实记录,而不是让措辞压着实测走。 --- .claude/agents/os-dev.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index 570bb0becc..9820f2e3f9 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -143,10 +143,13 @@ Definition of done, in order: 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 labels live seconds after the PR opens (#5580), so expect its - `opened` run to have started before your label lands — #5542 did this right - and still logged one red `opened` run, which the label then exempted on every - later run. Declaring the label in the PR body is not applying it: #5533 and + 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 + 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 + colour as information rather than as your verdict — every run after the label + is exempt. Declaring the label in the PR body is not applying it: #5533 and #5538 each said so in prose and each still cost a PM hand-fix. - Tear down anything you started (dev servers on random ports).