Repository navigation
[PR] Fix permanent unified-shadow DIGEST DRIFT on ref-floored sessions (Codex Desktop): replay leg minted a phantom byRef entry - #5597
Conversation
After a Responses/codex native-compaction rebase (#2592/F5) pins the session's ref high-water mark, byRaw carries the synthetic "bili:ref-floor" entry with no byRef counterpart (documented invariant). The refs ledger persists every byRaw entry as a row, and LegacyViewBuilder inverted every non-BLOCKED row into byRef — including the floor row — minting a phantom mNNNNN→floor entry the live map never has. Since #4685 made the parity digest order-insensitive, that content delta was the last divergent dimension left: DIGEST DRIFT [diverged: state; state: messageRefs] on every sampled verify of any session that ever pinned a floor, watermark drop + full-tail re-ingest each time, escalating to frozen JSON envelope writes after three samples — permanently, because the floor never leaves byRaw while the drift can never be clean. In shadow mode the JSON envelope is the primary durable record, so restarting after a freeze resumes from a stale snapshot. Codex Desktop sessions pin the floor on every native compaction (rebase-type boundary), which matches the field report: v0.1.212, long-running Codex conversation, persistent drift. The replay reconstruction now skips the floor entry exactly like BLOCKED: byRaw keeps the row (the cursor high-water must survive full-mode boot); byRef stays the strict inverse of real messages only. REF_FLOOR_RAW_ID moved to state-hydration.ts so the storage seam can consume it without importing the session layer; session.ts re-exports it for existing importers. Tests: tests/issue5589-ref-floor-parity.test.ts — red run reproduces the exact field log line byte-for-byte; negative gate proves a genuine divergence around the floor number still drifts. Adjacent suites 50/50.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10658-pr.5597.e8968d7This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5597.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…inherited-red convergence)
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复——本 PR 即 #5589 的修复(唯一在途针对该机制的 PR);#5106 是另一观测车道(snapshot-shadow lost-tail),机制不同、本 PR 不涉。 ① 是什么问题:unified shadow(默认模式)下,凡走过 Codex/Responses native compaction 的长会话,每次抽样校验必报 ② 什么原因导致:native compaction 清理旧 ref 时,游标高水位用合成键 ③ 影响范围与严重程度:所有走过 native compaction 的 Codex/Responses 长会话(v0.1.212 字段实锤,Codex Desktop app-server 0.166.0);shadow 为默认模式,面宽。严重度 p1 数据丢失类:冻结期内仅内存保存的回合在重启时丢失。 ④ 怎么修复:回放腿的唯一反转点跳过 floor 行,与 BLOCKED 同等待遇;byRaw 保留 floor 行(full-mode boot 的游标钉必须存活,ref 分配零变化)。无需数据修复:存储行一直正确,只有内存重建错;升级+重启即清(frozen set 进程级,首存即验证干净)。 ⑤ 是否有回归问题:审过的既有行为——(a) BLOCKED 跳过路径不变(同条件并列);(b) byRaw 持久化/重建不变(floor 行照旧往返,cursor 分配零变化);(c) fork-adoption 两条自造 byRef 的路径( ⑥ 是否破坏缓存:不涉及 prefix cache 语义(修的是存储校验腿)。反而消除了水位丢弃/全尾重灌的恶性循环——那是本 bug 的症状。 ⑦ 是否改了设计方向:不变。 ⑧ 是否引入新配置:无。 本地定向验证(全量以 CI 为准):
CI 现状:d265b35a5 重跑中,19/30 已过、0 红(余为 test shard 运行中)。 判定:可合(待 CI 全绿确认)。§7.4:触碰 message-ref/id 逻辑 → 人工合并层,请 owner 合入。 |
(ai: vllm-qwen/qwen3.8-27b) CI 更新:d265b35a5 全绿(30/30,0 红)。审核结论维持可合,请 owner 合入。 |
|
Independent reproduction on Node 26.13.0, using PR head
This independently confirms the active v0.1.212 failure mode and the fix. It does not recover turns already lost before a restart; existing frozen in-memory sessions still need a safe upgrade/restart path. |
|
Current upstream rollup is not green: 58 success, 1 failure, 39 cancelled, 31 skipped. The sole failure is Windows Node 22 shard 3, |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Review posted as COMMENT: GitHub blocks the account from formally approving its own PR (422 self-approval) — the verdict below stands as the review-lane approval.
(ai: vllm-qwen/qwen3.8-27b)
Verdict: APPROVE. Mechanism verified end-to-end against the code; the fix is the minimal correct one; the old→new disclosure matches what the diff actually does.
结构化八问
- 是什么问题:任何曾经钉过 ref floor 的会话(Codex/Responses native compaction)在每次抽样的 unified-shadow 校验上漂移(
[diverged: state; state: messageRefs])→ 每次丢水位 + 全尾重灌 → 连续三次抽样后该会话的 JSON 信封写入被冻结到进程生命结束。shadow 模式(默认)下,冻结后重启从过期快照恢复——数据丢失级。 - 什么原因导致的:#2592/F5 在
byRaw["bili:ref-floor"] = mNNNNN上钉高水位且无 byRef 对应项(文档化不变量——把 kernel 游标压在已释放编号之上);finishPlan把每个 byRaw 条目都持久化为 refs 行;LegacyViewBuilder回放腿把每个非BLOCKED行反投影回 byRef——铸造了一个活地图从未有过的幻影mNNNNN → "bili:ref-floor"条目。#4685 让 parity digest 对顺序不敏感后,这个内容差成为唯一残留的漂移维度。根因类别:账本消费者漏掉了BLOCKED早已具备的同款跳过。 - 影响范围与严重程度:所有 floored 会话。Codex/Responses 的 REBASE 型边界无条件钉 floor(长时运行的 Codex Desktop 会话几乎必然命中——与现场报告 #5589 一致);anthropic-wire
/compact(dsh/opencode/pi 车道)仅在归档剪枝释放最大编号时才钉,很少命中。严重程度 p1 级:每会话永久退化(信封冻结)+ 默认 shadow 模式下的过期恢复风险。 - 怎么修复的:回放腿构建 byRef 时像跳过
BLOCKED一样跳过 floor 行(单一谓词,src/storage/ingest.ts:610)。常量移到src/state-hydration.ts,让存储缝无需导入 session 层即可消费(session.ts保留 re-export 给既有导入方)。行仍留在byRaw——full-mode boot 依旧看到游标高水位,ref 分配不变。两条物化腿(shadow 回放与 full-mode boot 的viewFor)走同一个 builder,一处修复覆盖两条腿。 - 是否有回归问题(既有行为逐项清点):
- 全仓审计每个
byRaw/byRef构造点:fork-adoption.planForkAdoption遍历的是真实消息 id(blockeffectiveMessageIds/ incoming ids),从不遍历 byRaw 键 → floor 进不来;HTTP fork 端点克隆父会话活messageRefs(其 byRef 本就没有 floor)并用真实前缀消息重断言 → 干净;cloneStoreForRefs操作 CCR content store(另一结构)→ 不涉及;BatchedViewVerification复用loadLegacyView(即修复路径本身);store 一致性检查只用正向投影(rawId→ref)→ 不涉及。回放腿是唯一的行→byRef 反投影点,与 PR 声明一致。 - 负向门:围绕 floor 编号的真实分歧仍然漂移(新测试第 3 条)——#4323 的 heal 方向保住,修复不掩盖真漂移。
- 游标语义不变:floor 行 round-trip 后仍在 byRaw(新测试第 2 条)——ref 分配逐字节等价。
- 非阻塞观察(#2592/F5 起就存在,本修复使其暴露面缩小):
getLoadHeader的mapped_refsSQL(src/storage/store.ts:2690)会把 floor 行计入,floored 会话比loadResidentFields漂移态仲裁用的信封 byRef 计数(src/persist.ts:1906)恒多 1;效果仅是「已漂移状态下平局时系统性偏向 indexed 视图」,未发现正确性破坏。在那里排除raw_id='bili:ref-floor'是一行谓词的事,但它改动加载路径仲裁输入——本 PR 不动,留给 owner 裁决。
- 全仓审计每个
- 是否破坏缓存:否。模型前缀缓存语义未触碰;变更移除的是重复的水位丢失/全尾重灌(存储侧重复劳动,不是模型缓存)。ref 分配不变。
- 是否改了设计方向:否——一个消费者对齐文档化不变量;常量搬家是依赖方向清理(存储层不应导入 session 层),行为中性。
- 是否引入新配置:无(已核实,PR 声明无配置面)。
范围说明:四个 golden 文件
tests/golden/storage-render/*.json 的更新(四条 wire 每 turn 统一 +49 bytes 的摘要位移)属于 #5555 false-advertising 文案清扫落 master 后未重生成 golden 的继承红(按 #4599 纪律收敛进本分支)。已验证幂等:在本 head 跑 scripts/update-storage-render-goldens.ts 产生零 diff——golden 与当前代码精确一致。
验证证据
- 本地定向运行(d265b35a5):新测试文件 + 12 个相邻套件(drift-escalation、digest-drift-ref-order、canonical-key-order、rebase-floor、transcript-lineage、json-writer-off、snapshot-shadow、batched-verification、golden-storage-render 等)58/58 通过;typecheck 干净。
- 报告者独立复现(真实工作站数据):五个冻结会话全部带 floor 行;master 代码复现精确漂移 + 幻影
byRef["m00042"];本实现三条回归全过。 - CI(实质 head d265b35):guards 全绿,test 分片 10/11 绿;唯一失败 =
test (windows-latest, 22, 3)于tests/issue3380-dsh-rereg-selflock.test.ts:285(时序断言,与本 diff 零交集,本地通过)——已在 #4599 报备,不归因于本补丁。评审顺手小修(re-export 注释订正)以 81b36c8 落分支,最终绿等其重跑。
(ai: vllm-qwen/qwen3.8-27b) Review 完成——APPROVE(完整八问结论见上方 review;GitHub 禁止账号自批自己的 PR,故以 comment-review 形式落定)。 @Maziar123 感谢独立 red/green 复现——与代码级审计逐条吻合:五个冻结会话全部带 floor 行、master 代码铸出幻影 已顺手修: CI 说明:唯一红分片 收工判定:可合并——等注释级新 head 81b36c8 的矩阵转绿即可。 |
(ai: vllm-qwen/qwen3.8-27b) Review lane 收工总结(详情见上方 review 与楼层 12):
等 CI 转绿后请 owner 合入。 |
…facet C) A native-compaction rebase clears blockContents in place, but the store kept whatever the sessions.orphans_json journal already held (merge semantics): pre-clear entries became ghosts that the sampled verifier flagged as [diverged: blockContents] on EVERY verify - a permanent drift the escalation could never heal (field evidence S6 on 0.1.212). Per-save replacement: null resets the journal, a populated set replaces it. The old retention protected a production-unreachable state (a thinned plain map) - LazyBlockContents re-materializes on iteration or throws, so a save only ever sees the full set or a genuine clear; the pinned #4216 expectation for that case is updated accordingly. The mysql upsert now carries orphans_json (same latent class: it never wrote the journal column at all). Hermetic repro tests/issue5589-orphan-journal-ghost.test.ts reproduces the byte-identical field log signature pre-fix, plus a negative control.
…inherited-red convergence)
a2e0af4 to
2aeac3f
Compare
(ai: vllm-qwen/qwen3.8-27b) 结论:本轮 10 个红的 test 分片已全部转绿。 这是继承性红(master born-red,非本 PR 缺陷);收敛提交在我接手前已在分支上,我沿上游 check-runs 直接确认了终态全绿。 head 变化: 结构化八问
收工判定:无需我再 push——收敛提交已在分支且上游全绿,本 PR 两个 blocker(behind + 红分片)均已清除,可待人工合并(合并权在 owner,我按规不合并)。如需我在 #4599 总控补一行留痕,说一声即可。 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Formal APPROVE event blocked again by GitHub's own-PR rule (this lane posts under the repo account) — the verdict below stands as the review-lane approval, same convention as round 1.
Scope of this round: facet C commit 6b0d37bae (orphan-journal ghost after authoritative clears) + ci-fixes/master convergence merge e60f2e482 (inherited-red per #4599, master-side changes out of review scope) + review-lane comment fix 2aeac3f20 (comment-only, zero behavior delta vs e60f2e4). Facet A (ref-floor phantom byRef) was fully audited in round 1 and its regression suite re-passes on this head.
① 是什么问题:unified shadow(默认模式)下,凡走过 #2695 archive reap(block 离开 state.blocks、contents 留在 blockContents 供 decompress)的会话,一旦再经历权威清空(Codex/Responses native compaction rebase 原地 clear blockContents),孤儿日志(sessions.orphans_json)里清前条目永久保留 → 每次抽样校验必报 DIGEST DRIFT [diverged: blockContents] → 连续 3 次抽样失败后本进程对该会话的 JSON envelope 写入永久冻结,重启从陈旧快照恢复。
② 什么原因导致:两层。机制层:journal 写入语义是 MERGE(只增不删)——live map 是 journal 内容的唯一事实源,但 store 侧从不删除 live 侧已权威清掉的条目,幽灵跨 clear 存活。触发层:rebase 清正是合法清空,却撞上了只增语义。同 commit 另发现并修复:mysql upsert 此前根本不带 orphans_json 列(列存在但从未写入)→ mysql 会话同一潜在缺陷类、不同机制(journal 恒 NULL,reap shape 在 unified 视图不可表示)。
③ 影响范围与严重程度:走过 archive reap 且随后发生权威清空的会话(Codex/Responses native compaction 路径);shadow 为默认模式,面宽。p1 数据丢失类(与 facet A 同类):冻结期内仅内存保存的回合存活,重启回退到冻结前快照。字段证据 S6(v0.1.212,Codex Desktop)。
④ 怎么修复的:写入语义 MERGE → REPLACE——每次 save 把 live 孤儿集逐字落库(null = 重置),"journal = live set"恒成立。并验证了「thinned map 到不了 plan 构造」这一前提的全链路:LazyBlockContents 任何访问(含迭代)都走 ensure() 从 store 重材化,失败时 throw 而非返回瘦集(src/session.ts:72-74,注释明言"否则一次迭代会把磁盘上的 block contents 抹掉");重材化来源 = block 行 + orphans journal(src/storage/shadow.ts:700-709),所以 journal-only 条目在 #3050 drop 之后也不会被 REPLACE 误删;blockContents 全部变更点逐一审计过——orphan-gc 只删仍留在 state.blocks(inactive)的 block、不涉 journal;convergeToDisk 用磁盘构建的完整视图替换(正是要持久化的内容);rebase clear 就是设计内的重置触发点。reapBlocks 的增量合并保留,与 REPLACE 自洽(其新增项由下一次 save 重新携带)。
⑤ 是否有回归问题:逐项审过既有行为:(a) reap shape 保持可表示(#4216/#4242 不变,更新的 pin 测试已在 PR body 披露);(b) 持久孤儿不被过度清除(负控测试:孤儿跨 21 次 save 保留,两次抽样校验均 clean);(c) 真分歧仍可检出(verifier 比较逻辑未动,digest 机制与 facet A 同一套,facet A 负门钉住 messageRefs 维,blockContents 维同路径);(d) mysql 补上 sqlite 早已带的列——full-mode mysql 用户的 reap-shape contents 此前只活在 JSON envelope、unified 视图缺失(同类漂移/冻结潜在风险),本 commit 关闭;(e) 行为变更旧值→新值:journal 保留策略 merge→replace(已披露)、pin 测试期望翻转(已披露,旧输入形状生产不可达);heal = 升级+重启(per-process frozen set 重置,首个 verify-clean save 恢复 envelope 写),无需 DB 修复。高危模式检查:无 fail-fast 变吞错、无阈值/时序/输出格式漂移。
⑥ 是否破坏缓存:不涉及——未触碰任何缓存/重试/增量游标/去重键;ingest watermark 机制本身恢复正常工作(这正是修复目的)。
⑦ 是否改了设计方向:无——留在既有 unified-shadow 架构内,只是收紧 journal 契约(live set verbatim),数据流不变。
⑧ 是否引入新配置:无(无新 env/config/CLI surface)。
测试有效性:新 tests/issue5589-orphan-journal-ghost.test.ts hermetic red/green(pre-fix 复现字段日志签名 [diverged: blockContents])+ 负控(持久孤儿不误报)——gate 双向断言,#3617 纪律达标;断言有牙(verifyDrift/verifyOk 计数 + 精确日志签名),非恒真。更新 tests/storage-orphan-representable.test.ts step 4 期望并在 PR body 披露。
本地验证(e60f2e4):相邻定向套件 16 个文件 69/69 pass(与 PR body 声明一致)、golden-storage-render 5/5(goldens 在本 head 幂等)、typecheck clean。全量回归以 CI 为准。
kernel:未触碰,无 kernel-change 声明——授权门禁不适用。§7.4 human-tier 已在 PR body 标注。
已顺手修:facet C 把 journal 写入语义改为 replacement 后,src/storage/ingest.ts:435 与 src/storage/shadow.ts:460 两处注释仍写 "the store merges it"(与代码事实不符)——订正为 replacement 语义并引 #5589-C + commit 2aeac3f。
收工判定:可合——新 head 2aeac3f 的 CI 矩阵已绿(26 success / 0 failure / 4 skipped = e2e 门控车道;相对受审树 e60f2e4 仅注释级差异,零行为增量)。请 owner 合入。
(ai: vllm-qwen/qwen3.8-27b) Facet C(孤儿日志幽灵)审核完成,结论可合。
已顺手修:facet C 把 journal 写入语义改为 replacement 后,src/storage/ingest.ts:435 与 src/storage/shadow.ts:460 两处既有注释仍写 "the store merges it"(与代码事实不符)——订正为 replacement 语义并引 #5589-C + commit 2aeac3f。 请 owner 合入:#5597 |
[bot] 🏷 Merge conflict resolved and pushed — verified clean against live sources. Why it looked bigger than it was: the branch's real change is only 9 files (the #5589 orphan-journal / ref-floor storage fix: How I fixed it (mechanical, no design decisions):
Verified live this run:
On the repeated "dirty" alerts: they landed after my push and are stale/delayed detections — the live check above shows the conflict is gone. Master did not move past 中文八问(结构化结论)
判定:合并冲突已解决并推送(分支头 |
[bot] (ai: vllm-qwen/qwen3.8-27b) 重启说明与当前状态确认:review-worker 进程曾卡住 31 分钟被强制重启。卡住前我的审核工作已全部落定(结论见上楼层 12/14/19:主修复 APPROVE、facet C 可合、注释级顺手修 commit
收工判定:本 PR 两个 blocker(behind + 红分片)均已清除,CI 全绿,可合并。按规 agent 不执行合并——请 owner 手动合入:#5597 。若合入后 master 再前进且触及这 9 个文件才需要再收敛(属哨兵/ci-fixes 车道职责),目前无需任何进一步操作。 |
[bot] 🏷 Re-verified live this run — the fix is unchanged and CI has since finished:
Remaining step is owner approval + merge (agents don't merge). I won't re-post on every duplicate trigger unless the state actually changes (a new conflict or a red check). 中文:冲突已解、CI 全绿(30/30,0 失败),现仅剩 owner 人工批准合并;重复的 dirty 告警是推送前旧状态的延迟检测,无新可修项。 |
[bot] 🏷 Closing this CI lane — final state (verified live):
Nothing further to fix on my side — standing down unless the state regresses (a new conflict or a red check). 中文:冲突已解并推送、本地 typecheck 绿、CI 30/30 全过,现仅剩 owner 人工批准合并;本车道收工,若状态回退(新冲突或红 check)再介入。 |
…elds (#5589) The sampled DIGEST DRIFT diagnosis (#5677) names the divergent top-level fields of the first divergent lastMessages slot, but a fixed-size serialization difference INSIDE a sidecar field (e.g. rawResponsesItem — the v0.1.215 Codex CLI shape: same id/role/text, +26 canonical bytes in rawResponsesItem) still leaves the exact wire member unknown. Drill one level: for each divergent top-level field whose value is a plain object on both legs, name the inner members whose canonicalized values disagree. Wire schema names only — values never reach the log line (same privacy contract as the #5677 field names). Bounded: at most 5 inner members per field, sorted. Fields absent on one leg are not drilled (the top-level name already says "the sidecar appeared/disappeared"); arrays are not drilled (index-level diffs are a different shape). The line prefix stays byte-identical for existing greps — the nested segment is additive: ...; fields: rawResponsesItem; rawResponsesItem: summary Wired into both call sites (the header-level describeViewDivergence and the per-row compareMessages that produces the sampled verify line). Diagnostic only — no behavior, wire, storage, or config change.
What this fixes
Field report #5589 — v0.1.212, Codex Desktop app-server 0.166.0, long-running conversation:
The same line repeated on every sampled verify of that session's lifetime.
Follow-up field data in the same thread (69 deduped drift events across 6 sessions, 4 frozen envelopes) splits into three signatures: 63x
[diverged: state; state: messageRefs](facet A below), 4x[diverged: blockContents]on one session (facet C below), and 2 isolated single-eventlastMessagestail-slot byte deltas that self-healed on the next sample (the documented delta-fast-path trade-off for host-side rewrites below the watermark — no action). This PR fixes both structural facets; each is its own labeled commit. The report's second symptom (snapshot-shadow lost-tail:N) is a separate observability lane that legitimately flags client-side history rewrites — see the issue thread; no change here for it.Facet A mechanism — ref-floor phantom byRef entry
reconcileNativeCompactionBoundary([Bug] #2436 的宿主本地压缩检测只接在 OpenAI 车道,Anthropic 车道缺失——未宣告宿主压缩后 nudge 广播的 compress ref 永久不可解析 #2592/F5) pins the session's ref high-water mark after every Responses/codex native compaction:byRaw["bili:ref-floor"] = mNNNNNwith no byRef counterpart — a documented invariant (the floor only exists to hold the kernel cursor high).finishPlanpersists EVERY byRaw entry as a refs row (src/storage/ingest.ts).LegacyViewBuilder(the replay leg) inverted every non-BLOCKEDrow into byRef — including the floor row — minting a phantommNNNNN → "bili:ref-floor"entry the live map never has.[diverged: state; state: messageRefs]on every sampled verify (every 20 ingests) → watermark drop + full-tail re-ingest each time → after three consecutive samples the session's JSON envelope writes are frozen for the rest of the process lifetime — permanently, because the floor never leaves byRaw while the drift can never be clean. In shadow mode (the default) the JSON envelope is the primary durable record, so a restart after freeze resumes from a stale snapshot (data-loss class).Why Codex specifically: codex/Responses native compaction takes the REBASE-type boundary path, which pins unconditionally; the anthropic-wire
/compactpath (dsh/opencode/pi lanes) only pins when an archive prune frees the max number. dsh lanes therefore rarely pin; long-running Codex Desktop sessions almost certainly do.Behavior change (old → new)
bili:ref-floordrifted on every sampled shadow verify → repeated watermark drops + full-tail re-ingests → after three consecutive samples its JSON envelope writes froze for the whole process lifetime. Full-mode boot additionally resolved citations of the floor number to the synthetic id instead of falling through to tombstone handling.BLOCKED. Shadow verify of a floor-pinned session now passes; a genuine divergence around the same number still drifts (negative-gate test).byRawkeeps the row — the cursor high-water must survive full-mode boot, so ref allocation is unchanged.Facet C — orphan-journal ghost latch (
[diverged: blockContents])Field evidence: one session (S6), 4 events, escalated to envelope freeze. Every stored block row postdates the first drift and no compaction/rebase line precedes it within the retained log window — the divergence came from state carried over from an earlier session generation, not from a visible compaction at drift time.
Mechanism:
state.blockswhile its original text stays inblockContents(kept for decompress).finishPlanjournals those entries intosessions.orphans_json.blockContentsin place — an authoritative clear; the plan then carries an empty orphan set (null).orphans_jsonforever.[diverged: blockContents]on every sampled verify → streak escalation → envelope freeze — permanently, for the same reason as facet A: no future save can ever make the sample clean again.Fix = per-save authoritative replacement: a populated set replaces the journal, an empty set resets it. Safe because a save can only ever see the full set or a genuine clear —
LazyBlockContentsre-materializes from disk on iteration or throws refusing a thinned view, so the "trimmed live map" state the old merge semantics protected is unreachable in production. The mysql upsert had the same latent class one notch worse (it never wroteorphans_jsonat all); it now carries the column.Behavior change (old → new):
[diverged: blockContents]drift + envelope freeze.tests/storage-orphan-representable.test.tsstep 4 previously asserted "a save whose live map was trimmed keeps the journal"; that input shape is unreachable in production (see above) and the assertion now pins the reset invariant instead. Disclosed per the behavior-change rule.Heal: same as facet A — upgrade + restart (per-process frozen set resets; first verified-clean save resumes envelope writes). No DB repair needed: the journal rows were always a faithful copy of what the store was told; only the retention policy was wrong.
Config surface
None. No new env/config/CLI surface.
Kernel
Untouched (no
kernel/**changes).Tests
tests/issue5589-ref-floor-parity.test.ts: e2e red/green (the pre-fix run reproduces the exact field log line byte-for-byte, incl.[v=0.1.212] [diverged: state; state: messageRefs]), shape assertion (floor survives the round-trip in byRaw, no phantom byRef), negative gate (a genuine divergence around the floor number still drifts — After idling for one hour, the fold override is lost: the client resends byte-for-byte identical content, and the previo | 闲置一小时后折叠覆盖丢失:客户端重发逐字节不变,已折叠的 ~240K token 内容自己回到上下文 #4323 heal direction preserved).tests/issue5589-orphan-journal-ghost.test.ts(facet C): hermetic red/green — the pre-fix run reproduces the exact field log signature[diverged: blockContents] — dropped the ingest watermark…, plus a negative control proving a persisting orphan does NOT trip the verifier.Third commit: nested field drill-down in the drift diagnosis (#5589 field evidence, v0.1.215)
A follow-up field report on v0.1.215 (Codex CLI 0.169.0) showed 7×
unified shadow DIGEST DRIFTall ondiverged: lastMessages— 3× with the SAME id/role/text but a constant +26 canonical bytes insiderawResponsesItem(535→561, 592→618, 729→755). The #5677 top-level field diff names the sidecar (fields: rawResponsesItem) but not WHICH wire member moved, so the exact trigger stayed unidentifiable from the log.This commit drills one level: for each divergent top-level field whose value is a plain object on both legs, it names the inner members whose canonicalized values disagree. Wire schema names only — values never reach the log line (same privacy contract as the #5677 field names). Bounded: at most 5 inner members per field, sorted. Fields absent on one leg are not drilled (the top-level name already says "the sidecar appeared/disappeared"); arrays are not drilled (index-level diffs are a different shape). Wired into both call sites (header-level
describeViewDivergence+ the per-rowcompareMessagesthat produces the sampled verify line)....; fields: rawResponsesItem...; fields: rawResponsesItem; rawResponsesItem: summaryDiagnostic only — no behavior, wire, storage, or config change. The 3× +26 shape is the documented #4614 slot-rewrite class (self-healing: watermark drop → full re-ingest → converge; the report showed no escalation/freeze). This commit makes the next occurrence name the exact member instead of leaving it to inference.
tests/issue5677-drift-field-diag.test.ts(7 cases: added inner member / changed value / multiple sorted / absent-on-one-leg no-drill / >5 capped / array not drilled / non-object no empty segment). Targeted suite 4/4 pass; adjacent shadow-drift suites (issue5408, issue3919, fold-round2) 11/11 pass. Typecheck clean. arch-docs guard green.Closes #5589