dsh-jev-plugin:在 DeepSeek Harness 裏批量向 Jev 提 typed 問題

前言

在 DeepSeek Harness(DSH)裏跑 coding agent 時,常見重複判斷會堆在日誌行、工具輸出、失敗測試、搜索結果或候選文件上。把這些內容全部塞進大模型上下文,或逐個開 subagent 去讀,成本和延遲都會上去。機械條件用 grep 更合適;需要語義判斷、又要結構化概率時,就需要專門接口。下面介紹社區插件 dsh-jev-plugin(維護者 RaulLazaro),它把 TypeSafe 的 Jev(System One 決策模型)掛進 Harness,通過 jev 工具對同一段 state 並行提問,返回帶概率的 typed 答案,並在 Settings → Plugins → Jev 裏按用戶配置 Provider 與密鑰。

這是什麼

dsh-jev-plugin 屬於 DSH 社區插件目錄中的「模型推理」類條目(目錄頁:skillhub.cn/plugins/RaulLazaro/dsh-jev-plugin)。插件不負責寫長文或生成 prose,而是返回 judgements:每個問題在同一段文本上並行評估,README 說明一次請求裏帶 50 個問題與帶 1 個問題的耗時和成本大致相當,適合 agent 需要對大量條目做同類判斷的場景。

插件向 Harness 註冊兩類表面:

表面 作用
jev 工具 發送 state + questions,返回 typed 答案、概率與 confidence
Settings → Plugins → Jev 按用戶選擇 Provider、可選 model override、Custom 時的 Base URL、API key,以及 Test connection

源碼與說明見 GitHub:RaulLazaro/dsh-jev-plugin(package.json 版本 0.2.2,許可證 MIT,要求 Node >=20、dsh >=0.1.1-rc.1)。社區目錄與 DeepSeek / 幻方無官方從屬關係;插件在當前 dsh 進程權限下運行,安裝前請自行審閱源碼與許可證。

核心功能

  1. 批量 typed 問題:state 爲字符串(可含多段,用穩定標籤如 ### ITEM 1 引用);questions 爲對象,每題指定 type 與 instructions(及 choice / score 所需的 criteria)。
  2. 三種問題類型:
    - noul:返回 yes 的概率(0–1)
    - choice:返回 choice、probabilities、confidence
    - score:有序 rubric 上的 score、probabilities、confidence
  3. 多 Provider:TypeSafe 直連、Vercel AI Gateway、Laya Studio、OpenCode Zen、Custom;各 Provider 使用獨立 API key,也可通過對應環境變量回退(如 TYPESAFE_API_KEY)。密鑰存入 DSH credentials store,不寫入 settings.yaml。
  4. 連接測試:Settings 內 Test connection 會做一次真實往返,報告解析到的 provider、model、延遲、input tokens 與答案。

README 在相同任務與數據上給出了與「直接用模型」「用 subagent」的對比測量(含 median subagent 9 次請求、48 s、$0.035 等),並註明在機械標準上不如 grep;完整證據見倉庫內 docs/MEASUREMENTS.md,刻意不做的事見 docs/DECISIONS.md。設計問題可參考 TypeSafe 官方 typesafe-ai/skills 與 agent-skill 文檔。

安裝與啓用

包內自帶 bundle patch,安裝一條命令即可。dsh plugin 會轉發到 pnpm,本地路徑、git spec、registry 名稱均可:

dsh plugin --profile web add /path/to/dsh-jev-plugin         # 本地 checkout
dsh plugin --profile web add github:RaulLazaro/dsh-jev-plugin  # 從 GitHub
dsh plugin --profile web add dsh-jev-plugin              # 發佈後從 registry

上述命令會添加依賴、把 dsh-jev-plugin 寫入 profile 的 bundle 列表,並按 cordis.patch.yml 合成配置。不啓動進程即可確認合成結果:

dsh --profile web --dump-config | grep -A4 'dsh-jev-plugin'
# - id: jev
#   name: dsh-jev-plugin
#   config:
#     enabled: true
#     provider: typesafe

必須重啓 Harness 才能掛載新 bundle;運行中的進程不會熱加載。API key 在 UI 填寫,不必寫進 composition。卸載:

dsh plugin --profile web remove dsh-jev-plugin

配置

打開 Settings → Plugins → Jev:

  1. Provider — Jev 服務來源(見下表)。
  2. Model override — 可選;留空則用該 Provider 默認模型。
  3. Base URL — 僅 Custom Provider 需要。
  4. API key — 見上文 credentials store;界面會提示是否已配置。
  5. Test connection — 真實 round trip 與結果摘要。
Provider Endpoint 默認 model 憑證 / 環境變量
TypeSafe (direct) https://api.typesafe.ai/v1/systemone jev-latest TYPESAFE_API_KEY
Vercel AI Gateway https://ai-gateway.vercel.sh/typesafe/v1/systemone typesafe-ai/jev AI_GATEWAY_API_KEY
Laya Studio https://api.laya.studio/v1/systemone auto-routed LAYA_API_KEY
OpenCode Zen https://opencode.ai/zen/v1/systemone jev-1.13 OPENCODE_ZEN_API_KEY
Custom 自建 URL jev-latest JEV_API_KEY

評估接口走 TypeSafe 兼容的 POST …/v1/systemone,不是 OpenAI / Anthropic 兼容端點。Laya Studio 與 Jev 同 wire、同題型,但有截斷與選項數等限制(README 有說明);自建 Laya 可通過 Custom 指向例如 http://127.0.0.1:<port>/v1/systemone。

典型用法

向 jev 工具傳入 JSON 形參(README 示例):

{
  "state": "### ITEM 1\nTypeError: x is undefined\n\n### ITEM 2\nAll 42 tests passed in 1.2s",
  "questions": {
    "item1_failed": { "type": "noul",   "instructions": "Does ITEM 1 report a failure?" },
    "item2_failed": { "type": "noul",   "instructions": "Does ITEM 2 report a failure?" },
    "worst": {
      "type": "choice",
      "instructions": "Which item is the failure?",
      "criteria": { "item1": "a code exception", "item2": "a passing run" }
    }
  }
}

使用上 README 強調:原子化提問(每題窄、按標籤引用條目);instructions / criteria 用英文,state 語言不限;看概率而不只看選項,平坦分佈表示在猜,noul 上 confidence 約 0.4–0.6 信息量少,是否門控動作需在自己 workload 上標定。

適用場景與注意

適合:對大量同質條目做並行語義判斷(是否失敗、選哪一項、打分等),在 agent 流程裏用代碼組合多題答案,而不是一次問整篇文檔。

不要用 Jev 做(README 明確拒絕):

  • 寫作、摘要、翻譯或重排版 — 不能生成文本
  • 精確字符串或算術 — 不是正則或計算器
  • 需要長鏈推理 — 應拆成原子問題,在代碼裏組合

與 grep 的分工:標準可機械匹配時用 grep;需要語義與概率時再調 jev。

DSH 生態理念是「一切皆插件」;本插件是社區貢獻的模型推理擴展,按 profile(示例爲 web)安裝後需在 Settings 配好 Provider 與密鑰,重啓 Harness 即可在 agent 中調用 jev 工具。

更多說明與變更記錄見 GitHub 倉庫 README,插件索引見 SkillHub 目錄頁。

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

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

小夜