Taler97/dsh-rollback
dsh-rollback
File-mutation rollback plugin for DeepSeek Harness
Install
npx @deepseek-ai/dsh plugin --profile demo add dsh-rollbackRestart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/dsh-rollback)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from Taler97/dsh-rollback, cleaned of badges and images.
dsh-rollback
English | 中文
File-mutation rollback plugin for DeepSeek Harness: it observes every successful tool result for the pre-image a write/edit mutation reports, checkpoints that pre-image into the workspace git object database or a snapshot store, and exposes restore through a model-facing rollback_files tool and a /rollback human command. It registers no service and changes no loop code — capture rides the tools/result observation event, and restore writes files directly (never through the fs policy seam or the sandbox, because undoing a mutation must not be gated by the policy the mutation passed).
Install
The package is an installable bundle (declares dsh.bundle), so it plugs into a profile without touching the harness. All you need is a dsh CLI; the runtime peer packages (@deepseek-ai/dsh-tools, @deepseek-ai/cordis, ...) resolve from the dsh installation itself, so nothing else is installed.
Prerequisites
- A
dshCLI on the machine (dsh pluginshells out topnpm, sopnpmmust be onPATH). - A profile to install into —
demobelow is initialized on first use; use any name.
Install from npm (recommended)
dsh plugin --profile demo add dsh-rollback
Other sources work the same way:
# straight from git (sources are built by the prepare script; pin a commit)
dsh plugin --profile demo add github:you/dsh-rollback#<sha>
# or from a local tarball
dsh plugin --profile demo add ./dsh-rollback-0.1.0.tgz
Verify the install
- The profile manifest under
$DSH_HOME/profiles/demo/($DSH_HOMEdefaults to~/.dsh) now listsdsh-rollbackindependenciesand indsh.profile.bundles— the reconciler adds it automatically because the package declaresdsh.bundle. The equivalent manual patch layer row:
- id: rollback
name: dsh-rollback
config:
mode: auto # auto | git | snapshot
storeDir: '' # '' = <harness home>/rollback
maxRecords: 200
gitPath: git
- Start a session. Any of these proves the plugin is live:
- the model sees a
rollback_filestool in its tool list, - typing
/rollbackanswersrollback: nothing to restore(instead of an unknown-command error) before any mutation happened.
- the model sees a
Usage
30-second quickstart
- Open a session whose working directory is a git repository.
writea filenotes.mdwith the contenthello.writeit again withgoodbye— the first content is silently checkpointed.- Tell the model "restore the file you just overwrote" (it calls
rollback_files), or type/rollbackyourself. - Read
notes.md: it sayshelloagain.
For humans — /rollback [count]
Type it in the chat input (base web and headless profiles mount the command registry the command needs):
/rollback— undo the single most recent captured mutation in this session's working directory,/rollback 3— undo the three most recent ones.
The output lists every restored file and its action:
rollback: restored 2 file mutation(s):
restored /ws/src/lib/parse.ts
deleted /ws/src/lib/generated.ts
For models — rollback_files
…
