Repository navigation
[PR] Remove the allowDshCompaction escape hatch: dsh native compaction refused unconditionally (#3666) - #3672
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4704-pr.3672.8c55ad6This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3672.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — open/closed issue 与 PR 中检索 标签: bug, dsh, scope/wiring, p2 — 缺陷类(配置面存在可致不可逆会话破坏的开关);客户端仅涉及 dsh;改动核心在协议接线层(#1729 wire guard + web config API);默认路径本就安全、危害仅在显式 opt-in 时发生,故 p2。 这是 [PR] issue:按规程不重做,正在拉取分支核对代码与 CI。初步状态:head |
…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.
(ai: vllm-qwen/qwen3.8-27b) 逐文件审完 diff(19 文件,+216/−257)、核过 CI、验证了跨分支注记。八问结论: 1. 是什么问题:#2028 的 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)删除 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 8. 是否引入新配置:零新增;两个移除( 测试有效性(④):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 从 diff 整洁度(⑤):干净,每行都服务移除目的,双语同步,无锁文件/生成物 churn。 顺手小修(独立标注 commit):评审发现本 PR 新增的两个注释块续行各多一个前导空格( 跨分支注记已核实:master 的 CI:新 head |
|
解决冲突 重新review |
9cf601f to
3b5dd22
Compare
…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.
(ai: vllm-qwen/qwen3.8-27b) 冲突已解决、分支已重推,并做了独立重新 review。 冲突处理:PR 分支 rebase 到最新 master( 重新 review 结论(diff 逐段通读,21 文件 / ~510 行变更):
行为变更披露(旧→新):曾设 验证:本地 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 八问
判定:冲突已清、review 通过,待 CI test 分片全绿即可由你合并。 |
3b5dd22 to
39560a4
Compare
…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.
(ai: vllm-qwen/qwen3.8-27b) 第二次冲突已解决并推送:rebase 到最新 master(f9e0d27c8,含 #3502/#3885/#3335/#3734)后 force-push,分支头 八问:
判定:冲突已解,等新 head CI 全绿后即可由你合并。 |
39560a4 to
5210405
Compare
…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.
(ai: vllm-qwen/qwen3.8-27b) 冲突已解(第三次):master 又前进了一个合并(#3545 pi /tree rewind loadout reassert,只动 重新 review(对照当前 master 独立过了一遍,八问):
CI 已在新头起跑(回帖时 21 个 job 排队中,暂无失败)。判定:冲突已解、review 通过,CI 全绿后即可由你合并。 |
(ai: vllm-qwen/qwen3.8-27b) Rebase 跟进(新 head 审查期间分支被 rebase 到了最新 master(旧 head 1. rebase 引入的语义交互 — 只有 #3733(dsh authored compaction,审查期间合入 master)
2. rebase 冲突处置(1 处): 3. 行为变更披露(rebase 后新增的一条,原 PR 描述写于 #3733 合入前):同时设置 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 在 判定:可合(待最后 3 个 shard 绿灯)。#3653 的跨分支注意事项仍然成立——若本 PR 先合,#3653 rebase 时需更新 |
(ai: vllm-qwen/qwen3.8-27b) CI 终态(head Windows shard 红项 = 环境 flake,已重跑转绿
另一条红 run 说明: 最终判定:可合。 代码审查结论见上一条评论(八问齐全:方向对齐 owner 指令、既有行为逐项清点、rebase 冲突按 union 解决且 master 侧测试钉线全部保住、行为变更已披露)。合并动作按规矩留给人工:#3672 另提醒(已在 PR body 注明):若本 PR 先于 #3653 合入,#3653 rebase 时需更新 |
…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.
…moved-key warning (#3672 rebase)
5210405 to
df16184
Compare
(ai: vllm-qwen/qwen3.8-27b) 第四次冲突已解决并推送:rebase 到最新 master( 这轮冲突是语义冲突,不只是文本撞车:分叉后 master 在本 PR 清空的
验证:本地 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)。全量裁决以新头 八问
判定:冲突已清、review 通过,新头 CI 全绿后即可由你合并。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.658-master.8b785fc # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #3666
Owner directive from the #3651 thread (「这个应该坚决拦截…直接删除这个配置 避免造成损失」): the #2028
dsh.allowDshCompactionopt-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: nesteddsh.*+ legacy bare top-level position)BILI_ALLOW_DSH_COMPACTIONenv vardshbodyProxyOptions.allowDshCompaction,allowDshCompactionState(), legacy auto-relocationWhy 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:
[acp-config] … was removed (#3651, superseding #2028) — value(s) ignored). Same for the stale env var (once per process). User files are never modified by bili.dshbody → loud 400 naming the removal; whole-file saves preserve leftover keys verbatim (they stay inert).auto: false) / See how to integrate the plugin that automatically disables dsh compression. | 自动关闭 dsh 压缩的插件看如何集成 #3354 load-time overlay / fix(dsh): profile 层 patch 其实可以关掉 web profile 的原生自动压缩(#1772 结论修正)+ 一个会静默清空整个 preset 的写法坑 #2474 full-snapshot override.Behavior change disclosure (mandatory)
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.tsended 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
dshsection, 4/4), config-surface-guard (section re-seeded as leafdsh, 5/5)