dsh-runtime-reconcile:在运行中的 DSH 进程里核对配置与实况

前言

DeepSeek Harness(DSH)把能力拆成大量插件 bundle,由 profile 经多层 patch 叠在一起。静态检查往往只能证明「声明的 YAML 语法正确」:某行写了 web.searchProvider = modsearch,manifest 也在,但注册该 provider 的 bundle 可能被更高层 patch 关掉了。真正调用 web_search 时,才会冒出 configured web provider "modsearch" is not registered 这类错误。

dsh-trust-check、dsh-plugin-preflight、dsh-conflict-doctor、dsh-doctor 等工具盯的是包、manifest、profile 文件或启动日志,看不到 Loader 叠层之后进程里实际的 searchProviders 映射和工具注册表。dsh-runtime-reconcile 在已 compose 的运行时进程内,通过 ctx.get() 做只读对照,把「配置写了什么」和「运行时注册了什么」摆到同一张报告里。

下面按定位、检查项、安装与用法说明;事实以 GitHub 仓库 README 为准。

这是什么

dsh-runtime-reconcile(npm 包名同插件名,displayName 为 Runtime Reconcile)由维护者 shuai0503 发布,许可证 MIT,当前 README 与 package.json 标注版本 0.2.1。在 SkillHub 等社区目录中归类为 admin-security;本质是 profile / 插件图的可观测与对齐诊断,输出带 remedy 的观察结论,不是安全裁决。

一句话:只读地把 profile 声明与 live runtime(ctx.web、ctx.tools、ctx.pluginManager 等)对齐,找出「配置了但未注册」的 provider、已安装但被禁用的 bundle、未激活的 Loader 行、工具注册表漂移等问题。

和相邻工具的差异

工具 检查对象 能否看到 live provider 映射 / Loader 行
dsh-trust-check、dsh-plugin-preflight 包源码 / manifest 否(安装前、静态)
dsh-conflict-doctor、dsh-plugin-conflict-guard 声明的能力 否(静态 / 安装时)
dsh-doctor、dsh-plugin-ops profile 文件、启动日志 否(启动前 / 事后)
dsh-harbor 声明 vs 检测账本 部分(静态对账)
dsh-runtime-reconcile live ctx.web、ctx.tools、ctx.pluginManager 是

README 提到大规模插件生态里存在静默失败的命名碰撞等问题(见 deepseek-harness discussion #4253);本插件不负责在上游修这些问题,而是让当前 profile 在这一次 session 里的状态对用户和 agent 可见。

核心功能:检查什么

Agent 工具入口为 reconcile_runtime。按 README,检查分为以下组(每组有 severity、code、title、detail、evidence、remedy):

组别 运行时来源 能发现的问题
providers ctx.web.config、searchProviders / fetchProviders、环境变量 DSH_WEB_SEARCH_PROVIDER / DSH_WEB_FETCH_PROVIDER 配置了但未注册、已注册但不可用、无 provider、歧义 provider
bundles pluginManager.listBundles() 已安装但被 disable 的 bundle,并与 provider 错误关联为可能根因
rows pluginManager.listPlugins() enabled 但未 active 的 Loader 行、disabled 行、active/total 计数
tools tools.definitions() 可见工具数量、缺少 output renderer 的工具、列表上限
services 对核心 seam 的 ctx.get() 缺失的可选服务

设计约束(README 强调):

  • 只读:不写文件、不发网络请求、不改配置、不做 runtime import。
  • 某一检查组无法执行时,记入 completeness.unavailable,并令 ok: false、complete: false,避免在注册表不可读时仍报「一切正常」。
  • 非法 focus 会被拒绝,而不是静默返回空 OK 报告。

安装与启用

package.json 要求引擎 dsh >=0.2.1-rc.2 且 <0.4.0-0。README 给出以下安装方式(任选其一):

从 npm / 默认源(无构建步骤、零依赖):

dsh plugin --profile web add dsh-runtime-reconcile

从 GitHub 固定版本:

dsh plugin --profile web add github:shuai0503/dsh-runtime-reconcile#v0.2.1

本地路径开发:

dsh plugin --profile web add file:/absolute/path/to/dsh-runtime-reconcile

也可通过 Harness 插件管理器或 Web GUI 安装 bundle 目录。README 说明:从 GitHub 安装有时需要允许构建,本包无 build scripts、无 dependencies。

安装后必须新开一个 session,新注册的工具才会进入模型的 tool set。

典型用法

对 agent 自然语言提问,或直接调用工具(参数来自 README):

reconcile_runtime {}
reconcile_runtime { "focus": "providers" }
reconcile_runtime { "focus": "all", "maxTools": 200 }
  • focus:缩小输出范围,但不跳过与安全相关的检查。
  • maxTools:限制列出的工具名数量(默认 40,最大 200),不改变检查逻辑本身。

README 中的示例输出节选:当 web.searchProvider 指向 modsearch 而 live searchProviders 只有 deepseek-official、web-search-free 时,会报 [ERROR] WEB_SEARCH_PROVIDER_MISSING,并在 evidence 里关联 bundle @liustack/modsearch 已安装但被禁用;remedy 建议启用该 bundle 或改 web.searchProvider。报告末尾注明:Read-only live inspection. No files, no network, no config changes. 本工具不会编辑 cordis.patch.yml。

适用场景与注意

适合谁:

  • 维护复杂 web profile、多层 patch 叠了很多 bundle 的开发者或运维。
  • 工具调用在 provider 选择阶段失败,而 dsh-doctor / preflight 显示「配置看起来没问题」时,需要在当前进程里看一眼实况。
  • 想让 agent 根据结构化 remedy 给出下一步(启用 bundle 或改 provider),而不是盲目改 YAML。

注意事项:

  1. 插件在当前 DSH 进程权限下运行,能读到的范围取决于已挂载的服务;安装前建议自行查看 源码 与 MIT 许可证。
  2. 与静态扫描互补,不能替代上游对插件命名冲突、孤儿 patch 等生态问题的修复。
  3. 社区目录(如 SkillHub 插件页)与 DeepSeek / 幻方无官方从属关系,安装来源以你信任的 registry 或 pin 的 commit/tag 为准。

结尾

配置语法正确、工具却在运行时失败,往往是「声明」与「Loader 叠层后的注册表」不一致。dsh-runtime-reconcile 用一次 reconcile_runtime 把 provider、bundle、Loader 行和工具注册表摊开,并给出可执行的 remedy,且全程只读。

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜