Potato1008ypy/dsh-purge-0.2.1rc2-fix

dsh-purge-0.2.1rc2-fix

DeepSeek Harness 破甲:让所有模型都能破甲,不同模型可换不同提示词;默认提示词面向国模「小码酱」。Jailbreak for every model — swap prompts per model.

미분류deepseekdeepseek-harnessdsh-plugins

dsh-purge

dsh-purge · Adapter fixes for DSH Desktop 0.2.1-rc.2

Base: upstream 1.1.71 (commit 6c1d638) · License: MIT · Intended for local security research and authorized testing


English | 中文


Overview

This repository is an adapter branch of YuJunZhiXue/dsh-purge, pinned to upstream 1.1.71 (commit 6c1d638, release v1.1.71).

Upstream 1.1.71 does not work on DSH (DeepSeek Harness) 0.2.1-rc.2. Nine structural changes on the host side make the plugin fail — by throwing or by silently doing nothing — during load, composition, patch application, or prompt assembly; one of them prevents DSH from starting at all. This repository fixes those nine points under three constraints:

  • No product-behaviour changes. Prompt content is not rewritten and no feature is removed; existing behaviour is only made to hold again on the new host.
  • Version-adaptive. Every fix probes the host structure and steps aside on older hosts such as 0.2.0-rc.2.
  • Regressable. A bundled offline test locks each fix in place; it needs neither the network nor the host's yaml.

Beyond the code fixes, the patch registry gains a retired flag so that "did not match" and "no longer applicable" are distinguishable in the status panel (expected final state applied 66 / na 15 / pending 1, where #40 only matches in complete mode).

Compatibility

HostProfileStatus
DSH Desktop 0.2.1-rc.2 (Windows)desktopVerified — the baseline for this repository
dsh CLI 0.2.1-rc.2webSame set of fixes applies; not re-tested item by item this round
DSH 0.2.0-rc.2desktop / webFixes are version-adaptive; not re-tested item by item
DSH < 0.2.0—Not supported

Note: original DSH and DSH Desktop are the same package @deepseek-ai/dsh with identical bundles composition logic; they differ only in which entry point may manage the desktop profile (see Install). Runtime requires Node.js ≥18; avoiding a console flash on Windows requires ≥22.

Fix list

IDSymptomRoot cause (host evidence)Treatment
FIX-01DSH will not start after enabling; config rows render twice; two dsh-purge-redteam-store instances contend for one SQLite filecordis.patch.yml carried two - insert: blocks, so all four plugin rows were inserted twice; the host re-parses that file on every bootCollapsed to a single block (1 insert block / 4 plugin rows)
FIX-02[E] [tool-subagent] toolFilter is no longer supported; the preset will not mount0.2.1-rc.2 removed toolFilter / persona from the @deepseek-ai/dsh-tool-subagent Config; writing either one throwsKey dropped from the template; repairDelegation() gained a line-wise strip that migrates old presets automatically
FIX-03unknown prompt variable "{{cwd}}"; working directory empty or { {cwd}}0.2.1 registers only model / provider; strict interpolation of an unregistered variable throws and drops the whole section batchThe plugin registers cwd itself; the persona section prefers a literal path
FIX-04Patch #40 COMPLETE_PROMPT_KEEP_INJECT silently stops matchingHost assemble() narrowed contexts to a requiredContexts filter, so the old anchor no longer fitsAdded a 0.2.1-shaped pattern; the replacement body moved into completePromptInjectBody()
FIX-05Every desktop-shell patch silently failsThe 0.2.1 executable is named DSH Desktop.exe, while isOfficialHarnessExecutable recognised only deepseek-harnessAdded DSH Desktop.exe / dsh-desktop.exe with a tolerant matcher
FIX-06One failed interpolation wipes the whole personaHost assemble() returns { sections: [] } on errorRebuild the section table in registration order and drop only the sections that fail
FIX-07No .dshpurge.bak is ever written, so restore and uninstall are deadHOST_SYNC in extract-asar.js lacked closeSync, and hostFs is generated from that table; backupAll()'s placeholder handle is never released, so rename fails with EPERM on WindowsAdded a separate HOST_FD table for fd-based methods
FIX-08The preset claims subagents are leaves, yet they recurse through workflow / ralphworkflow-ptc's childRequest() carries no maxDepth, falling back to the host default of 10; children inherit the parent preset's tool tabletool-workflow / tool-ralph set to disabled: true; the engine stays mounted
FIX-09Clicking Apply ends in dsh: fatal load failureA synchronous function calls async atomicCopyFile() without await; the rejection escalates through unhandledRejection to uncaughtExceptionSwitched to atomicWriteSync(), equally atomic but fully synchronous

FIX-01 through FIX-06 were located in this repository. FIX-07 through FIX-09 were merged after a line-by-line comparison with evilevil/dsh-purge-021rc2; the implementation differs from that repository and the tradeoffs are recorded in FIXES.en.md.

Per-fix symptoms, root causes, changes and verification: FIXES.en.md. Known limitations and deliberate tradeoffs are listed below.

Install

Installation has three steps: install → enable → patch the host. The first two make the host load this plugin; only the third rewrites host files, and it never happens on its own.

StepWhere
1 · Installinstall.ps1, or Plugins page → Add plugin
2 · EnableThe one-click script writes bundles for you; otherwise same page → Enable, then restart DSH
3 · Patchdsh-purge → Clean → Apply next to the session title

In recommended order — pick one of the four:

OrderRouteQuit DSH first?Writes bundles
1One-click install.ps1Yes✅
2pnpm addNo❌ (enable once by hand)
3Desktop command-line helperYes✅
4GUI "Plugins" pageNo (but may hit EPERM)✅

1 · One-click script (Windows, least work)

# fully quit DSH first
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1

No clone needed — one line fetches and runs it:

powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr -UseB https://raw.githubusercontent.com/Potato1008ypy/dsh-purge-0.2.1rc2-fix/v1.1.71-dsh0.2.1rc2-fix.7/install.ps1 -OutFile $env:TEMP\dsh-purge-install.ps1; & $env:TEMP\dsh-purge-install.ps1"

It detects the DSH install directory and run mode, installs the package, then writes dsh.profile.bundles — it takes effect on restart with no enable click, collapsing steps 1 and 2 above into one. The script refuses to run while DSH is up (that path hits ERR_PNPM_EPERM). Full switch list: INSTALL.en.md 2.0.

2 · Installing with pnpm add (most direct)

pnpm add "github:Potato1008ypy/dsh-purge-0.2.1rc2-fix#v1.1.71-dsh0.2.1rc2-fix.7"

pnpm add writes dependencies only — it does not register dsh.profile.bundles. Afterwards you must enable it on the Plugins page, then restart DSH.

Do not install from the Release tarball URL. The host passes CI=true to pnpm (frozen mode), under which pnpm add <remote tarball URL> records the dependency without an integrity field. The moment the bytes are actually needed (another machine, empty cache, --frozen-lockfile), pnpm refuses — and because that verification runs before any operation, it freezes every install and uninstall in that profile with ERR_PNPM_MISSING_TARBALL_INTEGRITY. GitHub sources and local file: archives do not trigger it. Recovery: INSTALL.en.md section 7.5.

3 · Desktop command line (helper)

:: dsh-plugin.bat wraps desktop-cli.js; see INSTALL.en.md
dsh-plugin.bat plugin --profile desktop add "github:Potato1008ypy/dsh-purge-0.2.1rc2-fix#v1.1.71-dsh0.2.1rc2-fix.7"

Calling dsh plugin --profile desktop directly is rejected (profile "desktop" is managed exclusively by the Electron application); <DSH install dir>\resources\app\lib\desktop-cli.js is the only gate that lets it through. That path writes both dependencies and dsh.profile.bundles; quit DSH first.

4 · Desktop "Plugins" page (GUI)

  1. Open the Plugins page → Add plugin and paste a Git URL or an absolute local path.
  2. When it finishes, click Enable on the same page, then fully quit and restart DSH.
  3. Click dsh-purge → Clean → Apply next to the session title; on success DSH restarts itself once more.

Measured: on a profile that carries plugins with native modules (a web-ui set, for instance) this route keeps failing. pnpm must rename native-module directories under node_modules and the running DSH has them mapped, so it reports ERR_PNPM_EPERM; a GUI install needs DSH running, which is the deadlock. Use routes 1–3 in such an environment.

Before adding, the host performs a git ls-remote reachability check (5-second timeout by default) and reports unreachable networks explicitly.

Do not enable it in dsh-market

dsh-market's enable only attempts a hot mount (dshmarket/lib/routes.js:773); on failure it leaves the plugin disabled and never writes dsh.profile.bundles. This plugin's patch carries inject and config, so the hot mount always fails — its "activates on restart" message never comes true. Enable it via route 1 or 3 instead (they write bundles).

For the full reference — entry-point capabilities, verification, migrating from an older version, uninstalling and troubleshooting — see INSTALL.en.md.

Verify

cd <DSH_HOME>/profiles/desktop/node_modules/dsh-purge
node test/fixes.test.mjs          # same as npm test

Expected last line 全部通过:22 passed, 0 failed, exit code 0. The test covers FIX-07 through FIX-09 and needs neither the network nor the host's yaml.

Documentation

FilePurpose
QUICKSTART.mdOne-page install procedure, follow step by step
INSTALL.md · INSTALL.en.mdFull install reference: path discovery, profile detection, verification checklist, recovery
FIXES.md · FIXES.en.mdPer-fix detail for all nine: symptom → root cause → change → how to re-check
FORK-NOTES.mdScope of this branch and suggestions for merging upstream
CHANGELOG.mdVersion history
dsh-purge-repair.mjsSelf-healing tool for duplicated insert blocks and retired keys; locates itself, no hardcoded paths

Upstream, attribution and licensing

  • Upstream: YuJunZhiXue/dsh-purge (MIT), author 小杨.
  • Copyright: all rights in the original code, prompts and documentation belong to the upstream author. This repository claims copyright only over its adapter changes (Copyright (c) 2026 Star).
  • Nature of this branch: a community adapter, not an official upstream release, and not endorsed upstream.
  • Attribution requirement: per the upstream requirement, any project reusing its name, ideas, code or prompts must retain attribution and name the source repository. This repository keeps the upstream attribution in LICENSE, package.json and this file.
  • Maintenance: upstream has announced that updates are paused (see Appendix A). This repository releases on its own schedule.

Do not update this plugin through a package manager. This branch and upstream share the version field 1.1.71 (this branch appends -dsh0.2.1rc2-fix.N), so the plugin manager may offer an "update"; running pnpm update dsh-purge or accepting a one-click update overwrites the fixes with the upstream build. To change versions, first remove dsh-purge from bundles, clean node_modules/dsh-purge, then reinstall from the URL above.

Known limitations and tradeoffs

  1. FIX-07 and FIX-09 were fixed without reproducing the original field failure. Both are statically decidable defects (a missing method, an un-awaited Promise); they were verified with the offline test and a before/after comparison, not by recreating the original crash.
  2. HOST_FD is kept separate from HOST_SYNC. An fd-based method's first argument is a file descriptor, not a path; reusing route() would probe asar with String(fd) and pollute the probe cache. They are therefore installed separately and go straight to node:fs.
  3. Ctrl+Enter behaviour is deliberately unchanged. Patches #85 / #86 rewrite the session-controller's case "steer" to followup, so a UI send always opens a new turn; this suppresses a race where an immediate second message was rejected. The side effect is that Ctrl+Enter queues the next turn instead of interrupting the current one. Later upstream versions reverted to agent.steer; this branch keeps the current behaviour because reverting would reintroduce that race. To revert, change the replace of #85 and the first replace of #86 in lib/core.js.
  4. Semantics of the retired flag. A patch marked retired reports na rather than skipped, meaning "the host structure no longer exists, nothing to apply" as opposed to "matching failed".
  5. Platform coverage. The verification baseline is Windows with DSH Desktop 0.2.1-rc.2; the web profile and 0.2.0-rc.2 were not re-tested item by item.
  6. Host changes after 0.2.1-rc.2. Patch anchors may drift again. After a host upgrade, re-run lib/audit-apply.mjs and lib/audit-compose.mjs to locate the patterns that no longer match.

License

MIT. Original copyright Copyright (c) 2026 小杨; modifications in this repository Copyright (c) 2026 Star. Full text in LICENSE.


Appendix A · Upstream README (verbatim)

The full upstream README of YuJunZhiXue/dsh-purge, retained verbatim under the MIT license with no content changes (only the table-of-contents entry added by this repository was removed). Its "Scope" and "Install" sections describe upstream 1.1.71 itself and differ from the install procedure of this branch; defer to the sections above and to INSTALL.en.md.

Updates paused. The author has no steady income for now because of work. Maintenance is on hold: no new releases, issues / PRs are not taken, and new dsh versions are not guaranteed. The repo stays usable; see Sponsor below. When maintenance resumes, this README will say so.

Official Web and the official desktop app are both supported. Official dsh web uses profile web. The official desktop EXE (DeepSeek Harness 0.2.0-rc.2) uses profile desktop. Install and Apply them separately. This release targets dsh 0.2 only. Older dsh builds need the matching older plugin. Community Desktop is not maintained.

Adding the plugin to a profile does not patch the host. Click dsh-purge beside the session title → Clean → Apply. A successful Apply restarts; an unfinished Apply does not. After the restart, start a new chat — that is when the inject enters the session.

Node.js ≥18. Windows no-flash needs Node ≥22. Hub one-click and the commands below both install the npm package dsh-purge.

Contents


☕ Sponsor

If this project helps you, send it over — I'm out here asking~

AssetAddress
USDT (TRC20)TV5ajPkRD8RH623Dx9mqvYZVNN8nPGRKid
Solana6x16GhRgLVpKFFXaU1seKNdx2rypspSJTL4dbpt6Xpwk
Ethereum0xB68BD60C0e8c519513B7DF9bB147696815423B3E
Bitcoinbc1qu70yxkrtwnymt8ryluz9x8y8hqzune5340npht

What this is

dsh-purge is a cybersecurity red-team plugin for the official DeepSeek Harness already installed on your machine. Official Web (dsh web) and the official desktop EXE are both supported. Install and Apply them separately.

Harness does more than forward a prompt. It rewrites prompts, approval gates, sandbox policy, and session migration at runtime. Asking only “will the model answer” treats a host-layer block as a model refusal. This plugin separates those two layers on your own install, for controlled evaluation and for seeing which default policy is too tight.

You getWhat it does
dsh-purge dockA button beside the session title opens the right dock. Two pages: Clean and Drill
CleanGrouped patch status, Apply / Restore / Uninstall, prompt editor, multiple rule sets
DrillBuilt into the stable release. After authorization: assets, skills, and the local environment. Only for a host you manage, an offline target, or a written authorized exercise
Host policyDefault copy, permission policy, and tool limits. Official capabilities stay. No second invented identity
On startChecks and reapplies. After npm overwrites node_modules, you do not hand-edit files

No hardcoded drive letters. It looks at $DSH_HOME, .dsh next to the dsh launcher, then ~/.dsh. It does not patch the Harness source tree. Apply on the Clean page of dsh-purge is what writes the changes. Identity comes from the encrypted prompt shipped in the plugin, the text the prompt box shows by default. The host prompt file is not read.

It only touches the official @deepseek-ai packages and local config on the user's machine. It is not a public scanner and not an attack kit for third-party sites. The repo does not ship malware, unauthorized-exploit scripts, or payloads aimed at the public internet.


Non-profit public project. Commercial sale, paid resale, and profit from illegal or gray-market activity are forbidden. For technical reference only.

Attribution required

If you borrow this project's name, ideas, code, or prompts, you must credit the author and name the source repository: YuJunZhiXue/dsh-purge.

Using them without attribution, hiding the source, or passing them off as your own will be pursued.


Unauthorized commercial use

Douyin live account 「老张的ai」 (room name 「老张AI讲堂」) is selling this repository: taking fees in the live room, no attribution, and ignoring the non-profit rule above. The author was in the room. They still charged.

This project is free and non-profit. Selling courses, the plugin, tokens, or reselling it voids the license on the spot. The author reserves the right to pursue it.

Recorded 2026-10-12:

老张的ai live asking for a fee 老张的ai live charging money

WeChat name 「老张的ai科技」, same handle as the live-room viewer board. Asked if they were this repo's developer, they said they were. The author said they would report it.

老张的ai科技 WeChat claiming to be the developer


Disclaimer: This is a non-profit open-source project. It follows applicable laws and the rules of the platforms it uses, and is intended only for learning and research. Do not use it for any illegal or non-compliant purpose; the user bears any resulting consequences.

Zero-tolerance statement: This project opposes and forbids any illegal activity. The authors do not support, encourage, or assist unauthorized network attacks, exploit use, data theft, unlawful intrusion into computer information systems, or generation of illegal or prohibited content. Anyone who uses this project for crime is solely responsible under the law. The authors have no liability.

  1. This repository contains no illegal material. The published code, docs, patches, and default prompt are not malware, backdoors, unauthorized pentest kits, ransomware, credential-stuffing scripts, or attack payloads aimed at the public internet or third-party systems. The project does not supply illegal content and does not incite, organize, or assist crime.
  2. Local official Harness only. Security-eval patches and prompt injection run only on the official DeepSeek Harness already installed on the user's machine (@deepseek-ai packages, local profile / $DSH_HOME). The target is the user's own official local software, not someone else's website, server, account, or information system.
  3. Eval patches do not attack the public internet. Apply, inject, revert, and uninstall stay in local files and local processes. They do not scan, probe, intrude, or send attack traffic to any public host or unauthorized system. Do not use this project as a jump host against the public internet. If "check for updates" is on, the plugin may only contact this plugin's own GitHub repository to compare versions. That is not an attack on third-party systems and is not authorization to penetrate anything.
  4. Lawful, controlled scope. This project is an aid for red-team research and robustness evaluation on an official Harness the user is entitled to administer. Do not run it against targets without the owner's lawful written authorization, public online systems, or production workloads. Testing must stay on the authorized local official Harness, offline local synthetic fixtures, authorized cybersecurity ranges, and compliant lab environments.
  5. Servers and sites in mainland China, Hong Kong, and Macau are forbidden. Do not access, scan, probe, or otherwise operate against network ranges in mainland China, Hong Kong, or Macau, or against servers, websites, or addresses that resolve into those ranges. A cloud-provider name is not an exception. The only exception is one exact IP, or one exact hostname, that the user registered in advance as their own server. A key, a password, a network range, a wildcard, or a claim made in t