Repository navigation
[PR] fix: snapshot-render — covered rows no longer accept signature binds (#4052) - #4057
Conversation
A genuinely new client message whose role|contentType|text matches an already-summarized row was signature-bound onto that covered row; the anchor then replaced the row while clientJoin sat past the new message, so its content vanished from the outbound view (model never saw the latest user message). verif judge C1 counterexample, confirmed on real code. Covered rows are now excluded from bySig candidates only (byId keeps them — exact ids are unambiguous and steady-state seams rely on them). Covered-region computation moves before the backward chain so the filter can see it; anchor synthesis consumes the precomputed seeds. Seams that rested solely on covered-row sig hits now degrade to legacy instead of guessing.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4839-pr.4057.ff68259This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4057.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 扫了全部 100 个 open PR + open/closed issue:本 PR 是唯一触碰快照渲染 covered 行 bySig 绑定的条目(相近标题的在途 PR——#4056/#4053/#4005 是 cache-seam 计量、#3742 是折叠延迟物化、#3311 是 thinking 回收——机制均不同);对应缺陷 #4052 是本 PR 的修复对象(Closes #4052),同族 #3812/#3817 已关闭。 标签: bug / scope/kernel / p1(出站内容丢失类,按 owner 规则 2026-10-19 定 p1;D 车道跨全部代理车道,不打客户端标签)。 本 PR 由本 daemon 前一会话实现(#4052 讨论 3-5 楼有过程记录)。现按 PR 审核规范独立复审——逐段读 diff、人工重放反向链逻辑、核对测试牙齿,不复用 issue 侧结论。本地定向验证与 CI 状态核查进行中,随后给结构化八问结论。 |
(ai: vllm-qwen/qwen3.8-27b) PR 复审结论(独立重审,非复用 issue 侧分析)总判定:代码过审,可合(人工合)。 修法打在根因上、最小且保守;测试有牙且双向;逐项回归清点无意外破坏。CI 当前红与本 diff 无关——是 #4049 跟踪的既有 #3769 存储回归套件 flake 家族(证据链见下),rerun 或等自然绿即可拿到干净信号,本 PR 侧无需改码。 结构化八问
测试有效性新增 6 例直跑 CI 状态(关键核查项)Head 本地验证(实测)typecheck 干净(exit 0);三个 snapshot 套件定向跑 23/23 绿。全量回归以 CI 为准。 收工判定:可合并(人工合并,本 PR 触及出站消息形态与身份绑定面,不走自动合并)。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.696-master.7b8e6ed # this exact build
npm install -g billion-context@master # always the newest merged build
|
…nding for-of support ranxianglei#4057 (merged) excludes covered rows from bySig candidates. The judge now proves the tail survives even when its (role|ct|text) collides with a covered row — C1b flips sat→unsat and becomes a regression pin for the fix itself (sat again = covered-row exclusion regressed). The ranxianglei#4057 refactor also introduced `for (const { blockId, seqs: blockSeqs } of blockSeeds)` in buildView's anchor synthesis — the translator's for-of binder only understood identifiers and array patterns. Added ObjectBindingPattern support (property read via the member fan, rename via propertyName) mirroring the VariableStatement arm, so snapshot-render stays in the guarded set with zero degradations. Suite: 29/29 with solver (guard 2 / smoke 3 / directed 8 / generic 1 / induction 2 / view-latch 2 / conflict-watch 4 / anthropic 3 / google 3 / snapshot-render 2).
Closes #4052
问题
快照渲染 D 车道的反向链路里,
bySig签名兜底(role|contentType|text,不含 id)会把一条全新的消息(新 id,byId查不到)绑定到一条已被摘要覆盖的旧行上。covered 行本来就被 anchor 替换、不渲染,而clientJoin又指到了这条新消息之后——于是这条新消息的内容从出站视图里整体消失,模型看不见用户最新说的话,没有任何报错。verif 符号执行(judge C1「tail 内容不得丢失」)给出 SAT 反例,真代码回放确认(issue 内含最小复现)。与 #3812(identitySig 太弱,#3817 已修)同族不同果:#3812 是中间历史被截断,这个是最新消息内容直接丢失。#3817 的 MIN_SEAM_RUN/单隙容忍没有拦住它,因为 sig 命中计入了 run、容忍隙桥接了矛盾。
修法
src/server/snapshot-render.tsbuildView:blockSeeds/coveredSeqUnion)从 anchor 合成处前移到反向链路之前(数据依赖),anchor 合成改为消费预计算的 seeds,逻辑等价。为什么选「排除 covered」而不是 issue 选项 3(sig 加 id):升级轮(#3752 id re-mint)里,被覆盖行的 twin 本来就该失去 sig 绑定——链在覆盖区上缘断开、join 停在边界、覆盖区仍随前缀渲染在 anchor 之后(有界降级,永不丢失);而 sig 加 id 会连未覆盖行的 twin 路径一起杀掉。
行为变更披露
chain-not-started/seam-too-short,客户端视图原样出站,无损)。稳态(id 稳定)路径与未覆盖 twin 路径字节级不变。方向是保守的:宁可降级也不猜。block-unanchored检查从链后提前到链前:同时命中两种情况的会话,degrade reason 标签可能变化(结果同为 legacy,纯观测面)。tests/snapshot-render.test.ts断言(无损断言保留并加强:tail 的新消息必须可见)。chain-not-started):原 Snapshot rendering identity signature does not include message ID: duplicate short messages silently truncate history (m | 快照渲染身份签名不含消息 id:重复短消息会静默截断历史(开灰度前必须修) #3812 形状不再触发降级;中段部分重写在本 harness 下 store tail view 不收敛(settleRows 超时),无法驱动。seam-too-short的钉由新增单元测试覆盖。测试
tests/snapshot-render-chain.test.ts(6 例,直跑maybeSnapshotView):issue 复现形状(T1,pre-fix 实测失败,stash 验证过 pass/fail delta)+ 5 个 gate 双向钉(未覆盖 sig 路径完好 / 中段覆盖区不断前缀 / 稳态 byId 不变 / 仅 covered 命中时保守降级 / MIN_SEAM_RUN 存活)。tests/snapshot-render.test.ts(Snapshot rendering identity signature does not include message ID: duplicate short messages silently truncate history (m | 快照渲染身份签名不含消息 id:重复短消息会静默截断历史(开灰度前必须修) #3812 形状按新语义)、tests/snapshot-shadow.test.ts(stake-4 形状)。tests/verif-snapshot-render.test.ts的 C1 查询目前只在 wt-4038 分支上(master 尚无此文件);可在该分支重跑,预期本形状 UNSAT。