dsh-fusion: Conflict Detection and Configuration Fusion in DSH Plugin Assembly

前言

DeepSeek Harness(DSH)用分层方式拼装 profile:根目录的 cordis.yml、各 bundle 的 cordis.patch.yml、再到 profile 自身的 cordis.patch.yml。插件装得越多,两类问题越常见,且往往没有明显报错。

一是同一个 loader 在不同 bundle 里被挂载两次。插件市场会报 install-shadow,例如同一模块名 @deepseek-ai/dsh-skill-filesystem 同时来自 @deepseek-ai/dsh-base 与 @tt-a1i/archify-dsh。模块可能跑两遍,工具或服务重复注册或互相遮蔽。

二是同一配置键被更上层 patch 静默覆盖。没有错误、没有日志,你以为生效的值其实已被改掉。

dsh-fusion 面向上述场景:读取真实的层叠栈,标出谁覆盖了谁,并输出只含最终合并结果的 patch。维护者为 mouyu6508-hue,在社区目录中归类为工作流;仓库 mouyu6508-hue/dsh-fusion 当前版本为 0.1.0,许可证 MIT。

这是什么

dsh-fusion 是 DSH 的 bundle 插件:在组合多个 market 插件时,检测跨层重复的 loader 条目、同 id 命名不一致、以及被后层静默改写的 config,并可选生成可安全落地的 cordis.fusion.yml。它不改动正在运行的 loader 图,也不动 system prompt。

核心功能

冲突与覆盖类型

插件会区分若干报告种类(severity 与含义以 README 为准):

Kind Severity 含义
duplicate-name conflict 同一 loader 在 2 行及以上挂载,模块运行两次
name-mismatch conflict 同一 id 被两层赋予不同 name
disabled-conflict conflict 一层 enable、另一层 disable
unknown-target conflict patch 指向无人插入的 id,行被静默丢弃
config-override override 配置键被后层覆盖
repeat-row notice 同 id + 同 name 写两次(市场存设置的常见方式)
dynamic-config notice 配置含 !!js 表达式,无法静态合并

CLI(DSH 无法启动时仍可用)

独立命令 dsh-fusion 只读 profile 与 patch 文件(及可选的运行时 loader),便于在 host 起不来时先排查:

dsh-fusion scan                        # 当前 profile 里谁在冲突?
dsh-fusion scan --profile web --json   # 机器可读输出
dsh-fusion fuse                        # 打印融合后的 patch
dsh-fusion fuse --fix --write          # 去重策略 + 写入 cordis.fusion.yml

内置示例 profile examples/conflict-profile 的典型输出包括:1 个 conflict(同一 loader 挂载两次)、2 个 silent override。fuse --fix 可对重复项生成例如 disabled: true 的 patch;--prefer <id> 指定保留哪一份(默认保留先挂载的,即更底层)。

工具 fusion_report

安装插件后会注册一个工具,参数如下:

参数 含义
profile 要检查的 profile 名(默认 desktop)
dir 用目录代替 profile 名
write 是否写入 cordis.fusion.yml(默认仅报告)

数据来源有两路:Static 读层叠 patch,host 未运行也能用;Runtime 向 ctx.loader 查询实际挂载项。部分重复只在运行时出现(patch 文件干净,但在 apply() 里又挂了一份),仅靠静态扫描找不到。若 host 未暴露 loader,会降级为仅静态分析,而不是直接失败。

明确不做的事

  • 不修改运行中的插件图(只读 loader,不 enable/disable)。
  • 不删除 patch 行;融合结果只钉住最终值,重复项是否去掉由你决定(--fix 可写 disabled: true)。
  • 不执行 !!js;无法静态合并的行会跳过并在输出中说明。

安装与启用

当前分发方式为 GitHub。在命令行安装到 web profile:

dsh plugin --profile web add github:mouyu6508-hue/dsh-fusion

桌面客户端可在 Settings → Plugins 粘贴仓库 URL。README 注明:若日后上架 npm,命令可能变为 dsh plugin --profile web add dsh-fusion。

环境要求:Node.js 18+;需要支持 bundle 插件(dsh.bundle.patch)的 DSH host;Linux、macOS、Windows 均可。peer 依赖含 @deepseek-ai/cordis(>=4.0.0)、@deepseek-ai/dsh-tools(>=0.1.0),在 package.json 中标记为 optional。

典型用法

  1. profile 启动异常或怀疑 install-shadow 时,先执行 dsh-fusion scan --profile <name> 看 conflict 与 override 列表。
  2. 需要可提交的修复草案时,执行 dsh-fusion fuse --fix --write,检查生成的 cordis.fusion.yml 再合并进自己的 patch 流程。
  3. DSH 已能运行时,通过 Agent 调用 fusion_report,必要时设 write: true 落盘;与 CLI 对照 static / runtime 差异。

开发自测(来自仓库 README):

node --test
node bin/fusion.js scan --dir examples/conflict-profile

代码结构:lib/core.js(解析、检测、深合并、输出)、lib/profile.js(按真实顺序读 profile 层)、lib/runtime.js(读已挂载 loader)、lib/index.js(注册 fusion_report)。

适用场景与注意

适合:多 bundle、多 market 插件的 profile 维护者,在 boot 失败或行为诡异时做只读诊断,并生成融合 patch 草案。

注意:

  • 插件以当前 DSH 进程权限运行;安装前请自行查看 源码 与 MIT 许可证。
  • 社区插件目录 SkillHub 上的 dsh-fusion 页 为独立站点,与 DeepSeek / 幻方无官方从属关系;星标等元数据以各站点当时展示为准(GitHub 上当前为 0 star)。

DSH 生态强调「一切皆插件」;dsh-fusion 补的是组合层可观测性——把重复挂载和静默覆盖摆到明处,再给出可 boot-safe 的 patch,而不是在运行中硬改插件图。

  • 目录页:https://www.skillhub.cn/plugins/mouyu6508-hue/dsh-fusion
  • GitHub:https://github.com/mouyu6508-hue/dsh-fusion
羽毛球分组比赛记分
小程序二维码

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

Xiaoye