PerryLink/dsh-github
PerryLink/dsh-github官方级 GitHub CI 集成:composite action.yml、轮询 PR 评审机器人(幂等行内评论 + status-check 门禁)以及 PR/issue 工具,所有写入走人工审批门。
在独立 Git worktree 中运行 3 或 5 个编码智能体候选,用项目命令验证补丁,只对通过者排序,并在应用获胜补丁前要求再次批准。
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.
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-writepermission mode, but validation commands still execute code from the target repository on the host. Read the security boundaries before using it.
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:
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]
HEAD, clean state, and winner-patch SHA-256 are checked again.| Item | Current public version |
|---|---|
| Release stage | Developer preview |
| DeepSeek Harness | Pinned to 0.1.0-rc.7 |
| Node.js | 24.x |
| Python bridge | Managed by uv; Python >=3.9,<3.14 |
llm-verifier | Pinned to 0.2.0 |
| Platforms | macOS and Linux |
| Candidate counts | 3 or 5; default 3 |
| Distribution | Local-path installation after building from source |
| License | MIT |
Install or prepare:
0.1.0-rc.711.7.0uvDEEPSEEK_API_KEYgit 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
dsh plugin --profile web add "$(pwd)"
dsh plugin --profile web list
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.
dsh plugin --profile web remove dsh-llm-verifier
verified_best_ofRuns candidate generation, validation, and winner selection without modifying the original checkout.
| Parameter | Required | Description |
|---|---|---|
task | Yes | Coding task shared by every candidate. |
candidateCount | No | 3 or 5; defaults to 3. |
validationCommands | No | Explicit commands. When omitted, one supported project type is detected. |
Possible run states are winner_selected, no_winner, and failed.
apply_verified_winnerApplies 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.
Explicit validation commands always take precedence. Without them, the plugin accepts exactly one recognized root project type:
| Root markers | Command |
|---|---|
package.json, one JavaScript package manager, and a test script | That package manager's test command |
pyproject.toml | uv run pytest |
Cargo.toml | cargo test |
go.mod | go test ./... |
Makefile with a test target | make 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.
The plugin is deliberately conservative about repository mutation, credentials, and artifacts, but the current public version is not a container boundary.
$DSH_HOME/llm-verifier/runs/<runId> in detached worktrees.workspace-write permission mode and do not inherit the host DSH_PERMISSION_MODE.git reset as an automatic rollback.Review every approval prompt, especially the validation commands shown before execution.
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.
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.
Default values:
| Setting | Default |
|---|---|
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 |
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 1–4, maxVerifierWorkers accepts 1–16, and verifierEffort accepts low, high, or max. The verifier model name must begin with deepseek-.
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 before proposing a change. Bug reports should include sanitized evidence and must never include credentials or private repository content.