dsh-mask 0.2.24 → 0.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ARCHITECTURE.md CHANGED
File without changes
package/CHANGELOG.md CHANGED
File without changes
package/LICENSE CHANGED
File without changes
package/README.en.md ADDED
@@ -0,0 +1,433 @@
1
+ <div align="center">
2
+
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/hero-en-dark-v3.webp">
5
+ <img src="docs/assets/hero-en-light-v3.webp" width="100%" alt="dsh-mask: anonymize personal data before it reaches the model — the plaintext never enters the session log">
6
+ </picture>
7
+
8
+ # dsh-mask
9
+
10
+ **Anonymize personal data before it reaches the model — the plaintext never enters your session log.**
11
+
12
+ A pure host-side PII masking middleware for DeepSeek Harness: phones, emails, ID cards, bank cards, and keys become placeholders at the model boundary, and the restore table stays on your own machine.
13
+
14
+ [Install](#three-step-setup) · [Configuration](#configuration) · [FAQ](#faq) · [简体中文](README.md) · [English](README.en.md) · [Español](README.es.md) · [Português](README.pt.md) · [हिन्दी](README.hi.md)
15
+
16
+ [![License](https://img.shields.io/badge/license-Apache--2.0-3366CC?style=flat-square&labelColor=2B3245)](LICENSE)
17
+ [![DSH](https://img.shields.io/badge/DSH-%E2%89%A50.1.2%20%3C0.3.0-4B67B4?style=flat-square&labelColor=2B3245)](#compatibility)
18
+ [![npm](https://img.shields.io/npm/v/dsh-mask?style=flat-square&labelColor=2B3245&color=CB3837)](https://www.npmjs.com/package/dsh-mask)
19
+ [![CI](https://img.shields.io/github/actions/workflow/status/PerryLink/dsh-mask/ci.yml?branch=main&label=CI&style=flat-square&labelColor=2B3245)](https://github.com/PerryLink/dsh-mask/actions/workflows/ci.yml)
20
+ [![Node](https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-339933?style=flat-square&labelColor=2B3245)](#compatibility)
21
+
22
+ [![Stars](https://img.shields.io/github/stars/PerryLink/dsh-mask?style=flat-square&labelColor=2B3245)](https://github.com/PerryLink/dsh-mask/stargazers)
23
+ [![npm downloads](https://img.shields.io/npm/dm/dsh-mask?style=flat-square&labelColor=2B3245&color=CB3837)](https://www.npmjs.com/package/dsh-mask)
24
+ [![dshfind](https://dshfind.com/api/badge/PerryLink/dsh-mask?metric=downloads)](https://dshfind.com/plugins/PerryLink/dsh-mask?ref=badge)
25
+ [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/PerryLink/dsh-mask/badge)](https://securityscorecards.dev/viewer/?uri=github.com/PerryLink/dsh-mask)
26
+ [![DSH Market](https://img.shields.io/badge/DSH_Market-listed-4B67B4?style=flat-square&labelColor=2B3245)](https://dsh.market/)
27
+ [![Gitee](https://img.shields.io/badge/Gitee-mirror-C71D23?style=flat-square&labelColor=2B3245&logo=gitee)](https://gitee.com/perrylink/dsh-mask)
28
+
29
+ ```sh
30
+ dsh plugin --profile <name> add dsh-mask
31
+ ```
32
+
33
+ </div>
34
+
35
+ <sub>Community plugin, not affiliated with DeepSeek. Canonical repository: <https://github.com/PerryLink/dsh-mask> (Gitee is a mirror).</sub>
36
+
37
+ ## What it is
38
+
39
+ Before a message reaches the model, `dsh-mask` rewrites the phones, emails, ID cards, bank cards, and keys inside it into placeholders such as `<PHONE_1>` — what the model sees and what the session log records are placeholders only. The originals live solely in the host-side restore table (memory plus the controlled `dsh_mask` storage domain), and an explicit `/mask restore` call delivers them back as a `0600`-permission file whose path — never the plaintext — is what gets logged. Pure regex, zero dependencies, no network requests.
40
+
41
+ <picture>
42
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/dsh-mask-flow-v4-dark.svg">
43
+ <img src="docs/assets/dsh-mask-flow-v4-light.svg" width="100%" alt="dsh-mask data flow: user message → agent/pre-step masking → model → /mask restore → controlled file">
44
+ </picture>
45
+
46
+ ## Three-step setup
47
+
48
+ 1. **Install** (pick one channel):
49
+
50
+ ```sh
51
+ # git channel (latest main; equivalent to git+https://github.com/PerryLink/dsh-mask.git)
52
+ dsh plugin --profile web add github:PerryLink/dsh-mask
53
+ # npm channel (published releases)
54
+ dsh plugin --profile web add dsh-mask
55
+ # tarball channel: pnpm pack in this repo, then
56
+ dsh plugin --profile web add ./dsh-mask-<version>.tgz
57
+ ```
58
+
59
+ No build step — `index.mjs` and `lib/` are the shipped artifacts.
60
+
61
+ 2. **Minimal config** (sane defaults; tailor the entity list as needed):
62
+
63
+ ```yaml
64
+ - insert:
65
+ - id: mask
66
+ name: dsh-mask
67
+ config:
68
+ entities: [phone, email, id-card, bank-card, key]
69
+ ```
70
+
71
+ 3. **Verify it mounts**:
72
+
73
+ ```sh
74
+ dsh --profile web --dump-config | grep -A2 'id: mask'
75
+ ```
76
+
77
+ ```
78
+ > /mask status
79
+ > /mask restore <PHONE_1>
80
+ mask: restored 1 placeholder(s): <PHONE_1>
81
+ file: /tmp/dsh-mask-restore/restore-1f0c….txt (mode 0600, one file per session)
82
+ ```
83
+
84
+ **Uninstall**: `dsh plugin --profile web remove dsh-mask` (or remove the row from the profile patch).
85
+
86
+ > `dsh-mask` no longer bundles the storage stack. Profiles that already compose it (the `web` profile does, via `@deepseek-ai/dsh-web-app`) provide `storageDomain`, so persistence works out of the box. On a bare profile without storage the plugin still mounts and masks, but the restore table is memory-only (lost on restart) — compose the storage stack in your profile patch, or set `persistRestoreTable: false`.
87
+
88
+ <details>
89
+ <summary>Install from the DSH Desktop market</summary>
90
+
91
+ Every PerryLink plugin is listed in the built-in DSH Desktop market: **Market → Sources → Add source → paste** `https://perrylink-dsh-catalog.perrylink.workers.dev/catalog-source.json` **→ select**. Installation still requires the market's npm identity check and your confirmation.
92
+
93
+ </details>
94
+
95
+ ## Core capabilities
96
+
97
+ `dsh-mask` anonymizes personal data **at the model boundary** — before a message reaches the model — and keeps a restore table host-side so placeholders stay reversible:
98
+
99
+ - **Request-time masking** — `agent/pre-step` messages are rewritten so phones, emails, ID cards, bank cards, and keys (on by default) and IPs (opt-in) become `<PHONE_1>`-style placeholders. The masked text is what gets logged and sent to the model.
100
+ - **Restore table** — the `placeholder → original` map lives only in memory and a controlled storage domain (`dsh_mask`); the plaintext never enters the session log.
101
+ - **Audit, not plaintext** — the `mask/applied` session event records only "replaced N values + type distribution", never the original text or the mapping.
102
+ - **`/mask` command** — `status` (counts + distribution), `on`/`off` (runtime toggle), `restore <text>` (unmap placeholders and deliver the plaintext as a file, never as logged text), `help`.
103
+ - **`mask_test` tool** — run a snippet through the detector and see the placeholder result; it never reveals the original values.
104
+
105
+ ```text
106
+ user message ──agent/pre-step──▶ placeholders ──model──▶ placeholders ──restore──▶ controlled file
107
+ ▲ │
108
+ └──────── restore table (memory + dsh_mask) ───────────┘
109
+ ```
110
+
111
+ ### Commands & tools surface
112
+
113
+ | Surface | Reveals plaintext | Notes |
114
+ |---|---|---|
115
+ | `agent/pre-step` masking | never | Rewrites messages to placeholders before they are logged or sent to the model |
116
+ | `tools/post-execute` masking | never | Rewrites tool-result text blocks to placeholders before they are logged or fed back to the model (scope: `tools`) |
117
+ | `/mask status` | never | Enabled state, total replaced, type distribution |
118
+ | `/mask on` / `/mask off` | never | Runtime toggle (resets to `config.enabled` on restart) |
119
+ | `/mask restore <text>` | yes (explicit) | Unmaps placeholders back to the values stored for this session and writes them to a controlled file (one per session, mode `0600`); the result text and the session log carry only that path and the placeholder names |
120
+ | `mask_test` | never | Masks a snippet and reports the placeholder result + counts |
121
+
122
+ ### Examples
123
+
124
+ These are the plugin's real entry points; install once, then call one.
125
+
126
+ **Detailed example** — command `mask_test`, input:
127
+
128
+ ```json
129
+ {"text":"电话 13812345678"}
130
+ ```
131
+
132
+ Output:
133
+
134
+ ```text
135
+ mask_test: replaced 1 PII value(s) (PHONE=1)
136
+ masked:
137
+ 电话 <PHONE_1>
138
+ ```
139
+
140
+ *Observed from `plugins/dsh-mask/index.mjs:243-250; test/index.test.mjs:306-315`*
141
+
142
+ **Failure branch** — input:
143
+
144
+ ```text
145
+ /mask restore <PHONE_1> with restoreDir=/tmp/dsh-mask-probe-not-a-dir (a regular file)
146
+ ```
147
+
148
+ Output:
149
+
150
+ ```text
151
+ mask: restore failed: EEXIST: file already exists, mkdir '/tmp/dsh-mask-probe-not-a-dir'
152
+ ```
153
+
154
+ *Observed from `plugins/dsh-mask/index.mjs:501-506; plugins/dsh-mask/lib/deliver.mjs:89-97; plugins/dsh-mask/test/index.test.mjs:278-290`*
155
+
156
+ **Brief examples**: `mask_test` · `/mask restore <text>`
157
+
158
+ ## Measured data
159
+
160
+ <picture>
161
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/dsh-mask-evidence-v3-en-dark.webp">
162
+ <img src="docs/assets/dsh-mask-evidence-v3-en-light.webp" width="100%" alt="dsh-mask per-type F1 bar chart: phone, email, id-card, bank-card, key all at 1.000; ip (opt-in) at 0.833">
163
+ </picture>
164
+
165
+ The per-type P/R/F1 benchmark over 108 synthetic samples (60 positive, 48 negative) is published in [`benchmark/RESULTS.md`](benchmark/RESULTS.md); regenerate it with `node benchmark/run.mjs` (no build step, zero new dependencies). The benchmark covers the regex path only: shape checks without checksums, the `ip` regex is range-loose (hence its false positives), and `person`/`address` are not measured.
166
+
167
+ ## Configuration
168
+
169
+ All tunables are Schemastery `Config` fields (changeable from cordis.yml). An id-targeted override replaces the whole row — restate every key you need. `cordis.patch.yml` documents each key inline.
170
+
171
+ Most-used keys:
172
+
173
+ | Key | Default | Meaning |
174
+ |---|---|---|
175
+ | `enabled` | `true` | Master switch; `false` unregisters the listener, the `/mask` command, and the `mask_test` tool |
176
+ | `mode` | `regex` | Detection mode; only `regex` is implemented (`regex+ner` for name/address recognition is reserved and fails loud) |
177
+ | `entities` | `[phone, email, id-card, bank-card, key]` | Which PII types to mask; `ip` is also regex-capable (opt-in), `person`/`address` require NER |
178
+ | `scope` | `[messages]` | Masking surface(s); `messages` masks agent/pre-step messages, `tools` masks tool-result text on tools/post-execute. Accepts a string or an array, e.g. `[messages, tools]` |
179
+ | `persistRestoreTable` | `true` | Persist the restore table to the controlled `dsh_mask` storage domain (`false` = memory only) |
180
+ | `restoreDir` | `''` | Where `/mask restore` delivers the restored plaintext. Empty = `os.tmpdir()/dsh-mask-restore`; a relative value resolves against the host process working directory. The directory is created `0700` and the file written `0600`, one file per session |
181
+
182
+ <details>
183
+ <summary>Full configuration table (11 keys)</summary>
184
+
185
+ | Key | Default | Meaning |
186
+ |---|---|---|
187
+ | `enabled` | `true` | Master switch; `false` unregisters the listener, the `/mask` command, and the `mask_test` tool |
188
+ | `mode` | `regex` | Detection mode; only `regex` is implemented (`regex+ner` for name/address recognition is reserved and fails loud) |
189
+ | `entities` | `[phone, email, id-card, bank-card, key]` | Which PII types to mask; `ip` is also regex-capable (opt-in), `person`/`address` require NER |
190
+ | `scope` | `[messages]` | Masking surface(s); `messages` masks agent/pre-step messages, `tools` masks tool-result text on tools/post-execute. Accepts a string or an array, e.g. `[messages, tools]` |
191
+ | `registerCommand` | `true` | Register the `/mask` command |
192
+ | `registerTools` | `true` | Register the `mask_test` tool when the tools service is present |
193
+ | `persistRestoreTable` | `true` | Persist the restore table to the controlled `dsh_mask` storage domain (`false` = memory only) |
194
+ | `maxRestoreEntriesPerSession` | `500` | Per-session restore entry cap (oldest evicted first) |
195
+ | `maxSessions` | `1000` | In-memory session cap (least-recently-used evicted, mapping reloaded on demand) |
196
+ | `maskClientEnabled` | `false` | Feature flag for the browser half "reveal" bubble (defensive; off by default until the live slot catalog verifies the target slot). The key is schema-declared and validated, but no runtime code reads it yet, so it changes nothing until the browser half ships |
197
+ | `restoreDir` | `''` | Where `/mask restore` delivers the restored plaintext. Empty = `os.tmpdir()/dsh-mask-restore`; a relative value resolves against the host process working directory. The directory is created `0700` and the file written `0600`, one file per session |
198
+
199
+ </details>
200
+
201
+ Example override in your profile patch:
202
+
203
+ ```yaml
204
+ - insert:
205
+ - id: mask
206
+ name: dsh-mask
207
+ config:
208
+ entities: [phone, email, id-card, bank-card, key, ip]
209
+ persistRestoreTable: false
210
+ registerCommand: true
211
+ ```
212
+
213
+ ## FAQ
214
+
215
+ <details>
216
+ <summary>Where does the plaintext actually live? Can it leak into logs?</summary>
217
+
218
+ The `placeholder → original` restore table lives in memory and, when `persistRestoreTable: true`, in the controlled `dsh_mask` storage domain — it is **never written to the session log**. The only other plaintext copy is the delivery file an explicit `/mask restore` writes under `restoreDir` (mode `0600`, one file per session, overwritten by the next restore); nothing writes plaintext to disk implicitly.
219
+
220
+ </details>
221
+
222
+ <details>
223
+ <summary>What happens on hosts without storage or the event type? Silent breakage?</summary>
224
+
225
+ Nothing is silent. On a bare profile without the storage stack the plugin still mounts and masks, with the restore table degrading to memory-only plus a one-time warning. When the host does not record the `mask/applied` event type, audit appends are skipped and the first refusal per session logs one visible warning. Unimplemented `mode` (`regex+ner`), NER entities, unknown `scope` values, and out-of-bounds numbers all fail loudly at load.
226
+
227
+ </details>
228
+
229
+ <details>
230
+ <summary>Does it fight other plugins over command names, events, or slots?</summary>
231
+
232
+ No. Every tool is namespaced, it provides no service key, registers no client slot and no `webServer` prefix, and mutates no globals; every shared-event listener delegates through `next()` and never short-circuits the chain. The point-by-point argument is in "Interoperability with other DSH plugins".
233
+
234
+ </details>
235
+
236
+ <details>
237
+ <summary>How big is the performance overhead?</summary>
238
+
239
+ The detector is zero-dependency pure regex — no network requests, no model calls — rewriting message text synchronously on `agent/pre-step`. For measured accuracy, see "Measured data" (108 samples, Macro F1 0.972).
240
+
241
+ </details>
242
+
243
+ ## Security boundaries
244
+
245
+ - **Plaintext never enters the session log.** The masked (placeholder) form is what gets logged and sent to the model, so model-visible content is reconstructable from the log in placeholder form; the originals stay in the restore table. The same rule governs the reveal direction: a command's result text is logged **verbatim** by the host and rendered from that same event, so `/mask restore` writes the plaintext to a controlled file and returns only its path.
246
+ - **Sanitize before display/log.** `lib/sanitize.mjs` redacts PII, secrets, and URL credentials before any text reaches the model or the log; `mask_test`, `/mask status`, and every `/mask` error path never echo originals.
247
+ - **Controlled restore.** `/mask restore` is the single explicit reveal surface, and it only reads the mapping for the active session. Failure fails closed: if the delivery file cannot be written, the command reports an error and never falls back to echoing the plaintext.
248
+ - **Fail closed.** Unimplemented `mode` (`regex+ner`), unknown `scope` values, NER-only entities, and out-of-bounds numbers all fail loudly at load.
249
+ - **Registrations are effects.** The listener, command, tool, and storage-domain close are all Cordis effects — stop/hot-reload removes them.
250
+
251
+ ## Permissions & data
252
+
253
+ - **Permissions**: `dsh-mask` performs no network requests and stores no credentials; it reads the session at the `agent/pre-step` boundary, writes its own `dsh_mask` storage domain, and writes the `/mask restore` delivery file (the manifest declares `filesystem:write` for exactly that). The `dshWorkshop` manifest also declares `network:none` and `credentials:none`.
254
+ - **Data**: see the first FAQ entry for where the restore table and the delivery file live — the conclusion stands: plaintext never reaches the session log.
255
+ - **Session log**: `mask/applied` is declared in `types.d.ts` and appended only when the host records the type (see Known limitations). Its payload is counts + type distribution only.
256
+
257
+ ## Known limitations
258
+
259
+ - **Regex only.** Name (`person`) and address (`address`) recognition needs an external NER recognizer, which the pure-host zero-dependency form does not bundle; `mode: regex+ner` and those entities fail loudly at load. The PII types covered out of the box are phone, email, ID card, bank card, key, and (opt-in) IP.
260
+ - **Region-specific patterns.** The `phone` and `id-card` detectors match mainland-China formats only: `phone` is `1[3-9]` followed by nine digits, and `id-card` is an 18-character Chinese resident ID (17 digits plus a digit or `X`). Phone numbers and national identifiers from other countries are not detected. `email`, `ip`, and `key` are region-agnostic; `bank-card` accepts any 16-19 digit run at a lower confidence score.
261
+ - **Display-layer restore needs a client half.** Masking is fully host-side, but transparently un-masking the assistant bubbles in the client UI is a browser-half feature this pure-host form does not ship. The host side keeps the restore table and the exported `RestoreStore` seam (its methods take a session id), so a future client half would reach them through a host remote rather than directly; today the unmasking surface is the `/mask restore <text>` command, which delivers the plaintext as a file because a command result is logged verbatim (see Security boundaries), and the `maskClientEnabled` key is validated but read by no runtime code yet.
262
+ - **No no-argument `/mask restore`.** Restoring *every* placeholder of the most recent assistant message is not offered, and the command says so when invoked without text. Two host facts block it: the restore table is a flat per-session `{placeholder: original}` map with no per-message index, so that message has to be located in the session event log; and the host deprecated `Session.snapshotEvents()` / `eventAt()` / `ownEvents()` with an explicit "new calls are prohibited", leaving an incremental projection as the only sanctioned route — which this plugin's declared host corridor (`>=0.1.2-rc.1`) cannot rely on. Placeholders keep working one at a time instead: `/mask restore <PHONE_1>`.
263
+ - **Session events on `0.1.7-rc.2`.** The harness records 59 session event types and none of them is `mask/*`; its `Session.append` also cannot stamp the `ignorable` envelope, so the session-log audit appends are skipped and sessions keep loading. The gate is not silent about it: the first refusal per session logs one visible warning naming the skipped type and this documented limitation. The plugin enables the append automatically once a host records the type or supports the `ignorable` envelope.
264
+
265
+ ## Interoperability with other DSH plugins
266
+
267
+ Verified against **DSH `0.2.0-rc.2`** (the runtime this README ships for) and the high-star plugin set surveyed on 2026-10-05.
268
+
269
+ This plugin **does not interfere** with other plugins, including the widely installed high-star ones:
270
+
271
+ - **No tool-name collision.** Every tool is namespaced; no bare name owned by a shipped tool or another plugin is registered.
272
+ - **No service-key collision.** It provides no service key at all, so it cannot collide on one.
273
+ - **No slot collision.** It registers no client slot key, so it cannot contend for a `shadows-shipped-ui` seat.
274
+ - **No HTTP route collision.** It registers no `webServer` prefix.
275
+ - **No patch-layer collision.** The bundle patch only `insert`s its own row; it never overrides a built-in row's `config`.
276
+ - **No global mutation.** It does not patch prototypes, rewrite `process.env`, or replace the global fetch dispatcher.
277
+
278
+ **Shared event listeners are non-interfering by construction.** It observes the ordering-sensitive events `agent/pre-step`, `tools/post-execute` with `ctx.on()` — Cordis's broadcast registration, where every listener runs and none can starve another. **Every listener here delegates through `next()`**, so the chain is never short-circuited, and a mutation is applied to the value `next()` produced rather than returned in its place:
279
+
280
+ - `agent/pre-step` — also used by `dsh-routing-suite` (7000★, 7 listeners), `modlens` (4122★), `dsh-purge` (3317★), `dsh-agent-teams` (1923★), `dsh-context` (1849★).
281
+ - `tools/post-execute` — also used by `cc-safety-net` (1576★).
282
+
283
+ Static evidence: `dsh-plugin-doctor` K10–K13 report `pass` for every check on this repository.
284
+
285
+ ## Compatibility
286
+
287
+ | Surface | Status |
288
+ |---|---|
289
+ | Harness | DeepSeek Harness `dsh-v0.2.1-alpha.1` (adapted 2026-09-18): the session envelope keeps its ignorable field for stored-log read compatibility only - Session.append still cannot stamp it, so audit-gate behavior is unchanged. Verified 2026-09-18 against the dsh-v0.1.7-alpha.1 master checkout (full gate chain + profile install smoke). |
290
+ | Node | `^22.19.0 \|\| >=24.0.0` |
291
+ | Platforms | Anywhere DSH runs (pure host, zero-dependency regex; no browser half) |
292
+ | Model | Text models fully supported; no extra model capability required |
293
+
294
+ ## Ecosystem & quality
295
+
296
+ - [Gitee mirror](https://gitee.com/perrylink/dsh-mask) (sync mirror; GitHub is canonical)
297
+ - [dshfind plugin page](https://dshfind.com/plugins/PerryLink/dsh-mask) (installs and ranking)
298
+ - [OpenSSF Scorecard report](https://securityscorecards.dev/viewer/?uri=github.com/PerryLink/dsh-mask) (driven by [.github/workflows/scorecard.yml](.github/workflows/scorecard.yml))
299
+ - [dsh-plugin-doctor verification report](https://github.com/PerryLink/dsh-plugin-doctor#verified-徽章) (K10–K13 all `pass`)
300
+ - [DSH Market](https://dsh.market/) (listed)
301
+ - **1024 store channel**: `npm i -g dsh1024` once, then `dsh1024 plugin --profile web add dsh-mask` (counts toward the [deepseek1024.com](https://deepseek1024.com) install ranking)
302
+ - [Ecosystem knowledge base](https://perrylink.github.io/dsh-plugin-guide/) — measured data, not marketing: plugin development guide · plugin-selection data · maintenance criteria
303
+
304
+ ## Development
305
+
306
+ ```sh
307
+ pnpm install # node ^22.19 || >=24
308
+ pnpm run typecheck && pnpm run typecheck:ci # two rulers: checkout face (guarded; unverifiable without the checkout) + published-line face
309
+ pnpm test # node --test
310
+ pnpm run verify:self-contained # dependency specs resolve from the registry
311
+ pnpm run verify:artifacts # shipped files present + index.mjs importable
312
+ pnpm run check:readmes # five-language README consistency
313
+ pnpm pack # the published tarball
314
+ ```
315
+
316
+ There is no build step: pure ESM, `index.mjs` and `lib/` are the shipped artifacts. Benchmark: `node benchmark/run.mjs`, results in [`benchmark/RESULTS.md`](benchmark/RESULTS.md). The README images are generated programmatically by [`scripts/gen-readme-assets.py`](scripts/gen-readme-assets.py) (Python + Pillow) and are safe to re-run.
317
+
318
+ Topics: `dsh`, `dsh-plugin`, `deepseek-harness`, `deepseek`, `cordis`, `pii`, `mask`, `privacy`, `anonymization`, `security`
319
+
320
+ ## Family & thanks
321
+
322
+ This project is part of the DeepSeek Harness plugin family from [PerryLink](https://github.com/PerryLink) (all Apache-2.0). If it is useful, **a star helps the next person find it** — nothing is gated behind it.
323
+
324
+ - [@PerryLink](https://github.com/PerryLink) — creator and maintainer: the regex PII detector ported from Pii-Stripper-Middleware, the `agent/pre-step` masking seam, the restore table, the `/mask` command and `mask_test` tool, and the five-language docs.
325
+
326
+ <details>
327
+ <summary>Expand all plugins</summary>
328
+
329
+ | Plugin | Status |
330
+ |---|---|
331
+ | **[dsh-aqua-input-check](https://github.com/PerryLink/dsh-aqua-input-check)** | |
332
+ | **[dsh-archive-check](https://github.com/PerryLink/dsh-archive-check)** | |
333
+ | **[dsh-auto-review](https://github.com/PerryLink/dsh-auto-review)** | |
334
+ | **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | 🧊 FROZEN — see the repo README |
335
+ | **[dsh-bid-ca-precheck](https://github.com/PerryLink/dsh-bid-ca-precheck)** | |
336
+ | **[dsh-bid-qual-check](https://github.com/PerryLink/dsh-bid-qual-check)** | |
337
+ | **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | 🧊 FROZEN — see the repo README |
338
+ | **[dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind)** | |
339
+ | **[dsh-click](https://github.com/PerryLink/dsh-click)** | |
340
+ | **[dsh-composer-history](https://github.com/PerryLink/dsh-composer-history)** | |
341
+ | **[dsh-contract-stance](https://github.com/PerryLink/dsh-contract-stance)** | |
342
+ | **[dsh-customs-doc-check](https://github.com/PerryLink/dsh-customs-doc-check)** | |
343
+ | **[dsh-data-quality](https://github.com/PerryLink/dsh-data-quality)** | |
344
+ | **[dsh-demurrage-ledger](https://github.com/PerryLink/dsh-demurrage-ledger)** | |
345
+ | **[dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck)** | |
346
+ | **[dsh-drill-script-check](https://github.com/PerryLink/dsh-drill-script-check)** | |
347
+ | **[dsh-eia-guide-check](https://github.com/PerryLink/dsh-eia-guide-check)** | |
348
+ | **[dsh-emergency-plan](https://github.com/PerryLink/dsh-emergency-plan)** | |
349
+ | **[dsh-essay-rubric-check](https://github.com/PerryLink/dsh-essay-rubric-check)** | |
350
+ | **[dsh-evidence-check](https://github.com/PerryLink/dsh-evidence-check)** | |
351
+ | **[dsh-export-ctl-check](https://github.com/PerryLink/dsh-export-ctl-check)** | |
352
+ | **[dsh-fast](https://github.com/PerryLink/dsh-fast)** | |
353
+ | **[dsh-fmea-table-check](https://github.com/PerryLink/dsh-fmea-table-check)** | |
354
+ | **[dsh-forecast-penalty](https://github.com/PerryLink/dsh-forecast-penalty)** | |
355
+ | **[dsh-fund-research](https://github.com/PerryLink/dsh-fund-research)** | |
356
+ | **[dsh-github](https://github.com/PerryLink/dsh-github)** | |
357
+ | **[dsh-gongwen-flow-check](https://github.com/PerryLink/dsh-gongwen-flow-check)** | |
358
+ | **[dsh-gongwen-word-check](https://github.com/PerryLink/dsh-gongwen-word-check)** | |
359
+ | **[dsh-guard-plan-qc](https://github.com/PerryLink/dsh-guard-plan-qc)** | |
360
+ | **[dsh-hazchem-check](https://github.com/PerryLink/dsh-hazchem-check)** | |
361
+ | **[dsh-hazplan-check](https://github.com/PerryLink/dsh-hazplan-check)** | |
362
+ | **[dsh-hidden-risk-map](https://github.com/PerryLink/dsh-hidden-risk-map)** | |
363
+ | **[dsh-hs-classify](https://github.com/PerryLink/dsh-hs-classify)** | |
364
+ | **[dsh-icd-rule-check](https://github.com/PerryLink/dsh-icd-rule-check)** | |
365
+ | **[dsh-industry-research](https://github.com/PerryLink/dsh-industry-research)** | |
366
+ | **[dsh-lawcite-adapter](https://github.com/PerryLink/dsh-lawcite-adapter)** | |
367
+ | **[dsh-laya](https://github.com/PerryLink/dsh-laya)** | |
368
+ | **[dsh-lc-doc-check](https://github.com/PerryLink/dsh-lc-doc-check)** | |
369
+ | **[dsh-learning-gap-check](https://github.com/PerryLink/dsh-learning-gap-check)** | |
370
+ | **[dsh-library](https://github.com/PerryLink/dsh-library)** | |
371
+ | **[dsh-local-ai](https://github.com/PerryLink/dsh-local-ai)** | |
372
+ | **[dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions)** | |
373
+ | **[dsh-mask](https://github.com/PerryLink/dsh-mask)** | |
374
+ | **[dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel)** | |
375
+ | **[dsh-medrec-qc](https://github.com/PerryLink/dsh-medrec-qc)** | |
376
+ | **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | |
377
+ | **[dsh-nsfc-form-check](https://github.com/PerryLink/dsh-nsfc-form-check)** | |
378
+ | **[dsh-nurse-record-check](https://github.com/PerryLink/dsh-nurse-record-check)** | |
379
+ | **[dsh-observe](https://github.com/PerryLink/dsh-observe)** | |
380
+ | **[dsh-origin-rvc-check](https://github.com/PerryLink/dsh-origin-rvc-check)** | |
381
+ | **[dsh-ota-review-check](https://github.com/PerryLink/dsh-ota-review-check)** | |
382
+ | **[dsh-output-styles](https://github.com/PerryLink/dsh-output-styles)** | |
383
+ | **[dsh-paper-doc-adapter](https://github.com/PerryLink/dsh-paper-doc-adapter)** | |
384
+ | **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | |
385
+ | **[dsh-permit-report-check](https://github.com/PerryLink/dsh-permit-report-check)** | |
386
+ | **[dsh-pipeline-check](https://github.com/PerryLink/dsh-pipeline-check)** | |
387
+ | **[dsh-pleading-draft](https://github.com/PerryLink/dsh-pleading-draft)** | |
388
+ | **[dsh-plugin-doctor](https://github.com/PerryLink/dsh-plugin-doctor)** | 🚫 RETIRED (repo archived) |
389
+ | **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)** | |
390
+ | **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** | 🚫 RETIRED (repo archived) |
391
+ | **[dsh-plugin-upgrade](https://github.com/PerryLink/dsh-plugin-upgrade)** | 🚫 RETIRED (repo archived) |
392
+ | **[dsh-policy-brief-draft](https://github.com/PerryLink/dsh-policy-brief-draft)** | |
393
+ | **[dsh-power-loss-split](https://github.com/PerryLink/dsh-power-loss-split)** | |
394
+ | **[dsh-power-ticket-check](https://github.com/PerryLink/dsh-power-ticket-check)** | |
395
+ | **[dsh-ppap-check](https://github.com/PerryLink/dsh-ppap-check)** | |
396
+ | **[dsh-protest-deadline](https://github.com/PerryLink/dsh-protest-deadline)** | |
397
+ | **[dsh-railway-window](https://github.com/PerryLink/dsh-railway-window)** | |
398
+ | **[dsh-repair-order-qc](https://github.com/PerryLink/dsh-repair-order-qc)** | |
399
+ | **[dsh-research-report](https://github.com/PerryLink/dsh-research-report)** | |
400
+ | **[dsh-review-reply-check](https://github.com/PerryLink/dsh-review-reply-check)** | |
401
+ | **[dsh-rulefile-check](https://github.com/PerryLink/dsh-rulefile-check)** | |
402
+ | **[dsh-safety-brief-check](https://github.com/PerryLink/dsh-safety-brief-check)** | |
403
+ | **[dsh-score](https://github.com/PerryLink/dsh-score)** | |
404
+ | **[dsh-session-sync](https://github.com/PerryLink/dsh-session-sync)** | |
405
+ | **[dsh-site-log-check](https://github.com/PerryLink/dsh-site-log-check)** | |
406
+ | **[dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security)** | |
407
+ | **[dsh-soe-decision-check](https://github.com/PerryLink/dsh-soe-decision-check)** | |
408
+ | **[dsh-soilwater-check](https://github.com/PerryLink/dsh-soilwater-check)** | |
409
+ | **[dsh-sop-sync-check](https://github.com/PerryLink/dsh-sop-sync-check)** | |
410
+ | **[dsh-spc-gbt-adapter](https://github.com/PerryLink/dsh-spc-gbt-adapter)** | |
411
+ | **[dsh-talk](https://github.com/PerryLink/dsh-talk)** | |
412
+ | **[dsh-tender-extract](https://github.com/PerryLink/dsh-tender-extract)** | |
413
+ | **[dsh-tender-matrix](https://github.com/PerryLink/dsh-tender-matrix)** | |
414
+ | **[dsh-test-drive](https://github.com/PerryLink/dsh-test-drive)** | |
415
+ | **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** | 🚫 RETIRED (repo archived) |
416
+ | **[dsh-translate](https://github.com/PerryLink/dsh-translate)** | |
417
+ | **[dsh-warranty-calc](https://github.com/PerryLink/dsh-warranty-calc)** | |
418
+ | **[dsh-budget](https://github.com/PerryLink/dsh-budget)** | 🧊 FROZEN — see the repo README |
419
+ | **[dsh-claude-move](https://github.com/PerryLink/dsh-claude-move)** | 🧊 FROZEN — see the repo README |
420
+ | **[dsh-defend](https://github.com/PerryLink/dsh-defend)** | 🧊 FROZEN — see the repo README |
421
+ | **[dsh-draw](https://github.com/PerryLink/dsh-draw)** | 🧊 FROZEN — see the repo README |
422
+ | **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | 🧊 FROZEN — see the repo README |
423
+ | **[dsh-background-agents](https://github.com/PerryLink/dsh-background-agents)** | 🚫 RETIRED (repo archived) |
424
+ | **[dsh-session-pin](https://github.com/PerryLink/dsh-session-pin)** | 🚫 RETIRED (repo archived) |
425
+ | **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | 🚫 RETIRED (repo archived) |
426
+
427
+ </details>
428
+
429
+ ## License
430
+
431
+ [LICENSE](LICENSE) (Apache License 2.0) © 2026 dsh-mask contributors
432
+
433
+ <p align="center"><sub>Apache-2.0 · Community plugin, not affiliated with DeepSeek.</sub></p>