Skip to content

[PR] test: plugin-fork assertions branch by storage mode (runners without sqlite engine are no longer born-red) | test: plugin-fork 断言按存储模式分支(无 sqlite 引擎的 runner 不再 born-red) - #4652

Closed
ranxianglei wants to merge 2 commits into
masterfrom
2026-10-25_plugin-fork-mode-aware-expectation
Closed

ranxianglei wants to merge 2 commits into
masterfrom
2026-10-25_plugin-fork-mode-aware-expectation

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

是什么

tests/plugin-fork.test.ts 的「HTTP fork revision and originals survive a new proxy process」无条件期望冷加载后的 state 带 refLedgerAligned: true(#4316 PR3/3 的一次性 ledger 对齐)。该对齐只在 unified(full)模式冷加载时执行;没有 node:sqlite 引擎的 runner(当前全部 windows-latest)上 store 解析为 legacy-only,restamp 不跑、标志缺失 → 该测试自 #4316 PR3/3 落地起在每个 windows leg born-red(master 52567f1 的 push run 40167778049 中 w22s3/w22s4 两条 leg 可见,diff 恰为 - refLedgerAligned: true)。

修法

期望值改为按 SessionStore.liveStorageStamp(#3135/#3818 的「当前实际持数模式」诚实戳)分支:仅当 full 模式实际持数时才期望该标志。只动测试期望构造,不碰 persist.ts 语义、不碰生产代码。

验证(双向钉住)

  • 默认环境(本机有引擎 → full → 期望标志):单测通过;
  • BILI_STORAGE_UNIFIED=legacy(legacy 戳 → 不期望标志):同一单测通过。
  • unused-exports gate clean,typecheck exit 0。最终证明在 CI windows leg。

行为变更披露

仅测试面:无引擎 runner 上该测试从 born-red 变为通过;full 模式下的断言强度不变(仍要求标志存在)。生产行为零变化。

关联:#4599(CI 总控清单项,常驻 issue 不关闭);#4635 合入后的随车遗留——哨兵车道当时将其列为裁决项 A/B,本 PR 实现的是其中不动生产语义的最小修(测试侧按模式分支);若后续要根治 full 模式下 flushSync 不落 sidecar 的生产缺口,另行立项。

… sentinel follow-up)

The unconditional 'refLedgerAligned = true' expectation assumed a unified-mode
cold load. On runners without the node:sqlite engine the store resolves to
legacy-only (liveStorageStamp), the one-time ledger restamp never runs, and the
flag is absent from the loaded state — born-red on every windows leg since
#4316 PR3/3 landed (master run 40167778049, w22s3/w22s4 legs).

Key the expectation on SessionStore.liveStorageStamp (#3135/#3818 honest
per-instance mode stamp): flag expected only when full mode actually holds the
data. Verified both directions locally: default env (full -> flag expected,
pass) and BILI_STORAGE_UNIFIED=legacy (legacy stamp -> flag not expected,
pass).
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-25_plugin-fork-mode-aware-expectation (2cdcef1)

Latest build — install this exact version

npm install -g billion-context@0.0.9435-pr.4652.bb5bafa

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
2cdcef1 billion-context@0.0.9435-pr.4652.bb5bafa build
6388f08 billion-context@0.0.5696-pr.4652.c6f34db build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title test: plugin-fork 断言按存储模式分支(无 sqlite 引擎的 runner 不再 born-red) [PR] test: plugin-fork assertions branch by storage mode (runners without sqlite engine are no longer born-red) | test: plugin-fork 断言按存储模式分支(无 sqlite 引擎的 runner 不再 born-red) Oct 25, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重: 不重复——本 PR 即 #4635 合入后遗留裁决项 A/B 中「不动生产语义的最小修」的实现,#4599(CI 总控)清单项;未发现同签名在途 issue/PR。

标签: bug / scope/ci / p2(windows CI leg 确定性 born-red,纯测试期望问题,需绕行哨兵车道,无用户影响)

状态核对(分支已拉取、代码已核对、CI 已确认):

  • diff 与描述一致:仅 tests/plugin-fork.test.ts 一个文件,+5/-3,只改冷加载测试的期望构造——persistedState.refLedgerAligned = true 改为 if (h.store.liveStorageStamp === "full") persistedState.refLedgerAligned = true,注释同步更新。未触碰 persist.ts 或任何生产代码。
  • 门禁精确性独立验证过:refLedgerAligned 全库只在 src/persist.ts:1613(maybeRestampToLedger 内)置位,而该函数只在统一存储冷加载路径(loadSync → unified 读取 → afterLoad,src/persist.ts:1594 附近)被调用;readsUnified 是 full-mode-only 谓词(src/persist.ts:768 注释明确),shadow 模式走 legacy 加载、不 restamp。所以「restamp 会跑 ⟺ liveStorageStamp === "full"」成立,测试门禁与生产语义等价,不是近似。
  • 本地定向双向钉住(PR head 6388f08):默认环境(本机有 sqlite 引擎 → full → 期望标志)49/49 通过;BILI_STORAGE_UNIFIED=legacy(不期望标志)49/49 通过。
  • CI:静态门禁 24 pass + 12 skipped、0 fail;11 个 test shard(含全部 windows leg)+ windows static-gates 仍在跑——windows leg 是本 PR 的最终证明,绿了即可合并(合并由你操作)。若 test lane 红,按 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 协调流程先判继承性失败。

结构化八问:

  1. 是什么问题:plugin-fork 的冷重启测试无条件期望 refLedgerAligned: true,但该标志只在 full(unified)模式冷加载时戳上;无 node:sqlite 引擎的 runner(store 降级 legacy-only)上标志缺失,测试自 After model switch / client-side history rewrite, all message identities (content hashes) are replaced: ACP numbers re-m | 切模型/客户端重写历史后,消息身份(内容哈希)全部更换:acp 编号重铸、折叠覆盖大规模重挂、死 ref、churn 区临时膨胀重折 #4316 PR3/3 起在每个 windows leg born-red(master 52567f1 push run 40167778049,w22s3/w22s4,diff 恰为 - refLedgerAligned: true)。
  2. 什么原因导致的:症状层是 windows leg 红;根因层是 After model switch / client-side history rewrite, all message identities (content hashes) are replaced: ACP numbers re-m | 切模型/客户端重写历史后,消息身份(内容哈希)全部更换:acp 编号重铸、折叠覆盖大规模重挂、死 ref、churn 区临时膨胀重折 #4316 PR3/3 写期望时假设了「冷加载必走 ledger 对齐」,而对齐是模式条件行为(仅 unified 读取路径执行),测试断言没有按实际持数模式分支。
  3. 影响范围与严重程度:仅 CI 面——两个 windows leg 永久红,掩盖真实回归,无用户/生产行为影响;p2(有绕行:哨兵车道已知项)。
  4. 怎么修复的:期望值按 SessionStore.liveStorageStamp(Storage Subsystem Wrap-up Checklist (#3130 Review): Dropping the last tick upon self-disable; BILI_PERSIST=0 falsely triggering a "Storage Degraded" banner; storageMode stamp mismatched with the actual enabled mode; and 3 more (6 items total) | 存储子系统收尾清单… #3135/Storage wrap-up: 6 fixes + switch default mode to full (single PR) | 存储收尾六修 + 缺省模式翻 full(一个 PR 统一处理) #3818 诚实戳)分支,仅 full 实际持数时才期望该标志;纯测试侧修法,生产语义零改动。
  5. 是否有回归问题:无。full 模式下断言强度不变(仍要求标志存在);legacy/shadow 分支新期望「无标志」,正是这些模式的实际生产行为。高危模式逐项过:无语义漂移、无 fail-fast→吞错、无阈值/时序/输出格式变化。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:否。full 模式下 flushSync 不落 sidecar 的生产缺口明确不在本 PR 范围,如需根治另行立项。
  8. 是否引入新配置:否。

结论:代码与描述一致、门禁等价性验证通过、本地双向钉住绿;待 CI windows leg 转绿即可合并。

@ranxianglei ranxianglei added bug Something isn't working p2 scope/ci labels Oct 25, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 终局状态:head 6388f08e7 共跑了三轮 CI,最终存活 run 40170348450 全绿——windows 五条 leg、ubuntu 各 leg、e2e 车道、静态门禁、Bugfix Release carve-out 全部通过,此前 born-red 的 windows leg 随本轮转绿。

诚实披露(调度失误):我前面打的三个标签(bug/scope/ci/p2)每次 labeled 事件都触发了一次 pull_request 重跑,并发把前两轮整轮取消——白烧了两轮舰队资源。时间线吻合(标签 06:47:16Z → 重跑 06:47:18Z),照实报告。

第一轮红的解释(run 40169909721,6 个 shard 红,与本 diff 无关):

八问(终版):

  1. 是什么问题:无 sqlite 引擎的 runner(当前全部 windows-latest)store 解析为 legacy-only,一次性 ledger 对齐(After model switch / client-side history rewrite, all message identities (content hashes) are replaced: ACP numbers re-m | 切模型/客户端重写历史后,消息身份(内容哈希)全部更换:acp 编号重铸、折叠覆盖大规模重挂、死 ref、churn 区临时膨胀重折 #4316 PR3/3)不跑、refLedgerAligned 标志缺失 → plugin-fork 冷加载测试自 After model switch / client-side history rewrite, all message identities (content hashes) are replaced: ACP numbers re-m | 切模型/客户端重写历史后,消息身份(内容哈希)全部更换:acp 编号重铸、折叠覆盖大规模重挂、死 ref、churn 区临时膨胀重折 #4316 PR3/3 合入起在每个 windows leg born-red。
  2. 什么原因导致的:测试无条件期望一个只在 full 模式冷加载时才被盖上的标志,未按存储模式分支——测试侧假设超出了生产机制的实际执行条件。
  3. 影响范围与严重程度:仅 CI 面——windows-latest 每条 leg 必红,阻塞所有 PR 的 windows 验证;生产零影响。p2。
  4. 怎么修复的:期望值按 SessionStore.liveStorageStamp(Storage Subsystem Wrap-up Checklist (#3130 Review): Dropping the last tick upon self-disable; BILI_PERSIST=0 falsely triggering a "Storage Degraded" banner; storageMode stamp mismatched with the actual enabled mode; and 3 more (6 items total) | 存储子系统收尾清单… #3135/Storage wrap-up: 6 fixes + switch default mode to full (single PR) | 存储收尾六修 + 缺省模式翻 full(一个 PR 统一处理) #3818「当前实际持数模式」诚实戳)分支——仅当 full 模式实际持数时期望该标志。已审门禁等价性:restamp 只在 unified 冷加载路径执行、readsUnified 为 full 模式专属谓词,「标志存在 ⟺ liveStorageStamp==='full'」严格成立,断言未弱化。
  5. 是否有回归问题:无。full 模式下断言强度不变(仍要求标志存在);legacy/shadow 只是不再期望。生产行为零变化(diff 只动测试文件)。
  6. 是否破坏缓存:不涉及(纯测试面)。
  7. 是否改了设计方向:否。
  8. 是否引入新配置:否。

判定:head 6388f08e7 全绿(含此前 born-red 的 windows leg),代码审查与双向本地验证(full/legacy 各 49/49)已完成,待 owner 合并:#4652

…ork-mode-aware-expectation

# Conflicts:
#	tests/plugin-fork.test.ts
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot]

冲突已解决,但 PR 已被 master 完全取代——建议关闭。

发生了什么:

PR 分支 2026-10-25_plugin-fork-mode-aware-expectation 与 master 冲突(3008 commits behind)。merge master 后,tests/plugin-fork.test.ts 有一处冲突。

冲突分析:

master 还做了其他演进:

  • 测试改为 for (const storageMode of ["legacy", "full"]) 循环,两种模式各跑一次
  • 加了 CI-only race fix(compress fold 异步落盘等待)
  • 加了 h.store.closeQuietly() 防止双写者
  • 加了 child.once("exit"/"error") 错误处理

结论:

merge 后 PR 分支与 master 内容完全一致(git diff origin/master..branch 为空)。PR 的原始修复(按模式分支 refLedgerAligned)已被 #5608-D 的更彻底修复(冷加载不再做 ledger alignment,标志根本不存在)完全取代。

建议: 关闭此 PR(superseded by #5608-D),无需合并——合并是 no-op。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner Author

Closing: the branch is fully in sync with master — the three-dot diff against origin/master is empty; the plugin-fork mode-aware test assertions it carries are already on master.

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

Labels

bug Something isn't working p2 scope/ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant