Skip to content

[PR] docs(kernel-boundary): add mechanical-bug exemption to Kernel Boundary rule 1 - #5822

Closed
ranxianglei wants to merge 2 commits into
masterfrom
2026-11-06_kernel-mechanical-bug-exemption
Closed

ranxianglei wants to merge 2 commits into
masterfrom
2026-11-06_kernel-mechanical-bug-exemption

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #5819

What

Adds a mechanical-bug exemption to Kernel Boundary rule 1 (AGENTS.md). An at-a-glance kernel defect — a wrong literal, a typo, or a falsifiable guard predicate whose failure a test demonstrates — may now be fixed directly, without the pre-implementation dedicated-issue approval.

Conditions (all required)

The fixing PR must:

  1. add a regression test that fails on the buggy code and passes on the fix;
  2. name the bug in its kernel-change: declaration (CI kernel-guard still enforces the declaration);
  3. report in-thread what changed, why it is safe (the change alters nothing beyond the bug), and which test pins it.

What does NOT change

  • The kernel-change: declaration requirement (CI-enforced) stays for every kernel PR.
  • The human-only review tier (rule 3) still gates every merge — no auto-merge, ever. That merge approval IS the required report; there is no separate sign-off.
  • All other Kernel Boundary rules (version discipline, golden pins, two-layer tests, structural invariants) are untouched.
  • No CI change: kernel-guard only checks the kernel-change: string, which the exemption keeps.

Process-behavior note (Deliverables §4)

  • Old: every kernel change needed owner approval BEFORE implementation, via a dedicated issue stating why the host side cannot solve the problem.
  • New: at-a-glance mechanical bugs skip that pre-approval step (replaced by the three conditions above); every other kernel change still needs pre-implementation approval. In both cases human review still gates the merge.
  • Aligns the repo spec with the companion daemon-prompt policy (e-work#48).

Docs-only change — a single line in AGENTS.md; no code, no config surface, no wire/persistence/kernel impact.

…y rule 1

At-a-glance mechanical kernel defects (wrong literal, typo, falsifiable guard predicate) may now be fixed directly without the pre-implementation dedicated-issue approval, provided the fixing PR (i) adds a regression test that fails on the buggy code and passes on the fix, (ii) names the bug in its kernel-change declaration, and (iii) reports in-thread what changed, why it is safe, and which test pins it. The human-only review tier still gates the merge; that approval is the required report. All other kernel rules unchanged.

Refs #5819
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-06_kernel-mechanical-bug-exemption (984e68f)

Latest build — install this exact version

npm install -g billion-context@0.0.8386-pr.5822.e3ae4c5

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
984e68f billion-context@0.0.8386-pr.5822.e3ae4c5 build
8e01169 billion-context@0.0.8382-pr.5822.c40a9ec build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5822.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title docs(kernel-boundary): add mechanical-bug exemption to Kernel Boundary rule 1 [PR] docs(kernel-boundary): add mechanical-bug exemption to Kernel Boundary rule 1 Nov 6, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重: 不重复。 按主题(kernel-boundary 豁免 / mechanical-bug / kernel-change 审批)检索 open+closed issues 与 PRs(近 7 天为主):命中的只有本 PR(GitHub #5822)与其来源 issue #5819,无并行工作项。查重声明:无。

标签: scope/docs + p3(仓库规范/流程文档变更,不涉及任何客户端车道,最低严重度档)

独立审核进行中(不复读 issue 结论)。已核对的事实:

  • diff 已逐行读取:仅 AGENTS.md Kernel Boundary rule 1 一行(+1/-1),无代码、无配置面、无 wire/persistence/kernel 影响;base = master@c3dfbe6b2,head = 8e01169。
  • CI @ head:目前零失败——static-gates / gate×3 / lane-guard / lock-sync / mysql-contract 已绿,test shards 仍在跑,e2e lanes 照例 skip(env-gated)。
  • 全仓 grep 旧规则表述("BEFORE implementation / dedicated issue / owner approval"):除 rule 1 新文本外,仅 §6 Contributing 的摘要句仍列 "owner approval" 未带豁免注记——属措辞与新规不一致的小问题,按「小问题直接修」处理,会在 PR 分支补一个标注 commit。

八问结论稍后给出。

…ng summary

Review-side consistency fix for PR #5822: the §6 pre-change checklist still listed 'owner approval' unconditionally for kernel changes, which now contradicts rule 1's mechanical-bug exemption. Adds the parenthetical pointer so the summary matches the rule text.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

审核完成(独立审核,未复读 issue 结论)。判定:可合(待新 head CI 绿)。

独立核验过的事实:

  • diff 逐行读取:仅 AGENTS.md Kernel Boundary rule 1 一行(+1/-1);base = master@c3dfbe6b2,即审核时 master 最新提交,基线新鲜;无代码/配置面/wire/persistence/kernel 影响。
  • 「kernel-guard 只查声明字符串、无需改 CI」的说法在代码里验证过(.github/workflows/ci.yml:436-469:仅 grep PR body 的 kernel-change:),不是只信 PR 描述。
  • 全仓 grep 旧规则表述(BEFORE implementation / dedicated issue / owner approval):除 rule 1 新文本外只有 §6 Contributing 摘要句滞后——已按「小问题直接修」处理:commit 984e68f 已推送到 PR 分支(docs(kernel-boundary): note mechanical-bug exemption in §6 Contributing summary,在 "owner approval" 后加 "(mechanical-bug exemption per rule 1)" 注记,使摘要与规则一致;独立标注 commit,不夹带其他改动)。
  • CI @ 原 head 8e01169:零失败(static-gates/gate×3/lane-guard/lock-sync/mysql-contract 绿,test shards 运行中,e2e lanes 照例 env-gated skip);我推的 984e68f 会触发重跑,最终绿以推送 head 的 CI 为准。

结构化八问

  1. 是什么问题:仓库规范(Kernel Boundary rule 1)要求任何 kernel/** 改动在实现前都要开专门 issue 走 owner 预审批——对一眼可证的机械性 bug(错字面量/笔误/可证伪守卫谓词)来说,这个流程成本与其风险等级不匹配。本 PR 为该情形加一条窄豁免。
  2. 什么原因导致的:非缺陷,是刻意的流程调整(配合 e-work#48 daemon 提示词同政策):机械性 bug 几乎无设计风险,单独审批轮次纯属开销;真正的判断点本来就在合并人审那道门。
  3. 影响范围与严重程度:只影响 agent 处理 kernel PR 的工作流(规范/流程面),零运行时、零用户可见影响。行为变更披露(旧→新):旧=所有 kernel 改动均需实现前专门 issue 预审批;新=一眼可证的机械性 bug 跳过该预审批步骤(改为三个可核查条件),其余 kernel 改动照旧需预审批;两种情况下合并仍过人审。
  4. 怎么修复的:把 rule 1 拆成三段——声明要求(原文保留、CI 继续强制)/预审批要求(收窄到「其他」kernel 改动)/豁免条款(三条件:回归测试红→绿、kernel-change: 声明点名该 bug、线程内报告改了什么/为何安全/哪个测试钉住);并显式重申 rule 3 人审层仍卡合并、该批准即所需报告。
  5. 是否有回归问题:逐项清点既有行为——① kernel-change: 声明要求:逐字保留,kernel-guard 逻辑未动(代码级验证)→ 保持;② 实现前 owner 预审批:有意收窄,PR 正文已按 Deliverables §4 披露旧值→新值+原因 → 有意变更;③ 人审层(rule 3)与 §7.4「Must stay human: any kernel/ change」:文本未动且豁免条款显式重申 → 保持;④ rule 2 版本纪律 / rule 4 golden pins / rule 5 双层测试 / rule 6 结构不变量:diff 未触碰 → 保持;⑤ 与 daemon 级「授权卡点必须走申请」政策的交互:豁免类修复仍带声明 → 守卫通过、不会误生成 authorization-request issue;非机械改动不受影响 → 无冲突;⑥ §6 摘要句与新规不一致 → 已顺手修(984e68f00)。结论:无意回归:无。
  6. 是否破坏缓存:不涉及(纯文档,无缓存/重试/游标/去重键面)。
  7. 是否改了设计方向:无架构/边界/数据流转向;仅在既有门禁结构内做一处流程放宽(预审批收窄、合并门禁不变),方向与「无决策依赖的部分先修」政策一致。
  8. 是否引入了新的配置:不涉及(无新 env/config/默认值)。

收工判定:可合——等 984e68f 的 CI 全绿即可由 owner 合并(合并权在人,我不代合)。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai: vllm-qwen/qwen3.8-27b)

结论:APPROVE(docs-only,可合) —— 以下为独立审核,非转述线程内既有评论。

独立核验(本轮重做的证据):

  • diff 只动 AGENTS.md(+2/-2),base c3dfbe6b2 == origin/master(fresh);
  • .github/workflows/ci.yml:436-475(本 head 上逐行读):kernel-guard Rule 1 仅在 kernel/ 有变更(排除 kernel/package-lock.json)时 grep PR body 的 kernel-change:;Rule 2 是版本纪律。CI 不检查「事前审批 issue」是否存在 → 豁免条款无需任何 CI 改动,PR 正文 "No CI change" 声明属实;
  • 全仓 *.md 一致性 grep(BEFORE implementation|dedicated issue|owner approval):旧版「一切 kernel 变更先批后做」表述无残留(剩余命中均为无关域:Configuration Surface 签核、release 批准、reference/external-summary.md);
  • #5819 存在且 open,标题与豁免语义一致(机械性 bug 直接修+线程内上报、合并仍人审),引用正确;
  • 行为披露(Deliverables §4):PR 正文已给 Old→New(事前审批范围从全部 kernel 变更收窄到非机械性变更;机械性 bug 类免事前 issue,human-only review tier 仍 gate 合并)——披露合规。

八问:

  1. 是什么问题:流程粒度——Kernel Boundary rule 1 原要求任何 kernel/ 变更实现前都走 dedicated issue + owner 批准,一眼可证的机械性 bug(错字面量/typo/测试可证伪的守卫谓词)也被迫走全流程。
  2. 什么原因导致:政策颗粒度与缺陷严重度不匹配(流程设计问题,非代码缺陷)。
  3. 影响范围与严重程度:仅影响未来 kernel 修复的 agent 工作流(流程层);零运行时/用户面影响;属流程优化,无外部可见变化。
  4. 怎么修复的:rule 1 加「Mechanical-bug exemption (#5819)」条款,三条件钉死——(i) 回归测试在坏代码上红、修上绿;(ii) kernel-change: 声明里点名该 bug;(iii) 线程内报告改了什么/为何安全/哪个测试钉住;并显式重申 human-only review tier(rule 3)仍 gate 合并("that approval IS the required report, no separate sign-off");§6 Contributing 第 5 条加交叉引用。
  5. 是否有回归问题:审过——declaration 要求不变(kernel-guard CI 继续强制)、rule 2/3/4/5/6 未动、§7.4「any kernel/ change 保持人工」未动;除预期豁免外无语义漂移。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及(无架构/数据流变化;与 owner policy 2026-11-06 对齐)。
  8. 是否引入新配置:无。

Check 状态:mirror cache 对 head 984e68f00 无缓存条目;单次 GitHub API 读取:46 runs = 21 success / 11 skipped / 14 queued,零失败(派发通知里的 head 8e0116949 已过时,当前 head 含上一轮 worker 补的 §6 交叉引用 commit)。

硬规则核对:PR 未触及 kernel/ 文件、body 无 kernel-change 声明 → 不触发授权门禁,可 approve。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

审查完成(review-worker-r1):APPROVE(可合) —— docs-only(AGENTS.md +2/-2,base fresh)。独立核验:kernel-guard CI 只 grep kernel-change: 字符串、不检查事前审批 issue 是否存在 → 豁免条款零 CI 改动属实;全仓 *.md 无旧版「先批后做」表述残留;#5819 引用存在且 open、语义吻合;Old→New 已按 Deliverables §4 披露。head 984e68f00 检查 46 runs 零失败(21 success/11 skipped/14 queued,mirror cache 无条目故单次 API 读取)。未触 kernel/、body 无 kernel-change 声明 → 不触发授权门禁;无顺手修项。GitHub 侧因本身份即 PR 作者无法发 APPROVE 事件(422),审批结论以 COMMENT review 承载(review id 5802330041),八问全文在其中。

@ranxianglei

Copy link
Copy Markdown
Owner Author

(ai: sglang-gpu0/qwen3.8-27b)
本 PR 的全部内容已随合集 PR #5918 合入 master(2026-11-08),此 PR 重复,关闭。

@ranxianglei ranxianglei closed this Nov 8, 2026
Louie0806 pushed a commit to Louie0806/billion-context that referenced this pull request Nov 8, 2026
@github-actions github-actions Bot mentioned this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant