Repository navigation
修复 master CI 常红:storage-render golden 对元数据字段顺序过敏(#3113) - #3119
Merged
Merged
Conversation
This was referenced Oct 14, 2026
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3546-pr.3119.1ea24b2This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3119.tgz
npm install -g packageInstall instructions are refreshed on each push. |
This was referenced Oct 14, 2026
Merged
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.400-master.68e32ff # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3113
是什么问题
master 上 4 个 storage-render golden 测试(chat/anthropic/responses/google)持续红,把 test lane(ubuntu×2、windows×2)拖红,进而拖红所有从 master 切出的新 PR。
根因(两层)
createSession的 metadata 从{}改成先赋{ biliVersion, storageMode }——持久化 JSON 里biliVersion从「保存时最后追加」变成「第一个键」,字段插入顺序翻转。值没有任何变化:A/B dump 逐字段比对(含嵌套原始串),会话详情面板:运行中的会话一律显示 legacy(仅 JSON)存储、代理版本 —,落盘后才恢复正常(实际存储正常) #3093 前后两棵树加载出的会话对象 parse 后完全相同。stateDigest/sectionDigests对持久化状态对象按插入顺序序列化后取 hash;canonicalize()只规范化值(版本→__VER__、时间戳→__TS__、UUID→__UUID__)不排序键。于是任何一次无害的字段重排都会让四个 golden 整体漂移。会话详情面板:运行中的会话一律显示 legacy(仅 JSON)存储、代理版本 —,落盘后才恢复正常(实际存储正常) #3093 只是踩中了这个潜在陷阱——陷阱在摘要逻辑里,不在 会话详情面板:运行中的会话一律显示 legacy(仅 JSON)存储、代理版本 —,落盘后才恢复正常(实际存储正常) #3093 里。修法(为什么在测试侧)
canonicalize()是运行时共享代码(src/storage/canonical.ts,shadow dry-run reconciler 与 storage-corpus 等其它 golden 集都在用),改它会动运行时行为并牵连其它 golden 集,超范围。因此只在 storage-render 驱动脚本(tests/golden-storage-drive.ts)内加 harness 本地的sortObjectKeys:深排对象键后再进 canonicalize/hash;数组顺序不动(foldAnchorOrder等有序列表本身就是契约)。wire 侧 turn-sha(canonicalBody)完全不碰。行为变更声明(有意,唯一一处)
验证
tests/golden-storage-render.test.ts5/5 ✓(rebase 到最新 master 1fcfe52 后的 head 5278e82);typecheck ✓。范围外
不改
canonicalize()(运行时共享,理由见上);其它 golden 集(storage-corpus 等)若出现同类键序敏感问题另行评估立项。