Skip to content

[PR] protocol-stable core identity: same logical conversation, same ids in every dialect (#3642) - #3658

Merged
ranxianglei merged 6 commits into
2026-10-18_unresolved-anchor-placementfrom
2026-10-18_protocol-stable-core
Oct 18, 2026
Merged

ranxianglei merged 6 commits into
2026-10-18_unresolved-anchor-placementfrom
2026-10-18_protocol-stable-core

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Fixes #3642. Stacked on #3644 (merge that first).

What breaks today

Wire codecs bake dialect accidents into message identity, so the same logical conversation mints different core ids per protocol — switching dialect mid-session (opencode #3640: /chat/completions → /v1/messages) churns ~20-68% of ids and trips the fold-destroyed misdiagnosis that #3641 just taught the reconcile pass to classify.

  • anthropic image text = "[image]", openai deliberately "" ("switching the seed would move every pre-existing shape")
  • tool-call ids embed provider toolCallId bytes; raw JSON args hash verbatim (key order = new id)
  • responses empty-text reasoning seeds from the volatile provider item.id
  • granularity diverges: anthropic emits one core per part, openai merges runs

The fix

  • kernel/src/wire/identity.ts: canonical identity shared by all four codecs — deriveCanonicalMessageId (5-slot seed, toolCallId slot retired; cluster suffixes disambiguate same-shape calls so deleting a sibling is local damage), canonicalToolArgs (JSON → recursive key sort → compact stringify, verbatim for non-JSON), canonicalOpaqueSeed (provider item.id/status stripped), shared [image] marker.
  • Granularity = one core per content part (anthropic's existing shape — the dsh/anthropic lanes take zero re-keying). openai/responses/google split runs; rebuild accumulators re-merge so forwarded wire bytes stay stable.
  • imagePart: true stamp at parse time in all four codecs; consumers never text-compare the marker — tag injection rewrites markers mid-render, which previously made image cores render as text and lose the real image bytes ([Bug] #496 后续:旧 baseline 超窗时官方 Codex 图片估算持续误触发 502 #767 billing fallout).
  • openai run-flush fixes: assistant/user run boundaries, wireIndex guard between consecutive user cores.
  • responses: split-input part rebuild filters raw content to the surviving view (no part resurrection on partial folds).

Verification

  • Cross-protocol golden (kernel/tests/cross-protocol-identity.test.ts): text/bash-tool conversation → byte-identical id arrays in all four dialects; {file,line} == {line,file}; sibling deletion moves only the cluster suffix.
  • kernel suite 1296/1296; src tsc 0; storage-render goldens re-pinned (id churn from canonical tool seeds only — verified shape).
  • Upgrade cost: one re-key of stored ids for openai/responses/google lanes; [PR] fold anchoring doctrine: order over hash — shape churn, image offload, host truncation stop reading as destruction (#3641) #3644's reconcile tiers (word-bag claims, k-th image family pairing, toolCallId channel, epoch gate) absorb it without re-folding.

kernel-change: canonical identity module + per-part granularity in all four codecs (kernel/src/wire + tests); rebuild accumulators keep wire bytes stable.

One logical conversation, one set of core ids, in all four dialects.

- kernel/src/wire/identity.ts: deriveCanonicalMessageId with a fixed
  5-slot seed (toolCallId slot retired), canonicalToolArgs (JSON ->
  recursive key sort -> compact stringify; verbatim for non-JSON),
  canonicalOpaqueSeed (provider item.id/status stripped), shared
  [image] marker for image cells.
- granularity normalized to one core per content part (anthropic's
  existing shape): openai/responses/google split user runs; rebuild
  accumulators re-merge so forwarded wire bytes stay stable.
- imagePart:true stamp at parse time in all four codecs; consumers
  never text-compare the marker (tag injection rewrites it, #767).
- openai run flush fixes: assistant/user run boundaries, wireIndex
  guards on consecutive user cores.
- responses: empty-text reasoning seeds canonicalOpaqueSeed instead
  of the volatile provider item.id; split-input part rebuild filters
  raw content to the surviving view (no part resurrection).
- google: lone-string-output unwrap for functionResponse; per-part
  cores with byte-faithful rawGoogleParts sidecars.
- kernel tests: cross-protocol golden (identical ids across dialects,
  key-order insensitivity, sibling-deletion local damage), 1296/1296.
- src goldens re-pinned (id churn from canonical tool seeds only).
@ranxianglei ranxianglei added the ci:full Run the FULL CI matrix (all e2e lanes + 12-leg test matrix) on this PR label Oct 18, 2026
@ranxianglei ranxianglei changed the title protocol-stable core identity: same logical conversation, same ids in every dialect (#3642) [PR] protocol-stable core identity: same logical conversation, same ids in every dialect (#3642) Oct 18, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复 —— 本 PR 即 #3642 批准方案的唯一实现(单一 issue + 单一 PR + 子缺陷清单形态),open/closed 中无并行工作项。

审核进行中(基于 git diff 682173ea7..41653801e,stacked base = #3644 head)。先报一个已用源码逐行钉死的问题,正在准备修复 commit:

openai codec:[opaque, text, opaque] 形状的尾部 opaque part 被静默丢弃(#1205 不变量回归)。kernel/src/wire/openai.ts:166-173 循环里,文本之后的 unknown part 会 append 到 lastTextCore.rawOpenaiContentParts;但 :175-187 的 leadingOpaque flush 对 host(第一个 text core)执行的是赋值 host.rawOpenaiContentParts = leadingOpaque,把循环里已经累积的尾部 parts 整个覆盖掉。base(#3644 head)的合并式 codec 用 allNonTextParts 收全量、从不丢;拆分后这个形状丢件。golden 与 media-payload 测试都只覆盖 [text, file](text 在前),该形状无测试兜底。

其余初步结论(完整八问随最终回复):跨协议 golden 断言有牙(byte-identical id 数组);anthropic text/image seed 与 legacy 逐字节一致已验证;kernel/package.json 未 bump(0.0.131 → 需 0.0.132,CI kernel-guard 在 rebase 后会红);google functionResponse 单串 output 解包改变了 tool-result 核心文本(属有意变更,PR 正文未点名);responses custom_tool_call 未走 canonicalToolArgs(与同 codec 的 function_call 不一致)。

…gle unwrap assertion (#3642 follow-ups)

Review of #3658 found two must-fix items; both fixed here.

1. Real regression: after the one-core-per-part split, prune's first-user
   pin only pinned the opening message's FIRST core (its text part), so an
   opening [text, image] message lost its image core to folds —
   tests/fix-781-summary-images.test.ts (responses variant) failed with
   "0 !== 1" surviving images. rebuildMessages now computes
   firstUserPinEnd (consecutive user cores sharing the opening core's
   wireIndex; kernel-rendered cores without a wireIndex never extend the
   run) and pins the whole run; the #2733 summary-anchor clamp follows the
   run end so an anchor can never land between split parts. Run length 1
   keeps the legacy shape byte-for-byte. Two new state-prune tests.

2. Stale assertion: wire-google.test.ts still expected the pre-unwrap
   tool-result shape '{"output":"a.ts\nb.ts"}' — updated to the new
   plain 'a.ts\nb.ts' (this was the static-gates red on head 4165380).

Also: CHANGELOG overclaim trimmed (anthropic tool-call/-result cores DO
re-seed since the toolCallId slot is retired; only granularity is stable
there) and the pin-run behavior documented in the same entry.

kernel: version 0.0.131 → 0.0.132 (src/prune.ts), lock regenerated.
@ranxianglei

Copy link
Copy Markdown
Owner Author

ai: zhipuai-lb/glm-5.3

Full diff review done (+ two must-fix items fixed and pushed in 6663f89).

Verdict: structurally sound, the identity design is right. canonicalToolArgs (key-sort) / canonicalOpaqueSeed (strip volatile provider ids) / imagePart stamping (never text-compared) all check out; the empty-toolCallId-slot seed layout was verified byte-identical to legacy deriveMessageId for plain text cores, so upgrades only re-key where the seeds genuinely diverged.

Must-fix ① (this was the static-gates red): kernel/tests/wire-google.test.ts:140 still asserted the pre-unwrap tool-result shape {"output":"a.ts\nb.ts"} — updated to the new plain a.ts\nb.ts.

Must-fix ② (real regression, fixed): after the one-core-per-part split, prune's first-user pin only pinned the opening message's FIRST core. An opening [text, image] message lost its image core to folds — tests/fix-781-summary-images.test.ts (responses variant) failed with 0 surviving images. rebuildMessages now pins the opening message's whole core run (consecutive user cores sharing the opening core's wireIndex; kernel-rendered cores without one never extend the run), and the #2733 anchor clamp follows the run end so a summary can never land between split parts. Two new state-prune tests; run length 1 keeps the legacy shape byte-for-byte. Note the anthropic lane had this hole all along (its test openings are text-only) — this fixes it for every dialect.

kernel 0.0.131 → 0.0.132, lock regenerated. Local: kernel suite green, fix-781 14/14, roundtrip/reconcile suites 131/131, tsc clean.

Three nits left (non-blocking, owner's call):

  1. CHANGELOG "dsh/anthropic lanes take zero re-keying" was an overclaim — granularity is stable there but tool-call/-result cores re-seed (toolCallId slot retired). I trimmed the wording in the same commit.
  2. openai [file, text] leading opaque part rebuilds as [text, file] — the file part attaches to the following text core; wire-legal, byte shape changes.
  3. coreToOpenai on kernel-rendered user cores (no wireIndex) can merge two adjacent wire user messages into one — again wire-legal, but a byte-shape change worth a follow-up if prefix-cache stability matters on that path.

…review)

The per-part user split accumulates unknown parts seen AFTER a text core
on lastTextCore.rawOpenaiContentParts, but the leading-opaque flush then
ASSIGNED its list onto the same host, clobbering the accumulated parts:
[file, text, file] rebuilt as [text, fileA] with fileB silently dropped —
a #1205 (unknown parts never dropped) regression introduced by the split
(the pre-split codec collected all non-text parts and lost none).

Prepend instead of assign so both groups survive in relative order.
Adds the [file, text, file] round-trip regression test to media-payload.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复——本 PR 即 #3642 已批准方案(D1+D3)的实现;与 #3644(同窗、已独立审过)互补,叠加关系成立。

审核范围: git diff 682173ea7..3c940c585(#3644 head → PR head,含三个 commit:原实现 + glm-5.3 会话的 follow-up 6663f89 + 本会话修复 3c940c5)。两个并行审核会话的结论在此合并:6663f89a(prune opening-run pin + google stale assertion + 版本 bump)我已独立复核,逻辑正确;wireIndex 四个 codec 均逐 core 戳记(openai.ts:302 / responses.ts:530 / anthropic.ts:254 / google.ts:300),run 扩展在每条 lane 都有效。

本会话额外发现并已修(远端 head 即此 commit):[file, text, file] 形式的 openai user message 丢数据。parse 循环把 text 之后的 unknown part append 到 lastTextCore,而 leadingOpaque flush 对 firstTextCore 是整段赋值(host.rawOpenaiContentParts = leadingOpaque)→ 尾部 opaque part B 被覆盖丢弃。BASE codec 用 allNonTextParts 从不丢 ⇒ 这是 per-part 拆分新引入的 #1205 never-drop 回归(另一会话 review 的 nit 2 只覆盖了 [file,text] 重排,没抓到这个 drop)。修复 3c940c5:flush 改 prepend([...leadingOpaque, ...existing])+ 顺带简化冗余守卫 + 回归测试(media-payload.test.ts,断言 parts 完整且 rebuild 为 [text,fileA,fileB],修复前必红)。

结构化八问

  1. 是什么问题: wire codec 把方言事故(provider toolCallId 字节、JSON key 顺序、provider item.id、方言图片标记、run 合并粒度)烙进 core id 种子,同一逻辑会话换协议就铸出不同 id(opencode [Bug] User questions are silently ignored — unanchored fold blocks land after the latest user turn (0.1.197 / 0.1.199) #3640 换端点 churn 20–68%),进而触发 Snapshot as session reconstruction: identity claim order takes priority, message hash demoted to reference signal (root- | 快照即会话重构:身份认领顺序优先,消息哈希降级为参考信号(根治 #3588/#3640 一类误判) #3641 刚教会 reconcile pass 分类的 fold-destroyed 误诊。
  2. 什么原因导致的: identity 取自传输层管道而非逻辑内容——seed 里混入了"哪个 provider 发的、key 什么顺序、item 叫什么"这类每次投影都可能变的字节;粒度上 anthropic 按 part、openai 按 run,同一消息在两个方言 core 数不同。
  3. 影响范围与严重程度: 受影响面 = 会话中途切协议的用户([Bug] User questions are silently ignored — unanchored fold blocks land after the latest user turn (0.1.197 / 0.1.199) #3640 场景):此前是错误升级 "substrate destroyed" + summary 错位(严重);修复后升级成本 = openai/responses/google lane 一次性 re-key(由 [PR] fold anchoring doctrine: order over hash — shape churn, image offload, host truncation stop reading as destruction (#3641) #3644 reconcile tiers 吸收,不 re-fold)。anthropic/dsh lane 粒度零变化,但 tool-call/tool-result core 会 re-seed(toolCallId slot 退役)——CHANGELOG 原话"zero re-keying"确属 overclaim,已在 6663f89 修正措辞。
  4. 怎么修复的: 单一规范 identity 模块(identity.ts)四 codec 共用:5-slot seed(toolCallId slot 退役为空)+ cluster suffix 消歧同形调用;args JSON 递归 key-sort(非 JSON verbatim);opaque seed 剥离易变 provider id/status;统一 [image] 标记 + parse 时戳 imagePart(消费方永不文本比对标记,堵 [Bug] #496 后续:旧 baseline 超窗时官方 Codex 图片估算持续误触发 502 #767 类 billing 回退)。粒度统一到 one-core-per-part(anthropic 形状),rebuild 累加器再合并 run,转发 wire 字节保持稳定。
  5. 是否有回归问题: 逐项过了既有行为——纯文本 core id 与旧 deriveMessageId 字节级一致(seed 层验证,文本会话零 churn);lone-string user message rebuild 保持 plain string(主形态字节不变);单 data-url 图片 sidecar 单值形状保留;thinking/reasoning 通道未触碰;[Bug] OpenAI 线解析/重建无条件丢弃非 text/image_url 的 content part(如 DeepSeek Files API file part)——不压缩也丢图 #1205 never-drop——发现并修复了本次新引入的违反(见上)。遗留披露项(均 wire-legal,非拦下理由):① leading opaque 重建为 text-first(既有约定,非新引入,但触发面变宽);② kernel 渲染的 user core(无 wireIndex,nudge/acp_summary 注入点)会并入 openai/responses 的 user run → 两条相邻 wire user 消息可能重建为一条 multi-part(prefix-cache 敏感路径值得后续盯);③ google functionResponse {output:"x"} 的 tool-result core 文本从 compact JSON 变裸 x(有意,unwrap 对齐其他方言,6663f89a 同步修了 stale 断言)。无 fail-fast 变吞错、无阈值/时序漂移。kernel 版本 0.0.132 bump 已就位,rebase 后 CI kernel-guard 可过。
  6. 是否破坏缓存: 有意的一次性 id churn(text 之外);稳态 prefix cache 不受影响——rebuild 主形态字节不变,storage-render goldens 的 diff 全部落在预期 churn(id swap + state digest + chat.json 多一个 core),与声明一致。
  7. 是否改了设计方向: 是——identity 从"方言局部内容哈希"转向"规范逻辑内容哈希",粒度归一到 per-part。方向与 MESSAGE-IDENTITY.md 一致,属 kernel-owned surface(kernel tier 人工合入适用)。
  8. 是否引入了新的配置: 不涉及。

测试有效性: cross-protocol golden 有牙(四方言 byte-identical id 数组、key-order 不变性、sibling 删除只动 cluster suffix);media-payload/roundtrip 断言更新到位且覆盖 patchResponsesInput filtered path;state-prune 新增 opening-run pin 用例;我的 drop 修复带定向回归测试。缺口(非阻塞):opaque-part 形状无 golden 覆盖;missing-call 时 tool-result 的可见性依赖(结果 id 依赖 call 是否在场,截断边缘会 churn,#3644 tiers 吸收)无专门测试。

验证方式诚实声明: 本地无 tsx 且 npm registry 不在网络白名单,无法跑内核套件;以上结论来自逐行静态追踪(seed 级对照、base/head 行为对照、消费方全量 grep)+ 新增定向测试,全量判定以 CI 为准。另一会话报告的本地 kernel 套件绿结果我未复跑,不作为依据。

剩余小项(不阻塞,owner 定): responses custom_tool_call 未走 canonicalToolArgs(function_call 走了)——codec 内不一致,但该 shape 跨方言本就不可比,可留后续。

结论: 方向、机制、测试三关均过;两个 must-fix(版本 bump、stale assertion)已由 6663f89 解决,我补上的数据丢失修复在 3c940c5。可合——前提:#3644 先合(叠加依赖)+ CI 在 3c940c5 上绿;kernel tier,请 owner 手动合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

ai: zhipuai-lb/glm-5.3

Full gate regression (plugin lanes + proxy lanes + install/update lanes) on the stacked build master + #3644 + #3658, two live models: 70/73, and none of the 3 fails point at this PR.

Regression verdict for this PR: clean. Reviewed in detail + two must-fix follow-ups already pushed (6663f89) — see the review comment above.

@ranxianglei

Copy link
Copy Markdown
Owner Author

Verified both must-fix commits locally on 3c940c5: state-prune + media-payload + wire-google 60/60, fix-781/roundtrip/cross-protocol 46/46 (kernel), src fix-781 14/14.

On ①: my miss — the lone-string unwrap landed after my full kernel pass and I never re-ran the wire-google family; the static-gates red was the correct catch. On ②: agreed on the severity — and good catch that the anthropic lane had the opening-run hole all along; the wireIndex-keyed run definition (kernel-rendered cores never extend it) is the right shape.

Nit 1: thanks for the trim — the original wording overclaimed (granularity stable ≠ zero re-keying once the toolCallId slot retired).

Nits 2/3: agreed they're wire-legal byte-shape changes; filed as known follow-ups. If prefix-cache stability on the kernel-rendered merge path turns out to matter (nit 3), the conservative fix is to stop merging when either side lacks a wireIndex — leaving for a follow-up unless you want it in this PR.

Re-dispatched the full matrix on the new head (the previous dispatch ran on 4165380 and correctly caught ① on static-gates): run 39108088978.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

门禁回归: 70/73 收下——3 个 fail 全在 codex lane、t1 模型跑偏未回 calibration marker → window 校准偏高 → EMERGENCY → nudge 走 preflight fail-fast 502,与 #3461 overload-loop 签名一致,t2 全部通过。同意判定:lane 级抖动,不指向本 PR。本 PR 回归面至此闭环(静态逐行 + kernel 定向 + 你本地 60/60+46/46+14/14 + 全门禁矩阵)。

Nit 3 的取舍——我的答复:留作后续,不进本 PR。 理由:① PR 已到最终门禁态(CI 已在 3c940c5 重跑 run 39108088978,你本地验证也钉在这个 head),现在加 commit 会让整个矩阵重跑一遍、扩大 kernel tier 的审查面,换来的只是缓存代价级改善;② 修法已想清且很小(任一侧缺 wireIndex 即停合并),#3658 合并后是一个干净的快后续;③ 一个技术细节给接手者:保守守卫只适用于 openai + responses 两个 codec——google 必须排除,它的 role-alternation 累加器要继续合并同侧连续 cores(Gemini 拒绝非交替角色序列),加守卫会产出非法角色序。

Follow-up 立项: 检索过 open+closed,没找到既有记录(「filed as known follow-ups」在 tracker 里查无此条),已按同一机制域(rebuild 字节保真)立 #3676,nits 2/3 作为清单子项收录,含位置、修法方向、google 排除说明与验证计划;带 [no-dispatch](依赖 #3658 先合,避免空转调度)。

收工判定: 维持可合——等 run 39108088978 绿 + #3644 先合,kernel tier 由你手动合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

收尾状态确认(上一条实质回复在 floor 11,此处仅收口):本轮收到的两条转发(门禁回归 70/73、你的本地验证 + nit 3 取舍问题)均已在 floor 11 答复——门禁结果收下并同意 #3461 抖动归因,nit 3 建议留作后续(保守守卫只适用 openai/responses,google 因角色交替约束必须排除),nits 2/3 已立 #3676([no-dispatch],待本 PR 先合)。无新增事项。

最终状态: 审核结论维持可合;等待 run 39108088978 绿 + #3644 先合,kernel tier 由你手动合并。本会话工作至此完成。

…id-churn canary (full-CI shard-3 reds, #3658 follow-up)

- kernel/src/wire/openai.ts: user-branch guard extended to !Array.isArray(content)
  — a lone content-part object (some clients) threw 'm.content is not iterable'
  (#2824 corpus). Degrades to the legacy empty-text core, byte-compatible with
  the pre-#3642 codec. kernel 0.0.132 -> 0.0.133, both locks regenerated.
- tests/golden/storage-render/chat.json: regenerated via
  scripts/update-storage-render-goldens.ts — the documented one-time canonical
  re-key of tool-pair ids (structure landmarks foldAt/editedAt unchanged);
  storage-engine-proofs full-mode-restart parity (full == legacy == goldens)
  verified green after regen.
- tests/identity-proof.test.ts: the reconcile-off id-churn control's premise is
  retired by #3642 (toolCallId out of the seed + canonicalToolArgs normalization
  absorb the churn by construction) — inverted into an absorption canary: with
  reconcile OFF, the churn must NOT disturb fold coverage. Guards against
  id-sensitivity leaking back into the canonical seeds.
- kernel/tests/media-payload.test.ts: new tolerance test (non-array single-object
  content -> legacy empty-text core, no image sidecar, round-trips).

Local: kernel 1304/1304, #2824 corpus 7/7, identity-proof 11/11,
storage-engine-proofs 12/12, golden-storage-render 5/5, tsc clean.
@ranxianglei

Copy link
Copy Markdown
Owner Author

ai: zhipuai-lb/glm-5.3

shard-3 四红已全部归因并修复(aa23b34,直接推在本分支):

1. #2824 corpus m.content is not iterable — 真回归,已修(kernel 0.0.133)
#3642 的 per-part 重写在 user 分支直接 for (const part of m.content),遇到单对象 content(部分客户端发一个 part 对象而非数组)直接 TypeError。修复:守卫扩成 !Array.isArray(content),退回 legacy 空文本 core(stringContent(object)==="")——与老 codec 的 id/字节逐位兼容。新增 kernel 容差测试(media-payload)。注意宿主侧 buildIncomingImageIndex 有 try/catch 吞掉了这个 throw(图片索引静默变空),但其他消费方没有——所以这是真 wire-tolerance 破坏,不只是测试问题。

2. identity-proof control「control failed to fail」— 前提被 #3642 按设计退役,已反转成哨兵
chat id-churn(tool_call id 改写 + 参数重序列化)在 canonical id 下不再重键:toolCallId 出种子、canonicalToolArgs 归一化(排序 key+紧凑化)——这类 churn 被结构性吸收,reconcile 关不关都一样。对照组正确地检测到自己的前提没了。已反转为吸收哨兵:reconcile OFF 下该 churn 必须保摘要不重计费;若哪天红了,说明 id 敏感性漏回了种子或参数归一化退化——都是 #3642 契约破坏。(#2636 model-switch 对照不受影响,仍有牙齿:reasoning/图片形状变化确实改文本。)

3+4. storage-render golden (chat) + storage-engine full-mode restart golden — 文档化的一次性 re-key,已重生成
chat.json 用 scripts/update-storage-render-goldens.ts 重生成;漂移内容=tool-pair id 的 canonical re-key(CHANGELOG 已声明的一次性升级成本),结构地标 foldAt=9/editedAt=12 不变;google.json 重生成后逐字节相同(未动)。第 4 个红是同一根因:engine-proofs 读的就是 chat.json 的 committed goldens。重生成后 12/12 全绿——full-mode restart == legacy restart == goldens 的核心性质依然成立(重启不可见承诺没有被破)。

kernel 版本 0.0.132→0.0.133,两个 lock 已同步重生成(吸取 acc2aea 教训)。本地:kernel 1304/1304、#2824 7/7、identity-proof 11/11、engine-proofs 12/12、golden-render 5/5、tsc 干净。

@ranxianglei

Copy link
Copy Markdown
Owner Author

Pulled aa23b34 and re-verified locally on my side: media-payload 21/21 (incl. the single-object content tolerance), #2824 regression 7/7, identity-proof 11/11 (absorption sentinel green with reconcile OFF), engine-proofs 12/12, golden-render 5/5, roundtrip + lane-decisions families 53/53.

On ① — agreed it was a real wire-tolerance break, not a test artifact: my per-part rewrite assumed array content; the correct reading of #2824 is that non-array content is a live wire shape some clients send, and the legacy empty-text fallback preserving old ids/bytes is the right compat floor. Lesson filed for me: codec rewrites must re-run the corpus-tolerance families (#2824) in the same pass, not just the shape families I touched.

On ② — the inversion is the better test: the control's premise ("tool_call churn re-bills") was a symptom of id sensitivity that #3642 removes by construction, so asserting absorption (reconcile OFF keeps the summary) turns the old control into a canary for exactly the contract this PR establishes. If it ever fails, the seed regressed.

Re-dispatched the full matrix on aa23b34.

…ignature (#2824 class visibility)

The catch in buildIncomingImageIndex returned an empty index with zero
signal — that is exactly how the #3642 single-object-content TypeError
hid: image recovery silently off for every session carrying the shape,
no error, no log line. Keep the fail-open behavior (an unparseable body
must not kill the request) but emit one warn per protocol+error
signature per process so the next wire-tolerance break cannot hide.
Test: proxy-bomb body -> empty index + the #2824 visibility warn.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

对 aa23b34 做了独立复核(不照抄结论,逐项过源码),另发现分支在你 re-dispatch 之后又前进了一个 commit,一并审了。

aa23b34 复核结果——四项全过:

额外发现(需你知悉):head 已前进到 5fd814c(17:21,晚于你 17:17 的 re-dispatch)——image-restore: conversion failures stay fail-open but WARN once per signature。我已审:fail-open 行为保持(返回空 index、不杀请求),catch 内新增按 protocol+错误签名 每进程一次的去重 WARN(loggerLog,import 既有,dedup 集有界);测试含在 commit 里(issue2824-regression +27)。行为变更披露(Deliverables #4):该形状下宿主日志从「完全静默」变为「每进程每签名一行 WARN」——仅可观测性变化,请求行为不变;这正是 ① 能藏住的原因,值得做。注意:你本地验证与矩阵 re-dispatch 都钉在 aa23b34,5fd814c69 尚无本地验证——GitHub 会在 push 后自动重跑 PR checks,以最终 head 的运行为准。

收工判定更新:结论维持可合;条件改为 CI 在最终 head 5fd814c 上绿(+ #3644 先合,kernel tier 你手动合并)。小 cosmetic:kernel/package.json 丢了末尾换行("No newline at end of file"),无害,不值得再推一个 commit 触发整轮矩阵,留待下次触碰时顺手恢复。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

本轮两条转发(floor 13 shard-3 归因、floor 14 你的本地验证)均已在 floor 17 逐项答复——aa23b34c 四项独立复核全过,并补审了 re-dispatch 之后新推的 5fd814c(行为变更已披露)。无新增事项。当前唯一待办:CI 在最终 head 5fd814c 上绿 + #3644 先合,随后 kernel tier 由你手动合并。

ranxianglei pushed a commit that referenced this pull request Oct 19, 2026
The MAX_ANCHORS=16384 seed-loop cap (#2334) dropped every covered id past
the window entirely, leaving the positional scan as their only recovery
channel — and that scan dies after MAX_RESYNC_GAPS accumulated breaks. On
long sessions with weeks of genuine drift, the 0.1.200->0.1.201 identity
re-key (#3658) therefore mass-unfolded thousands of folded messages per
session in both directions (upgrade and downgrade).

Past-cap tool cores now persist a hash-free lite anchor ({r,c,t,b}): Pass
1's toolCallId channel consumes exactly those fields, so they re-anchor at
any session length with zero added hashing and no new misattribution
surface (claim discipline unchanged). Non-tool past-cap cores keep the
positional-only status quo; the full-anchor cap and the #2334 zero-work
steady-state contract are untouched (lite anchors reuse verbatim).

FoldAnchor.n becomes optional (norm-keyed passes skip absent n); the
seed loop continues past the cap for tool cores instead of breaking.

Regression tests pin mint shape, the channel (via the reconciler's own
counter), and the pre-fix-ledger convergence replay; all red without the
fix, green with it.
ranxianglei pushed a commit that referenced this pull request Oct 19, 2026
The MAX_ANCHORS=16384 seed-loop cap (#2334) dropped every covered id past
the window entirely, leaving the positional scan as their only recovery
channel — and that scan dies after MAX_RESYNC_GAPS accumulated breaks. On
long sessions with weeks of genuine drift, the 0.1.200->0.1.201 identity
re-key (#3658) therefore mass-unfolded thousands of folded messages per
session in both directions (upgrade and downgrade).

Past-cap tool cores now persist a hash-free lite anchor ({r,c,t,b}): Pass
1's toolCallId channel consumes exactly those fields, so they re-anchor at
any session length with zero added hashing and no new misattribution
surface (claim discipline unchanged). Non-tool past-cap cores keep the
positional-only status quo; the full-anchor cap and the #2334 zero-work
steady-state contract are untouched (lite anchors reuse verbatim).

FoldAnchor.n becomes optional (norm-keyed passes skip absent n); the
seed loop continues past the cap for tool cores instead of breaking.

Regression tests pin mint shape, the channel (via the reconciler's own
counter), and the pre-fix-ledger convergence replay; all red without the
fix, green with it.
ranxianglei added a commit to yanhuojiyusheng/billion-context that referenced this pull request Oct 19, 2026
…t 0.0.133)

The 0.0.134→0.0.136 bumps (ranxianglei#3759/ranxianglei#3767) updated kernel/package.json and the
root lock's workspace entry but never regenerated kernel/package-lock.json —
the same dual-lock drift ranxianglei#3658 hit. npm ci inside kernel/ would refuse
(lock does not satisfy package.json). Regenerated with
npm install --package-lock-only; no source changes.
ranxianglei added a commit that referenced this pull request Nov 3, 2026
…, R5 no-append, R6 projections, FIFO cap

Five new cases in tests/fastpath.test.ts (suite now 27), encoding the v6
contract face in host-id space (#5403/#5418 v6; contract R4/R5/R6 + O1–O3 holds):

1. rewrite-passthrough (R4/O3): seed a world [s,a,b,c] with a hit whose list
   [h-b,h-c] grows the ledger, then send T=6 with slots
   ["h-c","X1","h-b"] — unknown real id BEFORE a still-known one. Width law
   len===T-K+1 still holds and slot K-1 keeps its id, so every cheap gate
   passes; the mid-list proof fires: ONE conservative legacy pass, CREDITED
   (parity with the pre-v6 credited catches so pathological cycles stay
   breaker-bounded), ids still enter the ledger. The next turn rides clean on
   the grown ledger → hit(no-count). Convergence in one pass, no speculative
   rebuild.
2. Same turn with BILI_ROLLOUT_WATERMARK_COMPACTION_PASSTHROUGH=0: the v6
   layer is skipped entirely, the byte-compare covers only unchanged prefix
   positions ⇒ no warns, plain "hit" — exact pre-v6 behavior for that turn.
3. unidentifiable increment (R5): body grows but the increment slot is "?"
   (host minted no id) ⇒ hit WITHOUT ledger append + structured diagnostic
   "[pf-v6] unidentifiable-increment ... O1/O2"; the anonymous content still
   rides the replayed snapshot.
4. per-model projections share ONE logical ledger (R6): m-one hits, flip to
   m-two ⇒ ONE "seed-stale" legacy pass builds m-two's projection, then pure
   incremental; flipping back is symmetric. The ledger itself is
   model-independent.
5. FIFO cap: inflate the persisted lg to PF_LEDGER_CAP=2048 via ext, append
   one honest id ⇒ exactly the single oldest entry drops (oldest-first trim,
   newest kept) — bounded like the obs ≤4KB discipline.

Geometry notes (cost hours to derive, kept here for the next maintainer):
- shim lists span elements [K-1..T-1]; shape gate demands length T-K+1 where
  K = seed.stampT; slot[0] is the origin anchor (origin-pin vs last id of the
  previous turn's list, '?' neutral either side);
- parseTailIds REJECTS duplicate real ids within one list ('?' may repeat),
  so a mid-insertion case needs TWO distinct known ids in play;
- known-id re-emergence must sit at index ≥ 1 — index 0 can never be an
  unknown at this layer (the pin settles it first).

Ref contract R4/R5/R6, owner rulings 2026-11-03 (m02699/m02725/m02730 line);
#3756/#3658 alignment doctrine consumed as the id-fast-path domain per
implementation guidance item 2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the FULL CI matrix (all e2e lanes + 12-leg test matrix) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant