DeepSeek Harness 插件

dsh-autoresearch

Bounded metric-driven autoresearch plugin for DeepSeek Harness(英文原文)

跳到安装方式

来源信息

GitHub 仓库
EveGoodEvening/dsh-autoresearch
最近更新
2026年8月22日
分类
工具与能力
GitHub stars
1
载体类型
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/EveGoodEvening/dsh-autoresearch
插件名:dsh-autoresearch
作者:EveGoodEvening

检查来源文件

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

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

dsh-autoresearch

> Bounded, metric-driven autoresearch plugin for DeepSeek Harness.

dsh-autoresearch gives a DeepSeek Harness agent a single tool — autoresearch — that runs a baseline-first, keep/reject optimization loop inside an isolated Git worktree.

The design is inspired by Karpathy's autoresearch: an autonomous propose → edit → run → measure → keep/revert loop where a coding agent performs the search and a fixed mechanical metric acts as the source of truth. What makes that loop trustworthy is discipline — the agent proposes candidate changes; trusted host code owns evaluation, metric decisions, persistence, cancellation, and recovery. The model never touches the evaluator, the metric, or the database.

  • One scalar metric. Strict minimize / maximize improvement against a measured baseline; no vibes.
  • Shell-free evaluator. Immutable { command, args, cwd? } argv, final-line JSON scalar parsing, frozen provenance hashes.
  • Narrow mutable surface. Only mutable_globs paths may change; everything else is protected.
  • Durable SQLite evidence. Every run, experiment, attempt, and artifact is recorded with transition-checked state and SHA-256 provenance.
  • Background jobs by default. Runs are dsh-jobs background jobs; inspect or stop them with the generic job tools.
  • Resumable. Crash-safe recovery reconciles in-flight runs from durable state on restart.

Requirements

  • Node.js ^22.19.0 || >=24.0.0 (uses node:sqlite)
  • pnpm 11.7.0
  • DeepSeek Harness 0.1.1-rc.2; this developer-preview integration is retested and repinned for each supported DSH release.
  • The Host must provide agents, jobs, subprocess, systemPrompt, and tools. Background mode additionally requires the calling Agent to mount dsh-tool-jobs; the Web standard Agent preset and the base/headless compositions do so. Host-global job_* tools are not required.

Install

Install the published package through DSH's profile plugin manager:

dsh plugin --profile <name> add dsh-autoresearch
dsh --profile <name> --dump-config

dsh plugin forwards the package spec to pnpm inside the selected profile, then adds installed packages that declare dsh.bundle to that profile's ordered bundle list. A plain pnpm add does not perform that DSH reconciliation.

For a release-like installation from this checkout, build and install the packed artifact:

pnpm install --frozen-lockfile
pnpm pack
dsh plugin --profile <name> add ./dsh-autoresearch-0.1.0.tgz
dsh --profile <name> --dump-config

For local development, install a link to the built checkout instead:

pnpm install --frozen-lockfile
pnpm run build
dsh plugin --profile <name> add .
dsh --profile <name> --dump-config

DSH anchors relative filesystem specs such as . and ./dsh-autoresearch-0.1.0.tgz to the directory where you invoke dsh. The config dump should contain id: autoresearch and name: dsh-autoresearch.

The package ships a Cordis patch row (cordis.patch.yml) declared via dsh.bundle.patch in package.json. DeepSeek Harness out-of-tree features ship as opt-in bundles: the stable patch inserts an ordinary Cordis plugin row whose config is replaced whole, not deep-merged, so every default you want must be explicit in the patch row.

How it works

┌─────────────┐   proposal    ┌──────────────────┐   evaluate   ┌──────────────┐
│  proposal   │ ────────────► │ AutoresearchRun  │ ───────────► │  evaluator   │
│   agent     │ ◄──────────── │    Controller    │ ◄─────────── │ (host-owned) │
└──────────────┘   history     └────────┬─────────┘   metric     └──────────────┘
                                        │ persist
                                        ▼
                               ┌──────────────────┐
                               │  DurableTracker  │  SQLite, schema v5
                               └──────────────────┘

1. Baseline. The controller checks out the start commit, runs the evaluator, and records the baseline metric. No baseline → run is baseline-blocked. 2. Propose. A delegated proposal agent (inherited tools: read, write, edit, glob, grep) edits only mutable_globs and reports back via the autoresearch_report tool. 3. Evaluate. The candidate commit is checked out into the worktree and the evaluator argv runs under an immutable boundary; provenance (evaluator files, dataset) is frozen and revalidated. 4. Decide. Strict improvement against the current best → accept (fast-forward the run branch); otherwise reject. A target threshold stops the loop early. 5. Persist. Every transition is written to the SQLite tracker with artifacts, attempts, and SHA-256 hashes. Terminal states: target-reached, budget-limited, baseline-blocked, blocked, round-failed, cancelled.

Runtime authority lives in AutoresearchRunController (src/controller.ts); it composes the existing agents, jobs, subprocess, systemPrompt, and tools services — no separate workflow engine or subagent service.

The autoresearch tool

Registered by apply() in src/index.ts. Runs as a background job by default; set mode: 'foreground' to block the caller until completion.

ParameterRequiredDescription
objectiveyesImmutable optimization objective.
mutable_globsyesNarrow relative paths/globs the proposal agent may edit.
evaluationyesShell-free evaluator argv: { command, args, cwd? }.
metric_nameyesExact JSON scalar key on the evaluator's final output line.
metric_directionyesminimize or maximize.
run_tagone ofFresh Git-safe exclusion tag; mutually exclusive with resume_run_id.
resume_run_idone ofDurable run id to resume using canonical repository identity and the persisted start commit; caller HEAD and subdirectory may differ.
constraintsnoImmutable policy constraints.
exceptional_allowlistsnoExplicit dependencies / evaluators / datasets / submodules / gitConfig path exceptions.
timeout_msnoPer-attempt timeout, bounded by deployment policy.
max_experimentsnoCandidate experiment cap (baseline is separate).
targetnoFinite stopping threshold.
provenanceno{ evaluator?, dataset? } labels.
environmentnoEvaluator env overrides; every value a NUL-free string, no reserved DSH_ prefix.
modenoExecution-only dispatch: background (default) or foreground; it may change when resuming a run.

Output is a discriminated JSON: background (run + job started), background-start-failed, or foreground (full run result). Run results carry status, counts, best, artifacts, and blocker evidence.

Configuration

The Config schema (src/config.ts) is loaded at deploy time. Defaults (also in cordis.patch.yml):

KeyDefaultMeaning
gitExecutablegitGit binary.
stateRootdsh-autoresearchTracker + worktree state directory.
branchPrefixautoresearch/Run branch prefix (must end in /).
defaultMaxExperiments20Default candidate cap.
maxExperiments100Hard candidate cap.
defaultTimeoutMs90000015 min per attempt.
maxTimeoutMs360000060 min hard per-attempt ceiling.
terminationGraceMs5000Grace period before killing the evaluator tree.
maxActiveRunsPerRepository1Concurrent run cap per repo.
maxStdoutBytes / maxStderrBytes1048576Evaluator output capture limits.
maxResultChars16384Tool result render limit.
artifactRetentionDays30Artifact retention window.
retainFailedArtifactstrueKeep artifacts from failed attempts.
retainWorktreestrueKeep worktrees after terminal runs.
cleanupWorktreesOnSuccessfalseRemove worktrees on target-reached / budget-limited.
exportTsvtrueExport a TSV summary per run.
tsvRetentionDays30TSV retention window.

Project layout

src/
  index.ts            Plugin entry: registers the `autoresearch` tool + direct-human guidance
  controller.ts       AutoresearchRunController — sole owner of the run state machine
  config.ts           Config schema, defaults, run-policy normalization
  types.ts            Tool parameters, output schema, durable state types
  evaluator.ts        Shell-free evaluator boundary, provenance freezing, final-line JSON metric
  git.ts              Worktree/lock/claim/commit reconciliation, candidate validation
  tracker.ts          DurableTracker — SQLite, schema v5, transition-checked state
  recovery.ts         Crash-safe run reconciliation from durable state
  agent.ts            Delegated proposal agent + autoresearch_report tool
  render.ts           Tool result rendering with bounded truncation
  invariant.ts        Package invariant companion (dsh-invariants)
  state-layout.ts     SQLite state layout
  evaluator-artifacts.ts  Evaluator stdout/stderr artifact capture

Develop

pnpm install
pnpm run typecheck      # tsc --noEmit
pnpm run test           # vitest run
pnpm run test:coverage  # vitest run --coverage
pnpm run build          # tsc -p tsconfig.json → lib/
pnpm run check          # typecheck + test + build
pnpm run release:smoke  # packed-artifact release verification

Release verification exercises the packed artifact outside the checkout: inspect the allowlist, install without local links, import generated ESM/declarations, install/dump the real named dsh profile, and boot the actual Web profile long enough to fetch its HTML surface. The integration suite separately executes autoresearch through the Web standard Agent preset with owner-scoped job_* controls.

License

MIT © 2026 EveGoodEvening