DeepSeek Harness
DeepSeek Harness Profile 与 Bundle:配置层如何组合
追踪 Profile、Bundle、cordis.patch.yml 和命令行 overlay 如何组成 dsh 启动的插件树。

你将学会
- Profiles persist a composition; bundles distribute patchable plugin rows.
- Later layers replace or insert rows in a fixed precedence order.
- Dump the actual tree before debugging a configuration issue.
开始前需要
- Basic HTTP and API knowledge
Leave with a concrete implementation checklist and a testable starting point.
先看结论
- Profile 保存组合,Bundle 分发可补丁化的插件行。
- 后置层按固定优先级替换或插入配置。
- 调试配置前先 dump 实际启动树。
Profile 与 Bundle 的区别
Profile 是 Harness Home 下的命名组合,保存 Bundle 列表、外部插件依赖和用户补丁。Bundle 则分发 Cordis 配置行以及它们挂载的代码。
Web 和 Headless 是内置模板;其他 Profile 要通过插件路径创建,因此 Profile 名称不只是命令别名,而是有独立依赖边界的持久化组合。
层级优先级
架构文档规定顺序:Profile 中按顺序应用 Bundle 补丁,然后是 Profile 补丁、Home 补丁,最后是命令行 overlay。后面的层可以按 id 替换或插入配置行。
按 id 匹配的补丁会替换完整 config,而不是深合并。常见错误是小补丁意外删除必须保留的依赖或 Provider 字段。
检查真实启动树
执行 `dsh --profile web --dump-config` 查看机器真正会启动的树。对照 manifest 给每一行标记来源层,再修改包。
实验使用小型 overlay,确认 dump 结果后再删除。配置 dump 是证据,包 README 才是契约。
如何选择
| 比较维度 | 方案 A | 方案 B |
|---|---|---|
| Best when | You need predictable behavior and easy auditing | You need adaptive optimization and have reliable telemetry |
| Main risk | May leave performance on the table | Can become difficult to explain or debug |
实施步骤
- 1
定位 `$DSH_HOME/profiles/<name>`。
- 2
阅读有序 Bundle 列表和补丁文件。
- 3
理解优先级后再加入 Home 或 CLI overlay。
- 4
用 dump-config 验证最终 Entry Tree。
可复制示例
# illustrative patch shape from the documented model
- insert:
- id: my-plugin
name: /absolute/path/to/plugin.ts常见问题
补丁会深合并吗?
不会。按 id 的补丁替换完整 config,需要重复写出仍要保留的字段。
资料来源
- DeepSeek Harness architecture来源核查 2026-08-27
- DeepSeek Harness CLI README来源核查 2026-08-27