前言¶
在 DeepSeek Harness(DSH)裏改規則、技能、模型或插件,往往憑主觀感受判斷「有沒有變好」。手工跑幾次對話很難復現,也缺少變更前後的對照。社區插件 dsh-verdict(中文名 效果評測,命令 verdict)面向這類問題:登記可重複的評測用例、執行校驗、在變更前後做 diff,用證據回答「這次改動是否真的有幫助」。
下面介紹插件的定位、能力與安裝用法。事實以 npm 包 dsh-verdict 的說明文檔爲準;原 GitHub 獨立倉庫 hj01857655/dsh-verdict 已無法訪問,SkillHub 目錄頁標註該插件已歸檔並曾合併進 dsh-plugins monorepo,而該包已於 2026-10-20 起從 monorepo 工作區移除,安裝與發佈仍以 npm 爲準。
這是什麼¶
dsh-verdict 由維護者 hj01857655 發佈,分類屬於 DSH 工作流 類插件。一句話定位:Measure whether a change to your dsh setup actually helped — register repeatable cases, run them, and diff the results before and after you change rules, skills, model settings, or plugins.
在 DSH「一切皆插件」的生態裏,社區目錄站點 SkillHub 提供索引與簡介,與 DeepSeek / 幻方無官方從屬關係;當前可安裝的製品主要來自 npm(許可證 MIT,npm 上最新版本爲 0.6.1,SkillHub 頁曾標註 v0.5.1,以你實際安裝的版本爲準)。
核心功能¶
以下能力均來自 npm 包 README 的說明,且標註爲已實現:
- 規則捕獲與持久化:通過
learn流程捕獲自然語言規則,寫入 durable store(項目內.verdict/ledger.json,原子寫入)。 - Guard 編譯與校驗:將可執行的規則編譯爲當前平臺可用的 shell 檢查;僅當存在可執行 check 時才 promote 到
AGENTS.md(帶<!-- verdict:<id> -->標記)。 - 按需與定時複驗:
check彙總 passed / violated / broken;常駐 host 上還可每六小時自動複驗。 - 變更前後對比:
verdict diff系列命令在 before / after 快照之間對比,回答改動是否改善。 - 會話與技能蒸餾:會話追加日誌(
session); repeated successes 可蒸餾爲 skill 候選(skills),設置頁支持寫入(POST /api/verdict.skills.write)。 - 設置頁 Web 面板:Host 註冊
GET /api/verdict.panel;客戶端在 Settings 中註冊 Verdict 頁,無 web 客戶端的 host 會跳過 UI 部分。 - 獨立 CLI:不啓動 dsh 也可運行
verdict子命令,便於本地核對與 CI 集成。
規則引擎對若干句式有明確支持(文件是否存在、禁止某文件、禁止根目錄 glob、要求文件內容包含某字符串等);無法在當前平臺忠實表達的句子會保持爲 candidate,不會生成近似命令。
違反與「檢查無法運行」分開處理:exitCode 爲 1 僅表示真實 violation;guard 無法執行時記爲 broken,不會單獨把流水線標紅。同一規則若持續失敗,在三次不同 violation episode 後會降爲 ineffective(不是三次運行計數)。
安裝與啓用¶
推薦從 npm 安裝(tarball 內含預構建的 lib/)。官方安裝命令如下:
dsh plugin add dsh-verdict --profile web
需要鎖定版本時:
dsh plugin add dsh-verdict@0.5.1 --profile web
本地開發可使用 link(路徑換成你的包目錄):
dsh plugin add link:/path/to/dsh-verdict --profile web
插件自帶 cordis.patch.yml,安裝後由 profile 自動註冊,無需手工改配置。不要指望直接從 GitHub 源碼 dsh plugin add github:... 安裝:lib/ 在源碼中 gitignore,且 dsh 禁止安裝期構建腳本;應使用 npm 或 link:。
安裝前請在 npm 或 tarball 中查看 LICENSE(MIT)與包內容;插件在 當前 dsh 進程權限 下運行,guard 會執行 shell 命令,安裝前應理解其行爲範圍。
典型用法¶
在 DSH 宿主內調用服務¶
宿主加載插件後,可通過 ctx.verdict 學習規則並檢查:
ctx.verdict.learn('never commit the file secrets.env')
// 捕獲規則、編譯 guard、寫入 AGENTS.md,並可按需複驗
ctx.verdict.check()
// -> { passed, violated, broken, exitCode }
CLI:日常操作與 CI¶
不啓動 dsh 時,可使用同名 CLI(節選 npm README 示例):
verdict learn "never commit the file .env"
verdict check
verdict list
verdict recall "env"
verdict session --intent "verify a change" --step "run tests" --step "commit"
verdict skills --write
verdict panel
verdict diff before ; verdict diff after ; verdict diff
verdict doctor
verdict inventory --audit
其中 verdict check 適合 CI:真實 violation 時退出碼非零;僅 guard 無法運行時退出碼仍爲 0。評估某次 DSH 配置變更時,可先打 before 快照、改配置、打 after 快照,再執行 verdict diff 查看對比結果。
verdict doctor 用於靜態檢查清單、構建產物、patch id、peer 依賴位置、lifecycle scripts 等是否符合 dsh 插件規則。
適用場景與注意¶
適合誰
- 經常調整 DSH 規則、技能、模型或插件,需要可重複證據的團隊或個人。
- 希望在 CI 或腳本里固定跑 guard,避免「感覺變好了」但無對照的情況。
- 使用帶 Web Settings 的 dsh 配置,需要在面板裏查看規則狀態與 before/after 對比。
注意事項
- 插件以 當前 dsh 進程權限 運行,guard 會讀寫項目文件並執行 shell;安裝前請閱讀源碼或 npm 包內容,並確認 MIT 許可證是否滿足你的合規要求。
- 獨立倉庫
https://github.com/hj01857655/dsh-verdict已不可用;源碼歷史曾進入 monorepo,但 monorepo 現僅保留其他包,請以 npm 包dsh-verdict爲安裝來源。 - GitHub 直裝不可行;開發調試請用
link:或本地npm ci && npm run build後再 link。 - 面板與 API(如
/api/verdict.panel)依賴 host 的 web 連接;純 CLI 環境仍可完成 learn / check / diff 等核心流程。
結尾¶
dsh-verdict 把「配置變更是否有效」從主觀感受拉回到可重複用例與快照 diff:登記規則、編譯 guard、複驗,並在變更前後對比結果。若你在 SkillHub 或 GitHub 上看到舊鏈接,以 npm 安裝命令與版本爲準。
- 社區目錄頁:https://www.skillhub.cn/plugins/hj01857655/dsh-verdict
- npm:https://www.npmjs.com/package/dsh-verdict
- 相關 monorepo(當前工作區已不再包含本包):https://github.com/hj01857655/dsh-plugins