docs: add Review & Auto-Merge Discipline (AGENTS.md §7 + guardrails) - #303
Conversation
Codify, from a full-history audit of this repo + siblings (billion-context#801), the rules humans enforce and the surfaces AI cannot safely self-judge. This is the CORE library: promote the kernel-owned contracts (ref-id immutability, wire-artifact format, round-trip fidelity, tool-pair atomicity) to first-class human-gates, and give this repo the narrowest auto-merge surface of the three. Docs only.
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)In your adapter project: npm install acp-kernel@pr-303Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf acp-kernel-pr303.tgz
npm install ./packageThis comment is automatically updated on each push. |
[bot] 🏷 Verified this PR end-to-end (pulled the branch, inspected the diff vs current master, checked CI, and spot-checked every cited number/PR against live repo state). Summary: Diff cleanliness — pass. Exactly 2 files, +154/−0, purely additive: CI — green. 4/4 checks on head Citations — all check out. Verified each cited item against the tracker: #286/#287→#293 tool-pair atomicity (#293 merged today; One factual concern — the §1 baseline. The doc states "295 tracked items (220 PR / 75 issues); 175 merged, 0 closed-unmerged, 21 open". Live counts today (GitHub search API): 225 PR / 77 issues; 177 merged, 25 closed-unmerged, 59 open. Two problems:
(The Suggested fix before merge: either re-run the count script and update §1 (my proposed replacement: "302 tracked items (225 PR / 77 issues); 177 merged, 25 closed-unmerged — mostly superseded iterations where the fix landed via a follow-up PR; 59 open"), or label §1 explicitly as a dated point-in-time snapshot with its counting definition. Happy to land the wording fix as a commit on the branch once you pick a framing. Everything else looks merge-ready; merging stays human per §4. 一句话中文摘要:PR 内容核实无误(diff 干净、CI 全绿、所有引用均可查证),唯一问题是 §1 基线数据与线上实际不符——"0 closed-unmerged" 实为 25 个,且 175+0+21=196 与总数 295 自相矛盾,建议作者修正基线数字或标注快照时间后合并。 |
…t live in AGENTS.md §7 Remove the gate/checklist/verbatim-§7 blocks that duplicated AGENTS.md §7; keep baseline data, per-rule issue citations, blind-spot analysis, and owner decisions. Rules now stated once, in §7.
Part of billion-context#801 — codify, from a full-history audit of this repo + siblings, the rules humans enforce and the surfaces AI cannot safely self-judge. This is the CORE library, so its auto-merge surface is deliberately the narrowest of the three repos.
What changed (docs-only; no code, no version bump):
AUTO-MERGE-GUARDRAILS.md— measured baseline (295 items; 175 merged, 0 closed-unmerged), ≈25% second-round ("重灾区") rate among merged PRs that drew review, the implicit human rules with citations (prune/compress: a fold can split one tool call from its result (parallel burst) — unrecoverable 400 on strict OpenAI backends #286/fix(prune,compress): never split a tool call/result pair or an assistant run across a fold #287/fix(prune,compress): never split a tool call/result pair across a fold #293 tool-pair atomicity, Blank reasoning_content is destroyed by the core round-trip, so a strict-echo backend rejects the rebuilt request #289/fix: repair compound JSON damage (raw control chars + invalid escapes) in lenient parser #274 round-trip fidelity, fix(config): NudgeConfig docstring defaults drift from actuals; validateConfig accepts non-finite nudge scalars that silently kill growth nudges #163 doc-vs-default drift, fix(sync): keep host-expanded blocks deactivated across syncBlocks #181 block-state stability, Count-based tier nudges (tier2Trigger/tier3Trigger) fire below the usage band #237/fix(nudge): fire tier-2/3 distillation nudges on block COUNT, not summary token mass #162 tier nudges), and the kernel-owned contracts as first-class human-gates.AGENTS.md§7 "Review & Auto-Merge Discipline": before-you-start, review discipline, kernel-owned contracts (first-class, ALWAYS human-gated) — message-id/ref immutability (§2 principle 6), wire-artifact format (tag / acp_summary / token-snapshot freezing), single-owner content, lossless round-trip, tool-pair atomicity, protected-tool filtering, load-bearing Prompts rules, pipeline node ordering + nudge invariants — plus structural constraints (zero deps, platform-agnostic, state schema). Then an explicit narrow auto-merge gate + must-stay-human list + reviewer focus.This is where the deferred kernel-side spec now lives: the format contract for ACP artifacts and the id-never-reused guarantee are promoted to first-class invariants in this repo (the host repos keep only their faithful-consumption duty). Any change to these is cross-repo by construction → always human + kernel-ships-first sequencing.
Docs only — no build/typecheck/test impact. Merging stays human.