Skip to content

[PR] fix(conflict-watch): classify clean-rebase rewrites as native-compaction (quiet) + attribute Claude native compaction - #6774

Open
ranxianglei wants to merge 4 commits into
masterfrom
2026-11-15_compression-conflict-root-cause
Open

ranxianglei wants to merge 4 commits into
masterfrom
2026-11-15_compression-conflict-root-cause

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

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):

  • New 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 as native-compaction (handled tier, quiet) instead of falling through to the generic path.
  • conflict-watch.ts: add churnAdoptOnly tier in formatConflictSection — recovered id-churn-adoption events no longer light the alarm banner.

Fix 2 — Clean-rebase classification for unknown clients (#6653):

  • When a generic rewrite is detected and 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 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)

tests/issue6653-clean-rebase.test.ts (new, 2 e2e tests):

  1. clean rebase (no active blocks) → native-compaction (quiet, no banner)
  2. dirty rebase (active blocks) → unannounced-rewrite (alarm, banner fires)

Behavior change (old → new)

Scenario Old New
Claude Code native compaction (anthropic lane) unannounced-rewrite (alarm) native-compaction (quiet)
Unknown client, no active fold blocks unannounced-rewrite (alarm) native-compaction (quiet)
Unknown client, active fold blocks present unannounced-rewrite (alarm) unannounced-rewrite (alarm) — unchanged
Recovered id-churn-adoption lights alarm banner neutral section (no banner)

Files changed

  • src/conflict-watch.ts — churnAdoptOnly tier + churnAdoptN counter
  • src/server/claude-compaction-guard.ts — NEW: Claude compaction continuation detector
  • src/server/prepare-anthropic.ts — Claude lane attribution + clean-rebase classification
  • src/server/prepare-openai.ts — clean-rebase classification
  • src/server/prepare-google.ts — clean-rebase classification
  • src/web/client.ts — churnAdoptN in banner computation
  • tests/conflict-lifecycle.test.ts — churnAdoptOnly tier tests
  • tests/issue5767-claude-native-compaction.test.ts — NEW: Claude attribution e2e tests
  • tests/issue6653-clean-rebase.test.ts — NEW: clean/dirty rebase e2e tests
  • tests/web-conflict-banner.test.ts — churnAdoptN banner tests
  • reference/architecture.md — claude-compaction-guard.ts in src map

Fixes #6653
Fixes #6764

@ranxianglei ranxianglei changed the title fix(conflict-watch): classify clean-rebase rewrites as native-compaction (quiet) + attribute Claude native compaction [PR] fix(conflict-watch): classify clean-rebase rewrites as native-compaction (quiet) + attribute Claude native compaction Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-15_compression-conflict-root-cause (03fe3ed)

Latest build — install this exact version

npm install -g billion-context@0.0.10789-pr.6774.36406af

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
03fe3ed billion-context@0.0.10789-pr.6774.36406af build
4d59364 billion-context@0.0.10045-pr.6774.e8ef26a build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr6774.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重: 不重复 — 本 PR 是 compression-conflict 聚合线程(#6768, 成员 #6653 + #6764)的唯一修复 PR。在途的 #6355 与 #5787 是前序 PR, 其内容已被本 PR cherry-pick(-x)完整吸收, 被本 PR 取代(见文末说明)。镜像 open [PR] 行中本主题仅此一条, 无并列第二 PR。

这是 [PR] 线程(ework-agent-pr 标记) — 上游工作已完成, 我未重做; 拉取分支、核对代码、核查 CI, 报告结论。

已核查(分支 2026-11-15_compression-conflict-root-cause, head 4d59364dfc, base = 当前 master f21b601893, mergeable):

  • Fix 1 — Claude 归因(src/server/claude-compaction-guard.ts 新增 + src/server/prepare-anthropic.ts): 续句检测器与 dsh 检测器同纪律, 三道门(carrier: user+text / novelty: id 不在 pre-turn ref map / standalone: 句首匹配)。版本钉死前缀 — Claude 若改措辞, 检测退化为 miss, 绝不误报。车道门 profile.identity === "claude-responses" || conflictClientOf(session) === "claude" 已端到端验证: Claude Code 发 x-claude-code-session-id → sniffScanClient → clientHint = "claude"。dsh 路径逐字节未变(authored 现正确按 dshFramed 门控, claude 落地不可能置 dshAuthoredCheckpointLanded)。
  • Fix 2 — clean rebase(三车道 anthropic/openai/google): cleanRebase = activeBefore.size === 0 在 processTurn 前捕获, 反映上一轮末的活跃块。无活跃块 ⇒ rewrite 不可能丢任何折叠基 ⇒ 归 native-compaction(handled, 静默)而非 unannounced-rewrite(告警)。markCompactionBoundary 在所有情况仍照调 — 仅账本级分类变化。dshWitness 推断路径优先于 cleanRebase(未变)。
  • Fix 3 — churnAdoptOnly(src/conflict-watch.ts + src/web/client.ts): 纯 id-churn-adoption 账本得中性措辞("bili 自身跨构建重铸 id 并已完全重锚 — 无第二压缩器, 无数据丢失"), 且从 signalN 扣除 / 计入 neutralOnly。门控到纯情形 — 混合账本逐字保留既有 tier。
  • 测试: 本地在本分支跑 4 个定向文件: 47/47 通过(issue6653-clean-rebase clean/dirty 双向、issue5767-claude-native-compaction 1 正 + 5 负 + 漂移钉、conflict-lifecycle 纯 adoption 中性 + 混合保留 unconfirmed、web-conflict-banner adoption-only 静默 + 混合仍告警)。npm run typecheck 干净。gate 双向均按 Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 断言。
  • CI(实时核对, head 4d59364dfc): 静态门(Wave 1, 12 个 check-suite: architecture-docs / unused-exports / lock-sync / config-surface-guard / kernel-guard / lane-guard / docs-sync / docs-coverage / plan / gate / mysql-contract 等)全绿。测试矩阵(主 CI workflow, 11 shards × ubuntu/windows × node 22/24)在起跑后 ~2s 被外部整批取消(21:02:13Z → 21:02:15Z), 零失败 — 与 CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 在档的外部取消事件模式一致(floor 1345/1349/1371: 整 run 秒级取消、零失败、runner 池饱和期), 非代码失败。按风暴期先例我未重触发; 测试矩阵需一次重跑才能产出权威绿/红。代码本地已验证(47/47 + typecheck), 重跑预期绿。

结构化八问

  1. 是什么问题: 客户端自身的 native compaction(Claude Code 自动压缩, 或未知客户端的压缩落地)被记进冲突账本为 unannounced-rewrite(告警级), 为 bili 本已处理好的"自家家务"点亮"第二压缩器"横幅。
  2. 什么原因导致的: anthropic 车道的落地检测器只认 dsh 的 checkpoint 框架, Claude Code 的续句落进通用 rewrite 检测器 — 后者看得见缺口但归不了因。另外通用检测器没有"没丢东西"的概念: 零活跃折叠块的 rewrite(clean rebase)仍被归到告警级。
  3. 影响范围与严重程度: anthropic 车道(Claude Code)与 openai/google 车道上遇到"客户端 native compaction 且无活跃折叠块"的用户 — 误报横幅 + "先查插件"的无用功。体验缺陷, 非数据/安全问题: rebase 本身一直在做, 只有账本分类错了。
  4. 怎么修复的: 在源头归因 — (a) 给 claude 车道一个与 dsh 同纪律的框架检测器(标记 + rebase, handled 级); (b) 检测到的 rewrite 若无活跃块可丢, 归 native-compaction(handled, 静默)而非 unannounced-rewrite(告警); (c) 纯 recovered id-churn-adoption 账本给中性措辞。脏 rebase(有活跃块)仍触发告警 — gate 双向断言。
  5. 是否有回归问题: 已审触碰路径的既有行为: dsh 标记路径未变(同阈值、同 rebase, authored 现正确按车道门控); dshWitness 推断路径优先且未变; markCompactionBoundary/applyCompactionArchive 在所有情况照旧调用; 混合账本逐字保留既有 tier(纯情形门控, 同 网页警告问题 #2912 纪律)。无 fail-fast→吞错漂移, 无阈值/时序漂移。
  6. 是否破坏缓存: 否。前缀缓存路径无改动; rebase 语义(归档/重锚什么)未变 — 只变账本事件种类与横幅 tier。
  7. 是否改了设计方向: 否。把既有 marker+rebase 模式(dsh [bug] DSH 桌面端 0.1.188:宿主原生压缩落地摧毁折叠基底 → 同一区间永久不可锚定、compress 连片失败并熔断(compaction-basic auto:false 仍无效) #2432/[bug] dsh 原生压缩单轮 rebase 兜底缺失于 anthropic 线路(#2432 修复未覆盖):checkpoint 落地后 ACP 状态永久失效 #2658, codex fix: rebase fold substrate on Codex local auto-compaction (#2372) #2373)扩到 claude 车道, 并给通用检测器加一个 handled 级分类。无架构转向。
  8. 是否引入了新的配置: 无新 env / config key。

行为变更(old → new, PR 正文已披露): Claude Code native compaction(anthropic 车道): unannounced-rewrite(告警) → native-compaction(静默); 未知客户端且无活跃折叠块: 告警 → 静默; 未知客户端且有活跃块: 不变(仍告警); 纯 recovered id-churn-adoption: 告警横幅 → 中性段。

说明:

结论: 代码核对干净、本地定向测试 47/47 + typecheck 绿、CI 静态门全绿; 测试矩阵被外部整批取消(在档模式, 零失败, 非代码问题), 需一次重跑产出权威绿。代码可合, 待测试矩阵重跑转绿; 无需改代码。要我现在重跑被取消的测试矩阵吗?(runner 池饱和期, 按先例默认不重触发, 等你一句话。)

ci-check added 4 commits November 18, 2026 17:51
…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 -->
@ranxianglei
ranxianglei force-pushed the 2026-11-15_compression-conflict-root-cause branch from 4d59364 to 03fe3ed Compare November 18, 2026 09:55
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Merge conflict resolved and pushed. Rebased PR #6774 (branch 2026-11-15_compression-conflict-root-cause) onto current master.

What I did this run:

  • The PR branch was 4 commits ahead / 244 behind master (merge base f21b601893); 5 files were touched by both the PR and master after that base.
  • Rebased onto origin/master (548e396022). One conflict, in src/server/prepare-anthropic.ts (import block): master had added countAnthropicSystemCacheControls, countAnthropicToolsCacheControls, pinClientMessageMarks to the loop/cache-control.js import, while the PR added conflictClientOf to the conflict-watch.js import. Resolved as the union of both sides — every one of those symbols is actually used in the merged body (verified by grep). The other 4 overlapping files (prepare-openai.ts, prepare-google.ts, src/web/client.ts, reference/architecture.md) auto-merged cleanly.
  • Verified the rebase preserved both sides: the rebased diff vs master is exactly the PR's original footprint (759+/24- across the same 11 files); master's additions (e.g. the ~368-line client.ts growth) are intact, and the PR's churnAdoptN / clean-rebase / claude-attribution logic are all present.
  • Local verification: npm run typecheck exit 0; the 4 targeted PR test files pass 47/47 (conflict-lifecycle, issue5767-claude-native-compaction, issue6653-clean-rebase, web-conflict-banner).
  • Force-pushed (sanctioned for this conflict-rebase): remote head 4d59364dfc → 03fe3edc61.

Post-push state (verified live via git this run):

  • Merge base of the branch and master is now 548e396022 (= current master head); the branch is 4 ahead / 0 behind master → no conflict, clean fast-forward.
  • CI: the mirror check-cache is stale in this run (last fetch 2026-11-14, still showing the pre-rebase sha 4d59364dfc) and did not refresh during this run, so I cannot report a live CI verdict for the new head 03fe3edc61 yet. This push triggers one full CI pass; the authoritative green/red is that run, which the mirror/CI will pick up on its next poll. I verified the touched area locally (typecheck + 47/47) but am not asserting CI green from the stale cache.

结构化八问

  1. 是什么问题: PR [PR] fix(conflict-watch): classify clean-rebase rewrites as native-compaction (quiet) + attribute Claude native compaction #6774 与 master 产生合并冲突(merge state dirty)——分支落后 master 244 个提交,prepare-anthropic/openai/google.ts、client.ts、architecture.md 在 merge base 之后被 PR 与 master 各自改动,无法合并。
  2. 什么原因导致的: 分支基于旧 master(f21b601893)开出,此后 master 在那些文件上持续演进,与 PR 的改动在 import 块等处重叠,产生内容冲突。
  3. 影响范围与严重程度: 仅该 PR 无法合并(阻塞合并),不影响任何运行中实例;非数据/安全问题。
  4. 怎么修复的: 把分支 rebase 到当前 master;唯一冲突(prepare-anthropic.ts import 块)按两侧并集解决——master 新增的 cache-control 符号与 PR 新增的 conflictClientOf 都保留(合并后正文两侧都用到了,已 grep 验证);其余重叠文件自动合并。
  5. 是否有回归问题: 已核对——rebase 后 diff vs master 与 PR 原始 footprint 完全一致(759+/24-),master 既有改动(如 client.ts 的 ~368 行新增)未被覆盖,PR 的 clean-rebase / claude 归因 / churnAdoptN 逻辑完整保留;typecheck 绿 + 4 个定向测试文件 47/47 通过。无 fail-fast→吞错,无阈值/时序/输出格式漂移。
  6. 是否破坏缓存: 不涉及——本次仅解决 import 冲突,未触碰任何缓存/前缀缓存/重试/游标逻辑。
  7. 是否改了设计方向: 不涉及——纯机械 rebase,无架构/数据流转向。
  8. 是否引入了新的配置: 不涉及——无新 env / config key。

判定: 冲突已解决并推送;分支现为 master 之上 4 提交、0 落后(clean fast-forward),本地 typecheck + 47/47 定向测试绿。权威 CI 判定待新 head 03fe3edc61 的 CI run 被镜像/CI 拾取后产出(本轮镜像缓存 4 天未刷新,不据陈旧数据下 CI 结论)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

APPROVE — independent review of the rebased head 03fe3edc61 (4 commits on master 548e396022, 4 ahead / 0 behind).

I re-read the full diff and every touched path against current master (not the pre-rebase head 4d59364dfc that floor 3 reviewed). Verdict: the code does what it claims, the tests are real and gate-tested both directions, and the behavior changes are disclosed. No kernel / config / version changes. No small findings to fix.

What I verified (independent of floor 3):

  • Clean-rebase predicate (cleanRebase = activeBefore.size === 0, all 3 lanes): activeBefore is captured BEFORE processTurn (anthropic src/server/prepare-anthropic.ts:297, openai src/server/prepare-openai.ts:225, google src/server/prepare-google.ts:155), reflecting end-of-previous-turn active blocks. syncBlocks runs INSIDE processTurn (kernel), so the capture is the correct pre-rewrite state. Sound: no active blocks ⟹ no fold base to lose ⟹ no double-compression risk ⟹ quiet is correct. markCompactionBoundary(session) is still called UNCONDITIONALLY in every detected-rewrite case (anthropic :504, openai :441, google :305) — rebase/archive behavior byte-identical; only the ledger event kind + log wording change.
  • Claude framing detector (src/server/claude-compaction-guard.ts, new): three gates (carrier: role=user + contentType=text; novelty: id not in the pre-turn ref map; standalone: text starts with the version-pinned continuation prefix). Lane-scoped (profile.identity === "claude-responses" || conflictClientOf(session) === "claude", prepare-anthropic.ts:354). The framing check runs BEFORE processTurn (:360), so the active-block gate reads the pre-turn state. Version-pinned prefix — drift degrades to a miss, never a false positive.
  • dsh path byte-equivalence: authored = dshFramed && carriesBiliSnapshotCheckpoint(msgs) — for a pure dsh session, dshFramed is true only if (dsh summary || bili checkpoint), and a bili checkpoint ⟹ dshFramed, so authored is unchanged; the else branch records "dsh native compaction" identically to before.
  • Classification ladder (anthropic, post-processTurn, if (!nativeRebased)): churnExplained → id-churn-adoption (no boundary) → dshWitness → native-compaction-inferred (boundary) → cleanRebase → native-compaction (boundary, quiet) → else → unannounced-rewrite (boundary, alarm). dshWitness keeps precedence over cleanRebase (unchanged).
  • Banner computation (src/web/client.ts): churnAdoptN is subtracted from signalN and included in neutralOnly; landed = hasConfirmed || signalN > 0 → a pure id-churn-adoption ledger → landed=false → quiet. Consistent with the (bug)压缩冲突 #3235 banner policy.
  • Tests (ran locally on the rebased head, 47/47 pass): tests/issue6653-clean-rebase.test.ts (openai lane, clean/dirty both directions), tests/issue5767-claude-native-compaction.test.ts (anthropic lane, positive + negatives + drift pin), tests/conflict-lifecycle.test.ts (pure adoption neutral + mixed keeps unconfirmed), tests/web-conflict-banner.test.ts (adoption-only quiet + mixed still alarms). All gate-tested both directions (Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617).
  • CI (mirror cache, head 03fe3edc61): static-gates lanes green; the test matrix was still in_progress in the cached snapshot — the task states the PR is green, and my local targeted run (47/47) corroborates.

Behavior changes (disclosed in PR body, old → new):

  • Claude Code native compaction (anthropic lane): unannounced-rewrite (alarm) → native-compaction (quiet).
  • Unknown client, no active fold blocks: alarm → quiet.
  • Unknown client, active fold blocks present: unchanged (alarm).
  • Pure recovered id-churn-adoption ledger: alarm banner → neutral section.

Notes (non-blocking):

结构化八问

  1. 是什么问题: 客户端自身的 native compaction 被冲突账本误判为 unannounced-rewrite(告警级), 点亮"第二压缩器"横幅 — 具体是 Claude Code 自动压缩(anthropic 车道)和未知客户端在无活跃折叠块时的压缩落地(openai/anthropic/google 车道)。
  2. 什么原因导致的: anthropic 车道的落地检测器只认 dsh 的 checkpoint 框架, Claude Code 的续写句不在已知框架里, 落进通用 rewrite 检测器 — 后者看得见缺口(历史被缩短)但归不了因(不知道是谁的哪种压缩)。通用检测器也没有"没丢东西"的概念: 零活跃折叠块的 rewrite(clean rebase)仍被归到告警级。
  3. 影响范围与严重程度: anthropic 车道(Claude Code)与 openai/google 车道上遇到"客户端 native compaction 且无活跃折叠块"的用户 — 误报横幅 + "先查插件"的无用功。体验缺陷, 非数据/安全问题: rebase 本身一直在做(markCompactionBoundary 照调), 只有账本分类错了。
  4. 怎么修复的: 在源头归因 — (a) 新增 claude-compaction-guard.ts, 给 claude 车道一个与 dsh 同纪律的三关检测器(carrier/novelty/standalone), 命中则归 native-compaction(handled, 静默)并 rebase; (b) 通用路径加 clean-rebase 谓词(activeBefore.size === 0, processTurn 前捕获) — 无活跃块可丢 ⇒ 无双压缩风险 ⇒ 归 native-compaction(静默)而非 unannounced-rewrite(告警); (c) 纯 recovered id-churn-adoption 账本给中性措辞, 从 signalN 扣除。脏 rebase(有活跃块)仍触发告警。
  5. 是否有回归问题: 已审触碰路径的既有行为 — dsh 标记路径字节等价(authored 现按 dshFramed 门控, 纯 dsh 会话判定不变); dshWitness 推断路径优先且未变; markCompactionBoundary/applyCompactionArchive 在所有重写情况照旧无条件调用(rebase 行为不变); 混合账本逐字保留既有 tier(纯情形门控, 同 网页警告问题 #2912/feat: surface identity-loss takeovers with an identity-orphan conflict event (#2791) #2802 纪律); 三车道的 cleanRebase 谓词一致。无 fail-fast→吞错, 无阈值/时序/输出格式漂移。
  6. 是否破坏缓存: 否。前缀缓存路径无改动; rebase 语义(归档/重锚什么)未变 — 只变账本事件种类与横幅 tier。
  7. 是否改了设计方向: 否。把既有 marker+rebase 模式(dsh [bug] DSH 桌面端 0.1.188:宿主原生压缩落地摧毁折叠基底 → 同一区间永久不可锚定、compress 连片失败并熔断(compaction-basic auto:false 仍无效) #2432/[bug] dsh 原生压缩单轮 rebase 兜底缺失于 anthropic 线路(#2432 修复未覆盖):checkpoint 落地后 ACP 状态永久失效 #2658, codex fix: rebase fold substrate on Codex local auto-compaction (#2372) #2373)扩到 claude 车道, 并给通用检测器加一个 handled 级分类(cleanRebase)。无架构/边界/数据流转向。
  8. 是否引入了新的配置: 否。无新 env / config key / 默认值。

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.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compression conflict banner (bili v0.1.214, node v22.20.0, win32-x64) Compression conflict banner (bili v0.1.213, node v22.15.0, darwin-arm64)

1 participant