Repository navigation
kernel: empty view no longer marks requested refs DEAD (#3137) - #3141
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.3921-pr.3141.3516452This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3141.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) PR #3141 审核结论(八问)1. 是什么问题:会话视图为空( 2. 什么原因导致的:可见性基准是 3. 影响范围与严重程度:触发条件是空视图调用——大会话上下文丢失后的重试、宿主侧异常。后果链:假 DEAD 墓碑让后续重试被 receipt 明确禁止("Do not retry this range in any form")、 4. 怎么修复的:给 dead-ref 记录循环加 5. 是否有回归问题:逐项审过触碰路径的既有行为——非空视图死 ref 记录(不变,字节等价)✓;墓碑解除双路径( 6. 是否破坏缓存:不涉及。 7. 是否改了设计方向:不涉及。内核契约层单点加固,与内核既有的「可见性是逐次调用的证据」纪律对称(解除逻辑本就只认非空视图的重现证据)。 8. 是否引入了新的配置:不涉及。 测试有效性(§④ 独立验证)3 个新测试钉住披露表的三行语义(空视图不写墓碑且无 DEAD 措辞 / 既有墓碑空视图下原样存活 / 混合请求不加墓碑)。本地 A/B 实证:PR head 上 Kernel Boundary 合规
CI 终局状态(head
|
bae518d to
2fed4c7
Compare
An empty input.messages carries no visibility evidence: it means this call
carried no messages at all, not that the requested messages disappeared.
applyCompression previously judged every requested known-but-uncovered ref
dangling under [] and wrote it to state.deadRefs, poisoning the intact refs
table until the next model request restored the view (tombstone-with-clear)
and lying in every receipt in between ('can NEVER compress').
With an empty view, create no new tombstones and lift none; existing
tombstone-with-clear branches are untouched, and non-empty-view behavior is
unchanged.
2fed4c7 to
d171c65
Compare
kernel-change: #3137 — applyCompression marked every requested ref DEAD under an empty message view (
input.messages=[]), poisoning intact refs tables until the next model request restored the view. An empty view carries no visibility evidence and must not create tombstones. Owner-approved via dedicated issue #3137 (the host-side gate in #3136 protects only bili; mixed requests it deliberately lets through, and every other acp-kernel consumer, still hit this path).Closes #3137
Problem
applyCompressioncomputes the "visible" baseline asnew Set(input.messages.map(m => m.id)). Withinput.messages=[]that set is empty, sodanglingMessageRefsjudges every requested ref that is known to the session but not covered by an active block as dangling and writes it intostate.deadRefs— even though nothing disappeared; the call simply carried no messages (proxy resident-pool eviction between model requests, process restarts, or any consumer calling with[]). Because the host commits the kernel state clone even on a total failure, those tombstones persist: receipts blame "the client rewrote or dropped those messages" and forbid retry forever ("can NEVER compress"), and three such calls arm the loop breaker with a false cause (#3126).Fix
Skip the dead-ref recording block entirely when
input.messages.length === 0. Everything else is unchanged:applyCompressionfilter + theprocessTurnlift);Behavior change disclosure (old → new)
messages=[], requested refs known but uncovered by any blockstate.deadRefs; receipt says "recorded as DEAD … Do not retry this range in any form"; acp_status shows "can NEVER compress"deadRefsunchanged); receipt uses the non-DEAD gate wording; acp_status unaffectedmessages=[], pre-existing tombstonesmessages=[], refs covered by active blocks (refold path)messages != [](all cases)Reason:
deadRefsexpress "the message really is gone", not "this call did not carry messages". This is defense-in-depth at the kernel contract layer — bili's main path gets the up-frontgate:no-visible-contextrefusal from #3136 (merged to master), but mixed requests (a range over an active block plus a range that is not, which that gate deliberately lets through) and every other acp-kernel consumer remain protected here.Tests (two layers, both green on the rebased head d171c65)
npm --prefix kernel test). New pins inkernel/tests/dead-refs.test.ts:state.deadRefsstays undefined, no "DEAD" wording in the receipt;Kernel version bumped 0.0.126 → 0.0.127 (CI-enforced discipline; master consumed 0.0.123–0.0.126 via other kernel changes while this PR was in review — the rebase resolved the version-line collision at the next free number each time).
package-lock.jsonrecords thefile:link version accordingly — verifiednpm install --package-lock-only --ignore-scripts --no-fund --no-auditproduces zero further lock drift (lock-sync job).