Repository navigation
[PR] fix: full mode — label adoption converges the unified index row instead of minting a duplicate (#3831) - #3875
ranxianglei wants to merge 1 commit into
Conversation
…ad of minting a duplicate (#3831) Sub-defect b of #3831: when a session persisted under a derived id is adopted by its label, importRecord ran on the label-remapped payload and minted a SECOND row while the pre-adoption id-keyed row lingered forever (viewFor hits on the old id block re-import, so nothing ever removed it). One conversation carrying two rows = double byte accounting, double web/CLI listing, split-brain bounded eviction, and a stale boot entry once the historical file stops aliasing. Convergence at every adoption seam (host-only, no kernel change): - loadSync miss path: after an organic import succeeds, drop the aliased pre-adoption row (new row committed first; crash between = healed next boot). - guardedBuild save path: same convergence after shadow.record, covering post-adoption saves that would otherwise re-mint the twin row. - boot scan: twin files of a canonical session skip the warm window, so a pre-adoption file can no longer be loaded under its dead id at boot. - boot heal: pre-existing duplicates (minted by pre-fix code) are deleted when the label-owned row is present and not older than the stale row. The historical file itself is untouched (#2803 pins byte-stability); only index rows converge.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4585-pr.3875.9e84e2aThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3875.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 是 #3831 清单里的子缺陷 b(采纳事件把统一索引行收敛到 label 而不是铸第二行);同家族的 a 已随 #3819(storage full flip)合入、c(createReplica/restoreReplica 丢孤儿原件)另行跟踪,#3841 是 kernel 侧 blockContents carrier——症状同家族但机制/边界不同,各自独立。本 PR 与任何在途条目无重复。 标签: bug、scope/storage、p2 —— 缺陷类;故障域在持久化/索引层(src/persist.ts 统一存储行管理);p2 判定:full mode + label 采纳场景下会话带两行永久索引(双倍字节记账/双列表/分裂驱逐/潜在陈旧 boot 条目),但 resume 本身可用、无数据丢失、增长有界(每次采纳事件多一行,非无限膨胀)——「能用但有明显问题」档。若你认为陈旧 boot 条目风险应升 p1,我改标。 开始审核:diff 已核对(仅 |
(ai: vllm-qwen/qwen3.8-27b) 审查结论:拦下,不建议合并(BLOCKED)——新回归测试 5 例中 2 例在本 head 上确定性失败;且修复漏了一条会让重复行复活的隐式 seam。方向本身是对的,细节如下。 ① 方向审核(原 issue #3831-b)方向正确:label adoption 应当收敛行而不是复制行。四个 seam(loadSync miss 收敛 / guardedBuild 保存后收敛 / boot scan 跳过 twin 预热 / boot heal 清存量重复)都打在了真实路径上,守卫齐全(alias 必须存在且异名、 ② 本地验证 —— 关键证据head
即 OP 声称的 “Targeted suites green locally on the rebased head” 不可复现。CI 侧同样没有绿信号:本 head 所有含 根因 1(case 1):#3050 R3 懒内容再物化 seam 未被覆盖boot 本身 adopt+converge 是成功的(日志可见 结论:PR 自己声明的不变量「adoption 后恰好一行」被这条 seam 打破。PR 文档化的 residual(“显式 runtime loadSync(oldId) 合法地重新导入其行”)与实现一致,但PR 自己的回归测试断言了超出该 residual 的范围——自相矛盾:要么修 seam,要么改测试。 根因 2(case 4):前提与已钉死行为冲突boot warm loop 按设计会 adopt 任何带 label 的非 canonical 文件(alias 把 item 映射到 label → ③ 回归审计(diff 触碰路径的既有行为逐项)
④ 测试有效性#3617 正负成对的门纪律形式正确;但 5 例中 2 例在 head 上不通过,「回归测试钉住 bug」的承诺当前不成立;case 4 属假测试(断言了一个系统里不会出现的状态)。 ⑤ 顺带发现(与本 PR 无关,另行处理)master 自身两条 required lane 是红的,且在 base commit 上同样失败(非本 PR 引入): 结构化八问
需要你拍板的选项
拍板后我立即在本分支实施(含 case 4 重写)并重跑定向套件回报。master 侧两条红 lane 的独立小修并行推进,不影响本 PR 决策。 |
(ai: vllm-qwen/qwen3.8-27b) 补充(CI 红灯跟踪线,与上方本 PR 的审核结论相互独立):
|
(ai: vllm-qwen/qwen3.8-27b) CI 红灯跟踪线进展:修复 PR 已开出 → #3883( |
|
(ai: zhipuai-lb/glm-5.3) 孤儿票清理:标题指向的 issue 已关闭,修复已由其他路径落地。关单;误判请 reopen。 |
What
Sub-defect b of #3831 (the issue was rescoped to b after sub-defect a landed with #3819):
In unified FULL mode, a session persisted under a derived id with a native label is adopted under that label on first resume:
loadEnveloperemaps the payload id to the label andimportRecordruns on the remapped record — minting a second index row while the pre-adoption id-keyed row lingers forever (viewForhits on the old id block any re-import, so nothing ever removes it). One conversation then carries two rows: double byte accounting in the bounded store, double web/CLI listing, split-brain eviction, and — once the historical file stops aliasing or a post-adoption save lands — a stale boot entry served alongside the fresh one.How (host-only, no kernel change)
Convergence at every adoption seam in
src/persist.ts:convergeAdoptedRow). New row committed first; a crash between the two re-creates the duplicate, which (2) heals.shadow.recordon both fresh and stale-disk branches, covering post-adoption saves that would otherwise re-mint the twin row.The historical file itself is untouched —
tests/bounded-storage.test.tspins its byte-stability through adoption+save (#2803) and stays green.Behavior change (old → new)
loadSync(oldId)against the still-present historical file legitimately re-imports its row (file-backed sessions stay addressable by file name); the boot heal removes it again at the next restart. Not addressed here — same failure domain but a different trigger surface than the adoption event this PR fixes.Config surface
None. No new env var, config field, or CLI flag.
Out of scope
Verification
tests/issue3831-label-adoption-dup-row.test.ts— 5 cases, gate discipline Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 (every positive has its negative twin): adoption converges the row; second boot does not resurrect it; pre-existing duplicates heal at boot; a sole pre-adoption row survives until actually adopted; plain (id===label) sessions untouched. All red without the fix where applicable.Part of #3831 (sub-defect b).
CI status note (2026-10-20)
Two fast gates fail on this head but are PRE-EXISTING master-state failures, not caused by this diff (this PR touches only
src/persist.ts+ one new test file):docs-sync: generated config-doc block carried two stale duplicate rows per language file (storage.unifiedpre-Storage wrap-up: 6 fixes + switch default mode to full (single PR) | 存储收尾六修 + 缺省模式翻 full(一个 PR 统一处理) #3818 wording + oldstorage.sqliteAutoDownload) left by a bad merge resolution upstream of this branch's base.unused-exports:INTERNAL_ONLY src/log-mask.ts: maskUrlForPublish— orphanedexportintroduced by a4f2730 ([security][web] Diagnostics blob prints private relay hosts verbatim in the config section — the "secrets masked" header only masks values, not hosts | 诊断包 config 段原样输出内网中转地址:标题说"密钥已遮蔽",但只遮值不遮主机 #3811).Both are tracked in #3870 and fixed by PR #3871 (fully green: docs-sync, unused-exports, all test shards). While #3871 is unmerged these gates sit in the
needschain, so this PR'stest/static-gateslanes were SKIPPED, not failed. Once #3871 merges, the two checks will be re-requested here so the full test lanes run against the updated merge ref.