Pular para o conteúdo principal
G

dsh-plan-adversarial

gendui123/dsh-plan-adversarial

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

Instalar

dsh plugin --profile web add github:gendui123/dsh-plan-adversarial

README

dsh-plan-adversarial

Command-triggered red/blue adversarial review for ANY plan (domain-agnostic), for DeepSeek Harness. Unlike dsh-adversarial-review (which is quant-specific: design/backtest/report), this plugin reviews any plan via a general-purpose red/blue debate that self-converges — no third-party referee.

Trigger

/plan-adversarial <被审plan/内容>

The command appears in the command bar (slash-menu) automatically once registered (zero UI-source changes). It arms a gate for the calling agent.

Mechanism

  1. /plan-adversarial <brief> arms the gate and stores the brief.
  2. The gate injects a red/blue adversarial task into the agent's next step:
    • 红队 (red / attacker): find holes — unclear goal, suspicious implicit assumptions, counterexamples/boundaries/failure conditions, broken evidence chain, poor executability, missing rollback. Never defend.
    • 蓝队 (blue / defender): defend the plan, rebut red point by point, and repair/harden it against every valid attack.
    • The two converge directly (multi-round). No third-party referee — convergence is reached by red and blue themselves, not adjudicated by the main agent. The main agent only orchestrates (dispatches, transcribes disagreement, summarizes the consensus) and never judges win/loss.
  3. Gate enforcement: while pending, every non-investigative tool call is denied (investigation, subagent-spawning, and asking the user remain allowed). The gate lifts only when the reply text contains a 🛡️ 对抗结果 marker that also has a 结论: line.
  4. Anti-loop: maxRounds (default 2) caps adversarial rounds per trigger; past the cap the gate force-releases and the unresolved disagreements must be reported honestly. A user interjection resets the gate.

Install (this workspace)

Registered in dsh-home/profiles/web/package.json (file: dependency + dsh.profile.bundles). cordis.patch.yml mounts the plugin row via dsh.bundle.patch. After adding a new bundle, run pnpm install in the profile dir, then restart the backend.

Config (cordis.patch.yml)

- insert:
    - id: plan-adversarial
      name: dsh-plan-adversarial
      config:
        enabled: true
        maxRounds: 2
  • enabled: master switch
  • maxRounds: adversarial-round cap per trigger (anti-loop)
  • allowlist: extra tools allowed while pending (default includes subagent/subagent_fork/workflow/explore and all read-only investigation)
  • conclusionPatterns: extra phrases that keep the gate armed

Fail-safe

apply wraps applyInner in try/catch, so a bug here disables only this plugin (console.error) and never prevents the harness from booting.

Relationship to dsh-adversarial-review

  • dsh-adversarial-review: quant-specific red-team gate (design/backtest/report), single reviewer, referee-by-protocol.
  • dsh-plan-adversarial: generic plan review, red + blue converge with no referee, command-triggered.

Plugins relacionados