Repository navigation
[PR] kernel: Remove crush tool result rewriter (owner directive) — mark config keys as INERT, synchronously remove invariant- | kernel: 移除 crush 工具结果重写器(owner 指令)— 配置键 INERT 化,invariant-judge 豁免同步删除 - #7966
Conversation
…ig key inert with a one-time warning; invariant-judge crush exemption gone; kernel 0.0.217
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.12436-pr.7966.0f13898This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr7966.tgz
npm install -g packageInstall instructions are refreshed on each push. |
The crush removal dropped the crush field from the kernel Config, which changed the effectiveConfig snapshot stamped into session.metadata (storeEffectiveConfig), which changed the persisted-state metadata digest. The committed storage-render goldens (read by both golden-storage-render and storage-engine-proofs) were not regenerated, so all four wires red on CI. Regenerated via scripts/update-storage-render-goldens.ts. The only change is the metadata section digest (effectiveConfig lost the crush field); the state/blockContents/stats sections are byte-identical. Closes the CI red on PR #7966 (shard-1 storage-render + storage-engine-proofs).
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复——独立审核 PR #7966(kernel crush 移除),未照抄 issue 结论,diff 逐段自行通读。 审核范围: 全量 diff(18 文件 +96/−3241)逐段读:kernel 侧( 发现并当场修复的回归: PR 原提交(3128090997c)CI 四条 wire 的 storage-render golden + storage-engine-proofs 全红。根因:crush 从 kernel 其余审核结论:
八问:
判定: 可合(待 CI 在 8ed3274 上转绿)。回归已修复并 push,PR 描述已补注。新提交 CI 当前 pending(旧 run 已随 push 取消,新 run 排队中)。 |
(ai: vllm-qwen/qwen3.8-27b) CI 已转绿: 8ed3274 的 CI run 完成,conclusion=success(27 success / 2 cancelled / 1 skipped)。storage-render golden + storage-engine-proofs 四条 wire 全过,回归修复确认生效。 补一句:push 后 GitHub 自动触发的 run 被整体取消(concurrency 取消旧 run 后未自动重起),我已手动 rerun CI workflow(run 46264747704)跑完转绿;2 个 cancelled 是未重跑的 E2E 侧 run(与本次改动无关的 e2e 车道,非 required check)。 PR 当前 mergeable=true、mergeable_state=behind(仅落后 master,非阻塞)。可合。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1349-master.e5fa99a # this exact build
npm install -g billion-context@master # always the newest merged build
|
… kernel version conflict (round 2) Master advanced 165 commits past the previous merge (4cad860), moving acp-kernel 0.0.214->0.0.217 (crush-removal ranxianglei#7966, mixed-tier auto-split ranxianglei#7959, eg_debug table ranxianglei#7976, release v0.1.218, ...). The PR head carried 0.0.215; the merged kernel = master's 0.0.217 + the PR's anchor-sidecar kernel/src changes, so the version resolves to 0.0.218 (next above master) per Kernel Boundary version discipline. Only the three version/lockfile files conflicted; the PR's 17-file feature diff is preserved byte-for-byte (git diff origin/master = exactly the feature, 758+/11-). Verified: kernel+root typecheck clean, kernel+pi-subagents build, anchor-sidecar 3/3 + compress-settings 44/44, config-surface/coverage/unused-exports/architecture-docs/ lifecycle-ledger/lock-sync all green.
…17 -> 0.0.218) Master advanced its kernel version past this PR's bump again (0.0.215 -> 0.0.217 via other kernel work: #7959 mixed-tier merge, #7966 crush removal, #7944 egress part-id, etc.). This PR's kernel/src changes (media-refs.ts, openai.ts for #6875 DSH attachment refs) remain new work not in any released version, so the merged tree bumps the kernel version to 0.0.218 (master's 0.0.217 + 1) to satisfy the Kernel Boundary version discipline (kernel/src changed => version must advance past the base). Only the three version fields conflicted (kernel/package.json, kernel/package-lock.json, root package-lock.json). All code files merged cleanly and master did not touch the PR's kernel files since the previous merge base (24ba3ad). kernel-change: recognize DSH attachment refs as recoverable media (#6875) - version bump to 0.0.218 is the mechanical consequence of merging master ahead of this PR's kernel work.
这是啥
把 kernel 的 crush 工具结果重写器整个移除(owner 指令 2026-11-29:「这个功能移除吧,我理解会影响模型的正常能力」——模型在改写后的内容上工作,哪怕逐轮字节稳定,也是模型没见过的文本)。crush(#354 引入、默认关闭)是纯视图层的确定性改写:对出站 prompt 里的工具结果做 json-fold / code-trim / log-select 三种压缩,模型读到的正文因此不再是原文。
移除了什么
kernel/src/crush.ts整文件(三策略 + 插件注册面 +__acp_crush包络)、compress.ts的crushNode(管线节点)与注册、config.ts的 crush 缺省/合并/校验、types.ts的CrushConfig/CrushStrategyOverride、view-latch.ts的 crush digest 切片(digest 变化 → 既有 latch 一次性释放重放,安全方向)、index.ts的全部 crush 导出(grep 确认零消费者)。src/invariant-judge.ts的__acp_crush豁免整条删掉(CRUSH_KEY 常量、isCrushedToolResult、stableEqual 豁免行、豁免台账的 crush 计数与日志字段)——包络从此不再是一种合法 diff。kernel/tests/crush.test.ts删除(46 用例随功能消失);pipeline.test.ts节点清单去掉 crush;issue3939-view-latch.test.ts的 crush 配置边界 pin 删除(该语义仍由 absorb / CCR 两个 pin 钉住)。tests/invariant-judge.test.ts:原「crush 改写豁免」用例反转为新行为的回归钉——__acp_crush包络现在必须被判成 rewrite(ok === false);台账断言改为「crush 桶不再存在」。tests/golden/wire-contract/kernel.json:重新生成,唯一变化是behavior/defaultConfig100k里少了 crush 块(4 行删除,无其他漂移)。tests/golden/storage-render/*.json(4 条 wire):重新生成——crush 从 kernelConfig移除后,storeEffectiveConfig盖进session.metadata的effectiveConfig快照少了 crush 字段,持久化 state 的 metadata 段 digest 随之变化;原提交的金标未重生成,CI 四条 wire 的 storage-render golden + storage-engine-proofs 全红。重生成后唯一变化是 metadata 段 digest(state/blockContents/stats 三段字节不变),与 CI 实测 actual 逐条吻合(commit 8ed3274)。tests/removed-compress-keys-inert.test.ts新增 2 例:crush 键残留的一次性 INERT 警告(顶层 + providers 两级、去重、静默路径)。crush键(顶层或 providers 各级)不再被读取,一次性[acp-config] … is INERT — the kernel crush tool-result rewriter was removed …警告后忽略值,不动用户文件。bili crush车道),与本功能无关,零文档改动。kernel-only PR 不改 CHANGELOG(release 分支收口,与 [PR] fix(kernel): route diagnostics through injected sink (no longer writing directly to host TUI) + funnel-zero only reports | fix(kernel): 诊断走注入 sink(不再直写宿主 TUI)+ funnel-zero 只报无法解释的清零 #7792/[PR] kernel: mixed-tier merges auto-split at the tier boundary instead of silently double-covering the higher-tier block (#7770) #7959 同惯例)。顺带关掉什么
#7827(crush 调用侧丢 protectedCallIds)、#7828(crush 剥 absorb 提示的 indexOf 误伤)——执行路径本身没了,按 won't-fix 关(关 issue 动作在 PR 外执行,此处注明)。
验证
npm test1660/0(基线 1706 − 46 crush 用例);host typecheck 干净。kernel-change:
移除 kernel crush 功能(crushNode 管线节点 + crush 配置/类型/导出 +
__acp_crush视图包络 + view-latch digest 切片),host invariant-judge 同步去掉__acp_crush豁免;配置键 inert 化处理。kernel 0.0.216 → 0.0.217。