DeepSeek Harness 插件

dsh-llm-verifier-web0926

Best-of-3/5 orchestration and LLM-as-a-Verifier selection for DeepSeek Harness(英文原文)

跳到安装方式

来源信息

GitHub 仓库
Web0926/dsh-llm-verifier
最近更新
2026年8月21日
分类
工具与能力
GitHub stars
3
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/Web0926/dsh-llm-verifier
插件名:dsh-llm-verifier-web0926
作者:Web0926

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-llm-verifier

<p align="center"> <strong>Generate several coding-agent patches, reject the ones that fail your tests, and let an LLM verifier rank the rest before you decide whether to apply the winner.</strong> </p>

<p align="center"> <a href="README.zh-CN.md">简体中文</a> </p>

<p align="center"> <img alt="Status: developer preview" src="https://img.shields.io/badge/status-developer%20preview-orange"> <img alt="DeepSeek Harness 0.1.0-rc.7" src="https://img.shields.io/badge/DeepSeek%20Harness-0.1.0--rc.7-4c6ef5"> <img alt="Node.js 24" src="https://img.shields.io/badge/Node.js-24-339933"> <a href="LICENSE"><img alt="MIT License" src="https://img.shields.io/badge/license-MIT-green"></a> </p>

dsh-llm-verifier is a developer-preview plugin for DeepSeek Harness. It runs 3 or 5 independent coding candidates in detached Git worktrees, validates every candidate against project tests, ranks the passing patches with llm-verifier, and keeps the original checkout unchanged until a separate approval applies the selected patch.

> [!WARNING] > This public version is for trusted repositories only. Candidate generation uses detached Git worktrees and the DeepSeek Harness workspace-write permission mode, but validation commands still execute code from the target repository on the host. Read the [security boundaries](#security-boundaries) before using it.

Why this exists

A single coding-agent run can produce a plausible patch, yet another independent run may find a simpler fix, add better tests, or avoid a subtle regression. Running several candidates manually creates a new problem: comparing them consistently.

This plugin turns that process into one approval-gated workflow:

1. Give every candidate the same coding task. 2. Keep candidate edits in separate detached worktrees. 3. Run deterministic project validation before model-based ranking. 4. Exclude candidates that fail validation. 5. Rank the remaining patches with an LLM verifier when comparison is needed. 6. Produce an auditable report and winner patch. 7. Apply the winner only after a second explicit approval, then rerun validation.

flowchart LR
    T[One coding task] --> C1[Candidate 1]
    T --> C2[Candidate 2]
    T --> C3[Candidate 3]
    T -. Best-of-5 .-> C45[Candidates 4 and 5]

    C1 --> V1{Validation}
    C2 --> V2{Validation}
    C3 --> V3{Validation}
    C45 --> V45{Validation}

    V1 -->|pass| R[LLM verifier or validation-only selection]
    V2 -->|pass| R
    V3 -->|pass| R
    V45 -->|pass| R
    V1 -->|fail| X[Excluded]
    V2 -->|fail| X
    V3 -->|fail| X
    V45 -->|fail| X

    R --> A[Report plus winner.patch]
    A --> H{Second approval}
    H -->|approve| P[Apply patch and rerun validation]
    H -->|stop| U[Original checkout remains unchanged]

What you get

  • Best-of-3 or Best-of-5: use 3 candidates by default, or 5 for higher-value tasks.
  • Validation-first selection: failing candidates never enter model ranking.
  • Efficient ranking: one passing candidate wins by validation; two use one pivot; three to five use two pivots.
  • Two approval gates: one before candidate execution and another before applying the winner.
  • Integrity checks before apply: repository path, base HEAD, clean state, and winner-patch SHA-256 are checked again.
  • Auditable artifacts: reports include rankings, changed files, timings, process status, patch hashes, verifier requests, and token usage.
  • Credential controls: validation processes do not receive the DeepSeek API key; logs, errors, validation output, and text diffs are redacted against the exact credential value.
  • No automatic Git mutation: the plugin does not commit, push, stash, reset, or automatically apply a patch.

Current status

ItemCurrent public version
Release stageDeveloper preview
DeepSeek HarnessPinned to 0.1.0-rc.7
Node.js24.x
Python bridgeManaged by uv; Python >=3.9,<3.14
llm-verifierPinned to 0.2.0
PlatformsmacOS and Linux
Candidate counts3 or 5; default 3
DistributionLocal-path installation after building from source
LicenseMIT

Quick start

Prerequisites

Install or prepare:

  • DeepSeek Harness 0.1.0-rc.7
  • Node.js 24 and pnpm 11.7.0
  • uv
  • Git
  • A DeepSeek credential available to Harness through the credential reference DEEPSEEK_API_KEY

1. Clone, install, and verify

git clone https://github.com/Web0926/dsh-llm-verifier.git
cd dsh-llm-verifier

pnpm install --frozen-lockfile
uv sync --frozen --project python
pnpm run check

2. Add the local plugin to the Web profile

dsh plugin --profile web add "$(pwd)"
dsh plugin --profile web list

3. Start Harness in a clean target repository

cd /path/to/a/clean-and-trusted-git-repository
dsh --profile web

Ask Harness to use the tool, for example:

Use verified_best_of with 3 candidates to fix the login retry bug and add regression tests.
Run pnpm test for validation. Do not apply the winner yet.

Equivalent tool input:

{
  "task": "Fix the login retry bug and add regression tests",
  "candidateCount": 3,
  "validationCommands": ["pnpm test"]
}

The tool returns the run ID, status, eligible candidates, ranking, report path, token usage, and—when a winner exists—the local path to winner.patch.

After reviewing the report and patch, explicitly call:

{
  "runId": "<runId returned by verified_best_of>"
}

through apply_verified_winner. The plugin requests a separate approval before applying the patch and reruns the original validation commands afterward.

4. Remove the plugin

dsh plugin --profile web remove dsh-llm-verifier

Tools

verified_best_of

Runs candidate generation, validation, and winner selection without modifying the original checkout.

ParameterRequiredDescription
taskYesCoding task shared by every candidate.
candidateCountNo3 or 5; defaults to 3.
validationCommandsNoExplicit commands. When omitted, one supported project type is detected.

Possible run states are winner_selected, no_winner, and failed.

apply_verified_winner

Applies one previously selected winner after a separate approval. Before applying, it rechecks the repository identity and state, base commit, and patch SHA-256. It then reruns the validation commands captured by the original run.

Automatic validation detection

Explicit validation commands always take precedence. Without them, the plugin accepts exactly one recognized root project type:

Root markersCommand
package.json, one JavaScript package manager, and a test scriptThat package manager's test command
pyproject.tomluv run pytest
Cargo.tomlcargo test
go.modgo test ./...
Makefile with a test targetmake test

If several project types match, several JavaScript package managers are present, or no supported type can be identified, the run fails fast and asks for explicit commands.

Security boundaries

The plugin is deliberately conservative about repository mutation, credentials, and artifacts, but the current public version is not a container boundary.

  • It accepts only a normal, clean Git repository root.
  • It rejects submodules, sparse checkouts, linked worktrees, and uncommitted changes.
  • Candidate edits live under $DSH_HOME/llm-verifier/runs/<runId> in detached worktrees.
  • Candidate Harness processes use the explicit workspace-write permission mode and do not inherit the host DSH_PERMISSION_MODE.
  • Validation commands execute repository code on the host. Use this version only with repositories and validation commands you trust.
  • Validation processes do not receive the API key.
  • If a candidate writes the exact credential into text, binary content, or a symbolic-link target, that candidate is invalidated.
  • Binary data is never sent to the verifier; complete binary patches remain local.
  • Cancellation and timeout handling terminate the candidate process group and attempt to clean up plugin-created worktrees.
  • An apply failure is left in place for inspection; the plugin does not run git reset as an automatic rollback.

Review every approval prompt, especially the validation commands shown before execution.

Run artifacts

Each run is stored under:

$DSH_HOME/llm-verifier/runs/<runId>/
├── artifacts/
├── manifest.json
├── report.md
├── winner.patch
└── apply-result.json        # created only after an apply attempt

The report records candidate launch, completion, validation, and ranking counts; exit codes and durations; diff statistics; patch paths and SHA-256 values; log paths; binary-file metadata; verifier request counts; and token usage. When verifier input is truncated, the report points to the complete local artifact.

Cost awareness

With the default three evaluation criteria and two repeated evaluations, a fully eligible Best-of-3 run makes about 36 verifier requests and a Best-of-5 run about 72. Actual counts vary with candidate eligibility and cache hits and are written to the report.

Real candidate and verifier runs use paid model requests. Automated tests do not call the live DeepSeek API.

Configuration

Default values:

SettingDefault
defaultCandidateCount3
candidateProfileheadless
credentialRefDEEPSEEK_API_KEY
verifierModeldeepseek-v4-flash
nEvaluations2
maxVerifierWorkers8
verifierEfforthigh
verifierMaxTokens32768
candidateTimeoutMs1200000
validationTimeoutMs600000
runTimeoutMs2700000
maxVerifierTraceBytes524288
stateDirectory$DSH_HOME/llm-verifier

Override the plugin entry in the Web profile's cordis.patch.yml:

- id: llm-verifier
  config:
    defaultCandidateCount: 3
    candidateProfile: headless
    credentialRef: DEEPSEEK_API_KEY
    verifierModel: deepseek-v4-flash
    nEvaluations: 2
    maxVerifierWorkers: 8
    verifierEffort: high
    verifierMaxTokens: 32768
    candidateTimeoutMs: 1200000
    validationTimeoutMs: 600000
    runTimeoutMs: 2700000
    maxVerifierTraceBytes: 524288
    stateDirectory: $DSH_HOME/llm-verifier

nEvaluations accepts 14, maxVerifierWorkers accepts 116, and verifierEffort accepts low, high, or max. The verifier model name must begin with deepseek-.

Development

pnpm run typecheck
pnpm test
pnpm run build
python3 -m py_compile python/verifier_bridge.py

The test suite covers Best-of-3 and Best-of-5 eligibility matrices, patch tampering, credential redaction, verifier failures, post-apply validation failures, binary patches, input truncation, and residual-process cleanup.

See [CONTRIBUTING.md](CONTRIBUTING.md) before proposing a change. Bug reports should include sanitized evidence and must never include credentials or private repository content.

Current limitations

  • No Windows support.
  • No dirty worktrees, submodules, sparse checkouts, or linked worktrees.
  • Candidate count is fixed to 3 or 5.
  • No automatic commit, push, merge, or patch application.
  • No OpenAI, Vertex, vLLM, or other verifier backends.
  • No custom Web UI, ProgressTracker, or early stopping.
  • Source installation only; no npm package or prebuilt GitHub release yet.

License

[MIT](LICENSE)