Preface¶
DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture, with the community plugin ecosystem operating independently of DeepSeek or the official High-Flyer platform. When developers use DSH for complex task orchestration, they need to handle repetitive work such as evidence tracing, discovery logging, acceptance gating, and skill evolution. dsh-research-harness is a research workbench plugin for DSH that bundles evidence guards, append-only ledgers, completion gates, shortest-path routing, and 10 research skills into an independent “Research Harness” preset.
What Is This¶
dsh-research-harness is a research workbench plugin designed for DSH, maintained by Oseas031. It encapsulates key stages of the research workflow into tools and presets, enabling researchers in DSH to:
- Record research findings in a structured manner (with provenance, confidence, and verification status)
- Control task progress through gates and routing
- Manage cross-session repair budgets and ledgers
- Evaluate and pair-evolve 10 built-in research skills
The plugin is currently at version v0.9.0, licensed under the MIT License.
Core Features¶
Evidence Guard and Workspace Isolation¶
The plugin implements multi-layered protection at the workspace boundary and file access level:
- Path escape guard:
guardPathEscape()usesrealpathSync()to resolve symlinks and Windows Junctions, walks the ancestor chain for validation, and prevents escape outside the workspace. - Binary file interception:
guardBinaryRead()callstrim()beforeextname()and validates against the real DSH tool contract, rejecting trailing-space bypasses. - Read/write boundary validation: Based on DSH’s
exec.argumentsandWorkingDirectoryService, it validateswrite/edit/apply_patchand rejects writes to paths outside the workspace. - Read-only mode: Optional
enforceReadInsideWorkspace: truestrictly limits the read scope in isolated evaluation mode.
The plugin also detects file size and intercepts text and binary files larger than 20MB.
Evidence Bookkeeping and Ledger¶
Research findings must include provenance (source) and confidence (observed / inferred / unknown), and support task labels and verifiedBy (agent-reported / lead-verified) verification status.
Key CLI tools include:
- findings_record: Record a finding
- findings_unknown: Record an unknown item
- findings_resolve: Resolve an unknown item
- findings_ingest: Structurally import findings code blocks from a report
- findings_mark_verified: Mark as verified
The ledger is written in append-only mode to ledger.jsonl. Each record generates a SHA-256 receipt synchronously at write time, stored in ledger-receipts.jsonl. verifyLedger can detect line modifications, deletions, and missing receipts (but does not prove conclusions are true).
Completion Gate and Routing¶
The plugin provides two layers of gate control:
- Completion gate: Unresolved blockers prevent a direct
complete; a soft gate (gate-skip) that is skipped must leave a reason, risk, and compensating action. - Routing (
findings_route/route): Supportsacceptancesufficiency specs and returnsrecord-findings,resolve-blockers,continue-recording,run-acceptance, orBLOCKED, while synchronously writing aroute-checkcheckpoint.
Routing is aware of repair budgets and incremental milestones to avoid deadlocks.
Repair Budget and Task-Level Acceptance¶
Ledger adds a repair-attempt event, persisting failed repair rounds per task:
- recordRepairFailure(task)
- resetRepairRounds(task)
- repairRoundsOf(task)
acceptance.task scopes the minFindings and minObservedRatio statistics to the current REQ-xxxx / TASK-xxxx, facilitating shared ledgers.
Expectation Alignment and 6-Layer Structure¶
The alignment_record tool and CLI alignment save|read persist the 6-layer expectations, probe adjudication (adopt|reject|reframe), and unknown items to .research/alignment/<slug>.md, and synchronize them to the ledger.
Skill Evolution and Evaluation¶
The plugin equips 10 built-in research skills with frozen behavior evaluation matrices (evals/skills/) and a SKILL.md <= 8192 character red line, supporting:
- Random A/B paired review
- keep/revert with rollback protection
CLI tools include:
- evolve init: Create an experiment
- evolve hash: Compute parent hash
- evolve apply: Apply a candidate
- evolve select: Select the current champion
- evolve verify: Verify a candidate
- evolve log: View the evolution log
- evolve champion: Designate a champion
- evolve eval: Asynchronous double-blind review executor
- evolve rollback: Rollback
End-to-End Artifact Pipeline¶
Built-in harness-lab/scenarios/pipeline-e2e.mjs (npm run test:e2e) chains experiment CSV → sci-figure 300dpi figure output → latex-paper-en PDF compilation → findings.* evidence loop.
Other Capabilities¶
- Turn observability:
SpanRecordermonitors guard pass-through andtools/result, writing sanitizedspans.jsonl; CLIfindings_spansoutputs tool latency rankings and recent invocations. - Evidence freshness and file provenance re-verification:
aggregatesupportsmaxAgeHoursto automatically downgrade expired entries to# TODO stale; theevidencevalidator supportscheckFileExists. - Multi-project ledger separation and concurrent locking: By default, the ledger is automatically isolated per workspace (
~/.dsh/research-harness/projects/<slug-hash>/), with writes protected by a cross-processwxexclusive lock ensuring monotonicseqand strict receipt alignment. - Secure async command validator:
verifier(command)enforcesshell: false, argv array arguments, environment variable whitelisting, rejects shell metacharacters, andverifyAsync()handles process-tree timeout reclamation; CLI addsverify-cmd.
Installation and Activation¶
npm Install (DSH Plugin)¶
Install v0.9.0 into DSH’s web profile (replace the name when using a different profile):
dsh plugin --profile web add dsh-research-harness@0.9.0
After installing, updating, or modifying the preset combination, you must fully exit and restart DSH, then select “Research Harness”.
GitHub Install¶
dsh plugin --profile web add github:Oseas031/dsh-research-harness#v0.9.0
Standalone CLI Install¶
npm install -g dsh-research-harness@0.9.0
Or install from source:
git clone https://github.com/Oseas031/dsh-research-harness.git
cd dsh-research-harness
npm install
npm link
Verify Installation¶
After restarting, check whether the following 13 tools are available:
- findings_record
- findings_status
- findings_aggregate
- findings_challenge
- findings_route
- findings_verify
- findings_gate_skip
- findings_unknown
- findings_resolve
- findings_ingest
- findings_mark_verified
- findings_spans
- alignment_record
And confirm that the skill provider has registered 10 skills.
Typical Usage¶
Initialize Ledger¶
research-harness init --ledger .research
Record a Finding with Provenance¶
research-harness record \
--claim "README provides v0.5.0 usage instructions" \
--provenance "README.md:1" \
--confidence observed \
--task REQ-0005 \
--verified-by agent-reported \
--ledger .research
View Status and Route¶
research-harness status --ledger .research
research-harness route --scale delegate --ledger .research
Verify Ledger Receipts¶
research-harness verify --ledger .research
Pass Acceptance Sufficiency Spec¶
research-harness route \
--acceptance acceptance.json \
--scale delegate \
--ledger .research
acceptance.json example:
{
"minFindings": 1,
"minObservedRatio": 1,
"requiredRouteChecks": 1,
"task": "REQ-0005"
}
Skill Evolution Example¶
Create an experiment and compute the parent hash:
research-harness evolve init \
--name EXP \
--surface "skills/validate-data/**" \
--root .
research-harness evolve hash \
--file skills/validate-data/SKILL.md \
--root .
Prepare proposal.json, generate the paired packet, fill in the verdict, then execute:
research-harness evolve apply \
--name EXP \
--candidate proposal.json \
--root .
research-harness evolve select \
--name EXP \
--root . \
--ledger .research
research-harness evolve verify \
--name EXP \
--root .
research-harness evolve log \
--name EXP \
--root .
research-harness evolve champion \
--name EXP \
--root .
Before apply and before select, the frozen evaluator_id is re-verified; if drift is detected, the operation is rejected or rolled back.
Default Data Locations¶
| Usage | Default Location | Override Method |
|---|---|---|
| DSH plugin | ~/.dsh/research-harness/ (on Windows: %USERPROFILE%/.dsh/research-harness/) |
Plugin config ledgerRoot; falls back to ./.research when DSH home is unavailable |
| Standalone CLI | ./.research in the current working directory |
--ledger DIR, then the RESEARCH_LEDGER environment variable |
| Skill evolution | <root>/.evolve/<name>/ |
--root DIR; defaults to the package root where the CLI resides |
Key artifacts:
- ledger.jsonl: Append-only evidence, unknowns, route-checks, completion attempts, and champion events
- ledger-receipts.jsonl: SHA-256 receipts corresponding to mechanically written lines
- guard-log.jsonl: Guard rejections and wiring self-check traces
- .evolve/<name>/: contract.json, archive.jsonl, archive-receipts.jsonl, gens/, packets/, verdicts/, and backups/
Applicable Scenarios and Notes¶
Suitable scenarios:
- DSH task orchestration requiring “evidence tracing + acceptance loop”
- Research-type tasks requiring structured recording of findings, unknowns, and resolution paths
- Tasks requiring evaluation and paired evolution of skills/subtasks
- Tasks requiring cross-session persistence of repair budgets and ledgers
Notes:
- The plugin runs with the current DSH process privileges; review the source code and license before installation
- The current tested scope is Windows + DSH; macOS, Linux, other DSH versions, and other installation layouts require re-acceptance in the corresponding environments
- harness-lab validates the plugin contract layer using real cordis boot, ToolsService, and SystemPrompt, but it is not a full DSH UI end-to-end test
- After changing preset combination layers such as persona, tool surface, or skill root in real DSH, you must fully exit and restart DSH before re-acceptance
10 Built-in Research Skills¶
| Skill | Purpose |
|---|---|
expectation-alignment |
Six-layer expectation alignment, probing, and unknown item governance before research begins |
humanizer-paper |
Fidelity polishing and AI-trace checking for Chinese and English academic manuscripts |
latex-paper-en |
English LaTeX paper compilation, structure, citations, logic, and formatting fixes |
latex-thesis-zh |
Chinese LaTeX thesis compilation, standards, structure, and consistency checks |
literature-search-arxiv |
arXiv literature search and abstract extraction |
literature-search-pubmed |
PubMed literature search and abstract extraction |
sci-figure |
Scientific figure generation and formatting |
latex-paper-zh |
Chinese LaTeX paper compilation and standards checking |
reporting-summary |
Structured summarization of research reports |
note-taking |
Research notes and structured recording |
Conclusion¶
dsh-research-harness provides DSH with a complete research workbench: from evidence guards and ledger management to acceptance gates and skill evolution, covering the critical stages of the research workflow. If you handle research-type tasks in DSH and need structured recording, acceptance loops, and skill evolution, this plugin can serve as your “Research Harness” preset.
- Directory page: https://www.skillhub.cn/plugins/Oseas031/dsh-research-harness
- GitHub: https://github.com/Oseas031/dsh-research-harness