From 8e0116949e5e4fa8ab0099465dd82e379a9a68b5 Mon Sep 17 00:00:00 2001 From: ci-check Date: Fri, 6 Nov 2026 22:46:41 +0800 Subject: [PATCH 1/2] docs(kernel-boundary): add mechanical-bug exemption to Kernel Boundary 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 --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 2cd4533d56..789376af92 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -87,7 +87,7 @@ The kernel (`acp-kernel`) guarantees, and billion-context RELIES on: within a se The compression kernel lives IN THIS REPO under `kernel/` (migrated verbatim from ranxianglei/acp-kernel @ v0.0.101 on 2026-10-04; the old repo stays frozen until the move has settled). It keeps its own identity — npm name `acp-kernel`, own `version`, own unit suite (`kernel/tests/`), own build chain (tsup → `kernel/dist` + d.ts) — and the host consumes it through `"acp-kernel": "file:./kernel"` exactly like the old registry package (same exports map, same typing, same JS inlined by tsup). The merge exists to end cross-repo maintenance pain WITHOUT making the kernel easy to disturb. Enforced rules: -1. **Declare before you touch.** Every PR touching anything under `kernel/**` MUST declare `kernel-change: ` in its body (CI job `kernel-guard` fails otherwise) AND needs owner approval BEFORE implementation, via a dedicated issue stating why the host side cannot solve the problem. Commits use the `kernel:` prefix. +1. **Declare before you touch.** Every PR touching anything under `kernel/**` MUST declare `kernel-change: ` in its body (CI job `kernel-guard` fails otherwise); commits use the `kernel:` prefix. Any OTHER kernel change additionally needs owner approval BEFORE implementation, via a dedicated issue stating why the host side cannot solve the problem. **Mechanical-bug exemption (#5819):** a kernel defect provable at a glance — a wrong literal, a typo, or a falsifiable guard predicate whose failure a test demonstrates — may be fixed directly WITHOUT that 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 (the change alters nothing beyond the bug), and which test pins it. The human-only review tier (rule 3) still gates the merge — that approval IS the required report, no separate sign-off. Every other rule in this boundary is unchanged. 2. **Version discipline (CI-enforced).** Any change under `kernel/src/**` (or `kernel/tsup.config.ts` / `kernel/tsconfig.json`) MUST bump `version` in `kernel/package.json`; a bump without such a change also fails. Normal kernel changes ride along with billion-context releases; when enough accumulates, a dedicated kernel release publishes `acp-kernel` standalone (§5, Kernel releases). 3. **Human-only review, always.** ALL kernel changes sit at the same review tier as `src/update.ts` and security (§7.4): no auto-merge, ever. 4. **Behavior constants are golden-pinned.** `tests/golden/wire-contract/kernel.json` pins not just the tool schemas but the behavior surface hosts silently depend on: `defaultConfig(100_000)` (incl. the flat-50K nudge constants), `defaultPrompts` (the four load-bearing prompt rules), tool-name tables, wire markers. Regeneration requires stated justification in the PR; the ledger never shrinks (#1304). From 984e68f00861cdb7e77965b5a4651249c9bdd18b Mon Sep 17 00:00:00 2001 From: ci-check Date: Fri, 6 Nov 2026 23:01:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs(kernel-boundary):=20note=20mechanical-?= =?UTF-8?q?bug=20exemption=20in=20=C2=A76=20Contributing=20summary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 789376af92..edc75a9588 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -233,7 +233,7 @@ Releases are fully automated via CI (`.github/workflows/release.yml`): the Agent ## 6. Contributing -Before changes: (1) `npm run typecheck` clean, (2) `npm test` green, (3) understand the module dependency graph, (4) **consider BOTH compression modes** — any change touching the wire (message rebuild, system/developer handling, tool injection, `acp_summary` stripping, preflight, nudge) must be reasoned in BOTH plugin mode and proxy mode; correct-in-one-mode can break the other (#377 only manifested in proxy mode). See TECHNICAL-NOTES.md "Two compression modes" and the `pluginMode` comment in `src/server.ts`. (5) **Kernel changes follow the Kernel Boundary** — declaration marker, owner approval, version discipline, two-layer tests; the kernel is relatively stable by design, touch it only when necessary. (6) **`pi-subagents/` changes follow the Pi-Subagents Boundary** — version discipline + two-layer tests, lighter gating than `kernel/` (see that section). +Before changes: (1) `npm run typecheck` clean, (2) `npm test` green, (3) understand the module dependency graph, (4) **consider BOTH compression modes** — any change touching the wire (message rebuild, system/developer handling, tool injection, `acp_summary` stripping, preflight, nudge) must be reasoned in BOTH plugin mode and proxy mode; correct-in-one-mode can break the other (#377 only manifested in proxy mode). See TECHNICAL-NOTES.md "Two compression modes" and the `pluginMode` comment in `src/server.ts`. (5) **Kernel changes follow the Kernel Boundary** — declaration marker, owner approval (mechanical-bug exemption per rule 1), version discipline, two-layer tests; the kernel is relatively stable by design, touch it only when necessary. (6) **`pi-subagents/` changes follow the Pi-Subagents Boundary** — version discipline + two-layer tests, lighter gating than `kernel/` (see that section). Commit convention: `feat:` / `fix:` / `refactor:` / `test:` / `docs:` / `release:`.