Skip to content

[PR] kernel: Remove crush tool result rewriter (owner directive) — mark config keys as INERT, synchronously remove invariant- | kernel: 移除 crush 工具结果重写器(owner 指令)— 配置键 INERT 化,invariant-judge 豁免同步删除 - #7966

Merged
ranxianglei merged 3 commits into
masterfrom
remove-crush
Nov 29, 2026

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

这是啥

把 kernel 的 crush 工具结果重写器整个移除(owner 指令 2026-11-29:「这个功能移除吧,我理解会影响模型的正常能力」——模型在改写后的内容上工作,哪怕逐轮字节稳定,也是模型没见过的文本)。crush(#354 引入、默认关闭)是纯视图层的确定性改写:对出站 prompt 里的工具结果做 json-fold / code-trim / log-select 三种压缩,模型读到的正文因此不再是原文。

移除了什么

  • kernel: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 确认零消费者)。
  • host: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 从 kernel Config 移除后,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 两级、去重、静默路径)。
  • 配置兼容(Remove the compressAtFoldPoint feature — it reorders resent history and caused an authorship-misattribution incident in a live session #6132 先例):旧配置里的 crush 键(顶层或 providers 各级)不再被读取,一次性 [acp-config] … is INERT — the kernel crush tool-result rewriter was removed … 警告后忽略值,不动用户文件。
  • 文档:全仓核查过——docs/AGENTS/README 各语言里所有 crush 字样都是 Crush CLI(charmbracelet 宿主,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 外执行,此处注明)。

验证

  • kernel npm test 1660/0(基线 1706 − 46 crush 用例);host typecheck 干净。
  • host 定向套件全绿:invariant-judge + wire-contract-golden + removed-compress-keys-inert + config 共 76/0。
  • 门禁:unused-export gate clean(13 waived 不变)、test-import-graph ok、architecture-docs guard all green。
  • golden 唯一 diff 已逐行核对(仅 crush 块 4 行删除)。
  • storage-render golden 重生成 diff 已逐行核对:仅 4 条 wire 的 stateDigest/stateDigestAligned/metadata 段 digest 变化,state/blockContents/stats 段不变(crush 字段从 effectiveConfig 快照消失所致)。

kernel-change:

移除 kernel crush 功能(crushNode 管线节点 + crush 配置/类型/导出 + __acp_crush 视图包络 + view-latch digest 切片),host invariant-judge 同步去掉 __acp_crush 豁免;配置键 inert 化处理。kernel 0.0.216 → 0.0.217。

…ig key inert with a one-time warning; invariant-judge crush exemption gone; kernel 0.0.217
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: remove-crush (ec34a48)

Latest build — install this exact version

npm install -g billion-context@0.0.12436-pr.7966.0f13898

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
ec34a48 billion-context@0.0.12436-pr.7966.0f13898 build
3128090 billion-context@0.0.12419-pr.7966.cd4d24a build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title kernel: 移除 crush 工具结果重写器(owner 指令)— 配置键 INERT 化,invariant-judge 豁免同步删除 [PR] kernel: Remove crush tool result rewriter (owner directive) — mark config keys as INERT, synchronously remove invariant- | kernel: 移除 crush 工具结果重写器(owner 指令)— 配置键 INERT 化,invariant-judge 豁免同步删除 Nov 29, 2026
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).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复——独立审核 PR #7966(kernel crush 移除),未照抄 issue 结论,diff 逐段自行通读。

审核范围: 全量 diff(18 文件 +96/−3241)逐段读:kernel 侧(kernel/src/crush.ts 整文件删除、compress.ts crushNode、config.ts/types.ts/index.ts crush 配置/类型/导出、view-latch.ts digest 切片)、host 侧(src/invariant-judge.ts 豁免删除、src/config.ts inert 警告)、测试(crush.test.ts 删除、invariant-judge 用例反转为回归钉、wire-contract golden 重生成、removed-compress-keys-inert 新增 2 例)。

发现并当场修复的回归: PR 原提交(3128090997c)CI 四条 wire 的 storage-render golden + storage-engine-proofs 全红。根因:crush 从 kernel Config 移除后,storeEffectiveConfig(src/session.ts:881)盖进 session.metadata 的 effectiveConfig 快照少了 crush 字段,持久化 state 的 metadata 段 digest 随之变化,但 PR 只重生了 wire-contract golden、漏了 storage-render golden(两个失败套件读同一批金标)。已重生成 4 条 wire 的 storage-render golden(commit 8ed3274,已 push 到 remove-crush),diff 仅 metadata 段 digest 变化(state/blockContents/stats 三段字节不变),新 digest 与 CI 实测 actual 逐条吻合(chat 7e75a8c9 / anthropic 71f57674 / responses d4ffaed5 / google 7f988385)。PR 描述已补注重生理由。

其余审核结论:

八问:

  1. 是什么问题: 按 owner 指令整体移除 kernel crush 工具结果重写器——模型在改写后的内容上工作,哪怕逐轮字节稳定,读到的正文也不再是原文,影响模型正常能力。
  2. 什么原因导致的: owner 裁定(2026-11-29)该功能让模型在没见过的文本上工作,故移除。
  3. 影响范围与严重程度: crush 默认关闭且 host 配置面从未暴露(CompressSettings 无 crush 字段,仅 kernel defaultConfig 缺省),实际影响面极小(仅程序化设 kernel Config.crush 的用户),严重度低。
  4. 怎么修复的: 整文件/整节点/整配置删除(kernel crush.ts + crushNode + 配置/类型/导出 + view-latch digest 切片)+ host invariant-judge 豁免同步删除 + 配置键 inert 化(一次性警告后忽略值,不动用户文件)。
  5. 是否有回归问题: 发现 1 处——storage-render golden 漏重生(CI 四 wire 全红),已当场修复(8ed327458aa)。其余既有行为逐项核过无破坏:state/blockContents/stats 段字节不变、view-latch 安全方向一次性释放、invariant-judge 新行为由反转用例钉住。
  6. 是否破坏缓存: 否。view-latch digest 变化 → 既有 latch 一次性释放重放(安全方向);无其他缓存/重试/增量游标/去重键影响。
  7. 是否改了设计方向: 否——功能移除,非架构/边界/数据流转向。
  8. 是否引入了新的配置: 否新增。crush 配置键转 inert:一次性 [acp-config] … is INERT — the kernel crush tool-result rewriter was removed … 警告后忽略值,不动用户文件。

判定: 可合(待 CI 在 8ed3274 上转绿)。回归已修复并 push,PR 描述已补注。新提交 CI 当前 pending(旧 run 已随 push 取消,新 run 排队中)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(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,非阻塞)。可合。

@ranxianglei
ranxianglei merged commit e5fa99a into master Nov 29, 2026
38 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.1349-master.e5fa99a (rolling master tag).

npm install -g billion-context@0.0.1349-master.e5fa99a  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

ranxianglei pushed a commit to feriaref/billion-context that referenced this pull request Nov 29, 2026
… 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.
ranxianglei pushed a commit that referenced this pull request Nov 29, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant