Repository navigation
fix(#2388): guard CompressionState clone fidelity; complete kernel hydrator - #2425
ranxianglei wants to merge 1 commit into
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3870-pr.2425.75ddc80This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2425.tgz
npm install -g packageInstall instructions are refreshed on each push. |
结论先行:代码正确、测试有牙、typecheck 干净;CI 仅一个无关单元格(windows/node22)因 e2e 启动时序抖动而红,我已重跑该 job。 这是 kernel 变更(human-gated),等重跑转绿后由你合并。 八问
行为变更披露(必报): 验证证据(PR head
处置:已对该 run 执行 判定:代码可合(待该 flake 单元格复绿);kernel 变更 human-gated,合并请你操作。 |
|
冲突 |
8390e6a to
7b9f625
Compare
…drator CompressionState clone/hydrate points rebuild via explicit field lists, so each new optional field silently drops wherever the list lagged (deadRefs hit three such points in #2362/#2370). Make that drift loud instead of silent: Guard (two layers): a compile-time field inventory mapped over keyof CompressionState with optionality stripped (-?), so adding a field without listing it is a TYPE error, plus a runtime EXACT match between each point's actually-carried keys and its documented expected-missing set. Covers syncBlocks, cloneState, mergeCompressionState (kernel) and mergeState (host). The subagent fork is targeted inheritance, documented rather than asserted (needs the session harness). Fix: mergeCompressionState (the standalone acp-kernel hydrator) carried neither hiddenOrphanRefs nor lastPassIds, so a real consumer lost them on restart. Bare passthrough like terminalStreak (neither is seeded by createInitialState). No runtime behavior change: the syncBlocks/cloneState gaps are left as-is; their safety proofs (self-heal / inert / deferred-eval) are documented in the guard. Carrying image*/lastPassIds there is deliberately deferred per the issue. Bumps acp-kernel 0.0.108 -> 0.0.109 (kernel/src changed).
7b9f625 to
9d60520
Compare
(ai: vllm-qwen/qwen3.8-27b) 收到「冲突」提醒,已处理完:把 PR 分支 rebase 到当前 master 并解决全部冲突,本地定向验证全绿。 八问
kernel 版本:0.0.126 → 0.0.127。这 supersede 了 PR 描述里「0.0.108→0.0.109」的说法(那是 rebase 前的旧基线);#2370 那次 kernel bump 也已随 master 落地( 并发说明:处理时看到该分支在同一时段被同一套自动化(另一实例)反复 rebase/force-push 过几次,各版本功能完全等价。我这次独立重做并本地验证绿,顺带把 subagent-fork 那段 docstring 恢复到更精确的措辞(prefix-scoped 过滤 / stats 重算 / nudge 条件继承)。当前 head 判定:冲突已解决、分支干净、本地验证绿,可进正常 CI + kernel 人工审核流程。合并按惯例由你手动执行(我不 merge)。 |
(ai: vllm-qwen/qwen3.8-27b) 冲突已解决:分支已 rebase 到当前 master( 过程披露(两个 worker 竞态):本次唤醒有两个 worker 同时处理,先后各推了一版 rebase 互相覆盖。最终保留的树 八问
收工判定:冲突已解、代码就绪、本地验证绿;剩余红灯全部是已追踪的 master 既有问题且修复在途(#3314/#3317),合入后重跑即绿。master 转绿后可直接由人工合并;若 owner 接受「红灯均有追踪且在修」的状态,现在也可合并。 |
Summary
Closes #2388
CompressionStateclone/hydrate points rebuild the object via explicit field lists, so every new optional field silently drops wherever a list lagged — no compile error, log, or runtime warning (deadRefshit three such points in #2362/#2370). This makes that drift loud instead of silent, and fixes the one point that was actually harmful today.Guard (two independent layers)
New suites
kernel/tests/state-clone-fidelity.test.ts+tests/state-clone-fidelity.test.ts:keyof CompressionStatewith optionality stripped ({ [K in keyof CompressionState]-?: K }). Adding a field (esp. an optional one) without listing it is a type error, so the omission surfaces attscbefore any test runs.Covered:
syncBlocks,cloneState,mergeCompressionState(kernel) +mergeState(host). The subagent fork is targeted inheritance (deliberately skips fields), not a full clone — documented rather than asserted here (it needs the session/lock/snapshot harness; extraction into a pure fn is noted as follow-up).The expected-missing sets double as the living documentation of why each gap is safe today (self-heal / inert, with line refs).
Fix (the harmful point)
mergeCompressionState— the standalone acp-kernel hydrator — carried neitherhiddenOrphanRefsnorlastPassIds, so a real consumer lost them on restart (bili's own host hydrator already had them);deadRefs(#2362) hit the same gap when it landed. All three added as bare passthrough liketerminalStreak(none is seeded bycreateInitialState), so the kernel hydrator now matches the host one field-for-field.No runtime behavior change
After rebase onto current master:
cloneStatealready carries every field (its original gaps were closed upstream by the #2362 work) — its empty gap set is pinned against regression.syncBlockskeeps its two documented gaps (hiddenOrphanRefs: self-heals post-pipeline;lastPassIds: inert — consumed before it runs, re-stamped after). Only the forward-compat hydrator gains completeness. Mutation-tested pre-rebase: reverting the fix made the guard fail naming exactly["hiddenOrphanRefs","lastPassIds"]; restored → green.Kernel version
Bumps
acp-kernel0.0.126 → 0.0.127 (kernel/srcchanged).Rebase (conflict wake-up, 2026-10-16)
Rebased onto master
6ee4a2ac9. Conflicts were all in the version lines + the hydrator field list: #3266 removedimageFullRestored/imageShrinksfromCompressionState, so both test inventories and the documented gap sets now track the post-removal field set (and pick updeadRefs). Local: typecheck clean + both clone-fidelity suites green (kernel 4/4, host 1/1); full-suite verdict per CI on the pushed head.kernel-change: complete the standalone acp-kernel hydrator (mergeCompressionState) — it silently dropped hiddenOrphanRefs/lastPassIds (and later deadRefs) on consumer restart; add the missing fields plus a compile-time + runtime clone-fidelity guard across all four clone/hydrate points. No wire/persistence-format change; version bump 0.0.126 → 0.0.127.