dsh-ai-team: Adding an Independent Acceptance Agent and DAG Orchestration to DeepSeek Harness

Introduction

The official agent-team plugin of DeepSeek Harness (DSH) primarily addresses the division-of-labor and coordination questions: “who does what, which part they handle, and how messages get routed.” This plugin, dsh-ai-team, addresses the acceptance and orchestration questions: “was it done correctly, and how should the next step be sequenced.” The two are complementary and can be installed together: the official plugin handles coordination, while this project enforces the acceptance criteria.

Plugin Overview

  • Name: dsh-ai-team
  • Maintainer: PrincessPip
  • Category: Workflow
  • Description: Adds an independent acceptance officer and DAG orchestration to DeepSeek Harness: separation of powers, three-state verdicts, and no pass without evidence.

The plugin does not reinvent teammate management / task boards / direct message delivery (already provided by the official plugin), does not bind to any model vendor (backend is pluggable), and does not embed any private environment (proxies, VPS, subscriptions).

Why You Need It

An LLM telling itself “I’m done” is unreliable. This is a structural problem:

  • It can read its own polished summary and then stamp it as approved. As long as the “worker’s self-narration” is placed before “evidence it actually ran,” the reviewer degrades into a parrot machine.
  • “Ran it once” and “verified it” look identical. A single reply of “the endpoint returned 200” is a single-point observation; real failures often hide in a second observation dimension (the process is up, the port is listening, the logs look fine, but the business logic is wrong).
  • Conclusions without evidence are always attainable. As long as phrasings like “it should be fine” or “theoretically it works” are permitted, rework becomes a game of rewording.

This project does three things, each mapping to one of the issues above:

  1. Separation of powers — Worker (implementation + self-test + writing the delivery package) · Reviewer (read-only re-verification, sole issuer of verdicts) · Arbiter (human, appears only on escalate). Nobody issues a pass certificate to themselves.
  2. Three-state verdicts — Only pass / rework / escalate are allowed. No “basically fine.” The second state sends back a minimal fix instruction; the third is packaged as a “decision that needs a human.”
  3. No pass without evidence — Every pass must carry a file:line reference or command output. Evidence is graded by strength E0–E3; a pass that cannot produce evidence is forcibly downgraded to rework. These rules are enforced mechanically by gates and parsers, not by the reviewer’s goodwill.

In one sentence: replace “I finished my work and I say it’s good” with “someone independently checked it, and the checking process left evidence that others can re-run.”

Core Features

Separation of Powers and Three-State Verdicts

  • Separation of powers: worker, reviewer, and arbiter each fulfill their role. The reviewer only performs read-only re-verification and is the sole issuer of verdicts. The arbiter intervenes only on escalate.
  • Three-state verdicts: only pass / rework / escalate are permitted. No ambiguous “basically fine.”

No Pass Without Evidence

  • Every pass must include a file:line reference or command output.
  • Evidence is graded by strength E0–E3; a pass that cannot produce evidence is forcibly downgraded to rework.

DAG Orchestration and Gates

  • ai_team_plan: Converts a requirement into a DAG.
  • ai_team_gate: Evaluates the graph; rejects malformed graphs before they reach the executor.
  • ai_team_run: Executes the graph in waves; supports headless / fixture / codex engines.

Swarm Mode

  • Disabled by default; toggled via a two-state switch in the input area.
  • When enabled, the Lead shifts from “worker” to “dispatcher”: it must produce a plan (graph) before executing. Deviations require an explicit declaration [Swarm Exception: reason].

Installation & Activation

Prerequisites

Requirement Notes
DSH Installed and able to run dsh --version (this plugin follows the 0.2.x plugin paradigm)
Node.js ≥ 18 (the plugin itself is ESM)
Python 3 ≥ 3.9 (ai_team_plan / ai_team_gate / ai_team_run invoke engines under engine/)
Review backend (pick one) codex CLI (codex exec, can read/write the workspace) or any OpenAI-compatible API (pure text, no file-read access)
Dependency @deepseek-ai/dsh-tools Peer requires ^0.2.0-rc.2; npm’s latest tag is 0.0.1-rc.1 (does not satisfy), so you must explicitly pin a version

Installing Dependencies

The latest tag of @deepseek-ai/dsh-tools does not satisfy the peer requirement; you must explicitly pin a version. Pick one of the three paths below:

# ① Explicitly request a version within the range (uses the official entry; profile managed by pnpm)
dsh plugin --profile web add "@deepseek-ai/dsh-tools@next"     # or pin a specific 0.2.x

# ② Directly link the copy bundled with your local DSH (0.2.1-rc.2) into the profile
New-Item -ItemType Junction `
  -Path "$env:USERPROFILE\.dsh\profiles\web\node_modules\@deepseek-ai\dsh-tools" `
  -Target "<npm global prefix>\node_modules\@deepseek-ai\dsh\node_modules\@deepseek-ai\dsh-tools"

# ③ Install this plugin into DSH's own install tree (Node walks up the directory tree and finds the neighboring dsh-tools)
cd "<npm global prefix>\node_modules\@deepseek-ai\dsh"
npm install /path/to/dsh-ai-team

Verify the dependency is in place:

cd "$env:USERPROFILE\.dsh\profiles\web"
node -e "console.log(require.resolve('@deepseek-ai/dsh-tools'))"
node -e "console.log(require('@deepseek-ai/dsh-tools/package.json').version)"   # must satisfy ^0.2.0-rc.2

Installing the Plugin

# Method A: Install from a GitHub tag (use this for public installs; tag is required)
dsh plugin --profile web add github:PrincessPip/dsh-ai-team#v0.2.1

# Method B: Install from the repo directory (use this when modifying source)
dsh plugin --profile web add /path/to/dsh-ai-team

Note: the installation does not take effect immediately. The tool table is assembled at session start, so you need to open a new session to see the ai_team_* tools.

Minimal Configuration

Plugin configuration lives in the profile patch. Merge the insert section from cordis.patch.yml at the repo root into <DSH_HOME>/profiles/<profile>/cordis.patch.yml (ensure id does not collide with existing entries):

- insert:
    - id: dsh-ai-team
      name: dsh-ai-team
      config:
        backend: codex                          # Reviewer backend: codex | openai
        model: ""                               # Empty = use the backend's default model
        codexPath: codex                        # codex CLI executable
        openaiBaseUrl: https://api.openai.com/v1
        openaiApiKeyEnv: OPENAI_API_KEY         # Write the "env var name" only, never the key itself
        timeoutMs: 3600000
        engineDir: ""                           # Empty = use the bundled engine/
        pythonPath: python
        nodePath: node
        outDirName: .ai-team

Security red line: openaiApiKeyEnv accepts only an environment variable name and never a key literal. The key will not appear in logs or return values. Store your key in an environment variable or a secrets manager; do not write it into the config file.

Typical Usage

First Invocation

In a new session, call the three tools in order:

1) ai_team_init()                                    # Scaffolds the team templates into the current workspace
2) ai_team_review({ brief: "REVIEW-BRIEF.md", round: "1" })
3) ai_team_gate({ graph: ".ai-team/runs/<runId>/GRAPH.json" })   # Only when a DAG is needed

ai_team_init scaffolds:

<target>/AI-TEAM.md          ← Team convention snippet
<target>/REVIEW-BRIEF.md     ← Task brief template
<target>/INC-TEMPLATE.md     ← Incident ticket template
<target>/.ai-team/roles/     ← Prompts for the three roles: worker / reviewer / fire-chief

ai_team_review returns a structured verdict (non-conforming output is downgraded by verdict.js; it never defaults to pass):

{
  "verdict": "rework",
  "confidence": 0.74,
  "blocking": ["B1: Acceptance criterion C3 claims 'covered' but no file:line can be cited — evidence missing"],
  "findings": [
    { "id": "C1", "claim": "New function has unit tests", "evidence": "src/x.test.mjs:12 it('...')", "type": "E2" }
  ],
  "outDir": "/path/to/workspace/.ai-team/reviews/round1",
  "raw": "……full reviewer text (truncated to 20000 chars)……"
}

Five-Tool Quick Reference

Tool One-liner Parameters (* = required) Returns
ai_team_init Scaffolds team templates into the current workspace target (default cwd) · force (default false) { created, skipped, root }
ai_team_review Sends to the independent reviewer; produces a three-state verdict (core) brief* (content or .md path) · round (default "1") · backend · model · dryRun { verdict, confidence, blocking, findings, outDir, raw }
ai_team_plan Requirement → DAG (invokes engine/manager.py) brief* · outDir · model · dryRun { graphPath, runId, nodeCount, summary }
ai_team_gate Gate: rejects malformed graphs before the executor (invokes engine/dag-gate.mjs) graph* (path to GRAPH.json) { ok, errs, warns, codes }
ai_team_run Executes the graph: runs in waves (invokes engine/runner.py) graph* · engine (headless/fixture/codex, default fixture) · runId · fixtureDir (only for fixture: scenario directory containing spec.json) { runId, result, nodes, runDir }

Usage Discipline

  1. When ai_team_gate returns ok=false, you must stop. No “let’s just try running it” — a graph rejected by the gate, if forced into execution, will only produce evidence that cannot be attributed.
  2. The default engine for ai_team_run is fixture: fake workers, sub-second, no cost, no writes to the main tree. It validates the process, not the artifacts. To actually call a model, explicitly pass engine: "headless".
  3. A rework from ai_team_review is not an exception. It is a normal outcome. Read blocking and findings, then act. Only a backend-unavailable error throws.

If fixtureDir is not provided, it falls back in order to <cwd>/.ai-team/fixtures, then the bundled scenarios/honest. If a non-fixture engine is used but fixtureDir is passed → an explicit error is raised (no silent swallowing).

Applicable Scenarios & Cautions

  • Suited for agent workflow scenarios that require strict acceptance and evidence-driven verification.
  • The plugin runs with the current DSH process permissions. Review the source code and license before installing.
  • Not published to npm. Released only via git tag + GitHub Release. You must explicitly include the tag when installing (e.g., #v0.2.1).

Closing

dsh-ai-team plays the role of “independent reviewer and DAG orchestrator” within the DSH ecosystem, complementing the official agent-team plugin. If you need to enforce “was it done correctly” criteria and orchestration flow in agent development, you can install it and configure it following the steps above.

  • Directory page: https://www.skillhub.cn/plugins/PrincessPip/dsh-ai-team
  • GitHub: https://github.com/PrincessPip/dsh-ai-team
羽毛球分组比赛记分
小程序二维码

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

Xiaoye