Repository navigation
fix: keep Responses turn separators out of fold coverage (#2627) - #2710
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2934-pr.2710.08a4120This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2710.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…Ids (#2627) Review follow-up on this PR, no semantic change: coveredIdsOf re-implemented the same real-history caliber (active blocks' effective ids minus outbound-only turn separators) inline instead of delegating to coveredRealHistoryIds, which the PR body designates as the single source for every drift consumer. Two implementations of one caliber is exactly the drift vector #2627 is about; BlockLike is structurally compatible with the shared signature, so the loop reduces to a call. Behavior identical - pinned by fold-reconcile.test.ts and issue2627-turn-sep-coverage.test.ts (both green post-change).
55ff58d to
7e032d5
Compare
[bot] 🏷 冲突已解决,rebase 完成,push 至 冲突来源与解法master 在我原 base( 跨分支语义交互(重点核查项):#2695 的 zombie streak 判据是 透明度说明:push 前发现远端分支已有一个 @ranxianglei 的 merge commit( Rebase 后验证(全部在 rebase 后 head 实跑)
结构化八问(本轮 rebase)
判定:可合。 mergeable=true,无冲突;behind 的两笔已验证不相交,直接 merge(GitHub merge commit)即可,CI 红了我再定向排查。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.245-master.5b65b65 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2627
What
acp_turn_sep_*synthetic separators (inserted byrepairResponsesAssistantOrdering, src/server.ts) are OUTBOUND-ONLY ordering markers — no client's resent history ever contains them. On the plugin lane the tool handler handed itsmem.processedview (which carries the separators) to the shared executor withoutcompressMessages, soapplyCompressionresolved compress ranges on the polluted view and wrote separator ids into new blocks'directMessageIds/effectiveMessageIds. Higher folds inherited them via child merge. Every later reconcile pass against the client's raw history then flagged them as permanently "missing": false[acp-drift]/fold-reconcilewarns every turn, persisted across restarts, stalling per-block ledger evidence (p+r>=tnever accrues).The proxy-mode relay loop was never affected (it has always passed
compressMessages: originalMessages).Fix — four layers, one invariant: no block coverage may carry outbound-only ids
src/plugin.tstool handler now passescompressMessages: mem.original, the same two-view split the relay loop ctx uses (display = processed, compress input = raw). The kernel never sees a separator.RESPONSES_TURN_SEPARATOR_ID_PREFIX+isResponsesTurnSeparatorId()shared by the producer and every consumer;coveredRealHistoryIds()is now the single real-history coverage set for the four#1195pre-turn snapshots, the dsh/codex local-compaction gap calibers,fold-reconcile's covered set, and the per-block ledgertcount.persist.ts mergeState(the only hydration chokepoint) scrubs already-persisted pollution on load, so long sessions stop alarming after upgrade. Block bodies/summaries/archives untouched.stream.ts applyRangesscrubs again post-commit with a count log, covering any unforeseen future path that re-poisons via child-block inheritance.Behavior change (disclosed, per owner policy)
Separator-only coverage gaps no longer alarm (old: every turn, never escalating, never clearing → new: silent). Real drift detection — content edits, deletions, tool-call-id rewrites — is unchanged and pinned by tests.
Verification
tests/issue2627-turn-sep-coverage.test.ts(new, 12 cases): predicate matrix, scrub counts, producer coupling (server.ts emits the shared prefix), a CONTROL case reproducing the old pollution through the real kernel (separator ids entering direct+effective coverage, parent inheriting them), and the healed path (compress against raw history → no separator ids anywhere, real mid-span messages still folded).tsc -p tsconfig.jsonclean.Rebase note
Originally authored as
02840d18(the bot comment on #2627 linked the wrong PR — #2628 is the unrelated #2621 detector fix). Rebased onto current master: import-union conflicts in prepare-anthropic/google resolved, and the two dsh-local-compaction calibers that master added to the anthropic/google lanes (#2628's lanes) were switched tocoveredRealHistoryIds()too — a provable no-op on those wires (separators never exist there) but keeps one caliber everywhere.