dsh-autopilot-harness:在 DSH 內做規劃、清單執行與多視角自審

前言

在 DeepSeek Harness(DSH)裏用智能體改產品代碼時,常見情況是:一輪編輯結束,會話在 turn 邊界停下,等你再發一句「繼續」或「再看看有沒有問題」。若只靠重複「繼續」式循環,模型往往是在同一套話術里拉長輸出,而不是從不同角度複查改動。

dsh-autopilot-harness(npm 包名同插件名,維護者 AdamsShen)是 Autopilot Harness 家族在 DSH 上的進程內移植,核心引擎爲 @autopilot-harness/core。它在 agent 的 turn 邊界(agent/turn-stopping)介入:當本輪發生了產品代碼編輯,會注入後續回合,按五套輪換的審查視角自審;清單模式下則按 checklist.md 逐項實現、確認、推進,並在本地提交(不自動 push)。分類上屬於工作流類 DSH 插件;社區目錄頁見 SkillHub,源碼與文檔見 GitHub。

這是什麼

一句話:dsh-autopilot-harness 把「規劃 → 清單執行 → 多鏡頭自審」放進 DSH,作爲 Cordis 插件與宿主同進程運行。

與「generic 的一直跑到看起來完成」類插件相比(README 中的對比表),本插件的差異在於:

  • 只在 turn 邊界、且本輪有產品代碼編輯時介入,而不是不論改什麼都持續續寫。
  • 邊界處跑五套輪換審查鏡頭,而不是重複同一條指令。
  • 自審依據包括 diff、不變量、錯誤路徑、競態、信任邊界、測試缺口等,而不單看模型自稱完成。
  • /autopilot-on 會經過 grill 輪次產出 brief.md / plan.md / checklist.md;進度落在倉庫裏的 checklist.md 與 SQLite 狀態庫,按項目工作目錄劃分狀態。
  • 在你執行 /autopilot-enable 之前,插件不向磁盤寫入項目文件。

它 deliberately 不做的事(README 明確列出):不是任務看板;不是測試框架(鏡頭 5 只記錄測試缺口);不是無人值守通宵跑任務;README 還稱無網絡、無憑據、無遙測(詳見上游文檔「Compatibility and permissions」節)。

核心功能

Turn 邊界自審

流程概覽:

/autopilot-on  →  grill rounds  →  brief / plan / checklist
       ↓
/autopilot-run →  per item: implement → fix → confirm×N → advance
       ↓
done (checklist clear)

五套審查鏡頭與輪次對應關係:

Lens Round
Correctness & invariants 1
Nulls, boundaries & error paths 2
Concurrency, races & partial failure 3
Security & trust boundaries 4
Test gaps & regression (read-only) 5

啓用項目後,最直接的驗證方式(Quick start):隨便改一個源文件,然後不再輸入;數秒內 agent 應自行開始自審,即 Autopilot 在工作。

規劃與清單執行

要做有規劃的功能時,README 給出典型路徑:

/autopilot-on user-login · 實現手機號+驗證碼登錄
     ↓  回答幾輪提問
     ↓  產出 docs/autopilot/plans/user-login/{brief,plan,checklist}.md
/autopilot-run
     ↓  逐項實現 → 自審 → 勾掉 → 本地 commit

命令

Command Effect
/autopilot-enable 爲當前項目執行 init(唯一會寫磁盤的命令)
/autopilot-on [slug · brief] 進入規劃;grill 產出 brief/plan/checklist
/autopilot-run 按清單逐項執行
/autopilot-off 暫停
/autopilot-replan 修訂計劃
/autopilot-resume 恢復執行

行首文本觸發同樣可用,例如 Autopilot ON、開啓自動駕駛、開始執行 等(完整列表見 README)。

/autopilot-on 參數規則:

  • 單個 slug 形 token → 軌道名:/autopilot-on user-login
  • 其他內容 → 當作 brief,slug 稍後生成
  • 兩者同時 → 用中點分隔:/autopilot-on user-login · add phone login

項目內配置

項目在 <project>/.autopilot/config.yml 中配置,下次操作生效,無需重啓 DSH:

review:
  scope: project        # project = 任意產品代碼編輯;executing_only = 僅在 RUN 期間
  confirm_rounds: 5     # 5 = 全套鏡頭;3 = 輕量(鏡頭 1→2→5)
  verify:
    enabled: false      # 是否跑測試命令並記錄結果
  stuck:
    max_idle_stops: 5
  errors:
    max_before_pause: 0 # 0 = 遇錯不因次數暫停
    recover: true

插件級選項在 profile 的 bundle 條目裏,例如 autoInit 默認 false(README 建議保持 false,用手動 /autopilot-enable)、maxSteerPerTurn 默認 32 等。

啓用後項目樹(完整 init 時)包括 .autopilot/config.yml、state.db、以及 docs/autopilot/plans 等;在不存在 config.yml 前,所有 Autopilot 鉤子對該項目爲 no-op。

安裝與啓用

DSH 插件中心推薦從 npm 安裝(與 README Install 節一致):

# ① 安裝(一次性)
dsh plugin --profile web add dsh-autopilot-harness

plugin add 只安裝依賴,不會自動寫入 bundle。需手動在 ~/.dsh/profiles/web/package.json 的 dsh.profile.bundles 中加入 "dsh-autopilot-harness",例如:

{
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-base",
        "@deepseek-ai/dsh-web-app",
        "dsh-autopilot-harness"
      ]
    }
  }
}

校驗是否加載:

dsh --profile <profile> --dump-config | grep autopilot-harness

然後完全退出並重啓 DSH(Node 模塊緩存需要重啓)。

README 另給出源碼安裝方式(dist/ 已提交,無需構建):

dsh plugin --profile web add github:AdamsShen/dsh-autopilot-harness

在目標項目會話中啓用(每個項目一次):

/autopilot-enable

若已安裝 @autopilot-harness/cli(全局或項目內)會走完整 init;否則會做 minimal local init,README 說明 /autopilot-enable 仍可開箱使用。安裝插件本身不會創建項目文件,啓用須顯式執行上述命令。

package.json 標明引擎要求:Node >=22,DSH >=0.2.1-rc.2 <0.3.0;許可證 MIT;當前發佈版本在 npm 元數據中爲 0.1.3。

適用場景與注意

適合希望在 DSH 會話內把「改代碼 → 多視角複查 →(可選)按清單推進並本地 commit」串成固定工作流的開發者,尤其是已採用或願意採用 Autopilot Harness 文檔與 docs/autopilot/ 目錄約定的倉庫。

應注意:

  • 插件與當前 DSH 進程同權限運行;安裝前建議閱讀 源碼倉庫 與 MIT 許可證,自行評估是否納入你的 profile。
  • 社區目錄(如 SkillHub、dsh-plugin.org)爲獨立站點,與 DeepSeek / 幻方無 README 所稱的官方從屬關係;DSH 生態理念是「一切皆插件」,本稿不將其描述爲官方應用商店條目。
  • 自審與清單推進會消耗更多模型輪次;confirm_rounds、scope 等可按項目在 config.yml 調整。
  • 推進清單時的本地 commit 仍需你在 VCS 側 review;插件不自動 push。

結尾

dsh-autopilot-harness 把 Autopilot Harness 的結構化規劃、清單狀態機與五鏡頭自審接到 DSH 的 turn 邊界,用可復現的 /autopilot-enable、/autopilot-on、/autopilot-run 替代單純的「繼續」循環。若要查看分類與簡介,可打開目錄頁 https://www.skillhub.cn/plugins/AdamsShen/dsh-autopilot-harness;安裝命令、命令表與配置字段以 https://github.com/AdamsShen/dsh-autopilot-harness README 爲準。

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

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

小夜