Repository navigation
[PR] fix(#4305): standing generation-boundary note so the model stops compressing dead refs after a model switch - #4308
Closed
ranxianglei wants to merge 4 commits into
Closed
ranxianglei wants to merge 4 commits into
ranxianglei wants to merge 4 commits into
Conversation
…ef residue After a mid-conversation model/upstream switch the ref ledger restarts at m00001 while the client-persisted history keeps citing previous-generation refs, which look exactly like live ones — the model keeps aiming compress at dead ranges until the circuit breaker fires. The reactive receipts (#1029, #2146, #4252) already name the frontier but the incident shows the model flails through them, so the fix is a STANDING part of the context. One-shot evidence-based detection (>=2 distinct above-frontier citations in visible history), verdict persisted in session metadata, static number-free note appended to the ACP standing system block on every wire plus the round-2 fold rebuild in exact steady-path order. Display-only: no storage, ref-space, gate or breaker changes.
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.5118-pr.4308.105e0e7This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4308.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
added 3 commits
October 22, 2026 21:38
…2 spaces) Review nit from #4308 review: the new relay.ts lines were indented one space deeper than the surrounding block. Whitespace-only, no behavior change.
… tags-only surface Two coverage gaps found in #4308 review: - The compress-loop round-2 rebuild recomposes the ACP standing system by hand; nothing pinned that a boundary-ACTIVE session keeps byte-identical system bytes between the steady request and the post-fold re-request (the same seam class #3298/#2499 fixed for attribution/cache marks). New tests/issue4305-round2-seam.test.ts drives one real fold through the anthropic wire with previous-generation residue seeded in the early turns and asserts round-2 system === round-1 system byte-for-byte. - The tags-only ACP surface (plugin/dsh lane, compressSurfaceOff — the lane that produced the #4305 incident) had no injection assertion; added a positive+negative pair to tests/generation-boundary.test.ts.
Owner
Author
(ai: vllm-qwen/qwen3.8-27b) Review 结论:可合(head 结构化八问
审过的既有行为清单(逐项结论)
Review 期间补入的修复(additive commits,已推 PR 分支)
残留(不阻塞)
行为变更披露(按政策)OLD:世代重置后,渲染上下文中没有任何东西告诉模型旧世代引用已失效。NEW:满足上述条件的会话从首个看见 residue 的请求起,ACP 常驻 system 块内多一段静态段落(~640 字符);不受影响的会话零字节。缓存影响见第 6 问。 判定:可合。 head |
Owner
Author
Merged
This was referenced Nov 1, 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.
Closes #4305
Problem
After a mid-conversation model/upstream switch the conversation's ref ledger restarts at m00001 while the client-persisted history keeps citing previous-generation refs — old compress receipts, acp_status outputs, block summaries, the model's own earlier replies. Those citations look exactly like live refs, so the model keeps aiming compress at dead ranges until the circuit breaker fires (incident session 01a15993: five gates rejected in a row, breaker armed,
[acp-drift]noise on every subsequent request). The reactive receipts already name the frontier (#1029 snapshot, #2146 beyond-frontier note, #4252 clamp note) — but the incident shows the model flails through them anyway, so the fix has to be a STANDING part of the context.Fix (issue proposal 1 of 3)
New host-side module
src/generation-boundary.ts:generationBoundary) → survives restarts, renders deterministically for the session's lifetime.injectSystem) and mirrored in the round-2 fold rebuild (relay.ts) in the exact steady-path order (prompt → note → absorb) so the prefix-cache seam holds.Behavior change (disclosed per policy)
Both compression modes
compressSurfaceOff): rides the tags-only slot — the lane that produced the incident.Tests
tests/generation-boundary.test.ts(10 tests): detection positive / below-frontier negative / distinctness guard / fresh-session (empty ledger) / tag-shaped residue / prose single-stray guard / idempotent short-circuit / malformed-record rejection / note contract /injectSystemappend + ordering vs attribution line. Targeted local runs green: this file plusptc-runcode-tools,prompt-pack-tool-prompts,plugin-nudge-injection,issue2432-breaker-awareness(42 tests total); typecheck + build green; full suite via CI.Boundaries