Repository navigation
[PR] fix(conflict-watch): classify clean-rebase rewrites as native-compaction (quiet) + attribute Claude native compaction - #6774
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10789-pr.6774.36406afThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6774.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — 本 PR 是 compression-conflict 聚合线程(#6768, 成员 #6653 + #6764)的唯一修复 PR。在途的 #6355 与 #5787 是前序 PR, 其内容已被本 PR cherry-pick( 这是 [PR] 线程(ework-agent-pr 标记) — 上游工作已完成, 我未重做; 拉取分支、核对代码、核查 CI, 报告结论。 已核查(分支
结构化八问
行为变更(old → new, PR 正文已披露): Claude Code native compaction(anthropic 车道): 说明:
结论: 代码核对干净、本地定向测试 47/47 + typecheck 绿、CI 静态门全绿; 测试矩阵被外部整批取消(在档模式, 零失败, 非代码问题), 需一次重跑产出权威绿。代码可合, 待测试矩阵重跑转绿; 无需改代码。要我现在重跑被取消的测试矩阵吗?(runner 池饱和期, 按先例默认不重触发, 等你一句话。) |
…he conflict banner #4131 added the `id-churn-adoption` ConflictKind (fold-reconcile re-mints and re-anchors ids across builds, 0 unmatched, NO compaction boundary) but only wired the recording side. Both display classifiers still treated it as an unexplained signal: - web banner severity (bili_conflictSeverity) dumped it into the residual signalN, so a pure id-churn-adoption ledger read landed=true and lit the alarm banner even though the event is fully recovered by design (#3235 policy: recovered stays quiet). - formatConflictSection framed a pure id-churn-adoption ledger as "something OUTSIDE bili touched this conversation" + "[suspected] confirm each named plugin", pointing the user at a phantom second compressor. Carve id-churn-adoption out of signalN (it joins the neutral/recovered bucket) and give formatConflictSection a dedicated churnAdoptOnly header + advice ("bili itself re-minted and fully re-anchored the ids; no second compressor, nothing to act on"). Mixed ledgers still alarm on genuine unannounced-rewrite/orphan signals. Behavior change (old -> new): a session whose only conflict evidence is a recovered id-churn-adoption event PREVIOUSLY showed the web alarm banner and the /acp panel framed it as an outside rewrite; NOW it stays quiet (banner hidden) and is framed correctly. Still recorded in acp_status/stats. Scope: this PR is deliberately limited to the id-churn-adoption variant of the recurring "Compression conflict banner" symptom. The unannounced-rewrite variant (dsh/claude native-compaction landings) is a different mechanism and still alarms by design pending separate attribution work -- untouched here. Closes #5786 (cherry picked from commit 4a96bad) (cherry picked from commit 3c7adee)
…nthropic lane rewrites the client history in place; the next request replays [continuation summary, retained tail...] against the same session id. The anthropic lane's compaction-landing detection knew only the dsh checkpoint framing, so the landing fell through to detectUnannouncedHistoryRewrite and recorded "unannounced-rewrite" (signal tier), lighting the conflict banner for the client's own auto-compact. The anthropic lane now detects the CC continuation framing with the same three-gate discipline as the dsh detector (#2621/#4438): carrier (user/text), novelty (fresh id vs the pre-turn ref map), standalone (sentence opens the message). On a hit it records "native-compaction" (handled tier) and rebases the ACP state onto the compacted history - the same marker+rebase treatment as the dsh lane (#2432/#2658) and the codex lane (#2373). The framing check is lane-scoped (dsh profile or claude identity/client); the sentence is version-pinned like DSH_CHECKPOINT_PREAMBLE_PREFIX (#970) - if Claude Code rewords it, detection degrades to the pre-#5767 archive path, never a false positive. Tests: drift pin on the pinned sentence; carrier/novelty unit gates; e2e positive (claude session rebases, no unannounced-rewrite, replay does not re-trigger) + four e2e negatives (no framing / assistant quote / old id / non-claude lane). Fixes #5767 (cherry picked from commit 0d9231c)
…5767) The PR added src/server/claude-compaction-guard.ts but the architecture map (reference/architecture.md) did not list it, so the architecture-docs CI lane failed with 'missing: src/server/claude-compaction-guard.ts'. Add the entry next to its sibling dsh-compaction-guard.ts.
…ion (handled tier, quiet) When a client's native compaction is detected as a generic rewrite but the client's marker is NOT recognized, the event was always recorded as 'unannounced-rewrite' (alarm tier → fires the conflict banner). When there are no active fold blocks to lose (activeBefore.size === 0), the rebase is clean — the client's own native compaction, not a second compressor. Classify clean-rebase rewrites as 'native-compaction' (handled tier, quiet) instead of 'unannounced-rewrite' (alarm tier) in the openai, anthropic, and google lanes. Dirty rebase (active blocks present) still fires the alarm. Gate-test both directions (#3617): 1. clean rebase (no active blocks) → native-compaction (quiet) 2. dirty rebase (active blocks) → unannounced-rewrite (alarm) Fixes #6653 Fixes #6764 <!-- rcagg:compression-conflict -->
4d59364 to
03fe3ed
Compare
(ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved and pushed. Rebased PR #6774 (branch What I did this run:
Post-push state (verified live via git this run):
结构化八问
判定: 冲突已解决并推送;分支现为 master 之上 4 提交、0 落后(clean fast-forward),本地 typecheck + 47/47 定向测试绿。权威 CI 判定待新 head |
(ai: vllm-qwen/qwen3.8-27b) APPROVE — independent review of the rebased head I re-read the full diff and every touched path against current master (not the pre-rebase head What I verified (independent of floor 3):
Behavior changes (disclosed in PR body, old → new):
Notes (non-blocking):
结构化八问
Verdict: mergeable. Code verified clean, local targeted tests 47/47 + typecheck green, CI static gates green; behavior changes disclosed; no kernel/config/version changes; no small findings to fix on the spot. |
[ework] CI fix verified green ✓ |
Root-cause fix for compression-conflict aggregation (#6768)
What this PR does
Two fixes for the same root cause: client native compaction misclassified as
unannounced-rewrite(alarm tier → fires the conflict banner).Fix 1 — Claude Code native compaction attribution (from PR #6355, cherry-picked with
-x):src/server/claude-compaction-guard.ts: detects Claude Code's native compaction continuation prefix ("This session is being continued from a previous conversation that ran out of context") on the anthropic lane.prepare-anthropic.ts: when the client is Claude Code and the rewrite carries the continuation prefix, classify asnative-compaction(handled tier, quiet) instead of falling through to the generic path.conflict-watch.ts: addchurnAdoptOnlytier informatConflictSection— recoveredid-churn-adoptionevents no longer light the alarm banner.Fix 2 — Clean-rebase classification for unknown clients (#6653):
activeBefore.size === 0), the rebase is clean — the client's own native compaction, not a second compressor.native-compaction(handled tier, quiet) instead ofunannounced-rewrite(alarm tier) in the openai, anthropic, and google lanes.Gate-test both directions (#3617)
tests/issue6653-clean-rebase.test.ts(new, 2 e2e tests):native-compaction(quiet, no banner)unannounced-rewrite(alarm, banner fires)Behavior change (old → new)
unannounced-rewrite(alarm)native-compaction(quiet)unannounced-rewrite(alarm)native-compaction(quiet)unannounced-rewrite(alarm)unannounced-rewrite(alarm) — unchangedFiles changed
src/conflict-watch.ts—churnAdoptOnlytier +churnAdoptNcountersrc/server/claude-compaction-guard.ts— NEW: Claude compaction continuation detectorsrc/server/prepare-anthropic.ts— Claude lane attribution + clean-rebase classificationsrc/server/prepare-openai.ts— clean-rebase classificationsrc/server/prepare-google.ts— clean-rebase classificationsrc/web/client.ts—churnAdoptNin banner computationtests/conflict-lifecycle.test.ts— churnAdoptOnly tier teststests/issue5767-claude-native-compaction.test.ts— NEW: Claude attribution e2e teststests/issue6653-clean-rebase.test.ts— NEW: clean/dirty rebase e2e teststests/web-conflict-banner.test.ts— churnAdoptN banner testsreference/architecture.md— claude-compaction-guard.ts in src mapFixes #6653
Fixes #6764