前言¶
讓一個 DSH agent 跑完一個已有基準,技術上說並不難;難的是跑完之後留下可校驗的證據:結果是不是按固定協議、固定種子和固定參數跑出來的,JSON artifact 的字段對不對,最後寫出的報告有沒有把運行數字偷偷說成交易能力。ml-quant-trading 倉庫把這些問題定義得很清楚——確定性合成輸入、固定的 protocol v1 命令、適合自動檢查的 JSON artifact、公開的 issue 模板,以及一條明確邊界:基準吞吐量不等於交易表現。
要把「運行 → 校驗 → 總結 → 起草報告」這條鏈路交給 agent 穩定執行,需要把每一步註冊成工具。下面介紹的 dsh-plugin-mlquant-benchmark 就是做這件事的。
這是什麼¶
dsh-plugin-mlquant-benchmark 是 initial-d 維護的 DeepSeek Harness 插件,一句話定位:用於復現 ml-quant-trading protocol v1 基準的 DSH 工具集。許可證爲 MIT,當前版本 0.1.0。
它解決的問題很窄:讓 DSH agent 能夠運行現有 benchmark、讀取機器可讀的 artifact、對照基準協議做校驗,並起草一份可以直接提交的 issue 報告。邊界同樣明確:不添加交易 agent,不調用行情數據 API,也不配置任何模型提供方。
README 把挑戰寫成一句話:DeepSeek Harness 能不能端到端復現一個量化基準、保住證據包,並且不把運行數字變成 alpha 聲明。這個插件就是對這個問題的回答。
核心功能¶
插件註冊四個 DSH 工具:
mlquant_benchmark_v1_cpu:運行固定的 protocol v1 CPU benchmark,結果寫入artifacts/benchmark-v1.json。mlquant_read_benchmark_json:讀取 JSON artifact,渲染成緊湊的 Markdown 結果表。mlquant_validate_benchmark_json:校驗 protocol v1 字段、預期用例、固定參數和方差警告。mlquant_draft_github_issue:從 JSON artifact 起草 DeepSeek Harness benchmark issue 正文,它不會發布到 GitHub。
四個工具對應報告鏈路的四步:先跑,再讀,再校驗,最後起草。發佈這一步留給人工。
安裝與啓用¶
在 DeepSeek Harness 的 profile 或 preset 環境裏執行安裝命令:
dsh plugin --profile web add github:initial-d/dsh-plugin-mlquant-benchmark
包聲明瞭一個 dsh.bundle manifest(patch: ./cordis.patch.yml),bundle id 爲 mlquant-benchmark,會插入下面這行:
- id: mlquant-benchmark
name: dsh-plugin-mlquant-benchmark
兩點需要知道:這個包刻意尚未發佈到 npm,目前只通過 GitHub 分發;依賴爲 @deepseek-ai/dsh-tools ^0.1.0-rc.7(同時出現在 peerDependencies 和 devDependencies 中)。
典型用法¶
經過上面的安裝與配置,典型的使用路徑是 README 裏的 Run-To-Report Path,一共四步:
- 從 GitHub 安裝插件。
- 在 DSH 中打開一個
initial-d/ml-quant-tradingcheckout。 - 讓 DSH 運行、校驗、總結並起草 benchmark 報告。
- 通過專用 issue 模板提交草擬的報告。
這條路徑刻意保持很小。具體執行時,README 建議的 DSH prompt 是:
Read AGENTS.md, docs/benchmarking.md, and docs/reality_check.md.
Use the mlquant benchmark tools to run the protocol v1 CPU benchmark, validate
and read the JSON artifact, and draft a DeepSeek Harness benchmark report. Keep
the result as an engineering reproducibility benchmark, not a trading-performance
claim.
注意 prompt 結尾那句要求:把結果保持爲工程可復現性基準,而不是交易性能聲明。
公開報告路徑走主倉庫的專用模板:
https://github.com/initial-d/ml-quant-trading/issues/new?template=deepseek_harness_benchmark.yml
種子示例見 https://github.com/initial-d/ml-quant-trading/issues/61。想了解背景和麪向 agent 的護欄,可以讀主倉庫的 DeepSeek Harness Recipe 與 Quant Agent Reproducibility Target 兩份文檔。
本地開發¶
如果用本地 checkout 開發,在 manifest 中手動添加同一行:
- id: mlquant-benchmark
name: file:/path/to/dsh-plugin-mlquant-benchmark
開發命令是:
npm install
npm test
測試會用 mock 的 ctx.tools.register 加載插件,驗證四個工具都能註冊,讀取並校驗示例 artifact,並起草一份 issue 正文。
適用場景與注意¶
適合的人:想驗證 agent harness 能否端到端復現一個量化基準、並把證據包完整保留下來的 DSH 開發者。這個插件不提供投資建議,不聲明回測性能,artifact 中不含私有數據或 API key,工具也不會向 GitHub 發佈任何內容——提交報告始終是人工動作。
另外幾點提醒:
- 插件以當前 dsh 進程的權限運行,安裝前應檢查源碼與許可證(本項目爲 MIT)。
- 插件沒有任何隱藏的模型提供方配置。
- 它不是交易系統的一部分,只負責基準復現這條鏈路。
結尾¶
dsh-plugin-mlquant-benchmark 的價值在於把一條容易走樣的鏈路固定下來:DSH 的注意力被引導到運行、校驗、讀取和起草上,產出一份可復現的工程基準報告,而不是投資或排行榜聲明。插件已列入 awesome-dsh-plugin(via PR #2573)。
- 社區目錄頁:https://www.skillhub.cn/plugins/initial-d/dsh-plugin-mlquant-benchmark
- GitHub:https://github.com/initial-d/dsh-plugin-mlquant-benchmark