Skip to content

[PR] Remove the allowDshCompaction escape hatch: dsh native compaction refused unconditionally (#3666) - #3672

Merged
ranxianglei merged 4 commits into
masterfrom
2026-10-18_remove-allowdshcompaction
Oct 20, 2026
Merged

ranxianglei merged 4 commits into
masterfrom
2026-10-18_remove-allowdshcompaction

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Closes #3666

Owner directive from the #3651 thread (「这个应该坚决拦截…直接删除这个配置 避免造成损失」): the #2028 dsh.allowDshCompaction opt-in existed so a user could deliberately let dsh native compaction land through bili. A landed dsh checkpoint durably shadows the raw conversation history — irreversible, and it destroys the proxy's compression substrate (#1729/#2432) — so the escape hatch is deleted outright instead of kept off-by-default.

config surface (mandatory section)

Removed:

  • dsh.allowDshCompaction (config file: nested dsh.* + legacy bare top-level position)
  • BILI_ALLOW_DSH_COMPACTION env var
  • web config page field + PUT acceptance of any dsh body
  • ProxyOptions.allowDshCompaction, allowDshCompactionState(), legacy auto-relocation

Why no existing surface can express what's left: none should — the point is that NO surface may express "let irreversible substrate destruction happen". The #1729 wire guard becomes unconditional on every lane (openai / anthropic / responses / passthrough).

Migration / compat:

Behavior change disclosure (mandatory)

before after
dsh native compaction call, default 422 refused (every lane) unchanged
dsh native compaction call, key/env ON forwarded & may land (irreversible shadowing) 422 refused unconditionally
leftover key/env in user config honored ignored + one-time deprecation warning naming it
web config page exposed the switch field gone; structured dsh writes → 400

WHY: owner decision in #3651 — an opt-in to irreversible damage should not exist as a knob at all; "off by default" still leaves one toggle away from a destroyed session.

Cross-branch note (resolved in rebase)

#3653 (attribution reporting contract) merged to master before this rebase. Its durable trace line in src/agent/dsh-native.ts ended with "…and remember dsh.allowDshCompaction (#2028), when on, lets such checkpoints through" — that sentence no longer holds and was updated during this rebase (the opt-in is gone; the #1729 wire guard refuses unconditionally since #3651). The trace itself stands unchanged.

Verification

  • local typecheck clean
  • targeted suites green: issue2028-dsh-compaction-toggle (rewritten removal contract, 5/5), issue2709-passthrough-compaction-guard (opt-out test inverted to "legacy env ignored", 6/6), issue1815-unknown-top-level-keys (surface fixture uses empty dsh section, 4/4), config-surface-guard (section re-seeded as leaf dsh, 5/5)
  • full-suite verdict: remote CI on this head

@ranxianglei ranxianglei changed the title Remove the allowDshCompaction escape hatch: dsh native compaction refused unconditionally (#3666) [PR] Remove the allowDshCompaction escape hatch: dsh native compaction refused unconditionally (#3666) Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-18_remove-allowdshcompaction (df16184)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4704-pr.3672.8c55ad6

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

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr3672.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)

查重: 不重复 — open/closed issue 与 PR 中检索 allowDshCompaction / dsh native compaction escape hatch 均无同类在途条目;本 PR 是 #3651 线程 owner 指令(「直接删除这个配置」)的唯一落地实现,且 Closes #3666。

标签: bug, dsh, scope/wiring, p2 — 缺陷类(配置面存在可致不可逆会话破坏的开关);客户端仅涉及 dsh;改动核心在协议接线层(#1729 wire guard + web config API);默认路径本就安全、危害仅在显式 opt-in 时发生,故 p2。

这是 [PR] issue:按规程不重做,正在拉取分支核对代码与 CI。初步状态:head 7f412a0e8 上 CI 除 test (windows-latest, 22, 2) 仍在跑外全绿(ubuntu 22/24 三 shard、windows 22 shard 1、static-gates 双平台、kernel-guard / pi-subagents-guard / config-surface-guard / version-guard / docs 门全部通过)。继续逐文件审 diff,结论稍后按八问给出。

ranxianglei pushed a commit that referenced this pull request Oct 18, 2026
…eview nit)

Continuation lines in the FileConfig.dsh field comment (src/config.ts) and the
dshLedgerFloorTokens doc block (src/server/budget.ts) carried one extra leading
space versus their surrounding blocks. Whitespace-only.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

逐文件审完 diff(19 文件,+216/−257)、核过 CI、验证了跨分支注记。八问结论:

1. 是什么问题:#2028 的 dsh.allowDshCompaction 逃生门允许用户显式放行 dsh 原生压缩调用——而落地的 dsh checkpoint 会永久覆盖原始会话历史、摧毁 bili 压缩基底(不可逆)。owner 在 #3651 拍板:这个开关不该存在,整体删除而非默认关闭。

2. 什么原因导致的:不是 bug,是设计面风险——#2028 当时作为「默认关 + 显式 opt-in」落地,但 opt-in 指向的是不可逆操作。根因层:配置面暴露了一个 ON 态 = 不可逆会话破坏的旋钮;本 PR 把该面从配置面、环境变量、web API、ProxyOptions 四个位置全部拿掉,guard 变无条件。

3. 影响范围与严重程度:默认用户零变化(一直 422 拒绝);显式开过键/env 的用户,其 dsh 压缩调用从「可转发落地」变为「一律 422」——这是披露过的有意变更;遗留键/env 的用户:值被忽略 + 一次性点名弃用警告,用户文件永不被改写。p2:默认路径本就安全,危害仅在显式 opt-in 时发生,修复后入口彻底消失。

4. 怎么修复的(机制层面):两处 guard(passthrough 无归因 lane + attributed openai/anthropic/responses lane)删除 allowDshCompaction !== true 条件 → 无条件拒绝;ProxyOptions.allowDshCompaction/allowDshCompactionState()/顶层自动迁移删除;DshFileSettings 改 Record<string, unknown>——段仍被 RECOGNIZED(不触发 unknown-key 警告),任何键忽略 + 按签名去重的一次性弃用警告;web GET 不再返回字段、结构化 dsh PUT → loud 400、whole-file 保存逐字保留残留键(惰性);refusal message 不再广告已死的 opt-in,改指宿主侧抑制(#3354/#2474/bundle patch);launcher 对 native install 无条件打印 armed 警告(以前仅在键关闭时打印——开了键的用户现在启动会多一行 stderr,属披露行为变更的一部分);文档中英 + website yaml 同步标 REMOVED。warnRemovedDshAllowKey 对畸形 dsh 值(string/array)有类型守卫,不会崩也不会产出垃圾警告。

5. 是否有回归问题:逐项过既有行为——默认 422 全 lane 拒绝:保持(测试钉死);knob ON 转发:有意变更(旧→新+原因已在 PR 正文与 CONFIGURATION 双语文档披露);遗留键加载 honored→ignored+warned:有意+披露;web GET/PUT 契约:字段消失/dsh 写 400,有意+披露,空体校验保持(测试 D 钉住 "expected providers…");passthrough lane 对不可解码体的 fail-open(verbatim relay):不变;#2490 floor 语义(budget.ts):仅注释,逻辑未动;post-landing recovery 四 lane 的 rebase 逻辑:不变,仅注释去掉已删旋钮引用;阈值/时序/输出格式无漂移;refusal 文案变化为有意且测试同步。结论:未发现无意回归。

6. 是否破坏缓存:不涉及。拒绝发生在压缩处理之前;会话身份/前缀缓存/fold 策略未触碰;refusal ledger(session.metadata.dshCompactionRefused)机制不变。

7. 是否改了设计方向:不转向。纯收缩配置面 + guard 无条件化;宿主侧抑制(bundle patch auto:false / #3354 加载期 overlay / #2474 完整快照覆盖)仍是官方推荐路径,文档与 refusal message 一致指向它。

8. 是否引入新配置:零新增;两个移除(dsh.allowDshCompaction 含 legacy 顶层位置 + BILI_ALLOW_DSH_COMPACTION)。迁移方式:什么都不做即可(忽略+警告),手动删键可消警告。

测试有效性(④):issue2028 suite 重写为移除契约——真实 server + 真实 mock upstream,断言有牙(422 + error.code + 上游零捕获 + 文件字节比对 + env 每进程一次去重 + 残留键惰性);issue2709 的 opt-out 测试反转为「legacy env=1 → 仍 422、上游零捕获」——谁再把旋钮加回来都会被抓住;负向覆盖完整(普通流量字节级透传、gzip 解码路径、fail-open、method gate)。config-surface-guard golden anchor 从 dsh.allowDshCompaction 重播种为叶 dsh,ledger 未缩水。

diff 整洁度(⑤):干净,每行都服务移除目的,双语同步,无锁文件/生成物 churn。

顺手小修(独立标注 commit):评审发现本 PR 新增的两个注释块续行各多一个前导空格(src/config.ts FileConfig.dsh 字段注释 4 行、src/server/budget.ts dshLedgerFloorTokens doc 块 4 行)——纯空白,已推独立 commit 9cf601ff8 到 PR 分支。

跨分支注记已核实:master 的 src/agent/dsh-native.ts 无 #2028 引用;那句话只在 #3653 分支上(refs/pull/3653/head 的 src/agent/dsh-native.ts:2008:「…and remember dsh.allowDshCompaction (#2028), when on, lets such checkpoints through…」)。若本 PR 先合,#3653 rebase 时需更新那一句(trace 本身仍成立)。

CI:新 head 9cf601ff8 上全部快速门(kernel-guard / pi-subagents-guard / config-surface-guard / version-guard / docs-sync / static-gates ubuntu 等)已绿,7 个 test shard 在跑;上一 head 7f412a0e8 除 windows-22 shard 2 外全绿,而我的追加 commit 是注释内纯空白,无行为面。判定:建议合并——待 test shard 全绿即可合;若 shard 有红我会跟进定向排查。

@ranxianglei

Copy link
Copy Markdown
Owner Author

解决冲突 重新review

@ranxianglei
ranxianglei force-pushed the 2026-10-18_remove-allowdshcompaction branch from 9cf601f to 3b5dd22 Compare October 20, 2026 05:19
ranxianglei pushed a commit that referenced this pull request Oct 20, 2026
…eview nit)

Continuation lines in the FileConfig.dsh field comment (src/config.ts) and the
dshLedgerFloorTokens doc block (src/server/budget.ts) carried one extra leading
space versus their surrounding blocks. Whitespace-only.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已解决、分支已重推,并做了独立重新 review。

冲突处理:PR 分支 rebase 到最新 master(687096785),force-push 至 3b5dd228d,merge state 已转 clean(mergeable=true)。冲突根源:master 在分叉后于同一守卫里落了 #3733「authored compaction」(bili 本地应答 dsh 压缩调用),与本 PR 删除 allowDshCompaction 逃生门直接相撞。解法取两方意图的并集——守卫条件按本 PR 改为无条件(isDshCompactionCall 命中即拦截),#3733 的本地应答逻辑原样保留在守卫内部;同步修正了所有因此失实的注释(守卫头注、dsh-authored-compaction.ts 模块头)和文档行。另外 #3733 测试里有一条断言「显式 allowDshCompaction 优先于 authored 模式」的用例,该行为已随本 PR 消失,改写为反向门禁:stale 值进入 options 后守卫照旧拦截、上游零流量、authored 计数照常(负向断言钉住「移除的键不再放行」)。

重新 review 结论(diff 逐段通读,21 文件 / ~510 行变更):

行为变更披露(旧→新):曾设 allowDshCompaction: true(文件或 BILI_ALLOW_DSH_COMPACTION=1)的用户——旧:dsh 原生压缩被放行、checkpoint 可落地(不可逆覆盖原始历史);新:一律被拦截,默认 422 拒绝;若同时设 BILI_DSH_AUTHORED_COMPACTION=1 且会话有活跃折叠块,则由 bili 本地应答快照(#3733,零出口)。原因即本 PR 目的:落地的 dsh checkpoint 摧毁压缩基底,逃生门整体删除。

验证:本地 typecheck 干净、build 通过、定向套件 48/48 绿(issue2028-dsh-compaction-toggle、dsh-authored-compaction、issue2709-passthrough-compaction-guard、issue2658-dsh-anthropic-google-compaction、config-surface-guard、issue1815-unknown-top-level-keys、web-diagnostics-enrichment)。远程 CI(pushed head 3b5dd228d):全部 gate/docs/kernel/lane/config-surface 检查已绿,仅剩 6 个 test 分片(ubuntu/windows × node 22/24)在跑,红了我会定向跟进。


八问

  1. 是什么问题:与 master 合并冲突——master 新增的 bili-authored client compaction: let the host's own compaction flow run, but bili writes the checkpoint #3733 本地应答逻辑和本 PR 删掉的逃生门挤在同一个守卫里,外加一条断言已删行为的存量测试。
  2. 什么原因导致的:分支分叉期间 master 在同一代码点落了新功能(bili-authored client compaction: let the host's own compaction flow run, but bili writes the checkpoint #3733),两侧对守卫条件和注释的修改互不相容,属正常的并行开发撞车,不是任何一方写错。
  3. 影响范围与严重程度:仅本 PR 分支自身处于 dirty 不可合状态;解决后行为面 = 本 PR 声明的行为变更(见上披露),对未设开关的用户零影响。
  4. 怎么修复的:rebase 到最新 master,冲突取意图并集(无条件守卫 + 保留 bili-authored client compaction: let the host's own compaction flow run, but bili writes the checkpoint #3733 应答路径),修正失实注释,把已失效的正向用例改写为负向门禁后 force-push。
  5. 是否有回归问题:审过上述 6 类既有行为,均保持或属已披露的有意变更;无无意回归。全量裁决以 CI 六个 test 分片为准(进行中)。
  6. 是否破坏缓存:不涉及——不动缓存/重试/游标策略;dsh 拒绝路径的 prefix-cache 语义与既有一致。
  7. 是否改了设计方向:不改架构;配置面收缩一个段(dsh.* 整体移除),守卫语义统一为「无条件拦截,authored 模式是唯一非拒绝出口」。
  8. 是否引入了新的配置:无新增。净减少:dsh.allowDshCompaction 键与 BILI_ALLOW_DSH_COMPACTION 环境变量移除,遗留值忽略并发一次性弃用警告(无需迁移动作)。

判定:冲突已清、review 通过,待 CI test 分片全绿即可由你合并。

@ranxianglei
ranxianglei force-pushed the 2026-10-18_remove-allowdshcompaction branch from 3b5dd22 to 39560a4 Compare October 20, 2026 05:53
ranxianglei pushed a commit that referenced this pull request Oct 20, 2026
…eview nit)

Continuation lines in the FileConfig.dsh field comment (src/config.ts) and the
dshLedgerFloorTokens doc block (src/server/budget.ts) carried one extra leading
space versus their surrounding blocks. Whitespace-only.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第二次冲突已解决并推送:rebase 到最新 master(f9e0d27c8,含 #3502/#3885/#3335/#3734)后 force-push,分支头 39560a496,PR 状态已转干净(mergeable,仅 behind)。

八问:

  1. 是什么问题:master 合入新 PR 后与分支再次冲突,冲突点只有一处——src/server/dsh-compaction-guard.ts 的 REFUSAL_MESSAGE 同一段落。
  2. 什么原因导致的:[PR] fix: add recovery guidance to the dsh compaction refusal message (#3499) #3502(拒绝文案指引)在旧的 opt-in 指针句前面插入了一句「No action is needed … starts folding on the next turn ([PR] fix: book upstream-stated overflow counts into the fold target (#3450) #3453)」,而本 PR 恰好把那句旧指针句替换成了无条件契约——双方改同一行、方向不同。
  3. 影响范围与严重程度:仅 dsh compaction 拒绝消息文案;行为面与第一轮已披露的变更完全一致,无新增。
  4. 怎么修复的:union 解法——保留前两句 + [PR] fix: add recovery guidance to the dsh compaction refusal message (#3499) #3502 的新指引句 + 本 PR 的无条件收尾(「This refusal is unconditional — … Model request is connecting directly (uncompressed) | 模型请求正在直连(不压缩) #3651 … host-side suppression See how to integrate the plugin that automatically disables dsh compression. | 自动关闭 dsh 压缩的插件看如何集成 #3354/fix(dsh): profile 层 patch 其实可以关掉 web profile 的原生自动压缩(#1772 结论修正)+ 一个会静默清空整个 preset 的写法坑 #2474」),丢弃 [PR] fix: add recovery guidance to the dsh compaction refusal message (#3499) #3502 里指向 allowDshCompaction 的旧指针句(逃生口已不存在,留着就是错误信息)。两侧测试断言对合并文案同时成立:[PR] fix: add recovery guidance to the dsh compaction refusal message (#3499) #3502 新增的 /No action is needed/、/starts folding on the next turn/(tests/dsh-compaction-guard.test.ts),与本 PR issue2028 测试的「含 unconditional/Model request is connecting directly (uncompressed) | 模型请求正在直连(不压缩) #3651、不含 BILI_ALLOW_DSH_COMPACTION」。handle.ts / budget.ts / prepare-* 的新增改动都在本 PR hunk 之外,自动合并干净。
  5. 是否有回归问题:无。typecheck 干净;定向测试 67/67 绿(dsh-compaction-guard、issue2028、issue2709 passthrough、dsh-authored-compaction、issue2658、config-surface-guard、issue1815、web-diagnostics-enrichment);全量回归以 CI 为准。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:否——本 PR 意图(无条件拦截/就地应答)与 [PR] fix: add recovery guidance to the dsh compaction refusal message (#3499) #3502 意图(拒绝时给用户可操作指引)共存,语义互补。
  8. 是否引入新配置:无。

判定:冲突已解,等新 head CI 全绿后即可由你合并。

@ranxianglei
ranxianglei force-pushed the 2026-10-18_remove-allowdshcompaction branch from 39560a4 to 5210405 Compare October 20, 2026 06:03
ranxianglei pushed a commit that referenced this pull request Oct 20, 2026
…eview nit)

Continuation lines in the FileConfig.dsh field comment (src/config.ts) and the
dshLedgerFloorTokens doc block (src/server/budget.ts) carried one extra leading
space versus their surrounding blocks. Whitespace-only.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

冲突已解(第三次):master 又前进了一个合并(#3545 pi /tree rewind loadout reassert,只动 src/agent/pi.ts + tests/plugin-agent.test.ts,与本 PR 零文件重叠),rebase 干净应用、无冲突。新头 5210405ec(基于 391b802),已 force-push,PR 状态 mergeable、无冲突。

重新 review(对照当前 master 独立过了一遍,八问):

  1. 是什么问题:本 PR 移除 allowDshCompaction 逃生口——dsh 原生 compaction 调用从此被无条件拦截(默认 422 拒绝;bili-authored client compaction: let the host's own compaction flow run, but bili writes the checkpoint #3733 authored 模式开启且会话有活跃折叠块时由 bili 就地应答)。
  2. 什么原因导致的:Model request is connecting directly (uncompressed) | 模型请求正在直连(不压缩) #3651 判定该 opt-out 是负债——落地的 dsh checkpoint 会永久遮蔽原始历史、摧毁压缩地基,旧开关是这堵墙上唯一的洞。
  3. 影响范围与严重程度:仅影响显式设过 allowDshCompaction: true 的用户(少数);残留配置值被忽略并打一次性弃用警告;web API GET 不再返回该字段,结构化 dsh PUT 带该字段 → 响亮 400,整文件保存原样保留残留值。默认用户行为零变化。
  4. 怎么修复的:config 解析/默认值/web API/文档/website yaml 全链路删字段;两个拦截点(主管线 src/server/handle.ts:1845 + passthrough 车道 src/server/handle.ts:405)改为无条件;保留弃用警告路径消化存量配置文件。
  5. 是否有回归问题:逐项核过既有行为——默认拒绝语义不变(nudge 死锁无检测:同一 session 交替收到两种结构互斥的请求流(巨型单消息 ↔ 多轮)时不告警 #1729);bili-authored client compaction: let the host's own compaction flow run, but bili writes the checkpoint #3733 authored 逻辑完整保留且注释已修正为「无原生转发路径」(union 解法只动了 REFUSAL_MESSAGE 一句,同时保住 [PR] fix: add recovery guidance to the dsh compaction refusal message (#3499) #3502 的「No action is needed」指引与本 PR 的无条件收尾);passthrough fail-open 方向不变(fix(#1729): refuse dsh native compaction calls at the proxy gate #1835);未知键处理里 allowDshCompaction 从已知键移入弃用警告([config] misplaced/unknown top-level keys are silently ignored — root-level promptPack does nothing without any warning #1815 测试同步更新);diagnostics enrichment 不受影响(渲染的是原始文件而非解析结果)。本地 typecheck 干净、定向测试 67/67 绿;另做了 hunk 漂移检查:新旧头之间差异恰好只有 [PR] pi-native: re-assert the active tool loadout after a /tree rewind (compress etc. no longer silently die) | pi-native: /tree rewind 后重断言活动工具 loadout(compress 等工具不再静默失效) #3545 本身,PR 自身改动逐字节未变。全量回归以 CI 为准。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:否——按 Model request is connecting directly (uncompressed) | 模型请求正在直连(不压缩) #3651 的决定收窄表面;host-side suppression(See how to integrate the plugin that automatically disables dsh compression. | 自动关闭 dsh 压缩的插件看如何集成 #3354/fix(dsh): profile 层 patch 其实可以关掉 web profile 的原生自动压缩(#1772 结论修正)+ 一个会静默清空整个 preset 的写法坑 #2474)仍是官方替代路径。
  8. 是否引入了新的配置:无(净删除 1 个字段 + 其 env BILI_ALLOW_DSH_COMPACTION)。

CI 已在新头起跑(回帖时 21 个 job 排队中,暂无失败)。判定:冲突已解、review 通过,CI 全绿后即可由你合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

Rebase 跟进(新 head 5210405ec)

审查期间分支被 rebase 到了最新 master(旧 head 3b5dd228d 的 CI runs 被 GitHub 按 re-push 惯例取消,不是失败)。我对 rebase 后的树做了完整复核:

1. rebase 引入的语义交互 — 只有 #3733(dsh authored compaction,审查期间合入 master)

2. rebase 冲突处置(1 处):src/server/dsh-compaction-guard.ts 的 REFUSAL_MESSAGE — master 侧(#3499/#3453)新增「No action is needed… starts folding on the next turn」安抚行,本 PR 侧删除 opt-in 指引。取并集:保留安抚行、删除已死的 opt-in 指针、保留 unconditional 措辞。master 自己的测试(tests/dsh-compaction-guard.test.ts 钉住 /No action is needed/)在该解法下通过。另:另一会话的并发 rebase 落了一个与我本地解法逐字节相同的树(git diff 两 head = 空),故未重复 push。

3. 行为变更披露(rebase 后新增的一条,原 PR 描述写于 #3733 合入前):同时设置 BILI_DSH_AUTHORED_COMPACTION=1 与遗留 allowDshCompaction=true 的用户 — 旧行为(master 现状):native forward 优先;新行为:有 active block 时 bili authored 应答优先,否则 422。这是 owner 指令的直接推论(任何面都不应能表达 native-forward),已由反转后的测试钉住。

4. 验证:该树上 typecheck clean;定向套件 55/55(dsh-compaction-guard / issue2028-dsh-compaction-toggle / issue2709-passthrough-compaction-guard / dsh-authored-compaction / config-surface-guard / issue1815-unknown-top-level-keys)。CI 在 5210405ec 上运行中:27 success + 13 skipped + 3 个 test shard 在跑,零失败;GitHub mergeable=True(无冲突)。跑完我再补一行终态。

判定:可合(待最后 3 个 shard 绿灯)。#3653 的跨分支注意事项仍然成立——若本 PR 先合,#3653 rebase 时需更新 src/agent/dsh-native.ts 里那句引用 opt-in 的话。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

CI 终态(head 5210405ec):全绿 —— 30 success + 14 skipped(预期内的 gated e2e)+ 0 failure。上一条回复后唯一的红项已闭环,补记如下:

Windows shard 红项 = 环境 flake,已重跑转绿

  • 失败形态:test (windows-latest, 22, 1) 日志里 1458 个 subtest 全部 ok、零断言失败,进程在 tests/issue3004-nudge-decide-selfheal.test.ts 中途静默死亡(无 FATAL/OOM/watchdog 签名)——典型的 Windows teardown/timing flake 家族(lane 统一决策点收尾:四处 B 类名字旁路迁入 + nudgeOn 单点(#3482) #3490 系,master 上已有同类 no-op 重跑先例);
  • 排除回归的三条证据:①同一 shard 在上一 head 3b5dd228d 全量通过;②该套件的失败点在 dsh上下文700K不触发压缩 #3004 nudge-decide 时序测试,与本 PR 触碰路径(dsh compaction guard/config surface/web api)无交集;③本树本地定向跑 tests/issue3004-nudge-decide-selfheal.test.ts 7/7 通过;
  • 处置:API 重跑该 job(run 39378267939 attempt 2)→ 通过。

另一条红 run 说明:ci-gate-plugins.yml 出现一条 event=push、零 job、conclusion=failure 的 run——这是仓库级无害产物:该 workflow 是纯手动触发(workflow_dispatch,需模型端点 secret),但每次向任意分支 push(包括 master 本身)都会生成这样一条零 job 的假失败;它不挂在 commit checks 上,与 PR 无关。

最终判定:可合。 代码审查结论见上一条评论(八问齐全:方向对齐 owner 指令、既有行为逐项清点、rebase 冲突按 union 解决且 master 侧测试钉线全部保住、行为变更已披露)。合并动作按规矩留给人工:#3672

另提醒(已在 PR body 注明):若本 PR 先于 #3653 合入,#3653 rebase 时需更新 src/agent/dsh-native.ts:2008 那句引用已删除开关的 trace 尾句。

awork added 3 commits October 20, 2026 18:09
…paction refused unconditionally (#3666)

Owner directive from the #3651 thread: the #2028 opt-in existed so a user could deliberately let dsh native compaction land through bili, but a landed checkpoint durably shadows the raw conversation history (irreversible substrate destruction), so the escape hatch is deleted outright rather than kept off-by-default.

- wire guards (pipeline + passthrough lane) now refuse unconditionally; REFUSAL_MESSAGE states the new contract and points at host-side suppression (#3354/#2474)
- ProxyOptions.allowDshCompaction, DshFileSettings fields, allowDshCompactionState(), legacy relocation all removed; FileConfig.dsh stays a recognized section so old files load cleanly
- one-time deprecation warnings name leftover file keys (nested + bare top-level) and the stale BILI_ALLOW_DSH_COMPACTION env var; user files are never rewritten
- web API: GET no longer exposes the field, structured dsh writes get a loud 400, whole-file saves preserve leftover keys verbatim (still inert)
- docs en/zh + server.yaml carry removal tombstones; tests pin the removal contract (issue2028 suite rewritten, issue2709 opt-out test inverted)
Regenerate the CONFIGURATION tables from the yaml seed (docs-sync), keep
BILI_ALLOW_DSH_COMPACTION documented on the removed dsh entry so the
deprecation-read stays covered (docs-coverage), and un-export two
now-internal helper declarations (unused-exports gate).
…eview nit)

Continuation lines in the FileConfig.dsh field comment (src/config.ts) and the
dshLedgerFloorTokens doc block (src/server/budget.ts) carried one extra leading
space versus their surrounding blocks. Whitespace-only.
@ranxianglei
ranxianglei force-pushed the 2026-10-18_remove-allowdshcompaction branch from 5210405 to df16184 Compare October 20, 2026 10:19
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

第四次冲突已解决并推送:rebase 到最新 master(1cec7add9,含 #3934/#3653/#3927/#3903)后 force-push,分支头 df1618457,PR 状态已转干净(mergeable=true,CI 在新头上运行中)。

这轮冲突是语义冲突,不只是文本撞车:分叉后 master 在本 PR 清空的 dsh.* 配置段里落了一个新的存活键 dsh.authoredCompaction(#3723/#3901,bili 本地应答 dsh 压缩调用,默认开),而本 PR 把该段当时唯一的键 allowDshCompaction 删掉、整段塌缩成开放 map——两侧对同一个类型声明、同一批文档表做了方向相反的重写。按意图并集解决:

  1. 类型:DshFileSettings 保留为接口,唯一存活键 authoredCompaction;allowDshCompaction 删除;按 PR 自身的 doc-gate 修正提交去掉 export。
  2. 弃用警告路径:warnRemovedDshAllowKey 原本会把 dsh.* 下每个键都点名「已移除」——并集后必须显式排除存活键 authoredCompaction,否则用户设置这个新键会收到假的弃用警告(这是粗解法会直接制造的回归)。已修,并补了一条负向钉线测试(独立 commit df1618457:设 {"dsh":{"authoredCompaction":false}} 时零移除警告;删掉排除逻辑这条测试就会红)。
  3. 文档(双语 CONFIGURATION + website yaml):保留本 PR 的 REMOVED 段描述行 + master 的 authoredCompaction 条目;段级描述改写为「段仍被识别、原逃生门已移除、唯一存活键见下一条目」;跑生成器重生成表格后零漂移。config-surface-guard 的 golden anchor 从叶 dsh 改为 dsh.authoredCompaction(类型回到接口形态后,提取器看到的是子叶而非裸段名——anchor 跟着事实走)。
  4. PR 正文的跨分支注记闭环:[PR] fix: stop takeover-broken banner false alarm from agentless sidecar lanes (#3651) #3653 已先合入 master,它在 src/agent/dsh-native.ts:2085 留的那句 trace 尾句(「…when on, lets such checkpoints through」)随本 PR 落地后不再成立,本次 rebase 中已更新为「guard 无条件拒绝(Model request is connecting directly (uncompressed) | 模型请求正在直连(不压缩) #3651)」;PR 正文对应注记同步改写,trace 本身不动。

验证:本地 typecheck 干净;docs-sync / docs-coverage / config-surface-guard / unused-exports 四门全绿;定向套件 8 个文件 68/68 绿(issue2028 移除契约含新负例、dsh-authored-compaction、dsh-compaction-guard、issue2709 passthrough、issue2658、config-surface-guard、issue1815、web-diagnostics-enrichment)。全量裁决以新头 df1618457 的远程 CI 为准。


八问

  1. 是什么问题:与 master 的第四次合并冲突——master 往本 PR 清空的 dsh 配置段里加了一个新存活键,两侧对同一类型声明和文档表做了相反方向的修改。
  2. 什么原因导致的:正常并行开发撞车:本 PR 的意图是「逃生门整体删除、段清空」,master 的意图是「段里新增本地应答键」,语义互不相容,必须取并集而不是任选一侧。
  3. 影响范围与严重程度:仅本 PR 分支自身处于 dirty 不可合状态;解决后行为面与前三轮披露完全一致,默认用户零变化。并集引入的新风险点(对新键误报弃用警告)已由排除修正 + 负向测试消除。
  4. 怎么修复的:意图并集——保存活键、删死键、段描述改写准确、跨分支失实句就地修正;文档表用生成器重生成保证与 yaml seed 零漂移;补负向钉线测试。
  5. 是否有回归问题:逐项过既有行为——全 lane 默认 422 拒绝保持(测试钉死);bili-authored client compaction: let the host's own compaction flow run, but bili writes the checkpoint #3733 authored 本地应答路径完整保留(其自身套件全绿);遗留键弃用警告对死键照旧点名、对存活键不误报(双向钉住);web 结构化 dsh 写入仍 400——与 master 侧「authoredCompaction 目前 env/file-only、web 开关待采纳后再上」的姿态一致,非本 PR 改变;无阈值/时序/输出格式漂移。未发现无意回归。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:否——配置面继续收缩(净删 1 键 + 1 env var),dsh.* 段从「空壳」变为「一个存活键」,与 bili-authored client compaction: let the host's own compaction flow run, but bili writes the checkpoint #3733/Storage cleanup wave 2: Batch-clearing nine items (Correctness #3841/#3798 + GC #3463/#3671/#3762 + Posture #3723/#3489/ | 存储收尾第二波:九项一次清账(正确性 #3841/#3798 + GC #3463/#3671/#3762 + 姿态 #3723/#3489/#3633/#3788) #3901 的方向一致。
  8. 是否引入了新的配置:无新增。dsh.authoredCompaction 是 master 既有键,非本 PR 引入;本 PR 仍是净减少(allowDshCompaction + BILI_ALLOW_DSH_COMPACTION,遗留值忽略 + 一次性点名警告)。

判定:冲突已清、review 通过,新头 CI 全绿后即可由你合并。

@ranxianglei
ranxianglei merged commit 8b785fc into master Oct 20, 2026
44 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.658-master.8b785fc (rolling master tag).

npm install -g billion-context@0.0.658-master.8b785fc  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

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

Labels

bug Something isn't working dsh p2 scope/wiring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove dsh.allowDshCompaction escape hatch (unconditional wire refusal) | 移除 allowDshCompaction 配置:dsh 原生压缩一律拦截

1 participant