Skip to content

[PR] fix(e2e): pin dual-write storage in the native-pi sandbox (#6480 follow-up) - #6567

Open
ranxianglei wants to merge 5 commits into
masterfrom
2026-11-14_e2e-native-dual-write-pin
Open

ranxianglei wants to merge 5 commits into
masterfrom
2026-11-14_e2e-native-dual-write-pin

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

#6480 (pure-SQLite default, 2026-11-13) turned the JSON writer off by default. Four e2e lanes plus one unit suite assert on persisted JSON envelopes via plain filesystem walks (sessionFiles()/persistedSessions()) and went red deterministically on master; this test-only PR pins the sandbox configs back to dual-write (storage:{unified:"full",jsonWriter:"on"}) so those assertions keep testing what they were written to test.

What turns green on master (cron FULL matrix)

Lane / suite Master failure After this PR
real pi package-native (tests/e2e/e2e-native-pi.test.ts) 6 subtests "proxy must persist the session … got 0" 7/8 local (the 8th, /acp delegate, is a local-host ~/.pi/acp.json leak artifact, not present on CI runners)
real dsh headless profile (e2e-native-dsh + persona) "proxy must persist the session within 20000ms" + 2 persona persisted-session asserts 2/2 + 2/2 local
real opencode native "proxy must persist the session" + "no persisted session carried compressed blocks (got 0)" (2 of 4) 4/4 local (pi 0.83.6, 169s)
real pi codex-responses WebSocket "session persisted" (1 of 6) 6/6 local
tests/notice-registry.test.ts (unit, red in every test shard leg containing it) 2 subtests: the storage-sqlite-default notice is hidden because the suite-wide baseline pins BILI_STORAGE_UNIFIED=legacy 5/5 under the full CI preload chain

Method

  • Each lane rig pre-seeds its sandbox config before the child process starts (ensureConfigTemplate() only seeds absent files, never overwrites — same pattern as the existing BILI_PI_INLINE=0 pin).
  • notice-registry: the suite asserts the FRESH-INSTALL default posture (the exact [PR] storage: pure-SQLite default — JSON envelopes stop being written unless dual-write is requested (#6479) #6480 flip the notice advertises), so it drops the inherited BILI_STORAGE_UNIFIED pin per the preload contract ("suites whose assertions depend on a specific storage mode MUST pin BILI_STORAGE_UNIFIED themselves").
  • e2e lanes verified with CI-pinned pi-stable 0.83.6; red→green discriminated by stashing the pin and re-running.

Scope

Test-only (+18 +21 +26 +6 lines across 6 test files). No src/ changes. Cherry-picked as e891908 into PR #6546 and #6551 so their shard legs containing the notice-registry file go green on the next run.

#6480 flipped the storage default to pure-SQLite (JSON envelope writer off
unless dual-write is explicitly requested). This suite's persistence
assertions all walk the sandbox's session JSON files (sessionFiles()), so
the pure-sqlite default left them structurally failing on master — the
'real pi package-native lane' CI leg has been red since the flip.

Pin dual-write in the sandbox config, the same pattern the suite already
uses for BILI_PI_INLINE=0: the assertions verify what they have always
verified (envelope presence, folded blocks, pluginAgent binding); the
pure-sqlite default is covered by the storage-json-writer-off* unit
suites. ensureConfigTemplate() never overwrites an existing file, so the
pre-seed survives plugin bootstrap.
@ranxianglei ranxianglei changed the title fix(e2e): pin dual-write storage in the native-pi sandbox (#6480 follow-up) [PR] fix(e2e): pin dual-write storage in the native-pi sandbox (#6480 follow-up) Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-14_e2e-native-dual-write-pin (425edec)

Latest build — install this exact version

npm install -g billion-context@0.0.10141-pr.6567.145073d

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
425edec billion-context@0.0.10141-pr.6567.145073d build
6539141 billion-context@0.0.9643-pr.6567.2a34ee3 build
f9e10ec billion-context@0.0.9625-pr.6567.597ce94 build
d5556ba billion-context@0.0.9609-pr.6567.679f2fd build

Download artifact

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

Install instructions are refreshed on each push.

The real-dsh headless profile lane went red on master the same way the
pi package-native lane did: #6480 made pure-SQLite the default
(jsonWriter off), so the JSON session envelopes this lane's
waitForPersistedSession()/persistedSessions() traversal asserts on are
no longer written. The lane's own rigs pre-write their sandbox
billion-context.json without a storage key, so they silently inherited
the new default.

Same test-only pin as the pi lane (e2e-native-pi): an explicit
storage.{unified: full, jsonWriter: on} for a lane whose assertions
deliberately read the JSON envelope layout. Verified locally with the
real dsh 0.2.0-rc.2: both files 2/2 after the pin, red before.
…e default (#6480)

The suite-wide baseline (tests/preload-storage-baseline.mjs) pins
BILI_STORAGE_UNIFIED ??= "legacy" for the legacy-written corpus, but this
suite asserts the fresh-install default posture — the exact #6480 pure-sqlite
flip the storage-sqlite-default notice advertises. Under the CI preload chain
the pin hid the notice and two subtests failed deterministically (red in
every shard leg containing the file). Drop the inherited pin so the
production default applies, per the preload's own pin-yourself contract.
…igs too (#6480)

Same regression as the native-pi/dsh lanes: #6480's pure-sqlite default made
the jsonWriter off by default, so the lanes' persisted-session file walks
(sessionFiles()/persistedSessions()) saw zero JSON envelopes and their
persistence assertions failed. Pre-seed the sandbox config with
storage:{unified:"full",jsonWriter:"on"} like the other lanes.

Verified locally (pi 0.83.6): without the pin the opencode lane fails 2 of 4
and the codex-ws lane fails 1 of 6; with it, both are fully green.
# Conflicts:
#	tests/notice-registry.test.ts
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Merge-conflict resolved — PR is now mergeable (no conflicts)

Merged origin/master into the PR branch 2026-11-14_e2e-native-dual-write-pin, resolved the single conflict, and pushed. Head is now 425edecdb1. A direct GET confirms mergeable: True (the mergeable_state: blocked is branch-protection pending review, not a conflict).

The one conflict — tests/notice-registry.test.ts: both the PR and master independently added storage-env unpinning for the #6480 pure-sqlite default flip, to the same lines. Master's version is a strict superset (it unpins both BILI_STORAGE_UNIFIED and BILI_STORAGE_JSON_WRITER; the PR only unpinned BILI_STORAGE_UNIFIED, with a thinner comment). Resolved by taking master's version verbatim — nothing from the PR side is lost, and the more complete knob-unpinning is preserved. The 5 e2e files auto-merged cleanly and retain exactly the PR's dual-write pinning (verified by diffing the merged tree against master).

Verification honesty: the mirror check-cache was stale this run (still reporting the pre-push sha 65391418e3, fetched_at 2026-11-13), so I could not read CI check states from it — I verified merge state via a single direct GET instead. I could not run the suite locally (no node_modules in this workdir); the full CI suite runs on the pushed head.


结构化八问

  1. 是什么问题:PR [PR] fix(e2e): pin dual-write storage in the native-pi sandbox (#6480 follow-up) #6567(给 native-pi/dsh/opencode/pi-codex-ws 等 e2e 沙箱钉死 dual-write 存储,[PR] storage: pure-SQLite default — JSON envelopes stop being written unless dual-write is requested (#6479) #6480 后续)与 master 产生合并冲突(merge state: dirty),无法合并。
  2. 什么原因导致的:PR 从较旧的 master(merge-base e1f31ad9d5)切出;此后 master 独立落地了同一处 tests/notice-registry.test.ts 的存储默认处理,且版本更完整(同时解绑 BILI_STORAGE_UNIFIED 与 BILI_STORAGE_JSON_WRITER 两个开关)。PR 分支与新 master 合并时,两侧对同一行的分歧编辑相撞。
  3. 影响范围与严重程度:仅合并冲突挡住 PR 可合并性,无功能影响——PR 本体改动(5 个 e2e 测试文件钉 dual-write)完整保留。严重度低(合并阻塞,非功能缺陷)。
  4. 怎么修复的:把 origin/master 合并进 PR 分支;唯一冲突文件 tests/notice-registry.test.ts 取 master 版本(严格超集:解绑两个存储开关、注释更完整);5 个 e2e 文件自动合并干净、保留 PR 原意;提交合并并推送。
  5. 是否有回归问题:无。冲突文件取的是 master 已知绿版本;自动合并的 e2e 文件经 diff 对照 master 确认只含 PR 预期改动,未触碰任何既有行为。
  6. 是否破坏缓存:不涉及——纯测试改动(6 个测试文件),未触及任何缓存/重试/增量游标/去重键逻辑。
  7. 是否改了设计方向:不涉及——纯测试改动,无架构/边界/数据流转向。
  8. 是否引入了新的配置:不涉及——未新增任何 env/config/默认值。

收工判定:冲突已解、PR 已可合并(mergeable: True),等待 CI 在 425edecdb1 上全量跑绿 + 人工 review 后由 owner 合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant