Skip to content

[PR] fix(conflict-watch): stop recovered id-churn-adoption from lighting the conflict banner - #5787

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-11-06_fix-id-churn-adoption-banner
Open

ranxianglei wants to merge 1 commit into
masterfrom
2026-11-06_fix-id-churn-adoption-banner

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Problem

A session whose ONLY conflict evidence is a recovered id-churn-adoption event was lighting the web compression-conflict alarm banner and being framed in the /acp panel as an outside rewrite / phantom second compressor.

Root cause

#4131 introduced the id-churn-adoption ConflictKind (fold-reconcile re-mints and fully re-anchors ids across builds — 0 unmatched, and it marks NO compaction boundary) but wired only the recording side (prepare-anthropic.ts / prepare-google.ts / prepare-openai.ts). The two display classifiers were never updated, so a pure id-churn-adoption ledger fell into the generic unexplained-signal path:

  • bili_conflictSeverity (src/web/client.ts): signalN = events − plugin − confirmedNative − handledNative dumped id-churn-adoption into the residual → signalN=1 → landed=true → the banner gate fired.
  • formatConflictSection (src/conflict-watch.ts): a pure id-churn ledger hit the signals.length===0 branch → header "something OUTSIDE bili touched this conversation" + "[suspected] confirm each named plugin".

Both contradict the #3235 banner policy ("only landed-unrecovered evidence alarms — recovered stays quiet") and misattribute a bili-owned, self-recovered event to an external actor.

Fix

Behavior change (old → new)

For a session whose only conflict evidence is a recovered id-churn-adoption event:

  • OLD: lit the web alarm banner; /acp framed it as an outside rewrite pointing at a phantom compressor.
  • NEW: stays quiet (banner hidden); /acp frames it correctly as a self-recovered cross-build re-mint.
    Still recorded in acp_status/stats (recorded-but-quiet tier). Rationale: the event is recovered by design (no compaction boundary, 0 unmatched), and (bug)压缩冲突 #3235 says recovered evidence stays quiet.

Config surface

None — no new env/config/default value.

Tests

  • tests/web-conflict-banner.test.ts: pure id-churn-adoption → landed=false, signalN=0, neutralOnly=true; mixed (id-churn + unannounced-rewrite) → signalN=1, landed=true, conflict.on_unconfirmed.
  • tests/conflict-lifecycle.test.ts: pure id-churn → correct header/advice and NOT the outside-rewrite / suspected / keep-one-compressor / auto-compaction wording; mixed → keeps the UNCONFIRMED tier and does not leak the pure-case advice.
    Targeted suite green (37/37 incl. 4 new); typecheck clean; full build green.

Scope note

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

…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
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-06_fix-id-churn-adoption-banner (4a96bad)

Latest build — install this exact version

npm install -g billion-context@0.0.8329-pr.5787.9cdf6ed

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
4a96bad billion-context@0.0.8329-pr.5787.9cdf6ed build

Download artifact

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

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix(conflict-watch): stop recovered id-churn-adoption from lighting the conflict banner [PR] fix(conflict-watch): stop recovered id-churn-adoption from lighting the conflict banner Nov 6, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复——本线程仅此一个修复 PR(#5787),无并列第二 PR。它关闭的原始缺陷是 #5786,已核对标题与其自带诊断(kinds:{"id-churn-adoption":1}、client dsh、win32),正是本 PR 测试复刻并修复的那份账本形状。

核对方式:这是 agent 已完成的工作(带 ework-agent-pr 标记),我按 [PR] 规程拉取分支、逐行核对代码、确认 CI,未重做。head 4a96bad,base master,mergeable(behind)。

结构化八问

  1. 是什么问题:一个会话若唯一的冲突证据是一条「已恢复」的 id-churn-adoption 事件([Bug][opencode lane] Cross-version restart replays the whole session: old v0.1.197 and new v0.1.202 write the same sessions dir, 212 folded refs re-anchor onto churned bytes and the ref map is pruned to 392 raw ids #4131 引入:跨 build 时 fold-reconcile 重新铸造并完全重锚定全部 id,0 unmatched、且不打压缩边界),却会点亮 web 的「压缩冲突告警横幅」,并在 /acp 面板里被说成「bili 之外有东西动过这段对话 / 疑似第二个压缩器」。
  2. 什么原因导致的:[Bug][opencode lane] Cross-version restart replays the whole session: old v0.1.197 and new v0.1.202 write the same sessions dir, 212 folded refs re-anchor onto churned bytes and the ref map is pruned to 392 raw ids #4131 只接了记录侧(prepare-anthropic/google/openai.ts 三处 recordConflict),两个展示分类器从没跟着更新。于是纯 id-churn 账本落进「无法解释的信号」兜底:web 端 signalN = events − plugin − confirmedNative − handledNative 把它算进残差 → landed=true → 横幅触发;/acp 端 formatConflictSection 命中 signals.length===0 分支 → 「something outside bili touched」+「[suspected]」。两者都违背 (bug)压缩冲突 #3235 横幅策略(只有落地未恢复才告警,已恢复保持安静),把 bili 自己已恢复的事件误归因给外部。
  3. 影响范围与严重程度:仅展示层(web 横幅 + /acp/stats 文案)误报,不碰任何压缩/存储/数据正确性——事件本就按设计恢复。严重度=体验瑕疵(p3):用户看到指向「幽灵压缩器」的假告警,被带去无意义排查。触发面:dsh 等插件车道跨 build 发生 id churn 且被 fold-reconcile 完整重锚定的会话(即 Compression conflict banner (bili v0.1.212, node v24.19.0, win32-x64) #5786 报告者场景)。
  4. 怎么修复的(机制层面):把 id-churn-adoption 从「未解释信号」剔除、并入「中性/已恢复」桶——与既有 网页警告问题 #2912 handledNativeN 完全同构。(a) src/web/client.ts bili_conflictSeverity:新增 churnAdoptN = kinds["id-churn-adoption"]||0,signalN = max(0, events − plugin − confirmedNative − handledNative − churnAdoptN),并把 churnAdoptN 加入 neutralOnly 条件;纯账本 signalN=0 → landed=false → 横幅隐藏,混合账本里真正的 unannounced-rewrite/orphan-reap 仍留残差照常告警。(b) src/conflict-watch.ts formatConflictSection:新增 churnAdoptOnly(meaningful 全为 id-churn-adoption)专用 header+advice(「bili 自己跨 build 重铸并完全重锚 id,[Bug][opencode lane] Cross-version restart replays the whole session: old v0.1.197 and new v0.1.202 write the same sessions dir, 212 folded refs re-anchor onto churned bytes and the ref map is pruned to 392 raw ids #4131/The intermediate message (core) is not protocol-agnostic: switching protocols/models causes identity churn; cross-protoc | 中间消息(core)没有做到协议无关:切协议/切模型制造身份 churn,补齐跨协议映射 #3642——没有第二个压缩器、没有要关的自动压缩、无需处置」),纯案例门控,混合账本原样保留 UNCONFIRMED 档。
  5. 是否有回归问题:逐项核过——无 id-churn 输入下 siblingOnly/neutralOnly/landed/onKey 各档逐字节不变(churnAdoptN=0);把 id-churn 减出残差不会掩盖真信号(unannounced-rewrite/orphan-reap 不是该 kind,仍计入);max(0,…) 防负;ladder 新分支插在 handledNativeOnly 之后、orphanOnly 之前,纯门控与 网页警告问题 #2912/feat: surface identity-loss takeovers with an identity-orphan conflict event (#2791) #2802 同纪律,混合账本不泄漏纯案例措辞(有专门断言钉住);isNeutralEvent/isConfirmedConflictEvent 对 id-churn 均 false,纯账本能正确到达 meaningful→新分支。无阈值/时序/输出格式漂移。结论:无回归。
  6. 是否破坏缓存:不涉及——只改展示分类,不碰折叠/快照/缓存键。
  7. 是否改了设计方向:不涉及——沿用 (bug)压缩冲突 #3235/网页警告问题 #2912「已恢复证据保持安静」策略,只把漏接的 id-churn-adoption 补进同一桶。
  8. 是否引入新的配置:不涉及——无新 env/config/默认值(PR 自述 Config surface: None)。

完整性核查(§7.5 首过不全风险):全仓 grep id-churn-adoption——master 上只有类型定义 + 三处记录侧;展示侧仅两个分类器(formatConflictSection 唯一调用方 src/acp-status.ts:491 即 /acp+stats;bili_conflictSeverity 即 web 横幅),两处均已修,无第三个遗漏面。

测试有效性(§7.2 双向门控):tests/web-conflict-banner.test.ts 纯→landed:false/signalN:0/neutralOnly:true,混合→signalN:1/on_unconfirmed/landed:true;tests/conflict-lifecycle.test.ts 纯→正确 header/advice 且不含 outside-rewrite/suspected/keep-one-compressor/auto-compaction 措辞,混合→保留 UNCONFIRMED 且不泄漏纯案例 advice。断言正负双向、有牙,bug 回归抓得住。

CI:head 4a96bad 全绿——30 checks,0 failed,0 pending(ubuntu/windows × node 22/24 各分片 success,red-signal skipped)。本地无 node_modules,未重复全量跑(CI 为权威裁决)。

行为变更披露确认:PR body 已明确 old→new(旧:点横幅 + /acp 指幽灵压缩器;新:安静 + /acp 正确描述为自恢复跨 build 重铸),符合交付规范第 4 条。

判定:可合。 方向对(修根因——补上漏接的展示分类器,而非过滤症状)、范围干净(4 文件 +68/−3)、双向测试齐备、CI 全绿、无回归、行为变更已披露。建议 owner 直接合并 #5787。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

核验完成(GitHub PR #5791,分支 2026-11-06_tier2-merge-ladder,head 063370639)。按八问给结论:

1. 是什么问题:历史块「毒块」永久杀死 T2 蒸馏合并——一个覆盖切穿回合组(伙伴仍在 span 外可见)的历史块,会让所有跨越它的合并永远硬失败,且两条建议出路(对齐整回合 / 少合几个)对历史块边界都不可执行。

2. 什么原因导致的:根因在 kernel 共享投影判定(projectUnit 合并分支):survivingCoverage 是全局的,一个毒块毒死全部合并;门把「被消费块拥有的 withdrawn id」判为致命、无恢复路径;而宿主侧覆盖回归守卫(#3322/#4484)又禁止朴素替代(展开已覆盖 id)。所以修复必须落在判定所在层(kernel)——PR 已按 Kernel Boundary 声明 kernel-change。

3. 影响范围与严重程度:长会话中存在历史 mid-turn 块的插件车道(dsh threads 模型等宿主)——受影响会话的蒸馏合并整体停摆,上下文只增不缩,核心压缩能力对该类会话不可用。触发条件明确(历史块覆盖切穿回合 + 伙伴在 span 外),非全量用户面。

4. 怎么修复的:三级阶梯,全在 projectUnit 合并分支内——①容忍合并中性冲突(unresolved id 与本次新折内容无交集 → 带警告继承,让干净块正常蒸馏);②把肇事的被消费块从消费中排除(保持 ACTIVE、覆盖不动)重放投影,递归有界(<64);③仅不可修复 span 才拒,拒绝文案点名冲突 ref、覆盖块和具体下一步,保留宿主/#4484 依赖的关键短语。

5. 是否有回归问题:审过 diff 触碰的既有行为——turn-integrity 门禁语义(对中性冲突变软,有意变更已披露)、空 span fatal 由 zone 改 split(zone fatal 在 #4521 下本就是 no-op 成功,现改为可行动 split,已披露)、拒绝文案措辞(关键短语保留,#4484 套件通过验证)、覆盖不变量「合并永不丢既有覆盖」(演进版 #4484 套件 + 新套件 post⊆pre 断言双重钉住)。无 fail-fast 变吞错:真冲突照旧拒绝。核验中发现一处未披露的行为变更并已补进 PR 正文:毒块自引用区间(b4..b4)master 上硬失败 → 本 PR 变为幂等 no-op(「folded nothing」警告、状态不动)——同属 refuse→recover 家族,已在 Behavior changes 节补一行。另修了一处测试注释与事实不符(称自引用是「master 既有 no-op 行为、零宽 span」,实测 master 硬失败且 span 嵌套自身)——独立 commit 063370639 推入 PR 分支,纯注释修正,套件复跑 3/3 绿。

6. 是否破坏缓存:不涉及——无 wire/cache/persistence 变更;被排除块保持 active、覆盖集不变;消息 ref/id 空间未触碰。

7. 是否改了设计方向:无转向——扩展既有共享单元投影设计(#3236),新增字段 excludeNestedBlockIds 为纯内部重试通道(projectUnit 自己设置,外部不可达);与 PR #5777(advertise 侧)零文件重叠、可先后可前(若 #5777 先合,本分支需机械性 rebump 0.0.183→0.0.184 + lockfile regen,PR 正文已注明)。

8. 是否引入新配置:无——无 config/env/CLI 新增(diff 核实)。

证据:

判定:代码正确、测试有牙、披露完整,未发现拦下项。Kernel 变更按边界规则需人工评审——等 owner 评审后自行合并(我不合并)。CI 全分片转绿即无任何遗留。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

⚠️ 误发说明:上一条(floor 5,「核验完成」八问报告)是另一会话误发到本线程的——它是 GitHub PR #5791(分支 2026-11-06_tier2-merge-ladder,kernel T2 蒸馏合并恢复)的核验结论,与本线程(GitHub PR #5787,conflict-watch 横幅修复)无关。出错原因:该 PR 所修 GitHub issue 的编号(#5789)与本线程的镜像号数字相同,会话把两个编号空间混了。同一份报告已在正确线程(镜像 #5793)重新发布。本线程自己的审核结论(floor 3)不受影响、维持原判;请忽略 floor 5 那条误发评论。

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.212, node v24.19.0, win32-x64)

1 participant