前言¶
在 DeepSeek Harness(dsh)里用智能体修 bug,常见问题是:模型说「修好了」就结束,缺少可核对的分步证据,红绿测试也可能被写成断言文件而不是真正跑命令。社区插件目录里有一类工作流插件,把一次修 bug 收成固定管道,每一步必须通过门禁,且台账里要有对应产物。
下面介绍维护者 EnRaiha 的 dsh-drill-kit(npm 包名 dsh-drill,目录页 skillhub.cn)。它把「定位 → 影响面 → 边界 → 红 → 绿 → 卫生检查 → 只读复审 → PR」串成一条 drill,并与 code2graph(c2g)、PR 文案等能力放在同一仓库里。
这是什么¶
dsh-drill 是面向 DSH 的证据门禁式 bug 修复 drill 插件:一次 issue、一个 worktree、一条证据链;每个阶段在 per-task ledger 里留记录,drill_gate 会拒绝没有证明的「完成」声明。红/绿证明由在本机执行测试命令产生,而不是往文件里写断言。
仓库除插件本体(index.js、lib/、16 个 tool、107 条测试)外,还包含:
core/c2g_tools.py:c2g 核心(仅 stdlib),供frame、error与查询类 tool 使用;core/pr_craft.py:PR 文案核心(lint-desc、lint-diff、plan等);frontends/kilo/、frontends/hermes/:把上述核心暴露到 Kilo、Hermes 运行时的薄前端;docs/:规格说明、评审记录与可审计的源码 bundle。
当前资料记载版本为 v0.8.6,在 DSH 0.1.6-alpha.2 上加载;许可证 MIT。
核心功能¶
阶段与门禁¶
资料中的阶段与所需证据如下(节选):
| 阶段 | 门禁 | 所需证据(概要) |
|---|---|---|
| 1 定位 | localize |
一条 locate 记录(file:line),来自失败信号(drill_error)或符号(drill_locate) |
| 2 影响面 | blast |
blast 记录(调用关系/受影响文件,drill_blast),和/或分支 diff(drill_diff) |
| 3 边界 | edge |
edge 记录:必须失败的 invariant;drill_diff 可提议 checklist |
| (后续) | 红 / 绿 / 卫生 / Review 2 / PR | 红绿由插件侧跑测试绑定 commit;Review 2 为 fresh-context 只读复审;PR 由 ledger 渲染 |
README 对 drill 的定义是:从失败信号定位、画爆炸半径、枚举边界、证明 red(基线失败)再 green(修复后通过)、通过卫生检查、通过只读 Review 2,最后产出 PR——每个主张都要有 ledger 里的 artifact。「Done」是门禁评估,不是一句话。
插件与宿主¶
插件依赖 DSH 运行时提供的 @deepseek-ai/dsh-tools、dsh-llm、dsh-subagent(在 package.json 中声明为 optional peer,由 profile 解析;缺宿主会在 import 时报错)。@deepseek-ai/schemastery 作为常规 dependency 随包提供校验。
插件行在 cordis.patch.yml 中声明(package.json 的 dsh.bundle.patch),DSH profile 管理器与 awesome-dsh-plugin 目录都会读这份 patch。
上游与自有部分¶
c2g 层基于 NodeDB-Lab/code2graph 等上游;本仓库自有部分包括门禁与 ledger 实现、drill skill 与 auditor role、lib/embed.js 中的 merged-store/embedding 回退,以及面向 drill 的 c2g_error、c2g_frame 等 tool。
安装与启用¶
安装脚本可从 checkout 或 GitHub 直拉执行,不依赖 npm registry 与 API token(官方 dsh plugin add 路径需要 PATH 上有 pnpm)。
常用方式(摘自 README):
./install.sh --profile web # 官方 dsh plugin add(需 pnpm)
./install.sh --profile web --link # 符号链接安装:无 pnpm、无网络
./install.sh --profile web --skills --frontends --verify
./install.sh --profile web --uninstall
远程预览或链接安装:
curl -fsSL https://raw.githubusercontent.com/EnRaiha/dsh-drill-kit/master/install.sh \
| bash -s -- --profile web --dry-run
curl -fsSL https://raw.githubusercontent.com/EnRaiha/dsh-drill-kit/master/install.sh \
| bash -s -- --profile web --link
脚本会尝试定位 DSH checkout(dsh 在 PATH、$HOME/projects/deepseek-harness 或与本仓库相邻的 checkout);在缺少 pnpm 或网络时会回退到 link 安装;编辑 profile 的 package.json 前会备份为 .bak-drill;覆盖 skill/role 前会保留副本;除非 --force 否则不替换已有 frontend 目录;不会自动重启运行时。--dry-run 只打印动作不写盘。
也可直接用 DSH 插件管理器(README 原文):
dsh plugin --profile <profile> add dsh-drill
dsh plugin --profile <profile> add dsh-drill@0.8.4
dsh plugin --profile <profile> add /path/to/dsh-drill-kit
dsh plugin --profile <profile> add github:EnRaiha/dsh-drill-kit#v0.8.6
手工指定 CLI:
node <dsh-checkout>/apps/cli/lib/bin.js plugin --profile <profile> add /path/to/dsh-drill-kit
dsh plugin --profile <profile> add github:EnRaiha/dsh-drill-kit
添加插件后需重启 DSH 运行时:宿主侧插件行在启动时组装。
环境要求:package.json 中 engines.node 为 >=22.19。
典型用法与文档¶
- 在目标 profile 安装并重启
dsh。 - 按 drill 阶段调用对应 tool(如
drill_error、drill_locate、drill_blast、drill_diff、drill_gate等),让 ledger 逐步填满证据。 - 红绿阶段在仓库内执行真实测试命令,由插件绑定 commit 记录证明。
- 通过 Review 2 与 PR 阶段后,用 ledger 生成 PR 正文。
规格与审计材料在 docs/:DRILL-BUG-AND-PLUGIN-FULL-DOC 为 canonical 规格;DRILL-PLUGIN-SOURCE-BUNDLE 为带文件哈希与测试记录的生成快照,便于无仓库访问的审查。索引见 docs/README.md。
仓库内自测:
node --test test/*.test.js
node tools/build-source-bundle.mjs
集成测试在无法解析宿主包时会 skip,standalone 消费者不会因此误报失败。
适用场景与注意¶
适合:已在用 DSH、希望把单次 bugfix 约束成可审计管道(门禁 + 台账 + 真实红绿 + PR)的团队或个人;需要与 c2g 定位、PR craft 同一套约定的场景。插件分类为工作流。
注意:
- 插件在当前 dsh 进程权限下运行,安装前请阅读源码与 MIT 许可证,确认 tool 行为与命令执行范围可接受。
- 社区目录 skillhub.cn 与 GitHub 仓库由维护者与社区维护,并非 DeepSeek / 幻方官方应用商店;DSH 生态遵循「一切皆插件」的扩展方式。
- 资料记载 GitHub 星标为 0;状态说明中有两轮文档评审,已修缺陷带回归测试,未决项标为 unverified。
结尾¶
dsh-drill-kit 把 DSH 上的一次 bug 修复收成带门禁与证据链的 drill:16 个 tool、ledger 驱动 PR,并与 c2g、PR craft 及 Kilo/Hermes 前端同仓维护。若要查看简介与分类,可打开 插件目录页;安装与阶段细节以 GitHub 仓库 README 与 docs/ 为准。