DeepSeek Harness 插件

dsh-workflow-worktree

Git worktree isolation backend for DeepSeek Harness workflows: binds each write-capable workflow agent to its own recoverable checkout.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
lisycotana/dsh-workflow-worktree
最近更新
2026年8月14日
分类
自动化与任务
GitHub stars
0
载体类型
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/lisycotana/dsh-workflow-worktree
插件名:dsh-workflow-worktree
作者:lisycotana

检查来源文件

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

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

dsh-workflow-worktree

Git worktree isolation for DeepSeek Harness workflows — every write-capable workflow agent gets its own checkout that cannot touch your working tree, and survives a crash.

The gap this fills

@dsh-external/workflow reserves a seam for worktree isolation and deliberately ships no implementation. Its README is explicit: "worktree 通过 registerIsolationAdapter() 接入,未注册时明确失败."

So a workflow task declaring isolation: 'worktree' fails today:

workflow worktree isolation requested but no isolation adapter is configured

This plugin is that adapter.

Not another worktree manager

Several plugins manage git worktrees. This one is not for you to use — it is for the workflow engine to use.

manual worktree pluginsdsh-workflow-worktree
who creates ityou, or the model, on requestthe workflow engine, per task
bound toa name you pickrunId + taskId + session
lifetimepermanent until you delete itthe task's, with dirty-lane retention
entry pointagent tools / chat commandsregisterIsolationAdapter()

If you want to fork a workspace and keep working in it, use a manual plugin such as dsh-worktree. If you want spawnAgent({ isolation: 'worktree' }) to work, use this one. They coexist.

Install

dsh plugin --profile web add @dsh-external/workflow
dsh plugin --profile web add dsh-workflow-worktree

Then a workflow task can ask for isolation:

await wf.spawnAgent({
  name: 'refactor-auth',
  prompt: '…',
  isolation: 'worktree',      // ← previously a hard failure
})

What a lane is

<repo>/.dsh-worktrees/wf-<runId>-<taskId>     the checkout
dsh/wf-<runId>-<taskId>                       its branch
<repo>/.dsh-worktrees/lanes.json              the manifest

The manifest records runId, taskId, worktree path, branch, base commit, session id, and status. Git already knows which worktrees exist; it does not know which workflow task owned one. That binding is what survives a crash.

Inspect lanes with the worktree_lanes tool:

run-7/task-3  dirty
  worktree: /repo/.dsh-worktrees/wf-run-7-task-3
  branch:   dsh/wf-run-7-task-3
  base:     d1015c2e…
  changed:  ?? agent-work.txt

Design commitments

Never degrade to the shared checkout. If the directory is not a git working tree, or the worktree cannot be created, prepare() rejects. The engine then fails the task loudly. An isolation backend that quietly runs the agent in your tree is worse than one that refuses, because the failure is invisible until the damage is done.

The returned agent is a new agent. The engine does parent = isolation.parent and reads cwdOf(parent) afterwards, so the returned agent's session must be created in the worktree. Returning the caller's parent unchanged type-checks and silently defeats the whole plugin — verify-contract.mjs asserts this binding directly.

Uncommitted work is never discarded. A lane that still has changes when the task ends is retained and marked retained-dirty, with its path and branch logged. Git refuses to remove a dirty worktree; so does this.

Your git status stays clean. The lane directory is added to .git/info/exclude, not to a tracked .gitignore — an isolation backend must not author changes in the tree it protects. Without this the directory reads as ?? .dsh-worktrees/ and perturbs the workspace fingerprints workflow verification takes around each task.

dispose() is idempotent. The engine calls it on task settle, run failure, and explicit stop.

Verified against

@deepseek-ai/dsh@0.1.0-rc.6, @dsh-external/workflow@0.1.2, git 2.47, Node 24, Windows.

verify-contract.mjs runs the adapter against a real repository and asserts the load-bearing invariants:

CONTRACT cwd bound to worktree : true
CONTRACT not the main checkout : true
main tree after agent write    : []
dirty lane retained on dispose : retained-dirty
clean lane removed             : true
double dispose survived        : true

Known limitations

  • No merge. This creates and recovers isolated workspaces; deciding what to

do with the result is the operator's. Diff/merge-preflight are deliberately out of scope for v1.

  • Dirty lanes accumulate. Retention is the safe default; recoverLanes()

prunes only lanes git no longer knows about, never live ones.

  • One repository per lane. A task whose cwd is outside the repository root

is refused rather than isolated somewhere surprising.

License

MIT