Repository navigation
[PR] kernel: preserve existing block coverage when merging blocks (#4484) - #4485
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.6530-pr.4485.703a216This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4485.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 —— 本 PR 即 #4484 的根因修复(承接 #3322 中 owner「直接修复根本原因」的指示)。相关但机制不同:#3353(host 侧 coverage-regression guard,本 PR 不动它、保留为纵深防御)、#4050/#4085(id churn 下的 fold 覆盖恢复,另一条产线)。 标签: bug + scope/kernel + p2(内核侧根因修复;跨车道不打客户端标签;被拒时旧块仍保持覆盖、无数据丢失 → 功能性缺陷而非可用性缺陷)。 开始审核:已拉取分支(1 commit,3 文件: |
(ai: vllm-qwen/qwen3.8-27b) lock-sync 已修复并推送(commit 结构化八问:
判定:CI 红因已消除,等新一轮 CI 跑完 |
(ai: vllm-qwen/qwen3.8-27b) Review 完成:代码方向正确、回归测试有牙、本地定向全绿;CI 仅 5 个 shard 红,已证明是既有 flake(与 master 同签名红过),rerun 已触发并立项 #4489。判定:可合(kernel 变更属 human-only review tier,最终合并由你执行)。 审核证据(判断层,非流水账)
结构化八问
CI 状态(c4d1b22,run 40069753327)32 success / 14 skipped / 5 failure——5 个失败 shard 全部死在同一处:既有 flake 收工判定:代码与测试层面可合;等 rerun 转绿后 CI 即全绿。kernel 变更按 Kernel Boundary 属人工合并范畴——rerun 绿后请你自行合并:#4485 |
(ai: vllm-qwen/qwen3.8-27b) CI 更新(修正上一条的「rerun 已触发」为完整结果): rerun(attempt 2)同样 5 个 shard、同一测试、逐字节相同错误(
判定维持:代码与测试层面可合;CI 的红全部归因于既有 flake(#4489 跟踪)。你随时可以合并(红的归属已有完整证据链);若想要一个全绿的 check 记录,等第三次 attempt。 |
(ai: vllm-qwen/qwen3.8-27b) CI 取证收尾(修正上一条「单一测试」的框定): 对全部 5 个红 shard 的日志逐槽位核对后发现,红的不是 1 个测试而是 2 个(都在 unified-storage 回收断言、node:sqlite/builtin 引擎):
测试序号跨树一致(1275/1243/635/835)⇒ 每 shard 文件组成相同(host CI 只分片顶层 处置:
最终判定:代码与测试层面可合(kernel 边界合规、回归钉真实、本地定向全绿);CI 的红全部归因于既有 flake 家族(#4489 跟踪,证据链完整)。按 Kernel Boundary,kernel 变更属人工合并范畴——你可以直接合并(https://github.com/ranxianglei/billion-context/pull/4485),合并时的 CI 即下一次自然抽签。 |
(ai: vllm-qwen/qwen3.8-27b) 自动修复通道(attempt 2/2)判定:5 个红 test shard 不是本 PR 分支的缺陷——是继承自红 master。不在本分支修,到此为止。 证据链:
结构化八问:
结论:本 PR 代码面自身各门禁通过,待 #4493(红 master)修复转绿后重跑 checks 即可最终确认;review 本身可并行推进。 |
…fixed ingest count The #3250 custom-cap case asserted the WAL sat under cap + one page after a fixed number of ingests. The residue above the cap depends on where the 1000-page autocheckpoint window closes relative to commit boundaries, which varies with the runner's bundled SQLite build — byte-identical red on some shards (left 1095952 bytes, cap 1048576), green on others, same sha (master run 40068050438; PR #4485 run 40069753327). Assert convergence instead: keep committing 128 KiB units until a completed checkpoint (autocheckpoint or cadence-tick PASSIVE) brings the file back to the configured cap, bounded at CONV_UNITS = 24 (one full cadence period + landing lag + headroom; derivation in the constant's doc). A pre-fix tree (limit never honored) sits at its high-water mark through all units and can never converge, so the RED/GREEN discrimination is unchanged.
…fixed ingest count The #3250 custom-cap case asserted the WAL sat under cap + one page after a fixed number of ingests. The residue above the cap depends on where the 1000-page autocheckpoint window closes relative to commit boundaries, which varies with the runner's bundled SQLite build — byte-identical red on some shards (left 1095952 bytes, cap 1048576), green on others, same sha (master run 40068050438; PR #4485 run 40069753327). Assert convergence instead: keep committing 128 KiB units until a completed checkpoint (autocheckpoint or cadence-tick PASSIVE) brings the file back to the configured cap, bounded at CONV_UNITS = 24 (one full cadence period + landing lag + headroom; derivation in the constant's doc). A pre-fix tree (limit never honored) sits at its high-water mark through all units and can never converge, so the RED/GREEN discrimination is unchanged.
|
解决冲突ci |
kernel-change: merging existing blocks retracted their own coverage. The turn-integrity gate judged the fold over this unit's ids only and withdrew ids carried solely by the consumed blocks; those blocks deactivate on apply and the new block does not inherit them, so the folded messages lose all coverage and the host pre-commit guard refuses the fold (gate:coverage-regression), causing repeated rejections of legitimate merges. Fix lives in projectUnit's integrity step, scoped to merges (consumedBlockIds > 0); fresh folds keep the legacy behavior verbatim: - judge post-fold coverage as this unit's ids PLUS every still-active sibling block's coverage, so a tool half already covered by an unconsumed sibling reads as folded rather than as a spurious visible half (#3322 facet); - unfold only ids whose coverage does not depend on a consumed block, re-checking to a fixed point; if consistency would force unfolding such an id, fail honestly (split fatal) instead of emitting a doomed regressive candidate. Host coverage guard (src/stream.ts, #3353/#3322) left intact as defense-in-depth. Regression tests: kernel/tests/issue4484-merge-coverage.test.ts (interior hard-protected tool; tail cut mid-tool-group; clean-merge control). Bumps acp-kernel 0.0.161 -> 0.0.162.
The kernel package.json bump skipped lockfile regeneration, so the root package-lock.json (file:./kernel link entry) and kernel/package-lock.json still recorded 0.0.161 and the lock-sync drift guard failed. Regenerated both with 'npm install --package-lock-only' (the exact lock-sync recipe); diff is only the two version lines.
Gate discipline (#3617): every gate ships with both directions asserted. The new merge stuck-fatal (cannot satisfy turn integrity without unfolding consumed-owned ids) had only success-side coverage. Adds an impossible-merge fixture (b2 tail cut mid-tool-group): asserts the honest split error fires up-front, blocksCreated stays 0, and existing coverage/state are untouched.
c4d1b22 to
31a18db
Compare
|
(ai: google/gemini-2.5-pro)
Validation on the rebased head:
CI lanes on the pushed head will confirm the full suite. Still needs human review (kernel change). |
(ai: vllm-qwen/qwen3.8-27b) 冲突处置核验完成:rebase 后的 head(31a18db6)对当前最新 master(9b6ec2345)复核无冲突,GitHub PR 状态已由 dirty 转为 mergeable(state=behind,不阻塞合并)。rebase + push 由上一轮完成(见上方评论),本轮是对 rebase 点之后 master 又前进的 5 个提交做的独立复核。 八问:
CI 现状(pushed head):30 项 check,0 红,8 项在跑;静态门禁已过(lock-sync / version-guard / docs-sync / config-surface-guard 等均绿),kernel-guard 排队中。 判定:冲突已解除,PR 恢复可合;kernel 变更仍需人工 review 后合并。 |
(ai: vllm-qwen/qwen3.8-27b) 冲突已解决,PR 现在可合并。 过程说明:我接单后按 merge master 方式解冲突(kernel 版本并集到 0.0.169、lockfile 按 CI recipe 重新生成),推送前发现分支已被 rebase 到新 master(提交作者 ci-check,即原 PR 作者 agent)——两边解法一致,我弃掉自己的未推 merge commit,改为独立复核其 rebase 的正确性,不做双重推送。 复核与验证结果(在等价合并树上本地定向跑):
结构化八问:
当前状态: |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.894-master.9563c1b # this exact build
npm install -g billion-context@master # always the newest merged build
|
kernel-change: merging existing blocks retracted their own active coverage. The turn-integrity gate judged the fold over this unit's ids only and withdrew ids carried solely by the consumed blocks; those blocks deactivate on apply and the new block does not inherit them, so the folded messages lose all coverage and the host pre-commit guard (src/stream.ts, #3353/#3322) refuses every such merge (gate:coverage-regression), producing repeated rejections of legitimate block merges. The regressive candidate is PRODUCED inside the kernel's projectUnit judgment, so the host side cannot prevent it — the guard can only refuse the symptom. Owner directed the root-cause fix in #3322 ("直接修复根本原因"); this implements it for #4484.
What changed
projectUnit's integrity step (kernel/src/unit-projection.ts), scoped to merges (consumedBlockIds.length > 0); fresh folds keep the legacy path verbatim:splitfatal instead of emitting a doomed regressive candidate.Behavior change (flagged)
Tests
kernel/tests/issue4484-merge-coverage.test.ts— protected-rule interior, parallel-tail cut, clean-merge control; asserts no coverage loss AND final-state integrity validity.tests/issue3322-coverage-regression-guard.test.ts. Full-suite verdict via CI.Bumps
acp-kernel0.0.161 → 0.0.162.Closes #4484. Related: #3322.