dsh-plan-adversarial
已验证dsh-plan-adversarial · v0.1.0 · MIT
Command-triggered red/blue adversarial review for ANY plan (not quant-specific). /plan-adversarial <plan>: arms a gate that requires the agent to derive two independent subagents (red=attack, blue=defend), have them converge on a consensus plan with NO th
安装
dsh plugin add dsh-plan-adversarial 用 dsh --profile default --dump-config 确认 layer 已生效 —— 参见安装指南。
源码
标签
说明文档
dsh-plan-adversarial
命令触发的红蓝对抗审查插件(DeepSeek Harness,通用、不限领域)。与 dsh-adversarial-review(量化专用 design/backtest/report)不同,本插件对任意 plan 发起红蓝对抗,且双方自收敛、无第三方裁判。
触发
/plan-adversarial <被审plan/内容>
命令注册后即在命令栏(slash-menu)中自动出现(零 UI 源码改动)。触发后武装当前 agent 的门禁。
机制
/plan-adversarial <brief>武装门禁并记住被审内容。- 门禁在 agent 下一步注入红蓝对抗任务:
- 红队(攻击):找漏洞——目标不清、隐含假设可疑、反例/边界/失败条件、证据链断裂、可执行性差、缺回滚。不辩护、不补全。
- 蓝队(辩护):替 plan 辩护,逐条回击红队;对合理的攻击做修订、补强、标注边界。
- 两方直接交锋(多轮)。无第三方裁判——收敛由红蓝自己达成,不是由主 agent 判定谁赢。主 agent 只编排(派发、转述分歧、汇总共识),不判胜负。
- 门禁执行:pending 期间,除只读调查、派生子代理、向用户提问外的一切工具调用都被拦截。只有当回复正文出现含
结论:行的🛡️ 对抗结果标记,门禁才解除。 - 防死循环:
maxRounds(默认 2)限制单次触发的对抗轮次上限;超限强制放行,未决分歧须如实写出。用户插话即重置门禁。
安装(本工作区)
已在 dsh-home/profiles/web/package.json 注册(file: 依赖 + dsh.profile.bundles)。cordis.patch.yml 通过 dsh.bundle.patch 挂载插件行。新增 bundle 后需在 profile 目录 pnpm install,再重启后端。
配置(cordis.patch.yml)
- insert:
- id: plan-adversarial
name: dsh-plan-adversarial
config:
enabled: true
maxRounds: 2
enabled:总开关maxRounds:单次触发对抗轮次上限(防死循环)allowlist:pending 期间仍允许的工具(默认含 subagent/subagent_fork/workflow/explore 及全部只读调查)conclusionPatterns:额外让门禁保持武装的短语
Fail-safe
apply 全包 try/catch——本插件出错只禁用自身(console.error),不会阻止 harness 启动。
与 dsh-adversarial-review 的关系
dsh-adversarial-review:量化专用红队门禁(design/backtest/report),单一审查者,协议定裁判。dsh-plan-adversarial:通用 plan 审查,红蓝自收敛、无裁判,命令触发。