Repository navigation
[PR] fix: two adjacent ranges in one compress batch both claimed the shared seam tool pair — first-come-first-served - #7428
Conversation
do not resend this range") gains a second, more accurate wording for the case where every resolvable message of a range is already covered by active block(s) — the previous "all of its content is protected or filtered" wording is kept VERBATIM for its original class; the new wording only appears for the newly-impossible-to-misread covered case (it names the covering class and points to block-ID refs). kernel: refresh batch coverage snapshot per range (seam double-claim fix) Two adjacent ranges in ONE compress batch both claimed the tool pair on their shared seam: the coverage snapshot (collectCoverage) was frozen before the batch, so each range's projection judged "already covered" without seeing what an earlier sibling had just claimed. Result: two active sibling blocks directly owning the same messages, overlapping seq intervals, and a later fold consuming one of them positionally although its ref range lay outside the newer block's range (pi session 01a1f6ff: b100/b101 shared two directMessageIds; b102 then consumed b101 across its ref range). The no-overlapping-active-siblings invariant (file header) now holds on the last path that bypassed it: the apply loop refreshes the snapshot each iteration (first-come-first-served seam ownership); a range left with nothing new becomes the #4521 idempotent no-op (warning, no error, batch survives). kernel-change: mechanical-bug exemption (owner policy 2026-11-06) — a single-point state-refresh omission with a reproducing regression test (kernel/tests/regression-batch-seam-double-claim.test.ts, red before / green after; full kernel suite 1647/1647 green). The human review tier still gates the merge.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11135-pr.7428.756aaa3This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr7428.tgz
npm install -g packageInstall instructions are refreshed on each push. |
The top commit bumped kernel/package.json to 0.0.201 but skipped lockfile regen, leaving acp-kernel at 0.0.200 in both package-lock.json (root, acp-kernel entry) and kernel/package-lock.json. The lock-sync CI job (#2704 drift guard) regenerates via 'npm install --package-lock-only' and fails on any residual diff. This commit is the exact output of that regeneration (idempotent fixed point): 3 version lines 0.0.200 -> 0.0.201, no registry churn. Fixes the red lock-sync check on PR #7428.
…ame-batch involvement (false for pre-existing covering blocks)
Review finding (reproduced with a two-turn probe): the new allCovered
no-op wording fired for a PRE-EXISTING block covering a requested
sub-range (anchor outside the range, so the block is not nested in it)
— a case that existed before this fix and previously got the
'protected or filtered' wording. There the clause 'including block(s)
created earlier in this same batch' asserted same-batch involvement
that did not exist (no block was created in this batch).
Fix: drop the clause — the actionable guidance ('do not resend this
range; reference them by block ID instead') is identical in both
cases, so the clause carried no decision value, only the false claim.
The wording now states only what is true in every case reaching this
branch: every resolvable message is covered by an active block.
Added regression test 3: pre-existing covering block (no same-batch
block) gets the covered wording and the warning is asserted to NOT
contain a same-batch claim. kernel-change: mechanical-bug exemption
(provably-false guard text + reproducing test); human review tier
still gates this merge.
(ai: vllm-qwen/qwen3.8-27b) CI fix run — PR #7428 (mirror #7430), head now Re-verified live state first: the only red check was Root cause: the PR's top commit Fix: regenerated both lockfiles with the exact command CI uses ( Verified live: 七问
结论: |
(ai: vllm-qwen/qwen3.8-27b) Duplicate screening: not a duplicate — searched open+closed issues/PRs by failure signature ("batch seam double-claim adjacent ranges", "01a1f6ff nested compression", "seam tool pair sibling blocks", "compress batch adjacent ranges claim"): no matches; no parallel [PR] on the same topic. Review of PR #7428 complete. The core fix (refresh the coverage snapshot at the top of the apply loop → first-come-first-served) is correct and verified: the new regression test is RED on master with exactly the live shape (
8问结论
MODEL-FACING TEXT CHANGE (top priority per review rules): the #4521 no-op warning gains a second, more accurate wording for the all-covered case (the old "protected or filtered" wording was inaccurate for it). The new wording carries no numbers/refs/counts the model could anchor (no phantom-value class); worst misread (resend the same range) lands on the same no-op — livelock-safe by design (#4521). The false "same batch" clause was removed at review (finding 1). 标签:PR #7428 已打 bug/p2/pi/scope/kernel(按 PR 自身 diff 判定:kernel batch-apply 缺陷、pi 车道显现、可用但状态不一致 → p2);mirror issue 7430 与 companion issue #7429(mirror #7431)同标。 CI: review 时唯一红项(lock-sync)已修(0f4e18d);新 head 54f37fb 的 30 项 check 运行中,目前 0 failed。 Verdict: fix correct, tests real (red-before/green-after, 3 cases), diff clean, all three review findings closed. It touches kernel/ → human-only review tier; I cannot merge — please review and merge yourself: #7428 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1245-master.ba2e819 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Second master sync (a446a3c -> bf778d9, 101 commits). Conflicts were kernel version lines only (branch 0.0.200 vs master 0.0.201, the #7428 batch-seam fix bump); resolved to 0.0.202 because the merged tree carries this PR's kernel/src changes on top of master's kernel, which kernel-guard version discipline requires a bump for. compress.ts auto-merged: master's batch-seam coverage refresh and no-op wording preserved, PR's supersedesBlockId lineage wiring intact. Verified: root + kernel typecheck clean, kernel suite 1654/1654, host targeted suites 45/45 (5 skipped), lockfiles idempotent.
…lict at 0.0.202 Master advanced 122 commits past the PR base (batch-seam double-claim fix #7428 -> kernel 0.0.201, storage backup/repair #7156/#7431, ingest-band default-off #7426, pf-tail-ids cap #7381, OpenAI reasoning alias #7432, dsh-mneme scan #7430, and more). Content hunks auto-merged (kernel/src/ compress.ts, all four storage-render goldens); the only conflicts were the three kernel version lines, resolved at 0.0.202 = master's 0.0.201 + this PR's kernel/src change, per the CI-enforced kernel version discipline. Targeted local verification: tests/golden-storage-render.test.ts + tests/storage-state-fields.test.ts 7/7, kernel issue6116/issue3769/ hide-consumed suites 27/27.
The #4521 no-op warning ("folded nothing … do not resend this range") gains a SECOND, more accurate wording for the case where every resolvable message of the range is already covered by active block(s) — the previous "all of its content is protected or filtered" wording is kept VERBATIM for its original class.
Scope of the new wording (corrected at review, 54f37fb): the covered wording fires in TWO cases: (a) the NEW case this fix turns into a no-op instead of a double-claim — a same-batch sibling claimed the seam tool pair; and (b) a PRE-EXISTING block straddling the range edge (a sub-range request whose anchor lies outside the covering block) — this case existed before the fix and previously received the inaccurate "protected or filtered" wording. The wording therefore states only what is true in both: "every message in it is already covered by active block(s) … reference them by block ID instead." The first draft's clause "including block(s) created earlier in this same batch" was FALSE in case (b) (no block was created in that batch) and was removed at review.
Regression inference (consumption chain):
What is broken (plain words)
When the model asks to compress TWO adjacent ranges in one call (very common — the batch seam sits on a tool pair), BOTH ranges claimed the tool pair on their shared boundary. Result seen live (pi session 01a1f6ff on v0.1.216): two sibling blocks (b100/b101) directly owned the same two messages; a later fold then consumed one of them positionally although its ref range lay completely outside that block's range — the "nested compression" confusion reported in the web UI.
Root cause
The no-overlap contract (kernel/src/compress.ts file header: "no two active sibling blocks may claim the same message directly") was enforced on every path EXCEPT same-batch siblings: the coverage snapshot (
collectCoverage) was frozen once, before the batch started (constat the apply loop), so each range's projection judged "already covered" without seeing what an earlier sibling in the SAME batch had just claimed. The overlap check also only compares block spans, and a just-applied block still carries its un-snapped projection span until the block is sealed — so even a check against just-applied siblings would not have caught it.Fix
No binary split of any range, no new config knob, no wire/protocol change, no storage format change. This restores the declared invariant on its last bypassing path — the sibling-claim decision was always "first-come-first-served" by design; the snapshot just went stale within one batch.
Reproduction & evidence
kernel/tests/regression-batch-seam-double-claim.test.ts: two adjacent batch ranges over a shared tool pair. RED before the fix with exactly the live shape:message c1 is directly claimed by BOTH block b1 and block b2. GREEN after (disjoint claims + clean no-op on the empty remainder). Test 3 (added at review): a pre-existing covering block (no same-batch block) gets the covered wording, and the warning is asserted to contain no same-batch claim.npm run typecheckclean.tests/wire-contract*.test.ts36/36 (golden pins untouched — behavior constants, nudge floor/cap, prompts, wire markers all unchanged).testlanes on this head.kernel-change: mechanical-bug exemption (owner policy 2026-11-06) — a single-point state-refresh omission with a reproducing regression test (red before / green after); the human review tier still gates this merge.
Review (2026-11-21, head 54f37fb)
Fixes #7429