Repository navigation
fix: reap zombie fold blocks after unannounced host history deletion (#2695) + host-compaction cache proofs - #2707
Merged
Conversation
…2695) Host-side deletion of history without a compaction frame (Claude Code context editing, dsh native checkpoints on lanes without the rebase fix) orphans fold blocks. syncBlocks keeps them alive forever via arrival- order cluster ids re-derived by identical later messages, and the remint feedback loop flaps one carrier in and out every turn - permanent mid-list churn, i.e. prefix-cache misses on every request (#2596). Host-only fix (no kernel changes): foldCoverageByBlock records a zombie streak (z) - consecutive passes with a majority of a block's covered ids absent from the inbound. After FOLD_DRIFT_ESCALATE_PASSES such passes in proxy mode, reapDestroyedSubstrate removes the block from state.blocks (removal is sticky; active=false would be resurrected by syncBlocks), archives it via the #395 preCompactionArchive path (blockContents stay for derived decompress), prunes refs, strips anchors/order/coverage, and records an orphan-reap conflict event. Plugin mode is exempt (covered ids are legitimately absent after the agent's own compress). Proofs added (user request: cache proofs covering host compaction): - cache-proof HOSTCOMPACT (chat wire): decimated replay drops orphan carriers, re-arms cleanly; zombie flap bounded (regression pin - red on master: zombie rides every later fold round-2, green with reap). - cache-friendly-plugin P6 (dsh native-compaction rebase, 4 wires): checkpointed replay rebases blocks cleanly, era-stable tags, prefix append-stable after the rebase turn; red on pre-#2664 masters for anthropic/google. Refs #2596 #2658. Kernel root-fix proposal (remint coveredBases should scan inactive blocks; instance identity for duplicate clusters) filed in #2695.
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2928-pr.2707.1ad6eefThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2707.tgz
npm install -g packageInstall instructions are refreshed on each push. |
#2695) remintCoveredLiveIds now also dodges INACTIVE blocks' covered ids when the same cluster root shows prior-pass continuity — the exact shape a new duplicate instance lands on a dead block's number and resurrects it in sync, rendering a carrier for content the instance was never part of (the every-other-turn carrier flap). A whole-root arrival that is new to lastPassIds (client rewind to a checkpoint still holding the folded originals) keeps the converter's ids so the block legitimately resurrects. kernel: 0.0.114 -> 0.0.115
This was referenced Oct 11, 2026
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.241-master.6819ece # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Oct 11, 2026
This was referenced Oct 17, 2026
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2695. Refs #2596, #2658.
kernel-change: stop new cluster extensions from resurrecting dead fold blocks (#2695) — owner-approved in the working session (2026-10-11); host-only mitigations cannot observe pre-remint cluster aliasing, so the identity fix belongs in
remintCoveredLiveIds. Kernel 0.0.114 → 0.0.115.Problem
An unframed host-side history deletion (client decimates its own resent history — "native compaction" without the framing contract) orphans proxy-mode fold blocks. Two failure layers:
syncBlocks("some covered id present"), rendering a carrier for content the instance was never part of; the next pass the collision mints elsewhere and the block dies again — an every-other-turn carrier flap that keeps invalidating the prefix cache forever.detectUnannouncedHistoryRewrite's two gates are both bypassed by this rewrite shape, andclaimsstays empty.Fix
Kernel (
kernel/src/instance-reid.ts) —remintCoveredLiveIdsnow also dodges INACTIVE blocks' covered ids, gated by cluster-root continuity: renumber only when some sibling of the same root was live last pass (the arriving instance is a new extension of a continuing cluster). Sound because a block inactive at pipeline start cannot have any of its own covered ids inlastPassIds(sync would have kept it alive). A whole-root arrival new tolastPassIds— a client rewinding to a checkpoint that still holds the folded originals — keeps the converter's ids so the block legitimately resurrects (#462 economy restored). All existing #1476/#462 semantics preserved (kernel suite 1266/1266).Host (
src/fold-reconcile.ts+src/session.ts) — per-block zombie streak in the existing fold-coverage ledger (foldCoverageByBlock[bid].z): majority-absent (2*(p+r) < t, same signals already computed) increments, any majority-present pass resets. Atz >= FOLD_DRIFT_ESCALATE_PASSES(3), proxy mode only (pluginAgent === undefined; plugin folds legitimately replace covered history), the block is reaped: removed fromstate.blocks(sticky — deactivation is reverted bysyncBlocks' unconditionalactive=true), recorded inpreCompactionArchive(#395 semantics — derived decompression stays available), refs pruned, anchors/order/positions/coverage stripped,orphan-reapconflict event recorded.Proofs carried
tests/cache-proof.test.ts, proxy mode): decimated replay — bounded healing window (zombie carriers die within 9 bodies and NEVER return), carrier visibility monotone post-decimation (the flap pin — RED on master kernel, GREEN with this kernel fix), re-arm fold works,orphan-reapevent + content-retention teeth. A/B on master:zombie carrier last seen on body #24, 10 bodies after decimation #14.tests/cache-friendly-plugin.test.ts, plugin mode): dsh native-compaction rebase across all four wires (DSH desktop 0.2.0-rc.2,偶现缓存命中失效,浪费大量token #2596/[bug] dsh 原生压缩单轮 rebase 兜底缺失于 anthropic 线路(#2432 修复未覆盖):checkpoint 落地后 ACP 状态永久失效 #2658 coverage). A/B on pre-fix(#2658): dsh native-compaction rebase fallback on anthropic/google lanes #2664 master: anthropic+google RED (the missing rebase lanes), openai/responses GREEN.Config surface
No config changes — no new knobs; the streak reuses
FOLD_DRIFT_ESCALATE_PASSESand the existing coverage ledger.