dsh-verify-gate
Agent 与会话 活跃维护

dsh-verify-gate

LosEcher/dsh-verify-gate

轻量级插件,将 verify-gate 封装为 verify_run 代理工具。所有检查用声明式配置描述,不写脚本;执行后输出通过/失败报告,并以严格退出码暴露结果,接入 CI 门禁判断零歧义。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
18 KB
仓库大小
2 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:LosEcher/dsh-verify-gate
git clone https://github.com/LosEcher/dsh-verify-gate.git
git clone git@github.com:LosEcher/dsh-verify-gate.git
README.md main

dsh-verify-gate

DSH 插件:把 verify-gate(声明式验证清单执行器)包装成 agent 工具 verify_run。

  • verify_run:按 TOML 清单(file 存在/包含/regex、cmd 退出码+输出、http 状态+body、git clean/branch、json 字段)机械执行验证,返回结构化报告(verdict / 每项 pass|fail|na / 证据明细)。manifest(路径)或 manifestText(内联 TOML)二选一,cwd 指定断言基准目录。

把「验证」从 agent 的散文行为变成 exit 0/1/2 门禁——改完必跑、不过 blocked。

安装

# 二进制(工具本体,crates.io 或 GitHub Release)
cargo install verify-gate

# 插件(link 本地开发 / github 依赖)
dsh plugin --profile web add /path/to/dsplugins/dsh-verify-gate
# 或 pnpm install 后把 dsh-verify-gate 加入 profile package.json dependencies + dsh.profile.bundles

二进制解析顺序:cordis.patch.yml 的 verify-gate 行 config.binary → $VERIFY_GATE_BIN → PATH verify-gate → ~/.cargo/bin/verify-gate。缺失时工具返回安装提示,不拖垮插件树。

验证

node --check index.mjs lib/tools.mjs
node test/preflight.mjs          # 用真实 @deepseek-ai/dsh-tools 编译工具定义
pnpm dsh --profile web --dump-config | grep -A6 'verify-gate'   # 行存在

改 host 代码后必须重启 dsh web;verify_run 在新会话可见(注入时序)。

Manifest 示例(内联)

[[check]]
name = "构建产物存在"
type = "file"
path = "target/release/verify-gate"

[[check]]
name = "测试通过"
type = "cmd"
cmd = "cargo test"
stdout_contains = "test result: ok"
timeout_secs = 180

License

MIT