前言¶
在 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/ 爲準。