Skip to content

[PR] fix(session): keep long sessions on their raw lane when a host upgrade repacks the message records (#5844) - #5851

Open
ranxianglei wants to merge 13 commits into
masterfrom
2026-11-07_repacked-tail-reanchor
Open

ranxianglei wants to merge 13 commits into
masterfrom
2026-11-07_repacked-tail-reanchor

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Closes #5844

Behavior change disclosure (old -> new + why)

Old behavior: when a host changes the system prompt text AND the message-record layout in the same turn (dsh 0.2.1 -> 0.2.2-rc.x does exactly this: assistant text segments merged into adjacent records, some standalone assistant records dropped), every byte-level continuation evidence is destroyed at once — per-source-message fragment hashes are disjoint even though every logical turn stays identical. All four tagChanged escape rungs in resolveSessionOrder miss structurally, so the conversation forks onto <id>|sub:<fp> with zero compression state; resuming such a session then dies with a fail-fast 413 (preflight folds the whole history from scratch — #5844: 32 rounds x ~26s > stream-idle timeout) and the parent's blocks sit unclaimed until manual surgery on session-order.json.

New behavior: at the #5686 rung site, a strictly shorter, kind-tail-aligned replay whose last <=TAIL_WINDOW(8) turns match the recorded skeleton turn-by-turn in canonical form (neutralTurnCanonical — the identity chain's own hashing input) reanchors onto the raw id instead of forking. Canonical form survives how the host regroups messages into records (a merged text+tool_use record projects to the same canonical turn as split ones) but not content mutation, so the fork guardrail holds.

Why this is sound: a canonical-turn match means the replayed tail IS the recorded conversation — forking it was a false positive. Both existing master rungs miss this shape by construction: #5686 still compares per-source-message fragments (disjoint after repack), #5719 requires host-stamped msgids with stored rows (sessions accumulated before stamping have an empty stored id set).

Mechanism

Honest boundary

A parent skeleton persisted by a PRE-FIX version carries no canon column, so the first post-upgrade request of an affected session can still fork (there is nothing to verify against yet). Recovery for those sessions = the documented manual procedure above, or the #5719 msgid rung when the host stamps ids and rows carry them; after one successful reanchor the skeleton permanently carries canon. Hosts that stamp msgids get automatic recovery without any manual step.

Regression audit (existing behaviors checked)

Scope honesty / related work

Same |sub:-drift family, different shapes — cross-linked, none superseded: #5719 (full compaction intersecting tag drift), #5517 (checkpoint drift), #5714 (grown+shifted replay — needs subsequence alignment, still open), #5686 (fragment-tail predecessor). This PR covers the upgrade-repack variant only. The report's section-7 item 4 (fail-fast 413 message naming unclaimed parent blocks) lives in a different module (the preflight site) and is deliberately not bundled here.

Config surface

None. No config/env/CLI changes; the skeleton snapshot field is internal persistence (additive, self-healing).

Review tier

Session-key identity logic => human review required per AGENTS.md section 7.4 (no auto-merge). No kernel/ change; no version bump (master stays at v0.1.212 until the release branch).

ci-check added 3 commits November 7, 2026 13:08
… a host record repack (#5844)

A host upgrade that changes BOTH the system prompt text and the message-record layout (dsh 0.2.1->0.2.2-rc.x: assistant text segments merged into adjacent records, some standalone assistant records dropped) destroys every byte-level continuation evidence at once: per-source-message fragment hashes are disjoint even though every logical turn is identical, so all four tagChanged escape rungs miss and the conversation forks onto an empty |sub:<fp> lane -> preflight folds from scratch -> resume dies with a fail-fast 413.

Add a canonical-turn fingerprint rung at the #5686 site: when the replay is strictly shorter and kind-tail-aligned, reanchor onto the raw id if the last <=TAIL_WINDOW turns match the recorded skeleton turn-by-turn in CANONICAL form (neutralTurnCanonical — the identity chain's own hashing input), which survives record regrouping but not content mutation. The skeleton persists the canon column additively (absent on pre-change snapshots); a missing or malformed column degrades to exactly the pre-change byte-fragment path. The #5686 fragment reason string stays byte-identical.
…, degradation)

Six pins: the bug shape reanchors with the new content-verified-tail reason; a mutated last user cell still forks derived-persona; a skeleton hydrated without the canon column forks exactly as before this change; the snapshot round-trip keeps the rescue alive across restarts; a malformed canon column degrades to the byte-fragment path; and a tag-invariant repacked shorter replay already reanchors through the pre-existing owner-rule branch (symmetry row).
…and exists (#5844)

SESSION-IDENTITY en/zh: state plainly that there is no supported command or config knob to re-attach a drifted |sub lane to its parent, and give the sanctioned manual procedure (stop the proxy first — the daemon silently rewrites session-order.json from memory; set the parent entry's tagHash to the sha256 hex digest of the host's current full system text or delete the entry; restart; bili sessions rm the orphan lane). Answers the reporter's section-8 question from #5844.
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-07_repacked-tail-reanchor (223226d)

Latest build — install this exact version

npm install -g billion-context@0.0.8974-pr.5851.71db455

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
223226d billion-context@0.0.8974-pr.5851.71db455 build
535bb92 billion-context@0.0.8556-pr.5851.14e82d7 build
07ccff4 billion-context@0.0.8552-pr.5851.6e8e4fa build
c48c548 billion-context@0.0.8540-pr.5851.920fd13 build
c0bdfb0 billion-context@0.0.8491-pr.5851.04cf4b6 build
b357e5f billion-context@0.0.8470-pr.5851.f79f37f build
c39dc84 billion-context@0.0.8456-pr.5851.1609ec6 build
676c259 billion-context@0.0.8442-pr.5851.9057e1a build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5851.tgz
npm install -g package

Install instructions are refreshed on each push.

ci-check added 3 commits November 7, 2026 14:58
…e length drifts from kinds

The writers keep canon 1:1 with kinds (both derive from the same turn list in record()), so a length mismatch means the column is shifted/corrupted. Degrade to absent (byte-fragment path = pre-change behavior) instead of trusting misaligned fingerprints.
… a kind break

The original guardrail replaced an assistant record with a user record, so the fork came from tailAligns' kind suffix comparison and never reached the canonical-fingerprint comparison it was meant to pin (it would pass even with the canon rung removed). Rewrite it to mutate the final tool result's text — layout and kinds unchanged — so the fork can only come from the canon mismatch itself.
…rified tail

An assistant turn carrying tool calls hashes as calls+role only (cross-wire neutrality — OpenAI renders such turns with content:null), so a prose-only difference inside a calls turn is invisible to the #5844 rung exactly as it is to the rest of the identity chain that shares neutralTurnCanonical. State that boundary next to the manual re-attach procedure (en+zh).
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷
(ai: vllm-qwen/qwen3.8-27b)

PR #5851 审核结论:可合(人工审层级——session-key identity 逻辑,§7.4 不自动合并)。 查重:不重复(本 PR 即 #5844 线程唯一修复 PR,无并列分支)。标签:PR 侧已有 bug/p1/dsh/scope/wiring/session-id,覆盖类别+优先级+车道+领域,未改标。

八问

  1. 是什么问题:宿主升级在同一轮里既换 system prompt 又重组消息记录布局(dsh 0.2.1→0.2.2-rc.x:assistant 文本段并入相邻记录、部分独立 assistant 记录被丢)时,长会话被错误分叉到 <id>|sub:<fp> 派生车道,压缩状态全空,resume 死于 fail-fast 413。
  2. 什么原因导致的:既有两档都接不住这个形状——dsh Long-Session Drift Comprehensive Remediation: Sealing the Last Leak Window for Native Compression Local Deployment + | dsh 长会话漂移综合治理:堵死原生压缩本地落地的最后漏窗 + 会话身份分叉可见化与自愈 #5686 fragment-tail 档比较逐源消息 fragment(重打包后 disjoint,尽管每个逻辑轮逐字相同);[resolveSessionOrder] Full compaction and persona tag drift occurring in the same turn → inevitably forks to |sub: side | [resolveSessionOrder] Full compaction and persona tag drift occurring in the same turn → inevitably forks to |sub: side | [resolve… #5719 msgid 档要求宿主 stamp 的 msgid 行(旧会话无行)。字节级延续证据被同一轮全毁,tagChanged 各逃逸档全部结构性 miss → fork。
  3. 影响范围与严重程度:dsh 0.2.x 升级路径上的存量长会话用户;触发条件=升级同时换 system 文本与记录布局。严重度=该会话完全不可用(零压缩态 + resume 413),p1 面。
  4. 怎么修复的:在 dsh Long-Session Drift Comprehensive Remediation: Sealing the Last Leak Window for Native Compression Local Deployment + | dsh 长会话漂移综合治理:堵死原生压缩本地落地的最后漏窗 + 会话身份分叉可见化与自愈 #5686 档位并行增加一条 canonical-form 尾窗证据——最后 ≤8 轮按身份链自有 hash 输入(neutralTurnCanonical)逐轮指纹比对:记录重打包不变、逻辑内容真变则断;持久化骨架加 additive 可选 canon 列(老快照无列=降级回变更前行为,坏列不信)。
  5. 是否有回归问题:逐档审过(见下方审计清单),未发现回归。
  6. 是否破坏缓存:不涉及 fold block/缓存键本身——只改 session-key 裁决(会话落在哪个 id 上),已存折叠状态不动;re-anchor 后父块直接复活(这正是修复目的)。
  7. 是否改了设计方向:无转向——沿用身份链既有 canonical-form 等价关系(hash 为辅助证据层),不引入模糊相似度。
  8. 是否引入新配置:不涉及(无 env/config/默认值变化)。

回归审计清单(触碰路径的既有行为,逐项):tagChanged 分支裁决序(E5 self-checkpoint → head → model-switch → chain → #4778 → #5686/#5844 → msgid-rescue → fork)各档位置与谓词均未动;canon 档只在 frag 档已求值处触发(门控相同,无新可达面);frag 路径 reason 串字节不变;pinned 测试覆盖老快照解析、坏列降级、tag-invariant 对称性;快照线形仅 additive。性能:record() 热路径新增 O(turns) sha256,相对既有整包 parse 可忽略,接受。

审核中发现并已修(独立标注 commit,已推 PR 分支):

  1. a1e0a7be9d fix:applyOrderSnapshot 对 canon 列只验元素形状、不验长度一致性——写入方 canon 与 kinds 恒 1:1(同源于 record() 的同一 turn 列表),长度漂移=错位/损坏,现降级为 absent(=变更前行为)而非信任错位指纹。
  2. 1d37f635ce test:原 guardrail 是假测试——它把一条 assistant 记录替换成 user 记录,fork 实际来自 tailAligns 的 kind 断裂,从未走到它声称钉住的 canonical-fingerprint 比对(把 canon 档整个删掉它照样绿)。改为变异最后一条 tool_result 文本(kind/布局不变),fork 只能来自 canon mismatch 本身。本地验证:改前写法如预期失败(顺带暴露下一条边界),改后 6/6 绿。
  3. c39dc843e1 docs:补记 canonical-form 的诚实边界(en+zh)——带工具调用的 assistant 轮按 calls+role 归一(openai 线此类轮 content:null,跨线中性),故 calls 轮内仅散文不同对本档不可见;这与共享同一 canonical form 的身份链其余部分完全一致,不是本档独有的信任放松。

需 owner 知悉(不改代码):PR 描述「canonical form … but not content mutation」对 calls 轮散文场景表述过强(上述边界);建议措辞改为「not logical-content mutation(kind/text/calls)」。描述是作者原文,我不代改,留你处置。

CI:原 head 676c259 全矩阵 30/30 绿(镜像缓存确认)。我按 §7.2 先将 master c45ac2196 合入分支再推(零冲突;hot file src/session-resolve.ts 与 #5734/E5 的重叠已逐 hunk 核对语义一致),新 head c39dc843e1 的 CI 中 tests/issue5719-msgid-lane-identity.test.ts T1/T8 将出现继承性 born-red 签名(#4599 floor 1084 在档:masterr 级,#5734/E5 置顶后影子掉旧 pin,修复已在独立小 PR #5857 在途)——非本 PR 引入,#5857 合入后含 c45ac21 的树全部转绿,届时 rerun 即收敛。本地证据:合并树上定向 11 套件 72/72 绿,typecheck/build 干净。

判定:可合,等 owner 人审签核;#5857 先落则 CI 直绿,否则预期上述单文件继承红(rerun 收敛)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷
(ai: vllm-qwen/qwen3.8-27b)

CI 归因更正(接上轮回复):新 head c39dc843e1 的 CI(run 42349350635)出来了,红签名与我上轮预判的家族不同,更正如下:

结论不变:可合,等待 owner 人工审层级签认(session-key identity 逻辑,§7.4 不可 auto-merge);代码面审查结论与三处 review 修复见上轮八问回复。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

CI 修复完成:根因是 master 级跨分支陈旧(非本 PR 代码问题),已把自愈后的 master 合入分支,新 head b357e5f4a3 已推送。本地门禁全绿;新 head 的 CI 快速门禁全过,12 个长跑测试任务运行约 90 分钟零失败。

七问:

  1. 是什么问题:PR [PR] fix(session): keep long sessions on their raw lane when a host upgrade repacks the message records (#5844) #5851 原 head c39dc843e1 上 3 个测试任务(ubuntu-24/shard1、ubuntu-22/shard1、windows-22/shard3)红,全部挂在同一个文件 tests/msgid-rule-parity.test.ts 的同样 2 个用例(msgid 规则六副本一致性校验里对水位快路径行为的两条断言)。与本 PR 自己的改动(session-resolve 重锚定)无关。
  2. 什么原因导致的:跨分支陈旧(master 侧自伤,PR 只是继承)。链条:[PR] release review #5826 的 release-review 分支先合并了「还带 v6 快路径([PR] feat(fastpath): v6 composite-identity incremental fastpath lane (full rework, #5576 line voided) #5652)」的 master,随后把上述 2 条断言重新钉到 v6 语义(33b2f82dc9);但 [PR] release review #5826 还没进 master,[PR] Revert "[PR] feat(fastpath): v6 composite-identity incremental fastpath lane (full rework, #5576 line voided)" #5854 就已把 v6 整个 revert(66aadbd89f)。于是 [PR] release review #5826 落地的那一刻,master 自己就带着「钉 v6 行为的测试 vs 已被 revert 的代码」born-red。本 PR 的 pull_request 流水线检出的是 base+head 合并视图,恰好继承了这份红。评审 bot 此前预测的 issue5719 T1/T8 风险未发生。
  3. 影响范围与严重程度:master 级瞬时红——凡 merge-ref 窗口覆盖该时段的 PR 都会同挂,不是本 PR 特有;未发布,无用户面影响。master 已自愈:613d290ef9([PR] Minor fix: Revert the v6 pin for parity tests along with the fastpath-v6 rollback (master self-red fix) | 小修:parity 测试的 v6 钉随 fastpath-v6 回滚一起回退(master 自红修复) #5862)把这 2 条钉回 pre-v6 判决,其后 master push 跑次全绿(run 42353282866 success)。
  4. 怎么修复的:零代码改动——把已自愈的 master(591e940e9d,含 [PR] Minor fix: Revert the v6 pin for parity tests along with the fastpath-v6 rollback (master self-red fix) | 小修:parity 测试的 v6 钉随 fastpath-v6 回滚一起回退(master 自红修复) #5862 钉位恢复)干净合入 PR 分支(无冲突),新 head b357e5f4a3 推送。本地定向验证:typecheck 干净 + 19/19 通过(tests/msgid-rule-parity.test.ts×5、tests/issue5844-repacked-tail-reanchor.test.ts×6、tests/issue5719-msgid-lane-identity.test.ts T1–T8)。按 CI 协调政策在 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 留了一行状态评论,未开任何新 issue。
  5. 是否有回归问题:无。纯 merge 提交,我未改一行代码;master 带入的 62 个文件逐项过目(parity 钉位恢复、kernel 0.0.184 phantom-pressure 守卫、nudge-hold 无采样守卫、lock-sync、文档再生),无语义漂移、无 fail-fast 变吞错、无阈值/时序/格式变化,与 session-resolve 改动无交互。
  6. 是否破坏缓存:不涉及——未触碰缓存/重试/增量游标/去重键逻辑。
  7. 是否改了设计方向 / 引入新配置:均不涉及——无架构/数据流转向,无新 env/config/默认值。

当前 CI 状态(镜像缓存,截至本轮收尾):30 项检查 = 7 success + 11 skipped + 12 个长跑测试任务运行中、零失败。对照:旧 head 的同批任务在 ~15 分钟内就红了;新 head 跑满 ~90 分钟无任何失败,且本地 19/19 已把原先失败的两例与预测风险例全部钉绿。

收工判定:本 run 的修复工作已完成(根因定位 + 合并修复已推送 + 本地门禁绿),修复本身不需要任何决策;剩余仅等 12 个长跑任务收尾确认——按现有证据预期转绿,届时 PR 回到「待 owner 人工审核」状态(§7.4 session-key identity 层,自动合并不适用)。若长跑任务出现任何红点,由本自动修复车道 attempt 2/3 接手处理。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

🔶 需要决策
(ai: vllm-qwen/qwen3.8-27b)

PR #5851 当前 head c0bdfb0(run 42366607622 + rerun 双重确认):残留 6 个确定性失败,全部是 master 级继承红,与本 PR diff 无关,需要 owner 拍板 #5860 的语义走向。 此前 9 项 golden 红已随分支并入 ci-fixes@6436b23b3c 转绿;#2791(affinity-crosswire-fold,win22-1 首跑 2!==1)rerun 转绿 = Windows 单次 flake,非回归。

待拍板:master #5860(nudge-hold-no-usage-sample,requireUsageSampleForPressure)落地后,6 个旧 nudge 行为测试必挂——hermetic fake upstream 不返回 usage sample → pressure-based nudge 被 hold → 旧断言「nudge must inject」不成立:

证据链:纯 master 591e940(不含本 PR)本地逐项复现同款失败;reren-failed-jobs 全量二次确认确定性;#728B「real usage always takes precedence」仍绿,与 hold 只作用于无样本路径一致。本车道按规则不做语义级测试改写,停手等决策。

选项

默认(不拍板时):按 A 执行;在此之前不动本 PR 分支,这 6 项红不阻塞本 PR 自身变更的合并判断(与本 diff 无关)。协调记录见 #4599(issuecomment-6708595676),needs-decision 标签已打。


七问

  1. 是什么问题:PR head c0bdfb0 上 6 个 test shard 红,共 6 个不同失败用例,全是 nudge 行为测试;上一代的 9 项 golden 红与 dsh anthropic-messages lane bypasses native-intercept fetch patch: anonymous pfa-* session, fold ledger orphaned, silent ~182s re-fold on cross-protocol switch #2791 已分别收敛/flake 掉。
  2. 什么原因导致的:master 级继承,非本 PR diff——[PR] fix(nudge): no billing sample this round → hold pressure-band injection one round (phantom-pressure guard) #5860 落了「无 usage sample 时 hold pressure nudge」的新语义但没同步 6 个旧行为测试;fake upstream 无 usage → nudge 被 hold → 旧断言必挂。纯 master 本地逐项复现 + rerun 确定性确认。
  3. 影响范围与严重程度:所有 merge-ref 含 [PR] fix(nudge): no billing sample this round → hold pressure-band injection one round (phantom-pressure guard) #5860 之后 master 窗口的 PR 都继承这 6 项红(CI 信号阻塞);对发布产物无运行时影响;[PR] fix(nudge): no billing sample this round → hold pressure-band injection one round (phantom-pressure guard) #5860 语义本身是否成立(选项 B 的场景)需 owner 裁定。
  4. 怎么修复的:本 PR 分支零代码改动——机械收敛已由 ci-fixes@6436b23b3c 并入分支完成(kernel.json pin + storage-render realignment,对应 9 项转绿)。本轮动作:live 双源复核(mirror 缓存 + GitHub API 单次校准)、拉 6 个红 job 日志抽签名、纯 master 复现、A/B 归因实验(local 树与 CI 树字节一致;dsh anthropic-messages lane bypasses native-intercept fetch patch: anonymous pfa-* session, fold ledger orphaned, silent ~182s re-fold on cross-protocol switch #2791 rerun 转绿定性 flake)、触发 rerun-failed-jobs、CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 留协调评论、打 needs-decision 标签。
  5. 是否有回归问题:未引入——本轮零代码改动。diff 触碰路径既有行为逐项过:session-resolve canon join(PR 本体,原 review 结论不变)、msgid-rule-parity([PR] Minor fix: Revert the v6 pin for parity tests along with the fastpath-v6 rollback (master self-red fix) | 小修:parity 测试的 v6 钉随 fastpath-v6 回滚一起回退(master 自红修复) #5862 已收敛)、storage golden(哨兵已收敛,CI 绿)、nudge 家族(红为存量,非本 PR 引入)。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及(本轮无架构/数据流变更)。
  8. 是否引入了新的配置:不涉及。

收工判定:本 PR 自身变更保持可合(review 结论不变);6 项残留红全部 master 级,已按规则升级为决策请求(A/B/C + 默认 A),本车道停手等 owner 拍板。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

冲突处理结论:live 验证后确认无需任何推送——分支已在触发前自行追上 master,「dirty」是过期状态。本轮零代码改动、零推送。

背景核对(全部 live 源,非记忆):触发时刻(15:15Z)分支 head c0bdfb00c6 确实落后于当日快速推进的 master(#5889/#5882/#5755/#5875 相继合入)。但在本轮动手前,另一车道已于 15:19:30Z 把 ci-fixes tip d7769ca5(= master tip 6945a354 + #5867 裁定的 estimate-hold backstop 落地)合入分支,新 head c48c5488。git ancestry 直接证明:master@6945a354 与 ci-fixes@d7769ca5 均为 PR head 的祖先——与 base 合并恒为 trivially clean,冲突已结构性不存在。镜像缓存(15:25Z,当前 head)确认 mergeable_state=blocked 而非 dirty:唯一剩余合并阻塞 = §7.4 session-key identity 层的人工审核签核(本 PR 不可 auto-merge),不是冲突。CI 同缓存:30 项 = 0 failed / 6 success / 11 skipped / 13 运行中或排队。

七问

  1. 是什么问题:本次唤醒报告「PR 与 base 分支冲突(dirty)」,需要解冲突并推送。
  2. 什么原因导致的:master 当日推进快于分支同步节奏,分支短暂落后被判 dirty;随后兄弟车道的 ci-fixes 合入(c48c5488)已把 master tip 带进分支——触发信息滞后于该合入约 4 分钟,属过期告警,非需要人工解决的文本冲突。
  3. 影响范围与严重程度:无影响——本轮未推任何东西,远端 head 保持 c48c5488 不动;用户面零变化。当前真实状态:等人工审核 + CI 长跑任务收尾(目前零失败)。
  4. 怎么修复的:验证而非盲推——① ancestry 证明 master/ci-fixes 均含于 PR head(merge 只会是 no-op,强推反而添乱);② 镜像缓存 live 复核 mergeable_state 与 check 汇总;③ 本地重建 kernel 0.0.185 后按 CI 同款 preload 环境跑定向 5 套件 19/19 绿(此前 6 条 nudge 红在 backstop 新语义下全部通过、msgid-rule-parity 5/5、本 PR 的 issue5844 重锚定套件 6/6),坐实裁定落地后的树健康;④ 清掉过期的 needs-decision 标签(The storage-render golden snapshot on master went stale after kernel 0.0.184 (#5860): the next scheduled CI run will def | master 的 storage-render 黄金快照在 kernel 0.0.184(#5860)之后过期:定时 CI 下次必红 #5867 裁定已由 owner 以 [PR] Infinite Wait Issue in Stress Injection: N-Round Fallback (Side Effect Introduced by Fix #5860) | 压力注入无限等待问题:N轮兜底(修复#5860引入的副作用) #5882 有界 hold 方案落地并合入 master,标签保留会误导后续调度),仅保留 pr;⑤ 本地工作区对齐远端 head(丢弃本地一个内容完全被远端包含的冗余 merge commit,ancestry 验证无损)。
  5. 是否有回归问题:无引入——本轮零改动。既有行为定向核过:nudge 家族 6 条旧 pin 现按有界 hold(backstop window)断言且全绿、#728B real-usage 优先仍绿、issue5844 的 re-anchor/guardrail/malformed-degradation/symmetry 各档语义不变、parity 六副本一致性 5/5。
  6. 是否破坏缓存:不涉及——零代码改动,未触碰缓存/重试/增量游标/去重键。
  7. 是否改了设计方向 / 引入新配置:本轮均不涉及。仅记录一条树内既成事实供知悉:[PR] Infinite Wait Issue in Stress Injection: N-Round Fallback (Side Effect Introduced by Fix #5860) | 压力注入无限等待问题:N轮兜底(修复#5860引入的副作用) #5882(kernel 0.0.185)引入了 compress.maxEstimateHoldRounds 配置(estimate-grade pressure hold 的有界等待上限,即 The storage-render golden snapshot on master went stale after kernel 0.0.184 (#5860): the next scheduled CI run will def | master 的 storage-render 黄金快照在 kernel 0.0.184(#5860)之后过期:定时 CI 下次必红 #5867 裁定的落地形态)——系 owner 车道实现,非本轮动作。

收工判定:本轮无可执行动作(远端 head 已是正确形态,任何推送都是冗余),已停手。PR 现处「待 owner 人工审核签核」+ CI 长跑任务收尾中(当前 0 失败);若长跑任务出现红点,由本自动修复车道后续 attempt 接手归因。

# Conflicts:
#	src/session-resolve.ts
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

本轮是真实冲突(与上一轮的 stale 误报不同),已解完并推送。七问:

1. 是什么问题:PR 分支再次与其 base(master)冲突,系统报 merge state dirty。这次 master 在上次对齐后真的又前进了。

2. 什么原因导致的:上次对齐把分支带到 master@6945a354;之后 master 合入了 #5895(P2 review batch:model scan memo、ephemeral-ref pinning、preoom snapshot、msgid-rescue trace + kernel EPHEMERAL_QUERY_PARAM 修复,cda6e735)。master 新提交与本 PR 同时改了 src/session-resolve.ts(master 给 tryMsgIdRescue 加 exit 参数和一行 warn trace,新增 logger.js import;本 PR 在同一 import 行加了 neutralTurnCanonical)→ import 行产生真实文本冲突。

3. 影响范围与严重程度:仅影响 PR 可合并性(dirty 挡住合并),无用户行为面。纯机械级。

4. 怎么修复的:merge origin/master(cda6e73)进分支。唯一文本冲突 = src/session-resolve.ts import 行,按 union-of-intent 取并集(PR 侧 neutralTurnCanonical + master 侧 loggerLog 都保留)。先审了 master 对该文件的语义改动(tryMsgIdRescue(xit) 签名 + 一行 warn 日志,三个调用点传上下文串)——纯附加,与本 PR 的 canon rung(#5686 位点)和 #5719 msgid rung 不重叠,文件其余部分自动合并干净。本地验证:typecheck 干净 + 定向 11 套件 62/62 绿(issue5844 核心套件、issue5686-tagchanged、issue5719-msgid-lane-identity、issue5719-self-checkpoint-reanchor、issue3397-persona-restart-stability、dsh-persona-fingerprint、dsh-persona-continuity、issue2601-fork-lineage、issue2817-crosswire-persona-fold、persona-fork-active-parent-guard、issue2944-neutral-skeleton)。push 前 fetch 确认远端头未动,正常 push(非 force)。新 sha=07ccff4a69。状态已按惯例在 #4599 留了一行。

5. 是否有回归问题:无。并集 import 两侧符号都在(neutralTurnCanonical 导出在 src/affinity-neutral.ts:395,loggerLog 有使用点);master 新增的日志行是诊断性的(warn 级,不改判定结果);本 PR 的 canon rung 逻辑逐字节未动。既有行为由上述 62 个测试钉住。

6. 是否破坏缓存:不涉及(未触碰缓存/重试/游标/去重策略,本轮只是把 master 合进来)。

7. 是否改了设计方向或引入新配置:无方向变化;本侧未引入新配置。(master 自带的 compress.maxEstimateHoldRounds 来自此前已合入的 #5867/#5882 owner 裁定,随本次 merge 一并进入分支,非本 PR 引入。)

收工判定:冲突解除,已推送;镜像缓存实测新头 07ccff4a69 的 mergeable_state 已从 dirty 回到 blocked(=等人工评审,§7.4 session-key identity 层,不可自动合入),新一轮 CI 进行中(0 failed / 8 success / 11 queued / 11 skipped)。等 owner 人工评审;CI 若红,本车道继续跟进。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai: vllm-qwen/qwen3.8-27b)

审查结论:APPROVE(通过)。此为 session-key identity 逻辑,按 AGENTS.md §7.4 需 owner 人工合入。(注:本操作账号即 PR 作者,GitHub 不允许对本人 PR 置 approve 状态,故以评审评论形式给出结论;合并请由你手动执行。)

独立审了 PR 正文、关联 issue #5844、完整 diff(4 文件 +281/−8;不碰 kernel/、不 bump version、无 config 面)。方向关通过:#5844 报的就是长 dsh 会话在宿主升级「同轮换 system prompt + 重打包 assistant 记录」后被误分叉到 <id>|sub:<fp> 空车道、压缩状态清零、preflight 从零压 ~2.5M token 超时 413;本 PR 修的是机制(延续证据通道太脆),不是掩盖 413 这个症状。

八问:

  1. 是什么问题:同一个对话,因宿主升级同时改了 persona 文本(tagHash 变→tagChanged)和消息记录布局(assistant 文本段并入相邻记录→重放更短),被顺序解析器误判成「换了个人」,分叉到空的派生车道,长会话的压缩状态随之丢失,resume 直接 413。
  2. 什么原因导致的:延续判定只有一条粒度敏感的字节级证据通道(逐源消息 fragment hash)。记录被重打包后逐消息粒度变了,fragment 全失配,但逻辑回合内容其实逐字不变;四道逃逸档全靠这种证据→集体失效。属「证据通道单一且脆」的机制缺陷,不是表面现象。
  3. 影响范围与严重程度:仅命中窄条件——同 id 上 tagChanged 为真 + 重放严格短于骨架 + 尾部 ≤8 轮 kind 对齐 + fragment 因重打包失配。严重度 p1(owner 规则:会话无法恢复类一律 p1);触发面窄(需宿主升级同时动 system+记录布局),但一旦命中即整个长会话状态丢失。
  4. 怎么修复的:给既有的「#5686 tagChanged+更短+尾对齐」档加一条并行内容校验证据——用身份链自有的 neutralTurnCanonical(kind+逻辑文本/调用)对末 ≤8 轮算规范化指纹(canonFp)。它抗记录重打包(重组不改逻辑内容→指纹不变)、但不抗内容变更(改一字即变→照旧分叉)。fragment 路径原样保留且优先、reason 逐字不变;仅当 fragment 失配才回落 canon。持久化加 additive 可选 canon 列,hydrate 严格校验(长度=kinds 数、每项 64-hex),坏值降级 absent→走改动前路径。
  5. 回归审查(逐项过既有行为):#5686 fragment 档(fragment 匹配时逐字不变、且优先于 canon)✓ 保持 / #5719 msgid-rescue 档(未触碰,仍是 fork 前最后一档)✓ / 全部 tag-invariant 分支(continue / grown / derived-task / tagged-shorter;测试 6 专门钉住 tagged-shorter 仍走既有 owner-rule-1 分支)✓ / 分叉护栏(mis-attribution 防护;测试 2 证明尾部真实内容变更仍分叉)✓ / 快照 wire 形状(additive-only,旧快照无 canon 列照常解析,测试 3/5 钉住)✓。唯一有意行为变更:原本会分叉的「重打包+tagChanged+更短+canon 尾匹配」现在 reanchor——正是本 bug,PR 正文+文档均已披露 old→new,非静默漂移。诚实边界已声明:修复前持久化的骨架没有 canon 列→受影响会话升级后首轮仍可能分叉,靠文档里的施工流程或 #5719 msgid 档兜底;一次成功 reanchor 后骨架即永久带 canon。
  6. 是否破坏缓存:不涉及。canon 是身份判定用的内存+持久化字段,不进出站渲染、不进 prefix-cache 键,不改任何缓存/重试/增量游标策略。
  7. 是否改了设计方向:未转向。仍在「顺序为中心 + 多路身份证据、永不模糊相似」框架内加一条更强证据(与 KDD #11/#13 的 msgid>顺序>hash 层级同向);文档明确把「客户端侧稳定身份信号」列为未来根治方向,durable home 留了注记,符合 §7.3「疏 not 堵 + 超范围留边界」。
  8. 是否引入了新的配置:无。无 config/env/CLI 新增;skeleton 的 canon 列是内部自愈合持久化字段,对用户不可见。

测试有效性:6 个测试都有牙(断言精确的 action/key/reason,非恒真)——正例(reason 匹配 /#5844/,证明走的是 canon 新路径而非 fragment)、护栏(变异末位 tool-result 仍分叉,且特意选 text 承载轮而非 calls 轮,避开跨线中性的已知盲区)、向后兼容(剥离 canon 列→fork,与改动前完全一致)、持久化往返(restart 保住 rescue)、加固(畸形 canon 降级 absent)、对称回归(tag 不变的 repack 走既有分支)。bug 若回归,这些抓得住。

CI:此前 head 各 gate(kernel-guard / version-guard / config-surface-guard / docs-coverage / build / gates)均绿;本次仅追加一行注释修正,无任何行为变化。

已顺手修:src/session-resolve.ts 中 #5686 档的注释序号笔误——原文写「fifth rung」,实为 tagChanged 分支的第 6 个 reanchor 档(前五个依次是 selfCheckpoint / headAligns / model-switch / chain-continues / #4778),改为「sixth rung」;纯注释、零行为影响 + commit 535bb92。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

PR #5851(#5844 repack-reanchor)审查完成:结论 APPROVE(通过)。独立审了正文 + 关联 issue #5844 + 完整 diff——方向关通过(修的是「延续证据通道太脆」的机制,非掩盖 413 症状)、回归逐项过(fragment 档逐字不变且优先 / msgid-rescue 未触碰 / tag-invariant 分支未触碰 / 分叉护栏由测试 2 钉住 / 快照 additive-only)、测试 6 个都有牙、文档准确且中英同步、范围干净(不碰 kernel/、无 version bump、无 config 面)。唯一有意行为变更(重打包+tagChanged+更短+canon 尾匹配 由 fork→reanchor)正是本 bug,PR 已披露 old→new。顺手小修:src/session-resolve.ts 中 #5686 档注释序号笔误 fifth→sixth rung(纯注释零行为,commit 535bb92,已推 PR 分支,CI 在新 head 重跑)。无阻塞项;属 session-key identity 逻辑,按 §7.4 待 owner 人工合入(作者账号无法对本人 PR 置 approve 位,故结论以评审评论形式给出)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 PR #5851(#5844 repack-reanchor)审查完成,结论 APPROVE(通过)。

…doc-move conflict (#5844 section ported to docs/session-identity.md)
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

本轮触发再次报告「PR 与 base 冲突(dirty)」。逐条活体核验后确认这次是真冲突,已解决并推送。七问如下:

1. 是什么问题:master 又前进了(cda6e73 → 58a8796,20+ 个合并,含 #5991/#5809/#5609/#5903/#5983 及文档布局迁移),PR 分支(上次已带到 cda6e73)与之产生新的文本冲突;另外作者在我上次推送后又补了一个提交 535bb92(修正 session-resolve.ts 注释里的 rung 序号),我的合并建在它之上、完整保留。

2. 什么原因导致的:master 按文档布局裁决把 SESSION-IDENTITY.md/.zh-CN.md 整体迁到 docs/session-identity*.md、根路径只留一行重定向占位;而本 PR 正是在原文件里新增了「Persona-lane drift(#5844)」章节——双方重写同一文件 = 整文件级冲突。代码侧无冲突:src/session-resolve.ts 与测试文件均自动合并干净。

3. 影响范围与严重程度:纯文档层冲突,不影响任何运行时行为;不解决则 PR 保持 dirty 无法进入合并。属于发布流程阻塞,非用户面缺陷。

4. 怎么修复的:union-of-intent 双向保留——根路径两文件恢复为 master 的重定向占位(遵循文档迁移裁决),PR 新增的两个章节逐字移植到迁后新址:docs/session-identity.md:259(EN,位于 "## Future direction" 之前)与 docs/session-identity.zh-CN.md:147(ZH)。零内容改写:EN 45 行/ZH 15 行均为纯插入,用 git apply 精确落位。

5. 是否有回归问题:逐项审过——① 合并带入的 master 侧变更本身已由 master CI 覆盖;② 我的人工干预仅两处文档文件:根占位与 origin/master 版本逐字节一致(git show 直取),移植章节与 PR 原版逐字节一致(纯插入 patch);③ 全仓无残留冲突标记;④ typecheck 干净(kernel 已随 master 升 0.0.192 并重建);⑤ 定向 12 套件(session-resolve reanchor/persona/msgid-rule-parity 家族:issue5844/issue5686/issue5719×2/issue3397/dsh-persona×2/issue2601/issue2817/persona-fork-guard/issue2944/msgid-rule-parity)67/67 全绿。无语义变化。

6. 是否破坏缓存:不涉及——纯 git 合并 + 文档位置调整,未触碰压缩/缓存/会话存储逻辑。

7. 是否改了设计方向或引入新配置:不涉及——无设计转向、无新配置项。

收工判定:冲突已解,合并提交 223226db 已普通 push(推前复核远端头仍为 535bb92,无并发推送者;未 force-push)。截至本轮,镜像缓存仍显示上一头 535bb92 的结果(18 success / 12 skipped / 0 failed),新头的 CI 运行待镜像轮询刷新,我不对新头断言绿。CI 转绿后,PR 回到 blocked = 等 owner 人工评审(§7.4 session-key identity 档,永不自动合并)。已在 #4599 留一行状态同步。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

本轮七问结论已在上方发出(评论 70621):真冲突核验成立(master 文档迁移 vs PR #5844 新增章节)→ union-of-intent 解决 → 223226db55 普通推送,typecheck 干净 + 定向 12 套件 67/67 绿。新头 CI 待镜像轮询刷新、未断言绿;之后回到 blocked = 等 owner 人工评审(§7.4)。本轮无其他动作。

@ranxianglei ranxianglei left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(ai: vllm-qwen/qwen3.8-27b)

Re-review @ new head 223226db5 (supersedes my review at 535bb92).

Delta since my last reviewed head: the author merged origin/master (58a87962) into the branch → merge commit 223226db5. That pulls in ~39K lines of already-merged master work (master's own kernel/ bumps 0.0.185→0.0.192, the docs/ hub relocation, and many unrelated merged PRs) — none of it is this PR's contribution.

Isolating the PR's own change (git diff 58a87962..223226db5) = the same 4 files, byte-for-byte identical to what I approved in round 1:

  • src/session-resolve.ts — the canonFp content-verified rung. Re-read the full hunk; logic unchanged (import of neutralTurnCanonical, Recorded.canon?, canonFp(), CANON_FP_RE, OrderSkeletonEntry.canon?, record() setting canon, the canonTailEquals() closure, the modified #5686 shorter-tail rung whose fragment-case reason string stays byte-identical, the additive orderSnapshot() emit, and the validating/degrading applyOrderSnapshot()).
  • docs/session-identity.md (+45) / docs/session-identity.zh-CN.md (+15) — the #5844 section, relocated to docs/ per master's docs-hub move (owner ruling #5920); en/zh still synced, content unchanged.
  • tests/issue5844-repacked-tail-reanchor.test.ts (+170) — present.

My round-1 spot-fix (stale ordinal fifth→sixth rung, src/session-resolve.ts:503) survived the master-merge and remains accurate (5 reanchor rungs precede it in the tag-changed branch). This PR touches no kernel/ path — the kernel/ files in the raw 535bb92..223226db5 diff are master's, not the PR's — so the kernel authorization HARD-RULE does not apply.

CI on 223226db5: green — 30 checks, 18 success + 12 gated-skip (e2e lanes), 0 failure/error/stale; mergeable_state: blocked means awaiting review/merge only, not a CI failure.

结构化八问

  1. 是什么问题:宿主升级在同一轮里既换 system prompt 又重组 assistant 消息记录后,长会话被误分叉到空的 <id>|sub:<fp> 车道,恢复时从零压整段历史而超时(#5844)。
  2. 什么原因导致:唯一可用的字节级延续证据绑定在「记录的物理切分」(per-source-message fragment) 上;宿主把消息重组进不同记录后 fragment 全变,而逻辑轮次其实逐字未变——证据通道太脆。
  3. 影响范围与严重程度:能用但体验毁灭(升级后 dsh 长会话直接坏掉、恢复超时 413)→ p1;触发条件为宿主同轮改 system prompt 且重组 assistant 记录布局(实测 dsh 0.2.1→0.2.2-rc.x)。
  4. 怎么修复的:在 #5686 更短尾档位补一条「内容校验」证据——按身份链自有的 canonical 形式(neutralTurnCanonical,kind+逻辑文本/调用)比较最后 ≤8 轮;canonical 对记录重组不敏感、对内容变更敏感,命中即 reanchor 到原始 id 而非分叉;持久化加可选 canon 列(additive,hydrate 时校验,畸形降级回旧路径)。
  5. 是否有回归问题:无。fragment 档 reason 逐字不变且优先 / msgid-rescue 未触碰 / tag-invariant 分支未触碰 / 分叉护栏由测试钉住(改最终 tool-result cell 仍分叉)/ 快照 wire additive-only(旧文件可解析、canon 缺失=变更前行为)。
  6. 是否破坏缓存:不涉及(不动压缩/缓存/重试策略)。
  7. 是否改了设计方向:不涉及(沿用既有 tag-changed 逃生阶梯,只在 #5686 档补一种等强度证据)。
  8. 是否引入新配置:无(内部持久化字段,additive 自愈,无 config/env/CLI 面)。

结论:APPROVE。 属 session-key identity 逻辑,按 §7.4 需人工合入。(操作账号即作者 ranxianglei,GitHub 不允许对本账号 PR 置 approve 位,故以 review-comment 形式给出结论。)

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 PR #5851 复审完成(新 head 223226d)。

说明:上一轮我已审过并给 APPROVE(head 535bb92);本次派发头移到 223226db5,是作者把 origin/master(58a87962) 合入分支产生的合并提交。(期间本进程曾因一次未加超时的网络调用挂住约 35 分钟被强制重启,本轮已改用带 timeout/低速阈值的受控命令完成核对。)

增量核对结论:

  • 本 PR 自身贡献与首轮批准版逐字一致——git diff 58a87962..223226db5 = 同 4 文件:src/session-resolve.ts(canonFp 内容校验档,逻辑不变)、docs/session-identity.md(+45)/.zh-CN.md(+15)(Resuming a long session fails with preflight 413 when persona fingerprint and replay shape change together (0.1.212) #5844 段落随 master 迁到 docs/,中英同步)、tests/issue5844-repacked-tail-reanchor.test.ts(+170)。原始 535bb92..223226db5 diff 里那约 39K 行全是 master 合入的既有工作,非本 PR。
  • 我首轮的序号小修(fifth→sixth rung,src/session-resolve.ts:503)在合并中幸存且仍准确。
  • 本 PR 不碰 kernel/(raw diff 里的 kernel 版本 bump 全是 master 的)→ 授权 HARD RULE 不适用,无需 🔶 需要决策。
  • CI 全绿:30 checks = 18 success + 12 gated-skip,0 失败;mergeable_state: blocked 仅表示待评审。

结论维持 APPROVE(§7.4 session-key identity 逻辑需人工合入)。操作账号即作者,GitHub 不允许对本账号 PR 置 approve 位,已在 GitHub 以 review-comment 形式给出完整八问结论(review id 5850052912 → pull/5851)。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resuming a long session fails with preflight 413 when persona fingerprint and replay shape change together (0.1.212)

1 participant