docs(os-dev): skip-changeset 硬步骤改为「先回读、写并集」,匹配 PUT-only 的工具面 (#5684) - #5687
Merged
Conversation
#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 不会代挂、双向竞态预期、回读进报告) 未动。
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
os-zhuang
marked this pull request as ready for review
August 6, 2026 00:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5684
单文件、单 hunk:
.claude/agents/os-dev.md收尾清单里skip-changeset那条硬步骤中的写入句。一、前提复核(在 main 上逐字确认,成立)
origin/main@52daddbe3的第 141-143 行仍是 #5650 落地的原措辞:意图正确,但 os-dev 手上唯一能写标签的工具是 MCP
issue_write的labels字段,而它是整集 PUT。于是「只加一个标签」照字面执行 ——labels: ['skip-changeset']—— 恰好就是这句要禁止的那次整集抹除。#5683 的受控实验实证(写入前["ci/cd","size/s"]):裸集写入产生同秒两条unlabeled+ 一条labeled;写并集只产生labeled、零unlabeled。同款措辞在仓内没有第二处:
.claude/skills/pm-dispatch/SKILL.md与其余 agent 文件 grep 无命中,所以落点确实只有这一处。二、改了什么
写入句改成工具面真正可执行的动作,四个要素:
GET /repos/{owner}/{repo}/pulls/{n}(labels 在响应内);同时点明issue_read get_labels解析不了 PR 号,免得下一个人在那儿卡一轮。skip-changeset)—— 唯一可用的写入是整集 PUT,漏一个就是抹一个。POST /issues/{n}/labels为何不可达(容器无ghCLI、未认证curl不能写)。⛔ 未动:该条款其余要素(硬步骤地位、
.github/labeler.yml没有规则、Auto Label 不会代挂、#5533 一秒即失的双向竞态预期、首个 run 的红当信息而非判决、PR 正文声明不等于挂上)、#5642 的 Byte discipline 段、#5630 的 Toolchain traps 段、任何 workflow(CI 侧已由 #5683 修)。一处请 reviewer 拍板的越界(2 个词,同一条款内)
同条款后文两处把这次写入称作 POST(
the read, not the POST, is what closes this step、a race between that step and your POST),随本次修改一并改为write。理由:新处方明说唯一可用的写入是整集 PUT、而POST /issues/{n}/labels不可达;若留着 POST 这个词,条款会一边告诉读者只能 PUT、一边让他去找一条不存在的加法调用 —— 正是本单要消掉的那种不可执行性。改动只换名词,不动这两句承载的要素(回读闭环、双向竞态预期)。若认为超出「只动一句」的边界,回退这 2 个词即可,不影响主改动。三、验证
node scripts/check-nul-bytes.mjs→OK (scanned 5603 tracked text file(s); skipped 5 binary, 1 non-regular; no raw ASCII control bytes);--self-test→56 assertions over a temp git repo (real scan() path)全过(test(devx): check-nul-bytes 的 --self-test 断言字符类引用面逐字节相等,终结该族漂移 (#5646) #5680 的字符类引用面断言未被误伤 —— 本 PR 不碰那条grep -naP命令行)。grep -naP零命中。**计数 4(两对)、反引号计数 38(偶),续行缩进全 2 空格,列表项未破坏。.claude/diff)。无红。四、实践自证(新措辞的第一次实测)
本 PR 自己的
skip-changeset就按修正后的处方挂:顺带现场复现了写进条款的另一条工具面事实:
issue_read get_labels(5687)→Failed to get issue labels: Could not resolve to an Issue with the number of 5687.诚实交代两点,不粉饰:
api.github.com(classifier 拦 curl),MCP 也没有 timeline / issue-events 工具,所以无法像 fix(ci): 两个标签写入 job 不再并发、也不再被标签事件重复触发 (#5649) #5683 那样引用unlabeled事件计数。可断言的是:第 2 步 PUT 的载荷就是第 1 步读到的集合的并集,而该集合为空,因此这次写入在结构上不可能移除任何标签;第 3 步回读也显示 bot 的documentation/size/s与我的skip-changeset三者并存、无一丢失。Changeset
.claude/文档-only、无用户可见变更 → 走skip-changeset标签路线,不写空 frontmatter changeset(#4898 / #5292)。