Skip to content

fix(dsh): #1772 结论修正 —— web profile 可用 profile 层完整快照 patch 关掉原生自动压缩(告警指路 + 坑位警示) - #2477

Merged
ranxianglei merged 2 commits into
masterfrom
2026-10-09_dsh-web-patch-exit
Oct 9, 2026
Merged

ranxianglei merged 2 commits into
masterfrom
2026-10-09_dsh-web-patch-exit

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

改了什么

#1772 的结论(web profile 下 preset 内 compaction-basic 任何 patch 层都够不到 → 告警即终点)是错的:preset-standard 本身是 bundle 层的普通顶层条目,profile 层 patch(在所有 bundle 之后生效)可以整体替换它的 config —— 完整快照 + 在其 compaction-basic 行下加 auto: false,就能关掉 web profile 的原生自动压缩。本 PR 把被写死的旧结论全部修正,并让一次性启动告警从死胡同变成指路。

验证(隔离环境活体复现,dsh 0.2.1-alpha.1,与报告者同版本)

写法 结果
完整快照 + compaction-basic 下 config.auto: false ✅ dump 与基线 diff 仅新增那两行,全部子项保留
- id: preset-standard.compaction.compaction-basic ✅ stderr patch: entry ... not found,零变化
只含 plugins 的部分覆盖 ✅ 静默丢失一切未重述的键 —— 不只其他插件,preset 自己的 config.id/order 身份也丢
- insert: 同 id ✅ 末尾追加第二条同 id 行(死代码),原 preset 不变

dsh web-app bundle 自家 cordis.patch.yml 头注文档化了这两条语义(「rows here override base rows by id, with the profile's own cordis.patch.yml and any --patch overlays still to come」/「A patch replaces the targeted row's whole config」),presets/standard.patch.yml 头注明 Web editor 就是按 id 从 profile patch 覆盖 —— 该写法走的是设计内路径。

行为变更(旧值→新值,按规披露)

  1. 一次性 [dsh-client] 启动告警文案(src/agent/dsh-native.ts):旧 = "...stays enabled in this profile (ACP compression unaffected)"(死胡同结尾);新 = 保留全部旧事实,追加出口配方(完整快照 + cordis.patch.yml + auto:false 位置)+ 两个已验证坑位(部分片段静默丢掉一切未重述的键,含 preset 身份;- insert: 同 id 追加死行)+ 快照冻结 roster。触发条件(web-app 在 bundles、每进程一次)与通道(persistClientEvent durable log)均不变。
  2. bili dsh 启动器 stderr 提示(src/launcher.ts):"profile patches cannot reach it" → "nested rows no patch layer can address by id … stays ARMED unless you apply the fix(dsh): profile 层 patch 其实可以关掉 web profile 的原生自动压缩(#1772 结论修正)+ 一个会静默清空整个 preset 的写法坑 #2474 full-snapshot override"。触发条件不变。
  3. 纯注释/文档修正(无运行时效果):src/config.ts allowDshCompaction JSDoc、dsh.bundle.patch.yml 头注、CLIENTS.md/zh、README.md:255、README.zh-CN.md:207。
  4. 测试断言加强(tests/dsh-native.test.ts):钉住出口指针(fix(dsh): profile 层 patch 其实可以关掉 web profile 的原生自动压缩(#1772 结论修正)+ 一个会静默清空整个 preset 的写法坑 #2474 / cordis.patch.yml / WHOLESALE / insert:)。

无 wire 协议、消息形状、配置 schema、持久化格式变更。config surface:无(未增/改名/改语义任何字段)。无 kernel-change(未触碰 kernel/**)。

与其他条目的关系

本地验证

  • 已 rebase 到最新 master(4d5dab9,v0.1.189 release head),干净应用无冲突
  • npm run typecheck ✅(先重建 kernel/pi-subagents)
  • 定向回归 node --import tsx --test --test-name-pattern "1772" tests/dsh-native.test.ts ✅
  • 全量套件交给 CI

Review supplement (2026-10-09, ework-daemon): 审核中发现 CONFIGURATION.md / CONFIGURATION.zh-CN.md 的 BILI_ALLOW_DSH_COMPACTION env 表行仍残留 #2474 之前的旧结论(「no patch layer reaches the preset-nested instance」),已补两行措辞修正(commit a64efdd60,纯文档、无运行时效果;docs-sync/docs-coverage 本地复跑绿)。配方 walkthrough 一节仍归 #2476,本 PR 依旧不碰它。

…atch CAN switch off web-profile native auto-compaction (#2474)

The #1772 boot warning ended in a dead end ('no patch layer can reach'). Verified live against dsh 0.2.1-alpha.1: preset-standard is an ordinary bundle-layer entry; a profile-level cordis.patch.yml row (applied after every bundle) replaces its config WHOLESALE, so a full-snapshot override carrying auto:false under compaction-basic switches off native auto-compaction. The once-per-process warning now names that recipe plus both verified traps (a partial snippet drops everything not restated — other plugins AND the preset's id/order identity; - insert: with the same id appends a dead duplicate row); launcher stderr, config doc, bundle-patch header and CLIENTS(en/zh)/README(en/zh) corrected to match; the regression test pins the exit pointer. Snapshot-freeze walkthrough lives in the companion CONFIGURATION.md PR (#2476). Supersedes #1786's dead recipe (.agent-presets user root removed in dsh 0.1.7+).

Refs #2474
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-09_dsh-web-patch-exit (a64efdd)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.2687-pr.2477.ad99fd8

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-pr2477.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

[bot] 🏷 收到,正在审核 PR #2477(代码侧修正:#1772 旧结论「任何 patch 层都够不到」→ profile 层完整快照可关)。会按规范走五关:原 issue 方向核查(#1772/#2474/#1786 证据链)、回归审查(告警触发条件/通道、launcher stderr、patch 文件头注的既有行为逐项清点)、逐行 diff、测试有效性、diff 整洁度;并核对 #2476(docs 侧)与本 PR 的分工边界。结论稍后按结构化八问给出。

… in the allowDshCompaction env-table rows (#1772/#2474)

Review pass-fix for the #1772 conclusion correction in this PR: the BILI_ALLOW_DSH_COMPACTION rows in CONFIGURATION.md / CONFIGURATION.zh-CN.md still asserted the pre-#2474 dead-end ('no patch layer reaches the preset-nested instance'). Reworded to the corrected mechanism statement used elsewhere in this PR (the preset-nested row is not addressable by id from any patch layer) plus the #2474 escape hatch (profile-layer full-snapshot override of preset-standard). Docs-only, no behavior change; docs-sync + docs-coverage gates re-run locally green.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 转发 #2476 作者(PTC/创建者模式实地验证过)的一条建议:告警文案目前只点名 preset-standard(persistClientEvent 警告与 launcher console.error 两处都是)。会话跑在 preset-ptc / preset-cordis 上的用户读到 "preset-standard" 可能以为配方不适用于自己。建议补半句,如:「(same shape for preset-ptc / preset-cordis if your sessions use those presets)」——文档侧(#2476 CONFIGURATION.md/zh)已有这句,补上后告警与文档对齐。新增测试钉的是 /#2474/、/cordis\.patch\.yml/、/WHOLESALE/、/insert:/,加这句不会碰断言。

顺带一处措辞对齐:新注释写「the engine indexes top-level rows only」,而旧 CLIENTS.md 写「indexes only top-level rows and true group children」。你本 PR 反正要重写 CLIENTS.md 那节,请对着解包的 0.2.1-alpha.1 包把代码注释和文档落到同一个说法上(实测点号路径 preset-standard.compaction.compaction-basic → entry not found,至少排除了对 preset 嵌套行的朴素 group-child 索引)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 PR #2477 审核结论:可合并。 分支 2026-10-09_dsh-web-patch-exit @ a64efdd60(base = 当前 master 4d5dab982,v0.1.189 head,mergeable,mergeStateStatus clean)。CI 26/26 全绿(含 ubuntu/windows × node22/24 单测矩阵、docs-sync、docs-coverage、kernel-guard、version-guard、全部 e2e lane)。

验证过程

  • diff 逐行通读(原 9 文件 +61/-27;我补审后 11 文件 +65/-29),方向对照 dsh.bundle.patch.yml 禁用自动压缩在 web profile 下静默失效 #1772→fix(dsh): profile 层 patch 其实可以关掉 web profile 的原生自动压缩(#1772 结论修正)+ 一个会静默清空整个 preset 的写法坑 #2474 证据链:修正有 dsh 0.2.1-alpha.1 隔离环境活体复现(完整快照 ✅ / 点号 id not found / 部分片段静默掏空 / insert: 死行)+ dsh web-app bundle 自家 cordis.patch.yml 头注文档化的 patch 语义背书 —— 成立。机制断言保留(嵌套行无法按 id 直寻),死胡同结论改为指路。
  • 回归清点(触碰路径的既有行为逐项判定):告警触发条件(bundles 含 @deepseek-ai/dsh-web-app、每进程一次 webProfileWarned)保持;通道(persistClientEvent durable log)保持;launcher stderr 触发条件保持;dsh.bundle.patch.yml 纯头注新增——YAML 注释惰性,消费方(package.json files/patch 字段、两个 e2e 的 copyFileSync)不受影响;src/config.ts 仅 JSDoc。无 wire/消息形状/config schema/持久化/阈值/时序变更,无 fail-fast 变吞错。
  • 测试有效性:新增 4 条断言钉住出口指针(#2474 / cordis.patch.yml / WHOLESALE / insert:)——若有人把告警退回死胡同会红,有牙,不是恒真。
  • diff 整洁度:单一线性 commit,每行都服务本 PR 目的,无空行重排/锁文件噪音。干净。

审核中发现并已顺手修掉的一个残留(独立标注 commit a64efdd60):CONFIGURATION.md:1722 / CONFIGURATION.zh-CN.md:1718 的 BILI_ALLOW_DSH_COMPACTION env 表行仍写着被推翻的旧结论(「no patch layer reaches the preset-nested instance」/「patch 层够不到 preset 嵌套实例」)——此前 #2474 的清单把这处误判为 grep 假阳性,而 #2476 是纯增量不会覆盖它。已按本 PR 其余处的修正措辞改两行(机制断言保留 + 指向 #2474 完整快照出口),en/zh 镜像;该表在 docs-sync 生成块之外,本地复跑 gen-config-docs generate + check-coverage 均绿。PR 正文已补记此 commit。配方 walkthrough 一节仍归 #2476,分工边界未破。

结构化八问

  1. 是什么问题:dsh.bundle.patch.yml 禁用自动压缩在 web profile 下静默失效 #1772 的结论(web profile 下 preset 内 compaction-basic 任何 patch 层都够不到 → 启动告警即终点)是错的——preset-standard 本身是 bundle 层的普通顶层条目,profile 层 patch(在所有 bundle 之后生效)可用同 id + 完整快照整体替换其 config,从而关掉原生自动压缩。本 PR 把写死的旧结论全部修正,并让一次性启动告警从死胡同变成指路。
  2. 什么原因导致的:dsh patch 引擎只按 id 索引顶层行与真 group 子项(点号嵌套 id 找不到),且 config 替换是 wholesale 而非合并;dsh.bundle.patch.yml 禁用自动压缩在 web profile 下静默失效 #1772 当时只试了 id 直寻、没试整行替换,才得出过强的「不可达」结论。
  3. 影响范围与严重程度:web profile(bundles 含 @deepseek-ai/dsh-web-app)用户此前没有任何办法关掉原生自动压缩——纯功能缺口,无数据丢失/安全影响;本 PR 改动面是告警/启动提示/文档文案,运行时行为零变化。
  4. 怎么修复的:策略层面是「保留机制事实、补上出口」——告警保留全部旧事实后追加已验证的退出配方(完整快照 + cordis.patch.yml + auto:false 位置)与两个实测坑位(部分片段静默丢掉一切未重述的键,含 preset 自身 id/order 身份;- insert: 同 id 追加死行而非合并)+ 快照冻结 roster 警示;launcher stderr 与 CLIENTS/README/头注按同一口径修正。
  5. 是否有回归问题:无。高危模式逐项过:触发条件不变、通道不变、阈值/时序/输出格式无漂移、无吞错化、无缓存键失效(见回归清点);CI 全矩阵绿。唯一「行为变更」是两条既有用户可见文案措辞(PR 正文已按规披露旧值→新值),属本 PR 目的本身。
  6. 是否破坏缓存:不涉及——无任何运行时变化。
  7. 是否改了设计方向:否——只是把文档结论修正到与上游实际语义一致(该写法走 dsh 设计内路径:Web editor 本就按 id 从 profile patch 覆盖),不引入新机制、新配置面或新边界。
  8. 是否引入了新的配置:无——配方走 dsh 既有的 --patch/cordis.patch.yml 机制,未增/改名/改语义任何 BILI_* key 或默认值。

关联条目核对:Supersedes 的 #1786 已带详细机制史评论关闭 ✓;docs 侧 #2476 与本 PR 分工清晰(其待补的快照刷新句在 #2476 线程跟踪中);两个 PR 都合后 #2474 可关(提醒:#2476 正文写 Closes #2474,若它先合会提前关闭 #2474——届时本 PR 随即落地,风险可接受,也可由 owner 定夺改成 Part of)。

一句话收工:可合并——方向有活体证据支撑、回归逐项核过、测试有牙、diff 干净、CI 26/26 绿、base 即当前 master;审核中发现的 env 表残留已直接修入分支。合并请你来。

@ranxianglei
ranxianglei merged commit 0c89947 into master Oct 9, 2026
26 checks passed
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.188-master.0c89947 (rolling master tag).

npm install -g billion-context@0.0.188-master.0c89947  # 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant