Repository navigation
[PR] Storage correctness wave 3: one mechanism per defect class (#4242) - #4249
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.5056-pr.4249.01d25f9This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4249.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…not reproduce in CI (#4249) CI computed the ORIGINAL digests on every failing shard (ubuntu 22 x2, windows 22 x2): actual=187920f4... (master value) vs expected=2b39faa2... (regenerated). The 'drift reproduces on a clean base' claim does not hold on CI's base+head — the regeneration was done against a contaminated local environment. Restoring master's golden turns all four shards green; no wire change comes from this PR.
…t lane runs with an unbuilt kernel (#4249) The storage seam's load graph (backend.ts -> ingest.ts -> state-hydration.ts) previously used only relative kernel-source imports, so CI's mysql-contract job (npm install --ignore-scripts, no build step) could run it. The new package-name import resolved to kernel/dist/index.js which that lane never builds -> ERR_MODULE_NOT_FOUND. Relative import matches the existing seam convention (ingest.ts refs.js/types.js); tsup inlines the kernel into dist regardless.
The mysql-contract lane installs with --ignore-scripts and runs tsx directly, so no built acp-kernel dist exists there. state-hydration.ts imported scrubTurnSeparatorIds from session.js, and session.ts value-imports acp-kernel at its top — the seam graph still reached the missing built package one hop deeper than the previous fix eliminated (CI run 39712614208, same ERR_MODULE_NOT_FOUND class, now 'imported from src/session.ts'). The three helpers depend on nothing, so they now live in src/turn-separator.ts (a zero-import leaf); session.ts re-exports them for existing consumers (server.ts, stream.ts, fold-reconcile.ts, tests) and state-hydration.ts imports from the leaf. Doc comments moved verbatim with the code. Verified hermetically: with kernel/dist removed, the two contract suites pass (11/11, mysql lane skipped without DSN); issue2627/state-fields/full-flip/ orphan-representable suites 24/24; tsc --noEmit clean; unused-export gate clean.
(ai: vllm-qwen/qwen3.8-27b) 查重:同家族但不算简单重复——与三个在途 PR 重叠,建议归并到本 PR,关闭动作留 owner 拍板(我不擅自关别人的 PR):
标签:已打 bug / scope/storage / p1(p1 依据:#3987 属无界增长类、#4216 冷加载返回陈旧数据、#4192 水合静默丢字段,按 2026-10-19 口径一律 p1)。 审核方式(独立重审,未复读 issue 结论):全 diff 逐行通读 + FK 纪律逐点审计 + 本地定向运行——true master 与分支各跑 golden 5/5、新/改测试族全绿(state-fields 2、orphan-representable 1、media-sidecar-split 2、full-flip 9、archive-gc 5、issue2627-turn-sep 12、proxy-persist 23、issue2129 4)、tsc 干净;并做了 mysql-contract lane 的密闭复现(移除 kernel/dist 后 contract 套件 11/11 过,含 1 个无 DSN skip)。 逐项结论: 两件过程事项,独立核实过:
非阻塞小观察(均不影响正确性;分支正被并行会话活跃迭代,留给收尾打磨,不在本轮推 commit): 八问:
判定:代码质量达标、测试有牙、本地定向验证全过;CI 现静态门禁与 mysql-contract 全绿,还有 8 个 lane(static-gates×2 + test shards×6)在跑,等全绿。不满足自动合并条件(多模块 feat 类 + 存储语义),人工合并。合并前需 owner 拍板两件事:① #4011/#4075/#4218 的归并/关闭处置(建议并入本 PR、吸收 #4075 的两载体覆盖、给 #4218 作者署名);② 上面四条小观察是否收进收尾。① 定案 + CI 全绿后即可合。 |
…ake) The three SSE cells of the abort row waited a fixed 300ms before asserting the upstream socket was destroyed; the json cell already polls (30x100ms) because slow runners destroy the socket later. The fixed sleep red on windows-latest/node22 in run 39715658226 (job test (windows-latest, 22, 2), closed=0) while its siblings passed - same race, only one cell converted. Apply the existing polling idiom to all three SSE cells. Test-only change; no wire or source impact. Found while reviewing #4249 (unrelated to its storage diff).
(ai: vllm-qwen/qwen3.8-27b) CI 收尾(更正上一条「等全绿」):head 红的定性:与本 PR 无关的既有测试竞态。失败断言: 同一矩阵的兄弟用例 openai-sse / anthropic-sse / proxy-json 在同一 shard 全过,只有 responses-sse 变体在更长的耗时(1100ms)下读到 处置(已做):按「CI 失败类小修在当前 PR 顺手修」的纪律,已在分支上补一个独立标注的 test-only commit 另澄清一条避免误读:check 聚合视图里那条 lock-sync 红属于 PR #4255 的运行(它自己 kernel/package-lock.json 漂移 0.0.151→0.0.152),不是本 PR 的——本 PR 自己的 lock-sync 是绿的(kernel 版本两侧同步 0.0.151)。 结论不变:等 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.737-master.c1d7eab # this exact build
npm install -g billion-context@master # always the newest merged build
|
…_FILES The #4216/#4249 storage work made tests/storage-engine-proofs.test.ts and tests/web-storage-banner.test.ts spawn the corrupt-index-child helper, but they were never added to LIVE_FILES — the run-ci-tests SPAWN_RE tripwire (#3182/#1248) failed every ubuntu leg in 20s. Append-only per the slot note: existing zone bands are untouched.
…_FILES The #4216/#4249 storage work made tests/storage-engine-proofs.test.ts and tests/web-storage-banner.test.ts spawn the corrupt-index-child helper, but they were never added to LIVE_FILES — the run-ci-tests SPAWN_RE tripwire (#3182/#1248) failed every ubuntu leg in 20s. Append-only per the slot note: existing zone bands are untouched.
What
One PR, five mechanism-level fixes — each removes a defect class instead of patching a symptom (per the issue's directive):
COMPRESSION_STATE_FIELDS = Object.keys(mergeState(createInitialState()))in newsrc/state-hydration.tsingest.tsdrifted (lostsweptOrphanCallIds,pendingOrphanSweepMinRef)createInitialState()grows an unknown keyreleaseContentdeletes on zero (UPDATE … RETURNING+ delete), sqlite and mysqlsessions.orphans_json(merged∪, LazyBlockContents-aware)requestskeeps advancing); the mirror skip ×3, importRecord skip and the #3818 writerOff JSON valve are deletedsplitMediaContentalso walks raw sidecars, swapping data-URL-form payloads (data:<mime>;base64,<payload>≥2 KiB — the openai/responses carriers) for{$media:<hash>}; hydrate restores byte-identically (both backends)imageBase64+ raw-sidecar data URL) → dedup capped ~1.89×rawAnthropicBlock.source.dataand googleinlineData.datacarry bare base64 with no data-URL prefix and are NOT matched — widening the regex blindly would eat signedthinkingbytes; those two carriers need slot-directed splitting (as #4075 does). Scope decision pending ownerstorage.unified=legacy+ new full-authority pinExplicitly not here
ingestSessioninput) but is exercised via the sqlite contract suite; a DSN-gated twin test can follow.Verification
storage-state-fields2/2,storage-orphan-representable1/1,storage-media-sidecar-split2/2, full-flip ⑦ authority 1/1; reworked ⑨/review tests to the new doctrine (9/9)tscclean; unused-exports cleanfull == legacy == goldensholds on every wire (engine-proofs). The local drift was a contaminated environment (stale kernel/dist), not a code property.kernel-change: none