Repository navigation
[PR] fix: log compress applications onto reused ref numbers (#5199) - #5212
ranxianglei wants to merge 9 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9206-pr.5212.f7a78fdThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5212.tgz
npm install -g packageInstall instructions are refreshed on each push. |
After a restart, the cold-load ledger restamp can hand a pre-restart ref to another message (a vacated number re-issued as someone else's seq+1 target in the same pass). The guard resolves endpoints live-first, so a replayed pre-restart compress call citing the old number applies to the new owner and returns success — silently folding the wrong message. Live-first stays the accepted resolution (rejecting dead-loops like #4797; translating to the old owner would mistranslate legitimate post-restamp cites). This change makes the application visible instead of silent: supersededRefRejection now reports every cited ref that is BOTH live and still another message's recorded pre-restamp label (dualIdentity), and applyRanges logs a prominent warning naming the refs with salted owner ids only (#1454 pattern). Acceptance behavior is unchanged — zero semantic change; direction decision pending #5204.
Labeled follow-up fixes for comments that contradicted code facts after #4807's kernel liveness prune was reverted: - reference/ref-keyed-surfaces.md: the contract section listed the reverted prune as enforced, and the 暂缓 section claimed host live-first '已消除其全部用户可见危害' — disproven by #5199 (isolated fixture reproduced the silent wrong-target application). Both now say what is actually true and point at #5199/#5204. - tests/issue4797-superseded-deadlock.test.ts: header comment described the post-prune superseded shape ({m3→b, m7→f}); master produces {m3→b, m6→e, m7→f} where m6 is the dual-identity case now pinned in tests/issue5199-dual-identity-log.test.ts.
…HARD_MAX_BYTES #4788 D2 added the per-session resident hard cap (config field sessions.hardMaxBytes / env BILI_SESSION_RESIDENT_HARD_MAX_BYTES) but never registered the surface: no YAML seed entry, no LIFECYCLE.md row, and a hand-edited EN-only CONFIGURATION.md row that diverged from the generator. That tripped config-surface-guard, docs-coverage, lifecycle-ledger-guard and docs-sync on master. Add the seed entry (restoring the author's original EN wording + the #4792 decision ref + honest dynamic default), the matching ZH rows, and the LIFECYCLE.md §2 ledger entry, then regenerate the config docs so the artifact matches the seed again.
…k test The #4666 suite's terminal-stamp asserts were moved to v9 when the schema advanced (commit 'expect the v9 stamp in the #4666 migration suite'), but the concurrent-boots lock test's final assert was missed and still expected v8. With MYSQL_SCHEMA_VERSION now 9 (#4796 zero-ref index — index-only, no row change), the migrator legitimately stamps 9 after the lock frees, so 'migration completed after the lock freed' asserted 9!=='8'. Bump to 9 to match the three sibling asserts; the lock-serialization discriminators (mid-flight stamp 7, rowCount 8, dedup collapse) are untouched.
4b7695e to
2fb797c
Compare
(ai: vllm-qwen/qwen3.8-27b) 结论:本次唤醒是过期转发——所指 head
为何不开 decision-request issue(attempt 2/2 逃生口):剩余阻塞(#4788 hang)不是设计决策,而是 master 车道的未修测试缺陷——按 owner policy 2026-10-24,一切 CI 问题收敛到 #4599,禁止为 CI 问题开新 issue;该缺陷已带签名+复现+嫌疑提交( 收工判定:自动修复车道用尽(2/2)。PR 代码无待办,分支已与 master/ci-fixes 完全对齐;哨兵把 #4788 修复收敛进 ci-fixes 后,再做一次同步合并即可全绿。 |
(ai: vllm-qwen/qwen3.8-27b) Tracking note from the #5207 decision thread (owner ruling 2026-10-31): when #5360 (slot-retirement, kernel 0.0.174) merges, this branch needs a small rebase — the |
Resolve base-move conflicts for PR #5199 against current master: - src/stream.ts: reconcile the residual-hazard comment — kernel #5196 slot-retirement closed the source-level path (pending-decision #5204 superseded), pre-#5196 sessions still carry the ambiguity that dualIdentity now logs. - tests/issue4797-superseded-deadlock.test.ts: take master's #5196-accurate post-restamp comment (f parks on m8), keep the cross-ref to the issue5199 dual-identity test. - src/loop/adapter-anthropic.ts, tests/plugin-fork.test.ts: not part of #5199's intent; converge fully to master (inherited #5179/#4599/#5140/#5608 divergence).
…ernel The PR's original fixture drove its shape through restampRefsToLedger, but #5196's slot-retirement now parks a colliding fresh stamp on a brand-new number instead of reusing the vacated one, so byRef.m00006 no longer resolves to "f" and dualIdentity comes back empty. The host-side dualIdentity detection + warning log (#5199) still needs coverage for the sessions whose PERSISTED superseded map predates #5196, so hand-build that exact end-state (byRef.m00006="f", restampSuperseded={m3->b,m6->e,m7->f}) directly rather than regenerating it through the kernel.
(ai: vllm-qwen/qwen3.8-27b) No new action needed this run — verifying live rather than trusting the earlier flag:
So the base-conflict from the previous trigger remains resolved and pushed; this forward reflects a snapshot taken before those landed. Nothing to fix or push. 状态:冲突已在上一次处理并推送(head= |
(ai: vllm-qwen/qwen3.8-27b) Re-verified live — nothing changed since my last two replies, so no action taken: remote PR head is still |
(ai: vllm-qwen/qwen3.8-27b) Fourth forward of the same base-conflict blocker; live check again shows nothing changed — PR head |
[bot] (ai: vllm-qwen/qwen3.8-27b) PR #5212 独立复审结论 —— head 八问:
非阻塞观察(措辞,不拦):告警落在 测试有效性(④):四例真实有牙——T1 钉住核心回归(折的是当前持有者 f 而非旧持有者 e)+ 告警触发且点名 m00006;T2 负对照(普通 live cite 不告警,满足 #3617 双向断言);T3 契约边界(singleton 去重 / clean 空 / no-map fast-path 空);T4 翻译路径 intact(vacated cite 仍翻译、不误报)。夹具手工构造 pre-#5196 持久化形状( CI:当前 head 判定:独立复审通过,无拦下项。 代码审核 + 回归清点 + 测试有效性均过;CI 绿。可进入合并流程,等 owner 审批。(顺带一提:floor 26 提到的「#5360/#5196 合入后 stream.ts docblock 需小改」已在本次冲突解决中一并落到位——docblock 现表述为「#5196 起不再新造双身份号,本日志只覆盖 pre-fix 旧会话 + displacement 残留」,与代码一致。) |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 复审已完成并验证。完整结构化八问在上一条(floor 44),此处给一份自包含结论,不重复整段。 做了什么:对 PR #5212 当前 head 已验证(证据):
结论:独立复审通过,无拦下项。 代码审核 + 回归清点 + 测试有效性均过,CI 绿,可进入合并流程。 剩余与风险:仅剩 owner 合并审批(合并权在 owner,agent 不代合)。无阻塞风险;一条非阻塞措辞观察(告警字面「applied」位于后续若干拒绝门之前,极端双重罕见情形下字面略超前,但诊断信号仍正确)已在 floor 44 详述,交由作者定夺,不拦合并。 |
Related to #5199; direction decision pending at #5204 (this PR is the no-decision-dependent part of options A/C).
What and why
重启后冷加载的 ledger 重排可能把已发放的 ref 重新发给另一条消息(空置号在同一次扫描里作为别人的 seq+1 目标被占用)。守卫 live-first:引用旧号的压缩调用会被静默地应用到新持有者并返回成功——#5199 用隔离 fixture 复现了这个最坏形态。
live-first 仍是接受的裁决(拒绝会死循环,#4797;翻译成旧持有者会系统性误判合法的 post-restamp 引用)。本 PR 不改任何接受行为,只把原本静默的应用变为可见:
supersededRefRejection现在报告每个「live 且同时是另一条消息的 pre-restamp 记录标签」的被引用 ref(dualIdentity,附加字段);applyRanges对此类应用打醒目告警行(ref + salted owner id,无业务内容,fix: replay connect-phase transport failures and report committed compression when the re-request dies (#1453) #1454 模式):[acp-proxy: ⚠️ compress applied onto reused ref number(s): m00006=x_…/x_… — each is live for its current owner yet was issued to a different message before the ledger alignment; …(#5199; direction decision #5204)]src/stream.tsladder docblock:过时的「kernel prune removes the ambiguity」表述改为真实状态(prune 已起草后 revert;残留是永久状态,直到 decision request: restamp reuses already-issued refs — replayed pre-restart citations silently compress the wrong message (#5199) #5204 拍板落地)。第二个 commit(标注的顺手 docs 修):修正两处与代码事实不符的注释——
reference/ref-keyed-surfaces.md(contract 段把已 revert 的 prune 写成 enforced;「已消除其全部用户可见危害」断言被 #5199 证伪)与tests/issue4797-superseded-deadlock.test.ts头注释(描述的是 post-prune 的 superseded 形状,master 实际产出 {m3→b, m6→e, m7→f},其中 m6 即双身份案例)。Behavior changes
无。接受/拒绝/翻译行为逐字节不变;仅新增一条服务端日志行(且只在双身份真实发生时出现)。
Verification
npm run typecheckcleantests/issue5199-dual-identity-log.test.ts(新,4 例:双身份应用折叠当前持有者+告警触发 / 负对照无告警 / 去重与 fast-path 契约 / 翻译路径不受影响)+tests/issue4797-superseded-deadlock.test.ts(既有 4 例仍绿)Boundaries