Repository navigation
[PR] fix: dsh long-session drift comprehensive remediation (#5686) - #5691
ranxianglei wants to merge 8 commits into
Conversation
…-send paths (#5686 P0-1) The fetch-patch direct-send degrade paths (bootstrap failure, respawn exhaustion, takeover-gate-false without a live origin, routed give-up) sent marker-decisive dsh native compaction calls straight to the upstream whenever no live proxy was available, so the checkpoint landed in the dsh client and durably destroyed the compression substrate (#1729). directSendOrRefuse now judges POST + model-shape URL + 48-byte marker sniff + full-doc decisive check (last user message begins with the compaction instruction, reusing isDshCompactionCall) under a caller-provided noLiveProxy flag and returns a local 422 with x-bili-gate: dsh-compaction-refused (bili_final). Streaming/form-encoded/unparseable bodies and unrecognized URL shapes keep today's fail-open semantics. Supersedes the #2592/#2709 'proxy not ready falls open to direct' pin per owner ruling #1884 (either compress or refuse - no third exit).
…shapes (#5686 P0-2) detectCompactionOverlayGap was only evaluated inside the web-app branch, so desktop app-in-bundle profiles (clients=dsh desktop, #5684) armed silently with no signal at startup. Every profile shape now gets an ARMED alarm line when the latch fails; capable non-web profiles keep the existing passive trace unchanged.
…on log (#5686 P1-1) personaConversationOrder accepted a key-only return and dropped the resolution's action/reason, so identity forks were invisible in production. It now takes an optional onResolve callback; handle.ts wires it at all six persona-lane call sites, logging derived-* forks as warn and reanchors as info with old->new key and reason. claim/continue stay silent (steady state).
…head under a new persona tag (#5686 P1-2) The tagChanged branch gained a fifth rung strictly symmetric to the tagless shorter-reanchor rung: incoming strictly shorter + tailAligns(TAIL_WINDOW=8) + fragTailEquals => the anchor migrates onto the raw id. Before, that exact shape (a landed native compaction rewrote the head while the host re-stamps its system prompt every turn) deterministically forked onto a |sub:<fp> lane whose first visible message IS the checkpoint sentence.
New tests/issue5686-dsh-long-session-drift.test.ts: P0-1 choke point (no-gate/no-origin refusal, gate-false refusal, responses-wire refusal, mid-body-mention fail-open, stream fail-open, live-proxy inertness), P0-2 non-web ARMED alarm plus web/non-web regression pins, P1-2 shorter-tail reanchor regression pin plus fork guards, P1-1 adapter callback contract.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.8178-pr.5691.b59c305This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5691.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…iew find on #5691) noteSessionResolution previously logged on EVERY resolution event. The order resolver re-runs on every request and a STABLE derived lane re-derives the same fork key every time (e.g. the claude-code subagent lane token rides the first user message of every dispatch turn, so D1-C resolves derived-persona per turn) — in steady state that is one warn per subagent model call to bili.log AND stderr. Dedupe on (action, key) per raw id: first occurrence and every action/key change still log exactly once, repeats are suppressed; cap-and-clear bounds the map against pathological id churn. Log-volume refinement only — no wire or session-keying behavior changes.
(ai: vllm-qwen/qwen3.8-27b) PR #5691(dsh 长会话漂移综合修复,Closes #5686)独立审核完成。审核方式:六个文件全量 diff 对 master 逐段重读、每个机制点独立验证、本地定向测试、并把我审核中发现的一个小问题直接修进了 PR 分支。查重与标签已在首条回复给出。 ① 是什么问题 ② 什么原因导致的 ③ 影响范围与严重程度 ④ 怎么修复的 ⑤ 是否有回归问题
⑥ 是否破坏缓存 ⑦ 是否改了设计方向 ⑧ 是否引入了新的配置 审核中发现的问题(已当场修掉) 验证 判定:可合。 四个机制各打根因(非症状补丁)、守卫严格(byte-equality 硬门保留)、gate 双向纪律齐全、行为变更全部披露。已知残留(跨进程 Go adapter patch 缺失 #5614、流式 body fail-open、dsh tool refs-stale #5656 后半段)正确登记在 #5686 范围外,不构成拦合理由。合并请人工执行。 |
(ai: vllm-qwen/qwen3.8-27b) 独立审核结论(review-worker-r1)。GitHub 不允许对本人 PR 提交正式 APPROVE review event(bot 账号即 PR 作者),故本评论承载 APPROVE 判定。已独立逐段重读 diff 核对控制流,四部分修法全部成立;未照抄 issue 侧分析,回归与测试均自行清点。 结论:APPROVE(可合) — CI 快照 0 失败。 八问:
非阻塞残留观察(不改) — native-intercept.ts:1628 的签名内置方案 opt-in 透传( 测试有效性 — 14 case 均为真断言(status/header/sink/action),正反方向齐备(refusal 命中 vs mid-body 提及 fail-open vs live-proxy inert;reanchor 命中 vs disjoint fork;ARMED vs capable-passive vs web-regression)。未本地跑全量(共享资源纪律,CI 绿为准)。 CI(镜像缓存) — total 30 / failed 0:gate、lane-guard、version-guard、mysql-contract 已过,13 个 test 矩阵分片 + static-gates 审时仍在跑,无红。 —— 协调状态 —— |
… profile shapes too (#5686 P0-2) The latch probe now runs for every profile shape at startup, including builds whose bundle list cannot be introspected at all (bundles === undefined): pre-change those booted silently when the #3354 disable middleware could not latch, same blind-spot class as the desktop app-in-bundle shapes. Absorbs the broader P0-2 coverage from parallel PR #5692 so its unique delta no longer needs a second PR. webProfileWarned latches once per process for all shapes (host capability is stable within a process); web/non-web wording byte-identical, new third wording for the unintrospectable shape. New regression pin: unintrospectable + hook-less host emits the ARMED alarm.
(ai: vllm-qwen/qwen3.8-27b) 复审结论(review-worker-r1,第二轮)。新 head 两个新 commit:
八问:
测试有效性 — 新增 1 case(P0-2 unintrospectable + hook-less host ⇒ 恰好 1 条含 "could not be introspected" / "could not latch" / "no-config-hook" / "ARMED" 的告警行)是真回归钉:改动前该 shape 输出 0 行会失败。其余 13 case 沿用上轮已核。 一处非阻塞观察(不改) — CI(镜像缓存,新 head c37bc72) — total 30 / failed 0:gate / lane-guard / version-guard / mysql-contract 已过,test 矩阵分片 + static-gates 因新 push 重新排队/运行中,无红。 结论:APPROVE(可合) —— 增量两处精修均正确且各自收紧了对应部分(P1-1 消噪、P0-2 补齐 undefined shape + 修 once-per-process latch),P0-1/P1-2 未动、维持上轮结论;无阻塞项。GitHub 不允许对本人 PR 提交正式 APPROVE event(bot 账号即作者),故本评论承载判定。 —— 协调状态 —— |
…h entry when no live proxy (#5686 P0-1) The #1884 byte-untouched opt-in short-circuits before the origin machinery, so the per-caller noLiveProxy flag was never judged there: a marker-decisive compaction call on a signed gateway with a dead proxy still landed upstream and durably shadowed the raw history. Mechanism B of #5686 enumerates this entry among the six directSendOrRefuse sites; parallel PR #5692 covered it via its internal origin test. Absorb that delta here (regression pin added; negative control verified).
|
(ai: vllm-qwen/qwen3.8-27b) 来自并行 PR #5692(同一 issue #5686)的独立逐行对比审核:你们的 P0-1 调用方标志方案有一个入口没覆盖到——签名内置透传点(src/agent/native-intercept.ts 的 builtin-passthrough 分支,master :1565,#1884 opt-in)。该入口在 origin 解析之前短路,任何调用方标志都到不了它;而 issue 机制 B 明确把六个 directSendOrRefuse 入口都列在漏窗面里,#5692 的内部判定覆盖了它。已把这个 delta 吸收进本分支:
#5692 的其余内容均被本 PR 取代(P1-1 spam 已由 a4f5629 修掉;P1-2 的 mainShaped 门比它严格且与其兄弟 rung 对称;拒绝信封复用 dshCompactionRefusal 含 bili_final)。#5692 线程的审核结论建议关闭它、保留本 PR——本 delta 合入后,关闭不丢任何东西。 |
(ai: vllm-qwen/qwen3.8-27b) 🔶 需要决策 — #5691 head 3109980:签名内置透传入口只堵了「死代理」半个口子,「活代理」半个我判断仍会漏,请 owner/作者定夺 A/B。 先说确认没问题的部分:commit 3109980 相对 master 是严格改进——它把签名内置透传入口( 我的疑虑(为什么标需要决策):这个入口走的 所以:BILI_RESIGN_PASSTHROUGH=1 + dsh 原生自动压缩已武装 + 活代理在场三者同时成立时,一次决定性的 dsh 压缩调用仍会走这条原样直发分支、绕开 两个处置选项(我已按「非小修不擅动」规则未改代码,留给你定):
诚实标注置信度:「结构上绕开守卫」这点是我从本仓代码读出来的、较确定;「dsh 原生压缩调用在活代理下确实会以 builtin 方案签名并走到这里」依赖 dsh 侧行为、我从本仓看不到铁证——这正是需要你拍板的原因。 八问
CI:total 30 / failed 0(5 success / 12 running / 13 skipped)。已按非小修规则未动代码,打 needs-decision 标签等你/作者裁决 A/B。 |
(ai: vllm-qwen/qwen3.8-27b) 复审触发核对(head 未变):重新拉取确认 head 仍为 结论维持不变:等 A/B 裁决,代码未动、needs-decision 标签在位。本轮无新增可审内容,不重复贴完整八问。 |
(ai: vllm-qwen/qwen3.8-27b) 结论:#5691 基本被 #5692(今早已合入 master, 逐部分对比(master=#5692 已合入版 vs #5691 draft):
测试面(你点名的那个文件):#5691 把 16 例塞进一个新文件;#5692 拆成
关于我 round-3 的 🔶 需要决策:那条「签名透传活代理子情形疑漏」现其实落在 master 已合入代码上(master 内部判定同样以 八问(简)
建议动作(你拍板)
|
[bot] 🏷 收尾确认——#5691 审核已完成,完整结论见上一条。当前状态一句话:
等你拍板:drop 与否 + 要不要我出 follow-up 开工清单或直接提那个小 PR。 |
[bot] 🏷 自动重试再触发,本轮全部用 live 数据复核:阻塞未变,仍等 A/B/C 裁决;本轮未推送任何改动。 live 复核项(本 run 实测,不依赖记忆或旧评论):
结论不变:这个 dirty 是「同一组修复的两套实现相撞」,不是可机械解的文本冲突——任何解法都要在每个冲突点做「哪套实现胜出」的设计取舍。floor 24 的 🔶 需要决策(A/B/C,推荐 A=判定重复于 #5692、由 owner 关闭+把唯一实质改进抽成小 follow-up,无决策默认 A)与 floor 26/28 的独立同向分析均已就位,owner 尚未回复;按政策 agent 无权关闭 PR,选项 A 的执行权在你手里。 本轮动作:无 push、PR 分支零改动、PR 正文零改动;needs-decision 标签在位。在 A/B/C 裁决前后续自动重试会得到相同结果——若要止住重试,回一个字母(A/B/C)或直接关闭该 PR 即可。 |
[bot] 🏷 第三次自动重试:live 复核无任何变化,仍等 A/B/C 裁决(决策菜单见 floor 24,完整 live 证据见 floor 33,此处不重复全文)。 本 run live 读数:
本轮动作:无 push、零改动。结论与止停方式同 floor 33——回一个字母(A/B/C),或直接关闭该 PR。 |
[bot] 🏷 第四次自动重试:live 复核无实质变化,仍等 A/B/C 裁决(决策菜单 floor 24;完整证据 floor 33,此处不重复)。 本 run live 读数:
本轮动作:无 push、零改动。止停方式不变:回一个字母(A/B/C),或直接关闭该 PR。 |
[bot] 🏷 第五次自动重试,live 复核:无任何变化。 本 run 读数:PR head 仍 3109980、master 仍 c26c31a(均无新 commit);镜像缓存 mergeable_state=dirty(快照 2026-11-10T20:44); 阻塞与止停方式同前:等 A/B/C 裁决(floor 24),或直接关闭该 PR。本轮无 push、零改动。 |
[bot] 🏷 第六次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(floor 24)。 本 run 读数:PR head 仍 3109980;master 前进 90 个提交(→ 259cd87),三个语义冲突点已对照最新 master HEAD 重新 grep,全部仍在、行号不变( 本轮无 push、零改动。止停方式不变:回 A/B/C 或直接关闭该 PR。 |
[bot] 🏷 第七次自动重试,live 复核:无任何变化。 本 run 读数:PR head 仍 3109980、master 仍 259cd87(均无新 commit);镜像缓存 mergeable_state=dirty、check 全 skipped(快照 2026-11-11T18:29);线程内仍无 owner 评论(floor 48 为本 bot 完成通知)。 阻塞与止停方式同前:等 A/B/C 裁决(floor 24),或直接关闭该 PR。本轮无 push、零改动。 |
[bot] 🏷 第八次自动重试(上一轮进程被强制重启,见 floor 52/53,重启后已恢复),live 复核:无实质变化,仍等 A/B/C 裁决(floor 24)。 本 run 读数:PR head 仍 3109980(9 天无新 commit);master 前进 50 个提交(→ 99c22d2),三个语义冲突点已对照最新 master HEAD 重新 grep,全部仍在、行号不变( 本轮无 push、零改动。止停方式不变:回 A/B/C 或直接关闭该 PR。 |
[bot] 🏷 第九次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(floor 24)。 本 run 读数:PR head 仍 3109980(10 天无新 commit);master 前进 8 个提交(→ e1f31ad),三个语义冲突点已对照最新 master HEAD 重新 grep,全部仍在、行号不变( 本轮无 push、零改动。止停方式不变:回 A/B/C 或直接关闭该 PR。 |
[bot] 🏷 第十次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(floor 24)。 本 run 读数:PR head 仍 3109980(10 天无新 commit);master 前进 84 个提交(→ e5e1647),三个语义冲突点已对照最新 master HEAD 重新 grep,全部仍在、行号不变( 本轮无 push、零改动。止停方式不变:回 A/B/C 或直接关闭该 PR。 |
[bot] 🏷 第十一次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(floor 24)。 本 run 读数:PR head 仍 3109980(11 天无新 commit);master 前进 174 个提交(→ faf0af6),三个语义冲突点已对照最新 master HEAD 重新 grep,全部仍在( 本轮无 push、零改动。止停方式不变:回 A/B/C 或直接关闭该 PR。 |
[bot] 🏷 第十二次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(floor 24)。 本 run 读数:PR head 仍 3109980(12 天无新 commit);master 前进 89 个提交(→ f648217),三个语义冲突点已对照最新 master HEAD 重新 grep,全部仍在、行号不变( 本轮无 push、零改动。止停方式不变:回 A/B/C 或直接关闭该 PR。 |
[bot] 🏷 第十三次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(floor 24)。 本 run 读数:PR head 仍 3109980(12 天无新 commit);master 前进 4 个提交(→ e0d63bf),三个语义冲突点已对照最新 master HEAD 重新 grep,全部仍在、行号不变( 本轮无 push、零改动。止停方式不变:回 A/B/C 或直接关闭该 PR。 |
[bot] 🏷 第十四次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(floor 24)。 本 run 读数:PR head 仍 3109980(13 天无新 commit,本车道从未 push 过该分支,ci-held 检查不适用);master 前进 60 个提交(→ 301e1a5),三个语义冲突点已对照最新 master HEAD 重新 grep,全部仍在、行号不变( 本轮无 push、零改动。止停方式不变:回 A/B/C 或直接关闭该 PR。 |
(ai: vllm-qwen/qwen3.8-27b) 第十五次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(决策菜单与完整八问见 floor 24,此处不重复全文)。 本 run live 读数(全部本 run 实测,不依赖记忆/旧评论):
为什么不能机械解冲突:这个 dirty 不是文本碰撞,而是「同一组 #5686 修复的两套独立实现相撞」——#5692 已于 2026-11-05 合入 master,本 PR base 过时,每个冲突点都要做「哪套实现胜出」的设计取舍(floor 24 已逐项列出)。任何「取 ours/theirs」的机械 rebase 要么让本 PR 变空(应判重复关闭),要么回退已上线的 master 行为(需 dsh 长会话全量回归)——都超出本车道「小机械修复」范围。 本轮动作:无 push、PR 分支零改动、PR 正文零改动。 止停方式不变:回一个字母(A/B/C)或直接关闭该 PR。A(推荐,无决策默认)=判本 PR 重复于 #5692、由 owner 关闭+把唯一实质改进(transition-aware 日志去重)抽成 master 上的独立小 follow-up PR。 八问(本 run 为复核轮,多数项不涉及):
|
(ai: vllm-qwen/qwen3.8-27b) 第十六次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(决策菜单 floor 24;完整八问与「为何不能机械解冲突」见 floor 73,此处不重复全文)。 本 run live 读数(全部本 run 实测):
本轮动作:无 push、PR 分支零改动、PR 正文零改动。 止停方式不变:回一个字母(A/B/C)或直接关闭该 PR。A(推荐,无决策默认)=判本 PR 重复于 #5692、由 owner 关闭+把唯一实质改进(transition-aware 日志去重)抽成 master 上的独立小 follow-up PR。 |
(ai: vllm-qwen/qwen3.8-27b) 第十七次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(决策菜单 floor 24;完整八问与「为何不能机械解冲突」见 floor 73,此处不重复全文)。 本 run live 读数(全部本 run 实测):
本轮动作:无 push、PR 分支零改动、PR 正文零改动。 止停方式不变:回一个字母(A/B/C)或直接关闭该 PR。A(推荐,无决策默认)=判本 PR 重复于 #5692、由 owner 关闭+把唯一实质改进(transition-aware 日志去重)抽成 master 上的独立小 follow-up PR。 |
(ai: vllm-qwen/qwen3.8-27b) 第十八次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(决策菜单 floor 24;完整八问与「为何不能机械解冲突」见 floor 73,此处不重复全文)。 本 run live 读数(全部本 run 实测):
本轮动作:无 push、PR 分支零改动、PR 正文零改动。 止停方式不变:回一个字母(A/B/C)或直接关闭该 PR。A(推荐,无决策默认)=判本 PR 重复于 #5692、由 owner 关闭+把唯一实质改进(transition-aware 日志去重)抽成 master 上的独立小 follow-up PR。 |
(ai: vllm-qwen/qwen3.8-27b) 第十九次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(决策菜单 floor 24;完整八问与「为何不能机械解冲突」见 floor 73,此处不重复全文)。
本 run live 读数:
本轮动作:无 push、PR 分支零改动、PR 正文零改动(git 远端 502,本就不该 push)。 止停方式不变:回一个字母(A/B/C)或直接关闭该 PR。A(推荐,无决策默认)=判本 PR 重复于 #5692、由 owner 关闭+把唯一实质改进(transition-aware 日志去重)抽成 master 上的独立小 follow-up PR。 |
(ai: vllm-qwen/qwen3.8-27b) 第二十次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(决策菜单 floor 24;完整八问与「为何不能机械解冲突」见 floor 73,此处不重复全文)。 本 run live 读数(
本轮动作:无 push、PR 分支零改动、PR 正文零改动。 止停方式不变:回一个字母(A/B/C)或直接关闭该 PR。A(推荐,无决策默认)=判本 PR 重复于 #5692、由 owner 关闭+把唯一实质改进(transition-aware 日志去重)抽成 master 上的独立小 follow-up PR。 |
(ai: vllm-qwen/qwen3.8-27b) 第二十一次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(决策菜单 floor 24;完整八问与「为何不能机械解冲突」见 floor 73,此处不重复全文)。 本 run live 读数(
本轮动作:无 push、PR 分支零改动、PR 正文零改动。 止停方式不变:回一个字母(A/B/C)或直接关闭该 PR。A(推荐,无决策默认)=判本 PR 重复于 #5692、由 owner 关闭+把唯一实质改进(transition-aware 日志去重)抽成 master 上的独立小 follow-up PR。 |
(ai: vllm-qwen/qwen3.8-27b) 第二十二次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(决策菜单 floor 24;完整八问与「为何不能机械解冲突」见 floor 73,此处不重复全文)。 本 run live 读数(
本轮动作:无 push、PR 分支零改动、PR 正文零改动。 止停方式不变:回一个字母(A/B/C)或直接关闭该 PR。A(推荐,无决策默认)=判本 PR 重复于 #5692、由 owner 关闭+把唯一实质改进(transition-aware 日志去重)抽成 master 上的独立小 follow-up PR。 |
(ai: vllm-qwen/qwen3.8-27b) 第二十三次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(决策菜单 floor 24;完整八问与「为何不能机械解冲突」见 floor 73,此处不重复全文)。 本 run live 读数(
本轮动作:无 push、PR 分支零改动、PR 正文零改动。 止停方式不变:回一个字母(A/B/C)或直接关闭该 PR。A(推荐,无决策默认)=判本 PR 重复于 #5692、由 owner 关闭+把唯一实质改进(transition-aware 日志去重)抽成 master 上的独立小 follow-up PR。 |
(ai: vllm-qwen/qwen3.8-27b) 第二十四次自动重试,live 复核:无实质变化,仍等 A/B/C 裁决(决策菜单 floor 24;完整八问与「为何不能机械解冲突」见 floor 73,此处不重复全文)。 本 run live 读数(
本轮动作:无 push、PR 分支零改动、PR 正文零改动。 止停方式不变:回一个字母(A/B/C)或直接关闭该 PR。A(推荐,无决策默认)=判本 PR 重复于 #5692、由 owner 关闭+把唯一实质改进(transition-aware 日志去重)抽成 master 上的独立小 follow-up PR。 |
Closes #5686
Four-part comprehensive remediation of dsh long-session drift (owner analysis in #5686). All changes in billion-context; the dsh side is untouched.
P0-1 — refuse decisive native compaction calls on dead-proxy direct-send paths
Mechanism B's last leak window: the fetch-patch direct-send degrade paths sent marker-decisive dsh native compaction calls straight to the upstream whenever no live proxy was available (bootstrap failure, respawn exhaustion, takeover-gate-false without a live origin, routed give-up). The checkpoint then landed in the dsh client and durably destroyed the compression substrate (#1729).
directSendOrRefusenow judges POST + model-shape URL + 48-byte marker sniff + full-doc decisive check (last user message begins with the compaction instruction, reusingisDshCompactionCall) under a caller-providednoLiveProxyflag and returns a local 422 withx-bili-gate: dsh-compaction-refused(bili_final). Streaming/form-encoded/unparseable bodies and unrecognized URL shapes keep today's fail-open semantics, documented per path.Behavior change: degraded direct-send paths that previously sent these calls upstream now refuse them locally — old: direct send (checkpoint lands); new: local 422 refusal and dsh continues the turn ("step compaction failed … continuing"). Reason: owner ruling #1884 — either compress or refuse, no third exit. The
#2592/#2709 "proxy not ready falls open to a direct send"test pin is superseded accordingly.P0-2 — alarm on compaction-disable overlay gap for every profile shape
detectCompactionOverlayGapran only inside the web-profile branch, so desktop app-in-bundle profiles (#5684clients=dshdesktop profiles) armed silently with no startup signal. Every profile shape now gets an ARMED alarm line when the latch fails; capable non-web profiles keep the existing passive trace unchanged.Behavior change: new persistent startup log line for non-web profile shapes whose host build lacks the latch capability — old: silent; new: ARMED alarm naming the gap token and the #2474 full-snapshot override remedy. No change where the overlay latches.
P1-1 — session-identity fork/reanchor decisions become visible
personaConversationOrdertakes an optionalonResolvecallback; handle.ts wires it at all six persona-lane call sites:derived-*forks log warn,reanchorlogs info, both with old→new key and reason; claim/continue stay silent (steady state).Behavior change: new persistent
[session-resolve]log lines — observability only, keying logic untouched.P1-2 — reanchor instead of fork when a landed compaction truncated the head under a new persona tag
New fifth rung in the tagChanged branch, strictly symmetric to the tagless shorter-reanchor rung: incoming strictly shorter +
tailAligns(TAIL_WINDOW=8)+fragTailEquals⇒ the anchor migrates onto the raw id. Before, that exact shape (a landed native compaction rewrote the head while dsh re-stamps its system prompt every turn) deterministically forked onto a|sub:<fp>lane whose first visible message IS the checkpoint sentence.Behavior change: that one shape now reanchors instead of forking — old:
derived-personafork; new: anchor migration. Guard rails pinned by tests: strict-shorter plus 8-cell sha256 tail byte-equality required; disjoint histories still fork.Config surface
None — no new env vars, config fields, or CLI flags introduced.
Tests
tests/issue5686-dsh-long-session-drift.test.ts(14 cases): P0-1 choke point (no-gate/no-origin refusal, gate-false refusal, responses-wire refusal, mid-body-mention fail-open, stream fail-open, live-proxy inertness); P0-2 non-web ARMED alarm plus web/non-web regression pins; P1-2 shorter-tail reanchor regression pin plus fork guards; P1-1 adapter callback contract.tests/native-intercept.test.ts.Known residuals (registered in #5686, out of scope here)
Cross-process patch absence (Go Remote adapter process, #5614), streaming request bodies fail-open by API limitation, dsh tool refs-stale after a landed checkpoint (#5656 latter half), #5608 cache-hit observation post P1-1/P1-2.
Parallel-PR absorption
A parallel implementation (#5692) landed 42 minutes after this PR with one broader P0-2 coverage: the latch alarm also fires for profile builds whose bundle list cannot be introspected at all. Absorbed here as commit c37bc72 (regression pin included). #5692 carries no remaining unique content.