dsh-verify-gate
English | 中文
DeepSeek Harness 的开源插件:在 agent 说「做完了」之前,先跑通工作区里的验证命令。
是否通过以进程退出码为准。通过后写入可复核回执;之后只要成功执行了改代码类工具(如 edit、write、bash),回执作废,须重新验证后才能结案。
安装
本地路径:
dsh plugin --profile web add /你的/绝对路径/verify-gate或从 GitHub(仓库已包含构建产物 lib/):
dsh plugin --profile web add github:blueWhalei/dsh-verify-gate重启 Web,打开目标工作区,然后:
1. 执行 /verify run,或让模型调用 verify_run 2. 全部命令退出码为 0 后,再调用 verify_conclude
验证命令如何选定
优先级如下:
1. 配置里的 commands(只要非空,一律用它) 2. 否则开启自动探测(默认开启),且工作区根目录须恰好匹配一种常见约定: - 存在 package.json,且含有 scripts.test → 按 lockfile / packageManager 选择包管理器,执行 <包管理器> test - 存在 go.mod → go test ./... - 存在 Cargo.toml → cargo test 3. 一种都匹配不到,或同时匹配多种 → 报错并要求写入 commands,避免跑错命令
Python、Java 等约定差异较大的项目,请直接配置 commands。
自定义配置
仅在默认行为不符合项目时修改。写入所用 profile 的 cordis.patch.yml(会整段替换该插件的 config):
- id: dsh-verify-gate
name: dsh-verify-gate
config:
commands:
- id: test
run: pytest -q
autoDetect: true
sandboxMode: danger-full-access默认 sandboxMode 为 danger-full-access,以便包管理器访问全局 store;若改为更严格的沙箱,请自行确认验证命令仍能真实跑通。
常用入口
| 目的 | 入口 |
|---|---|
| 跑验证 | verify_run 或 /verify run |
| 查看闸门状态 | verify_status 或 /verify |
| 结案 | verify_conclude(需绿回执,且未弄脏、未过期) |
回执目录:<工作区>/.dsh/verify-receipts/。业务仓库通常将其加入忽略列表。
许可证
MIT