dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
Le dsh-proof est un plugin qui vérifie automatiquement le code après chaque modification (types, qualité et tests) et oblige l’agent IA à corriger les erreurs avant de terminer son travail.
A verification gate for DeepSeek Harness.
Run typecheck, lint, and tests after every edit — and keep the agent working until they pass.
Features • Quick start • Usage • Configuration • Security • Docs • Contributing
The most expensive failure mode of a coding agent is not bad syntax — it is premature completion. The agent edits three files, writes “done”, and you discover by hand that typechecking fails and two tests are broken.
dsh-proof targets the exact moment the agent tries to stop: it turns the project’s checks into a turn-exit condition.
maxReruns limits retries, so there is no infinite loop.verify tool — the agent can run the same checks itself before claiming completion.>=0.2.1-rc.2 <0.3.0 (declared in engines.dsh).>=22.19.npm, pnpm, yarn, or bun) available on PATH.package.json with at least one of typecheck, lint, test, or check, or explicit checks.dsh-proof (npm), or the latest .tgz asset from Releases.The
desktopprofile is managed by the Electron app;dsh plugin --profile desktopis intentionally refused by the CLI.
web, headless)dsh plugin --profile web add dsh-proof
Or, from this repository:
pnpm install
pnpm test
pnpm pack
dsh plugin --profile web add ./dsh-proof-0.1.3.tgz
Restart the profile afterwards: manifest and export changes are not hot-reloaded.
After a write, edit, apply_patch, or similar call, the gate activates at the end of the turn:
agent.steer(...), which prevents the turn from closing and opens a correction step;maxReruns bounds the retries (2 by default).Success is silent. A failure produces a [Proof gate] message in the conversation.
verify toolverify() # run every check
verify(only="test") # run only the named check
It returns { passed, skipped, cwd, checks[] } plus a compact text rendering: overall status, check name, exit code, and output on failure.
[Proof gate] user message containing the failing command output, followed by another agent step.verify tool result with PASS or FAIL.The defaults work on a Node project. For explicit settings, add a top-level override in ~/.dsh/profiles/<profile>/cordis.patch.yml:
- id: proof
config:
checks:
- name: typecheck
command: npm run typecheck
timeoutMs: 120000
- name: test
command: npm test
timeoutMs: 180000
The bundle already inserts the
proofrow. Use- id: proofto override it; a secondinsertwith the sameidwould create a duplicate at startup.
| Key | Default | Purpose |
|---|---|---|
enabled | true | Master switch. |
autoDetect | true | Detect typecheck, lint, test (or check) in package.json. |
checks | [] | List of { name, command, timeoutMs }; takes precedence over auto-detection. |
cwd | '' | Directory for the checks; relative to the session directory. |
maxReruns | 2 | Maximum corrective retries per turn (0: verify without retrying). |
outputChars | 6000 | Maximum output size returned to the model. |
watchShell | false | Treat mutating shell commands as edits too. |
mutatingShellPattern | (provided regex) | Pattern for shell commands considered edits. |
includeSubagents | false | Apply the gate to subagent sessions. |
stopOnFirstFailure | true | Stop after the first failing check. |
The package manager is chosen from the lockfile (pnpm-lock.yaml, yarn.lock, bun.lockb, otherwise npm), but only if it is actually available on PATH. Otherwise the plugin falls back to npm. The following scripts become commands:
typecheck → npm run typecheck (or the detected manager);lint → …test → …check (only when none of the three above exists).write, edit, str_replace_editor, apply_patch, and similar tools marks the workspace as edited.agent/turn-stopping, if files changed, the checks run in the session’s working directory.maxReruns is exhausted (a warning is logged).The checks are shell commands executed with the user’s privileges, outside the DSH sandbox — like an npm test you run yourself. Only configure commands you trust.
The plugin does not modify files itself. However, the commands it runs may do so (formatters, snapshot updates). Their output is visible to the model: avoid printing secrets from a check.
'pnpm' is not recognized — the lockfile manager is not on PATH. The plugin now falls back to npm; otherwise install pnpm or use explicit checks with npm.Verification skipped — there is no package.json and no configured check. Add a test script or explicit checks.pwsh/bash. Enable watchShell: true, or use the editing tools.timeoutMs or reduce the list of checks.timeoutMs.pnpm install
pnpm build # tsc → lib/
pnpm test # build + tests (node:test)
pnpm pack # installable archive
Structure:
src/index.ts Cordis entry: verify tool, prompt section, hooks
src/gate.ts the gate state machine (testable without DSH)
src/runner.ts bounded command execution
src/types.ts configuration + the “proof” message source
src/__tests__/ unit tests
cordis.patch.yml bundle configuration layer
Issues and pull requests are welcome. Read CONTRIBUTING.md for the full engineering, testing, security, and release rules. AI coding agents must also read AGENTS.md, the DevSecOps playbook.
pnpm install and pnpm test.CI runs on Ubuntu and Windows. Release steps are documented in PUBLISHING.md.
GitHub releases and npm publication are automated: pushing a v* tag triggers release.yml, which runs the tests, checks that the tag matches package.json, packs the plugin, publishes to npm through OIDC trusted publishing with provenance, and creates the release with the .tgz asset.
MIT.