Repository navigation
feat: kernel-native deterministic pre-crush via compress.crush (#1094) - #1176
Conversation
Replaces the bili-local pre-crush library of #1098 with the kernel's crush pipeline node (acp-kernel >= 0.0.84): config plumbing only — three-level merge + validation for the top-level compress.crush key mapping onto kernel CrushConfig. The kernel executes between absorb-hide and absorb-prompt inside processTurn, so both compression modes behave identically and no duplicate strategy library ships in dist.
[bot] 🏷 Picked up. This is a [PR] issue mirroring PR #1176 (head |
[bot] 🏷 PR #1176 verified — no code changes needed. Pulled Local pre-flight (on head a807dfe): typecheck ✅ · build ✅ · Code review — claims confirmed:
Regression review — existing behaviors touched by the diff paths:
CI status:
Suggested order: merge #1175 first (it's green), then retarget/rebase #1176 onto master (or merge as-is once the base resolves) — 中文摘要:核对了 PR #1176 的完整 diff 与内核 0.0.84 的 CrushConfig 契约(映射、三级合并、fail-loud 校验均与设计一致,默认关闭时线上字节不变),本地在精确 head 上重跑 typecheck/2288 测试/build 全绿;唯一行为变化是 |
Rework of #1098 on top of acp-kernel 0.0.84 (#1175): the kernel now ships the crush strategies natively (pipeline node
crushbetween absorb-hide and absorb-prompt, kernel PR #359), so this PR deletes the 1263-line bili-local duplicate and keeps only the config surface.What ships:
compress.crushtop-level key (sibling ofabsorb):{ enabled, minReduction (ratio | percent-string), strategies: { "json-fold" | "code-trim" | "log-select": { enabled, excludeTools } } }applyCompressSettingsmaps onto kernelCrushConfig(DEFAULT_CRUSH_CONFIGdefaults; percent-string parsed)applyAbsorbViewchange — the kernel node fires insideprocessTurnfor every existing call site (all 7 pass the active config), identical behavior in both compression modesWhy rework instead of merging #1098 as-is: #1098 carried its own JSON/code/log crushers (
src/pre-crush.ts,__pre_crushenvelopes) — now a byte-divergent duplicate of kernelcrush.ts(__acp_crush). Two writers for one concern violates the kernel-owns-format-contract split; also its re-crush after processTurn was a non-idempotent double pass.Testing:
tests/crush.test.ts— parse validation, three-level strategies merge, kernel mapping defaults, and an integration test throughprocessTurnproving the kernel node crushes an oversized repetitive-JSON tool result via bili config plumbing (and passes through intact, absorb-prompt-only, when crush is off).Pre-flight: typecheck ✅ / 2288 tests 0 fail ✅ / build ✅ (on top of #1175's kernel 0.0.84 pin)
Fixes #1094
Supersedes #1098