dsh-mask 0.2.20 → 0.2.23
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 +20 -5
- package/CHANGELOG.md +47 -0
- package/README-es.md +182 -68
- package/README-hi.md +183 -69
- package/README-pt.md +182 -68
- package/README-zh.md +181 -67
- package/README.md +183 -74
- package/cordis.patch.yml +7 -0
- package/index.mjs +77 -5
- package/lib/constants.mjs +2 -0
- package/lib/deliver.mjs +111 -0
- package/lib/store.mjs +26 -2
- package/lib/strip.mjs +14 -0
- package/package.json +30 -21
- package/types.d.ts +7 -0
package/ARCHITECTURE.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
`dsh-mask` anonymizes PII at the model boundary: it rewrites the messages that enter a step so that phones, emails, ID cards, bank cards, keys, and IPs become `<TYPE_N>` placeholders, and it keeps a `placeholder → original` restore table host-side so those placeholders stay reversible. The restore surface this form ships is the `/mask restore <text>` command plus the exported `RestoreStore` seam; automatically mapping placeholders back in the client UI is the browser half this pure-host form does not ship (see `README.md` Known limitations). The hard invariant is that **the plaintext never enters the session log** — the masked form is what gets logged and sent to the model, so model-visible content reconstructs from the log in placeholder form.
|
|
5
|
+
`dsh-mask` anonymizes PII at the model boundary: it rewrites the messages that enter a step so that phones, emails, ID cards, bank cards, keys, and IPs become `<TYPE_N>` placeholders, and it keeps a `placeholder → original` restore table host-side so those placeholders stay reversible. The restore surface this form ships is the `/mask restore <text>` command plus the exported `RestoreStore` seam; automatically mapping placeholders back in the client UI is the browser half this pure-host form does not ship (see `README.md` Known limitations). The hard invariant is that **the plaintext never enters the session log** — the masked form is what gets logged and sent to the model, so model-visible content reconstructs from the log in placeholder form. That invariant also governs the reveal direction: a command's result text is logged verbatim, so `/mask restore` delivers the restored plaintext as a controlled file and its result carries only the path and the placeholder names (see "Restore delivery").
|
|
6
6
|
|
|
7
7
|
## Roles
|
|
8
8
|
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
| `lib/sanitize.mjs` | Pure display/log redaction (PII entities, secrets, URL credentials, mapping summarization) |
|
|
22
22
|
| `lib/gate.mjs` | Session-event adaptive gate (append only when the host records the type or supports `ignorable`) |
|
|
23
23
|
| `lib/store.mjs` | The restore table: per-session `Stripper` in memory + optional persistence to `storageDomain` |
|
|
24
|
+
| `lib/deliver.mjs` | Restore-result delivery: the controlled plaintext file (one per session, `0700`/`0600`, symlink and ownership checks) that keeps the reveal out of the session log — `node:` built-ins only |
|
|
24
25
|
| `lib/domain.mjs` | The `dsh-mask` storage-domain spec (`restore` table, zod-validated) |
|
|
25
26
|
|
|
26
27
|
## Data flow
|
|
@@ -29,12 +30,25 @@
|
|
|
29
30
|
inbox ──agent/pre-step──▶ maskMessages ──▶ user/message (placeholders) ──▶ model
|
|
30
31
|
│
|
|
31
32
|
└──▶ RestoreStore (memory + dsh_mask/restore)
|
|
32
|
-
response (placeholders) ──restore()──▶
|
|
33
|
+
response (placeholders) ──restore()──▶ /mask restore ──▶ controlled file (never the log)
|
|
33
34
|
```
|
|
34
35
|
|
|
35
36
|
1. **Mask** — the `agent/pre-step` listener calls `next()` first (waterfall discipline), then rewrites the returned decision's messages through the session's `Stripper`. The masked messages are what the loop appends as `user/message`, so the log and the model both see placeholders.
|
|
36
37
|
2. **Record** — the `Stripper` accumulates the mapping and counts in memory; `store.persist(sessionId)` writes the mapping to `dsh_mask/restore` (best-effort, when `persistRestoreTable: true`).
|
|
37
|
-
3. **Restore** — `/mask restore` (and a future client half) call `store.restore(sessionId, text)`, which unmaps placeholders using the in-memory mapping or reloads it from the domain.
|
|
38
|
+
3. **Restore** — `/mask restore` (and a future client half) call `store.restore(sessionId, text)`, which unmaps placeholders using the in-memory mapping or reloads it from the domain. The command handler uses `store.restoreDetailed` so it can report which placeholders matched, then hands the plaintext to `lib/deliver.mjs` instead of returning it.
|
|
39
|
+
|
|
40
|
+
## Restore delivery (why the reveal is a file)
|
|
41
|
+
|
|
42
|
+
The host gives a command handler no way to show text to the user without also logging it:
|
|
43
|
+
|
|
44
|
+
- `@deepseek-ai/dsh-commands`'s `execute()` appends `command/done` with the handler's **verbatim** `result.text` (`packages/interaction/commands/src/index.ts`, typed as verbatim in its `types.ts`). It is a direct log-only append: no turn wraps it, and it never reaches the model.
|
|
45
|
+
- The user-visible command outcome is rendered from **that same event**: the client conversation assembler builds the command node out of `command/run`/`command/done`, and `GenericCommandCard` renders `node.outcome.text`.
|
|
46
|
+
|
|
47
|
+
So `result.text` is simultaneously the transcript and the persistent log, and the host exposes no "log but do not render" or "render but do not log" switch (`recordInput: false` covers only the input side, `command/run.args`). Returning the restored plaintext there — what this plugin did until 0.2.21 — therefore wrote the PII into the session log on every `/mask restore`, which is exactly what the plugin exists to prevent. Redacting the result instead (running it through `redactText`) would keep the leak closed but leave the user staring at `***` for a command whose only purpose is to reveal the original.
|
|
48
|
+
|
|
49
|
+
The chosen design keeps both properties: the plaintext goes to a controlled file under `restoreDir` (default `os.tmpdir()/dsh-mask-restore`), and the result text carries only the path and the placeholder names — both non-PII by construction (the path is the config directory plus a fixed prefix plus a hash of the session id; the placeholders are already in the log by design). One file per session means the number of plaintext copies on disk stays bounded, and the result text says so. Delivery failure fails closed: an error result, never a fallback that echoes the plaintext.
|
|
50
|
+
|
|
51
|
+
The file is deliberately **not** the storage domain's own record: the domain holds the whole session mapping in one JSON record, whereas this file holds exactly the text the user asked to see, at a path the user can open.
|
|
38
52
|
|
|
39
53
|
## Why `agent/pre-step` and not `agent/request`
|
|
40
54
|
|
|
@@ -62,8 +76,8 @@ The `dsh_mask` domain has one `restore` table keyed by session id. Its record ho
|
|
|
62
76
|
|
|
63
77
|
## Safety boundaries
|
|
64
78
|
|
|
65
|
-
- **Plaintext never enters the session log.** The masked form is logged; originals stay in the restore table.
|
|
66
|
-
- **Sanitize before display/log.** `lib/sanitize.mjs` redacts PII, secrets, and URL credentials before any text reaches the model or log; `mask_test
|
|
79
|
+
- **Plaintext never enters the session log.** The masked form is logged; originals stay in the restore table. This covers the reveal direction too: the `/mask restore` result text is logged verbatim by the host, so the plaintext is delivered as a controlled file (see "Restore delivery").
|
|
80
|
+
- **Sanitize before display/log.** `lib/sanitize.mjs` redacts PII, secrets, and URL credentials before any text reaches the model or log; `mask_test`, `/mask status`, and every `/mask` error path never echo originals.
|
|
67
81
|
- **Fail closed.** Unimplemented `mode` (`regex+ner`), `scope` (`tools`), NER-only entities, and out-of-bounds numbers fail loudly at load.
|
|
68
82
|
- **Registrations are effects.** The listener, command, tool, and domain close are all Cordis effects, so stop/hot-reload is reversible.
|
|
69
83
|
|
|
@@ -72,3 +86,4 @@ The `dsh_mask` domain has one `restore` table keyed by session id. Its record ho
|
|
|
72
86
|
- `mode: regex+ner` — external name/address recognition; fails loudly until a recognizer is wired in (the detector Provider seam above is the plug point).
|
|
73
87
|
- `scope: tools` — implemented as `tools/post-execute` result-content masking. Tool-argument rewriting is deliberately NOT offered upstream: `tools/pre-execute`'s `PreToolDecision` has no input rewrite because logged/rendered arguments must match what ran, so `tools` scope masks the other model-visible tool surface (the result content) instead of the arguments.
|
|
74
88
|
- A browser half would consume the restore table to transparently un-mask assistant bubbles; the host-side restore surface (`/mask restore` + `RestoreStore.restore`) ships, and `maskClientEnabled` (default false) is the key reserved for that browser slot pending live slot-catalog verification. The key is declared in the schema and validated at load, but no runtime code reads it yet, so it has no effect until the browser half ships.
|
|
89
|
+
- **A no-argument `/mask restore`** (restore every placeholder of the most recent assistant message) is deliberately not implemented. Two host facts block it: the restore table is a flat per-session `{placeholder: original}` map with **no per-message index**, so "the last assistant 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" (`deepseek-harness/.agents/notes/implemented/architecture/2026-09-09-deprecate-synchronous-session-event-reads.md`), whose sanctioned alternative — keep a projection incrementally from delivered events — is not available across this plugin's declared host corridor (`>=0.1.2-rc.1`). Offering the form would mean shipping a prohibited synchronous read or a host-version-dependent projection seam, so the form is documented as unavailable and `/mask restore` stays text-only (its error text says so).
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.23] - 2026-10-24
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **Pin `zod` to 4.4.3 and ignore its dependabot bumps until the host packages align.** The npm-minor-patch group pulled `zod@4.6.7` alongside the host's `4.4.3`; the duplicated `ZodType` identity breaks `tsc`.
|
|
8
|
+
|
|
9
|
+
## [0.2.22] - 2026-10-18
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Add a 1280×720 hero and a 960×540, 4-second terminal GIF rendered from the test run; `screenshots.json` is an object array and `capture.json` records the command.
|
|
14
|
+
|
|
3
15
|
All notable changes to this project are documented in this file.
|
|
4
16
|
|
|
5
17
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
@@ -26,6 +38,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
26
38
|
|
|
27
39
|
## [Unreleased]
|
|
28
40
|
|
|
41
|
+
## [0.2.21] - 2026-10-17
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- **`/mask restore` wrote the restored plaintext into the persistent session log.** The
|
|
46
|
+
host logs a command's result verbatim (`command/done.text`, typed as verbatim in
|
|
47
|
+
`@deepseek-ai/dsh-commands`), and the client renders the user-visible command outcome
|
|
48
|
+
from that same event, so the two channels cannot be separated: the result text *is* the
|
|
49
|
+
log. Every `/mask restore <PLACEHOLDER>` therefore persisted the un-masked PII it had
|
|
50
|
+
just revealed, which is precisely what this plugin exists to prevent (the README and
|
|
51
|
+
`ARCHITECTURE.md` both promised the plaintext never reaches the log, and the restore
|
|
52
|
+
table stayed the only plaintext store). The reveal now goes to a controlled file —
|
|
53
|
+
one per session under `restoreDir` (default `os.tmpdir()/dsh-mask-restore`), directory
|
|
54
|
+
`0700`, file `0600`, symlink and ownership checked, overwritten by the next restore —
|
|
55
|
+
and the command result carries only that path and the placeholder names it restored.
|
|
56
|
+
Both are non-PII by construction, so the result stays safe to log and render. Delivery
|
|
57
|
+
failure fails closed: an error result is returned and the plaintext is never echoed as a
|
|
58
|
+
fallback. `/mask` error texts now also pass through `redactText`, since they are logged
|
|
59
|
+
too. `restoreDir` joins the config surface; the manifest declares `filesystem:write`.
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
- `lib/deliver.mjs` (the controlled restore-delivery channel), `Stripper.placeholdersIn`
|
|
64
|
+
and `RestoreStore.restoreDetailed` (report which placeholders a restore matched without
|
|
65
|
+
handling the plaintext twice), and 32 tests covering the delivery path, the fail-closed
|
|
66
|
+
cases, and the "no plaintext in the command result" contract.
|
|
67
|
+
|
|
68
|
+
### Documentation
|
|
69
|
+
|
|
70
|
+
- `README.md` (+ the four translations), `ARCHITECTURE.md` and `cordis.patch.yml` record
|
|
71
|
+
the delivery channel and its reason, and the Known limitations now state why a
|
|
72
|
+
no-argument `/mask restore` (restore every placeholder of the last assistant message) is
|
|
73
|
+
not offered: the restore table has no per-message index, and locating that message needs a
|
|
74
|
+
synchronous session-history read the host prohibits for new callers.
|
|
75
|
+
|
|
29
76
|
## [0.2.18] - 2026-10-05
|
|
30
77
|
|
|
31
78
|
undefined
|
package/README-es.md
CHANGED
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
|
|
22
22
|
[English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
23
23
|
|
|
24
|
+
```sh
|
|
25
|
+
dsh plugin --profile <name> add dsh-mask
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
|
|
24
29
|
</div>
|
|
25
30
|
|
|
26
31
|
---
|
|
@@ -29,11 +34,20 @@
|
|
|
29
34
|
**📖 Base de conocimiento del ecosistema** — datos medidos, no marketing: [guía de desarrollo · datos de selección · criterios de mantenimiento](https://perrylink.github.io/dsh-plugin-guide/).
|
|
30
35
|
|
|
31
36
|
<!-- star-cta -->
|
|
37
|
+
## Install & uninstall
|
|
38
|
+
|
|
39
|
+
- **Canal git**: `dsh plugin --profile web add github:PerryLink/dsh-mask` (equivale a `git+https://github.com/PerryLink/dsh-mask.git`). Sin paso de build.
|
|
40
|
+
- **Canal npm**: `dsh plugin --profile web add dsh-mask`.
|
|
41
|
+
- **Canal tarball**: `pnpm pack` y luego `dsh plugin --profile web add ./dsh-mask-<version>.tgz`.
|
|
42
|
+
- **Desinstalar**: `dsh plugin --profile web remove dsh-mask`.
|
|
43
|
+
|
|
44
|
+
`dsh-mask` ya no incluye la pila de almacenamiento. Los perfiles que ya la componen (el perfil `web` lo hace, vía `@deepseek-ai/dsh-web-app`) aportan `storageDomain`, así que la persistencia funciona de inmediato. En un perfil bare sin almacenamiento el plugin se monta y enmascara igualmente, pero la tabla es solo en memoria (se pierde al reiniciar): compón la pila de almacenamiento en tu parche de perfil, o pon `persistRestoreTable: false`.
|
|
45
|
+
|
|
32
46
|
## ⭐ 如果它帮到了你
|
|
33
47
|
|
|
34
48
|
Este plugin forma parte de la [familia de plugins DSH](https://github.com/PerryLink) (más de 40, todos Apache-2.0). Si te resulta útil, **dale una estrella**: no desbloquea nada, pero ayuda a que la siguiente persona lo encuentre antes.
|
|
35
49
|
|
|
36
|
-
*English:* part of a
|
|
50
|
+
*English:* part of a 95 plugin family for DeepSeek Harness. If it is useful, **a star helps the next person find it** — nothing is gated behind it.
|
|
37
51
|
|
|
38
52
|
## What is dsh-mask?
|
|
39
53
|
|
|
@@ -41,9 +55,10 @@ Middleware de enmascaramiento de PII para DeepSeek Harness: anonimiza los datos
|
|
|
41
55
|
|
|
42
56
|
Teléfonos, correos, documentos, tarjetas, claves y más se convierten en marcadores de posición en el límite del modelo; el texto plano nunca entra en tu registro de sesión.
|
|
43
57
|
|
|
44
|
-

|
|
59
|
+
|
|
60
|
+
*Resumen del flujo: llamada → plugin → resultado. Los ejemplos siguientes usan la superficie de comandos real.*
|
|
45
61
|
|
|
46
|
-

|
|
47
62
|
|
|
48
63
|
*La misma ejecución, animada.*
|
|
49
64
|
|
|
@@ -69,13 +84,13 @@ Teléfonos, correos, documentos, tarjetas, claves y más se convierten en marcad
|
|
|
69
84
|
- **Enmascarado antes de la petición** — reescribe los mensajes de `agent/pre-step` para que teléfonos, correos, documentos, tarjetas, claves e IP (opt-in) se vuelvan marcadores como `<PHONE_1>`. El texto enmascarado es lo que se registra y se envía al modelo.
|
|
70
85
|
- **Tabla de restauración** — el mapa `marcador → original` vive solo en memoria y en un dominio de almacenamiento controlado (`dsh_mask`); el texto plano nunca entra en el registro de sesión.
|
|
71
86
|
- **Auditoría sin texto plano** — el evento `mask/applied` solo registra «N valores reemplazados + distribución por tipo».
|
|
72
|
-
- **Comando `/mask`** — `status`, `on`/`off`, `restore <text
|
|
87
|
+
- **Comando `/mask`** — `status`, `on`/`off`, `restore <text>` (desmapea marcadores y entrega el texto plano como archivo, nunca como texto registrable), `help`.
|
|
73
88
|
- **Herramienta `mask_test`** — prueba un fragmento y ve el resultado con marcadores; nunca revela los valores originales.
|
|
74
89
|
|
|
75
90
|
```text
|
|
76
|
-
mensaje de usuario ──agent/pre-step──▶ marcadores ──modelo──▶ marcadores ──restore──▶
|
|
77
|
-
▲
|
|
78
|
-
└──── tabla de restauración (memoria + dsh_mask)
|
|
91
|
+
mensaje de usuario ──agent/pre-step──▶ marcadores ──modelo──▶ marcadores ──restore──▶ archivo controlado
|
|
92
|
+
▲ │
|
|
93
|
+
└──── tabla de restauración (memoria + dsh_mask) ──┘
|
|
79
94
|
```
|
|
80
95
|
|
|
81
96
|
## Quick start
|
|
@@ -102,16 +117,58 @@ dsh --profile web --dump-config | grep -A2 'id: mask'
|
|
|
102
117
|
```
|
|
103
118
|
> /mask status
|
|
104
119
|
> /mask restore <PHONE_1>
|
|
120
|
+
mask: restored 1 placeholder(s): <PHONE_1>
|
|
121
|
+
file: /tmp/dsh-mask-restore/restore-1f0c….txt (mode 0600, one file per session)
|
|
105
122
|
```
|
|
106
123
|
|
|
107
|
-
|
|
124
|
+
### Ejemplos
|
|
108
125
|
|
|
109
|
-
|
|
110
|
-
- **Canal npm**: `dsh plugin --profile web add dsh-mask`.
|
|
111
|
-
- **Canal tarball**: `pnpm pack` y luego `dsh plugin --profile web add ./dsh-mask-<version>.tgz`.
|
|
112
|
-
- **Desinstalar**: `dsh plugin --profile web remove dsh-mask`.
|
|
126
|
+
Son los puntos de entrada reales; instala y llama a uno.
|
|
113
127
|
|
|
114
|
-
|
|
128
|
+
#### Ejemplo detallado
|
|
129
|
+
|
|
130
|
+
**Comando**
|
|
131
|
+
|
|
132
|
+
~~~sh
|
|
133
|
+
mask_test
|
|
134
|
+
~~~
|
|
135
|
+
|
|
136
|
+
**Entrada**
|
|
137
|
+
|
|
138
|
+
~~~json
|
|
139
|
+
{"text":"电话 13812345678"}
|
|
140
|
+
~~~
|
|
141
|
+
|
|
142
|
+
**Salida**
|
|
143
|
+
|
|
144
|
+
~~~text
|
|
145
|
+
mask_test: replaced 1 PII value(s) (PHONE=1)
|
|
146
|
+
masked:
|
|
147
|
+
电话 <PHONE_1>
|
|
148
|
+
~~~
|
|
149
|
+
|
|
150
|
+
*Observado en `plugins/dsh-mask/index.mjs:243-250; test/index.test.mjs:306-315`*
|
|
151
|
+
|
|
152
|
+
#### Rama de fallo
|
|
153
|
+
|
|
154
|
+
**Entrada**
|
|
155
|
+
|
|
156
|
+
~~~text
|
|
157
|
+
/mask restore <PHONE_1> with restoreDir=/tmp/dsh-mask-probe-not-a-dir (a regular file)
|
|
158
|
+
~~~
|
|
159
|
+
|
|
160
|
+
**Salida**
|
|
161
|
+
|
|
162
|
+
~~~text
|
|
163
|
+
mask: restore failed: EEXIST: file already exists, mkdir '/tmp/dsh-mask-probe-not-a-dir'
|
|
164
|
+
~~~
|
|
165
|
+
|
|
166
|
+
*Observado en `plugins/dsh-mask/index.mjs:501-506; plugins/dsh-mask/lib/deliver.mjs:89-97; plugins/dsh-mask/test/index.test.mjs:278-290`*
|
|
167
|
+
|
|
168
|
+
#### Ejemplos breves
|
|
169
|
+
|
|
170
|
+
- `mask_test`
|
|
171
|
+
- `/mask restore <text>`
|
|
115
172
|
|
|
116
173
|
## Configuration
|
|
117
174
|
|
|
@@ -128,6 +185,7 @@ Todas las opciones son campos Schemastery `Config` (modificables desde cordis.ym
|
|
|
128
185
|
| `persistRestoreTable` | `true` | Persiste la tabla en el dominio `dsh_mask` |
|
|
129
186
|
| `maxRestoreEntriesPerSession` | `500` | Tope de entradas por sesión |
|
|
130
187
|
| `maxSessions` | `1000` | Tope de sesiones en memoria |
|
|
188
|
+
| `restoreDir` | `''` | Dónde entrega `/mask restore` el texto plano. Vacío = `os.tmpdir()/dsh-mask-restore`; un valor relativo se resuelve contra el cwd del proceso host. El directorio se crea `0700` y el archivo se escribe `0600`, uno por sesión |
|
|
131
189
|
|
|
132
190
|
## Tools & surfaces
|
|
133
191
|
|
|
@@ -136,20 +194,20 @@ Todas las opciones son campos Schemastery `Config` (modificables desde cordis.ym
|
|
|
136
194
|
| Enmascarado `agent/pre-step` | nunca | Reescribe mensajes a marcadores |
|
|
137
195
|
| `/mask status` | nunca | Estado, total reemplazado, distribución |
|
|
138
196
|
| `/mask on` / `/mask off` | nunca | Alternancia en tiempo de ejecución |
|
|
139
|
-
| `/mask restore <text>` | sí (explícito) | Desmapea marcadores a los valores de esta sesión |
|
|
197
|
+
| `/mask restore <text>` | sí (explícito) | Desmapea marcadores a los valores de esta sesión y los escribe en un archivo controlado (uno por sesión, modo `0600`); el texto del resultado y el registro de sesión solo llevan esa ruta y los nombres de los marcadores |
|
|
140
198
|
| `mask_test` | nunca | Enmascara un fragmento y reporta el resultado |
|
|
141
199
|
|
|
142
200
|
## Permissions & data
|
|
143
201
|
|
|
144
|
-
- **Permisos**: sin red, sin credenciales (`network:none`, `credentials:none`).
|
|
145
|
-
- **Datos**: la tabla `marcador → original` vive en memoria y, con `persistRestoreTable: true`, en el dominio `dsh_mask`; nunca en el registro de sesión.
|
|
202
|
+
- **Permisos**: sin red, sin credenciales (`network:none`, `credentials:none`). El manifest declara `filesystem:write` por el archivo de entrega de `/mask restore`.
|
|
203
|
+
- **Datos**: la tabla `marcador → original` vive en memoria y, con `persistRestoreTable: true`, en el dominio `dsh_mask`; nunca en el registro de sesión. La única otra copia en texto plano es el archivo de entrega que escribe un `/mask restore` explícito (`restoreDir`, modo `0600`, uno por sesión, sobrescrito por la siguiente restauración); nada escribe texto plano en disco de forma implícita.
|
|
146
204
|
- **Registro de sesión**: `mask/applied` se declara en `types.d.ts` y se añade solo cuando el host registra el tipo.
|
|
147
205
|
|
|
148
206
|
## Security boundaries
|
|
149
207
|
|
|
150
|
-
- **El texto plano nunca entra en el registro de sesión.** Lo registrado y enviado es la forma enmascarada; los originales quedan en la tabla de restauración.
|
|
151
|
-
- **Sanitizar antes de mostrar/registrar.** `lib/sanitize.mjs` redacta PII, secretos y credenciales de URL.
|
|
152
|
-
- **Restauración controlada.** `/mask restore` es la única superficie de revelado explícita.
|
|
208
|
+
- **El texto plano nunca entra en el registro de sesión.** Lo registrado y enviado es la forma enmascarada; los originales quedan en la tabla de restauración. La misma regla rige el revelado: el host registra el texto del resultado de un comando **literalmente** y lo usa para renderizar la salida visible, así que `/mask restore` escribe el texto plano en un archivo controlado y solo devuelve la ruta.
|
|
209
|
+
- **Sanitizar antes de mostrar/registrar.** `lib/sanitize.mjs` redacta PII, secretos y credenciales de URL; `mask_test`, `/mask status` y todas las rutas de error de `/mask` nunca muestran originales.
|
|
210
|
+
- **Restauración controlada.** `/mask restore` es la única superficie de revelado explícita. Si falla la entrega, falla cerrado: un error, nunca un respaldo que muestre el texto plano.
|
|
153
211
|
- **Fallo cerrado.** `mode`/`scope`/entidades no implementados y números fuera de rango fallan al cargar.
|
|
154
212
|
- **Registros como efectos.** Listener, comando, herramienta y cierre de dominio son efectos Cordis.
|
|
155
213
|
|
|
@@ -157,7 +215,8 @@ Todas las opciones son campos Schemastery `Config` (modificables desde cordis.ym
|
|
|
157
215
|
|
|
158
216
|
- **Solo regex.** `person` y `address` requieren un reconocedor NER externo; fallan al cargar. Cubierto de serie: teléfono, correo, documento, tarjeta, clave e IP (opt-in).
|
|
159
217
|
- **Patrones específicos de región.** Los detectores `phone` e `id-card` solo reconocen formatos de China continental: `phone` es `1[3-9]` seguido de nueve dígitos, e `id-card` es un documento de residente chino de 18 caracteres (17 dígitos más un dígito o `X`). Los teléfonos y documentos de otros países no se detectan. `email`, `ip` y `key` no dependen de la región; `bank-card` acepta cualquier secuencia de 16-19 dígitos con menor confianza.
|
|
160
|
-
- **La restauración visual necesita una mitad de cliente.** Enmascarar es host-side; desenmascarar burbujas en la UI es una función de navegador que esta forma host puro no incluye. El host conserva la tabla y el seam `RestoreStore` exportado (sus métodos piden un id de sesión), así que una futura mitad de cliente debe consumirlos mediante un remoto del host, no directamente; hoy la superficie de desenmascarado es el comando `/mask restore <text>`, y la clave `maskClientEnabled` se declara y valida pero ningún código en ejecución la lee todavía.
|
|
218
|
+
- **La restauración visual necesita una mitad de cliente.** Enmascarar es host-side; desenmascarar burbujas en la UI es una función de navegador que esta forma host puro no incluye. El host conserva la tabla y el seam `RestoreStore` exportado (sus métodos piden un id de sesión), así que una futura mitad de cliente debe consumirlos mediante un remoto del host, no directamente; hoy la superficie de desenmascarado es el comando `/mask restore <text>`, que entrega el texto plano como archivo porque el resultado de un comando se registra literalmente, y la clave `maskClientEnabled` se declara y valida pero ningún código en ejecución la lee todavía.
|
|
219
|
+
- **No hay `/mask restore` sin argumentos.** Restaurar *todos* los marcadores del último mensaje del asistente no se ofrece, y el comando lo dice si se invoca sin texto. Dos hechos del host lo impiden: la tabla de restauración es un mapa plano `{marcador: original}` por sesión, **sin índice por mensaje**, así que ese mensaje hay que localizarlo en el registro de eventos de la sesión; y el host marcó `Session.snapshotEvents()` / `eventAt()` / `ownEvents()` como obsoletos con un «prohibido llamarlos desde código nuevo», y la única alternativa sancionada (mantener una proyección incremental) no es fiable en el corredor de hosts declarado (`>=0.1.2-rc.1`). Los marcadores siguen restaurándose de uno en uno: `/mask restore <PHONE_1>`.
|
|
161
220
|
- **Eventos en `0.1.7-rc.2`.** El host registra 59 tipos de evento de sesión y ninguno es `mask/*`; su `Session.append` tampoco puede estampar el sobre `ignorable`, así que los appends de auditoría se omiten (las sesiones siguen cargando). La puerta no es silenciosa: la primera negativa de cada sesión registra un aviso visible con el tipo omitido y esta limitación documentada. El append se habilita automáticamente cuando un host registra el tipo o admite el sobre `ignorable`.
|
|
162
221
|
|
|
163
222
|
## Development
|
|
@@ -207,55 +266,110 @@ Evidencia estática: `dsh-plugin-doctor` K10–K13 dan `pass` en todas las compr
|
|
|
207
266
|
|
|
208
267
|
## PerryLink DSH Plugin Family
|
|
209
268
|
|
|
210
|
-
Este proyecto
|
|
269
|
+
Este proyecto forma parte de la familia de plugins de DeepSeek Harness de [PerryLink](https://github.com/PerryLink). El registro permanece plegado abajo para que cada README conserve una primera pantalla corta; expándelo para ver cada fila y su estado.
|
|
211
270
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
|
216
|
-
|
|
217
|
-
| **[dsh-
|
|
218
|
-
| **[dsh-
|
|
219
|
-
| **[dsh-
|
|
220
|
-
| **[dsh-
|
|
221
|
-
| **[dsh-
|
|
222
|
-
| **[dsh-
|
|
223
|
-
| **[dsh-
|
|
224
|
-
| **[dsh-
|
|
225
|
-
| **[dsh-
|
|
226
|
-
| **[dsh-
|
|
227
|
-
| **[dsh-
|
|
228
|
-
| **[dsh-
|
|
229
|
-
| **[dsh-
|
|
230
|
-
| **[dsh-
|
|
231
|
-
| **[dsh-
|
|
232
|
-
| **[dsh-
|
|
233
|
-
| **[dsh-
|
|
234
|
-
| **[dsh-
|
|
235
|
-
| **[dsh-
|
|
236
|
-
| **[dsh-
|
|
237
|
-
| **[dsh-
|
|
238
|
-
| **[dsh-
|
|
239
|
-
| **[dsh-
|
|
240
|
-
| **[dsh-
|
|
241
|
-
| **[dsh-
|
|
242
|
-
| **[dsh-
|
|
243
|
-
| **[dsh-
|
|
244
|
-
| **[dsh-
|
|
245
|
-
| **[dsh-
|
|
246
|
-
| **[dsh-
|
|
247
|
-
| **[dsh-
|
|
248
|
-
| **[dsh-
|
|
249
|
-
| **[dsh-
|
|
250
|
-
| **[dsh-
|
|
251
|
-
| **[dsh-
|
|
252
|
-
| **[dsh-
|
|
253
|
-
| **[dsh-
|
|
254
|
-
| **[dsh-
|
|
255
|
-
| **[dsh-
|
|
256
|
-
| **[dsh-
|
|
257
|
-
| **[dsh-
|
|
258
|
-
| **[dsh-
|
|
271
|
+
<details>
|
|
272
|
+
<summary>Expandir todos los plugins</summary>
|
|
273
|
+
|
|
274
|
+
| Plugin | Estado |
|
|
275
|
+
|---|---|
|
|
276
|
+
| **[dsh-aqua-input-check](https://github.com/PerryLink/dsh-aqua-input-check)** | |
|
|
277
|
+
| **[dsh-archive-check](https://github.com/PerryLink/dsh-archive-check)** | |
|
|
278
|
+
| **[dsh-auto-review](https://github.com/PerryLink/dsh-auto-review)** | |
|
|
279
|
+
| **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | |
|
|
280
|
+
| **[dsh-bid-ca-precheck](https://github.com/PerryLink/dsh-bid-ca-precheck)** | |
|
|
281
|
+
| **[dsh-bid-qual-check](https://github.com/PerryLink/dsh-bid-qual-check)** | |
|
|
282
|
+
| **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | |
|
|
283
|
+
| **[dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind)** | |
|
|
284
|
+
| **[dsh-click](https://github.com/PerryLink/dsh-click)** | |
|
|
285
|
+
| **[dsh-composer-history](https://github.com/PerryLink/dsh-composer-history)** | |
|
|
286
|
+
| **[dsh-contract-stance](https://github.com/PerryLink/dsh-contract-stance)** | |
|
|
287
|
+
| **[dsh-customs-doc-check](https://github.com/PerryLink/dsh-customs-doc-check)** | |
|
|
288
|
+
| **[dsh-data-quality](https://github.com/PerryLink/dsh-data-quality)** | |
|
|
289
|
+
| **[dsh-demurrage-ledger](https://github.com/PerryLink/dsh-demurrage-ledger)** | |
|
|
290
|
+
| **[dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck)** | |
|
|
291
|
+
| **[dsh-drill-script-check](https://github.com/PerryLink/dsh-drill-script-check)** | |
|
|
292
|
+
| **[dsh-eia-guide-check](https://github.com/PerryLink/dsh-eia-guide-check)** | |
|
|
293
|
+
| **[dsh-emergency-plan](https://github.com/PerryLink/dsh-emergency-plan)** | |
|
|
294
|
+
| **[dsh-essay-rubric-check](https://github.com/PerryLink/dsh-essay-rubric-check)** | |
|
|
295
|
+
| **[dsh-evidence-check](https://github.com/PerryLink/dsh-evidence-check)** | |
|
|
296
|
+
| **[dsh-export-ctl-check](https://github.com/PerryLink/dsh-export-ctl-check)** | |
|
|
297
|
+
| **[dsh-fast](https://github.com/PerryLink/dsh-fast)** | |
|
|
298
|
+
| **[dsh-fmea-table-check](https://github.com/PerryLink/dsh-fmea-table-check)** | |
|
|
299
|
+
| **[dsh-forecast-penalty](https://github.com/PerryLink/dsh-forecast-penalty)** | |
|
|
300
|
+
| **[dsh-fund-research](https://github.com/PerryLink/dsh-fund-research)** | |
|
|
301
|
+
| **[dsh-github](https://github.com/PerryLink/dsh-github)** | |
|
|
302
|
+
| **[dsh-gongwen-flow-check](https://github.com/PerryLink/dsh-gongwen-flow-check)** | |
|
|
303
|
+
| **[dsh-gongwen-word-check](https://github.com/PerryLink/dsh-gongwen-word-check)** | |
|
|
304
|
+
| **[dsh-guard-plan-qc](https://github.com/PerryLink/dsh-guard-plan-qc)** | |
|
|
305
|
+
| **[dsh-hazchem-check](https://github.com/PerryLink/dsh-hazchem-check)** | |
|
|
306
|
+
| **[dsh-hazplan-check](https://github.com/PerryLink/dsh-hazplan-check)** | |
|
|
307
|
+
| **[dsh-hidden-risk-map](https://github.com/PerryLink/dsh-hidden-risk-map)** | |
|
|
308
|
+
| **[dsh-hs-classify](https://github.com/PerryLink/dsh-hs-classify)** | |
|
|
309
|
+
| **[dsh-icd-rule-check](https://github.com/PerryLink/dsh-icd-rule-check)** | |
|
|
310
|
+
| **[dsh-industry-research](https://github.com/PerryLink/dsh-industry-research)** | |
|
|
311
|
+
| **[dsh-lawcite-adapter](https://github.com/PerryLink/dsh-lawcite-adapter)** | |
|
|
312
|
+
| **[dsh-laya](https://github.com/PerryLink/dsh-laya)** | |
|
|
313
|
+
| **[dsh-lc-doc-check](https://github.com/PerryLink/dsh-lc-doc-check)** | |
|
|
314
|
+
| **[dsh-learning-gap-check](https://github.com/PerryLink/dsh-learning-gap-check)** | |
|
|
315
|
+
| **[dsh-library](https://github.com/PerryLink/dsh-library)** | |
|
|
316
|
+
| **[dsh-local-ai](https://github.com/PerryLink/dsh-local-ai)** | |
|
|
317
|
+
| **[dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions)** | |
|
|
318
|
+
| **[dsh-mask](https://github.com/PerryLink/dsh-mask)** | |
|
|
319
|
+
| **[dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel)** | |
|
|
320
|
+
| **[dsh-medrec-qc](https://github.com/PerryLink/dsh-medrec-qc)** | |
|
|
321
|
+
| **[dsh-memento](https://github.com/PerryLink/dsh-memento)** | |
|
|
322
|
+
| **[dsh-nsfc-form-check](https://github.com/PerryLink/dsh-nsfc-form-check)** | |
|
|
323
|
+
| **[dsh-nurse-record-check](https://github.com/PerryLink/dsh-nurse-record-check)** | |
|
|
324
|
+
| **[dsh-observe](https://github.com/PerryLink/dsh-observe)** | |
|
|
325
|
+
| **[dsh-origin-rvc-check](https://github.com/PerryLink/dsh-origin-rvc-check)** | |
|
|
326
|
+
| **[dsh-ota-review-check](https://github.com/PerryLink/dsh-ota-review-check)** | |
|
|
327
|
+
| **[dsh-output-styles](https://github.com/PerryLink/dsh-output-styles)** | |
|
|
328
|
+
| **[dsh-paper-doc-adapter](https://github.com/PerryLink/dsh-paper-doc-adapter)** | |
|
|
329
|
+
| **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | |
|
|
330
|
+
| **[dsh-permit-report-check](https://github.com/PerryLink/dsh-permit-report-check)** | |
|
|
331
|
+
| **[dsh-pipeline-check](https://github.com/PerryLink/dsh-pipeline-check)** | |
|
|
332
|
+
| **[dsh-pleading-draft](https://github.com/PerryLink/dsh-pleading-draft)** | |
|
|
333
|
+
| **[dsh-plugin-doctor](https://github.com/PerryLink/dsh-plugin-doctor)** | |
|
|
334
|
+
| **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)** | |
|
|
335
|
+
| **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** | |
|
|
336
|
+
| **[dsh-plugin-upgrade](https://github.com/PerryLink/dsh-plugin-upgrade)** | |
|
|
337
|
+
| **[dsh-policy-brief-draft](https://github.com/PerryLink/dsh-policy-brief-draft)** | |
|
|
338
|
+
| **[dsh-power-loss-split](https://github.com/PerryLink/dsh-power-loss-split)** | |
|
|
339
|
+
| **[dsh-power-ticket-check](https://github.com/PerryLink/dsh-power-ticket-check)** | |
|
|
340
|
+
| **[dsh-ppap-check](https://github.com/PerryLink/dsh-ppap-check)** | |
|
|
341
|
+
| **[dsh-protest-deadline](https://github.com/PerryLink/dsh-protest-deadline)** | |
|
|
342
|
+
| **[dsh-railway-window](https://github.com/PerryLink/dsh-railway-window)** | |
|
|
343
|
+
| **[dsh-repair-order-qc](https://github.com/PerryLink/dsh-repair-order-qc)** | |
|
|
344
|
+
| **[dsh-research-report](https://github.com/PerryLink/dsh-research-report)** | |
|
|
345
|
+
| **[dsh-review-reply-check](https://github.com/PerryLink/dsh-review-reply-check)** | |
|
|
346
|
+
| **[dsh-rulefile-check](https://github.com/PerryLink/dsh-rulefile-check)** | |
|
|
347
|
+
| **[dsh-safety-brief-check](https://github.com/PerryLink/dsh-safety-brief-check)** | |
|
|
348
|
+
| **[dsh-score](https://github.com/PerryLink/dsh-score)** | |
|
|
349
|
+
| **[dsh-session-sync](https://github.com/PerryLink/dsh-session-sync)** | |
|
|
350
|
+
| **[dsh-site-log-check](https://github.com/PerryLink/dsh-site-log-check)** | |
|
|
351
|
+
| **[dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security)** | |
|
|
352
|
+
| **[dsh-soe-decision-check](https://github.com/PerryLink/dsh-soe-decision-check)** | |
|
|
353
|
+
| **[dsh-soilwater-check](https://github.com/PerryLink/dsh-soilwater-check)** | |
|
|
354
|
+
| **[dsh-sop-sync-check](https://github.com/PerryLink/dsh-sop-sync-check)** | |
|
|
355
|
+
| **[dsh-spc-gbt-adapter](https://github.com/PerryLink/dsh-spc-gbt-adapter)** | |
|
|
356
|
+
| **[dsh-talk](https://github.com/PerryLink/dsh-talk)** | |
|
|
357
|
+
| **[dsh-tender-extract](https://github.com/PerryLink/dsh-tender-extract)** | |
|
|
358
|
+
| **[dsh-tender-matrix](https://github.com/PerryLink/dsh-tender-matrix)** | |
|
|
359
|
+
| **[dsh-test-drive](https://github.com/PerryLink/dsh-test-drive)** | |
|
|
360
|
+
| **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** | |
|
|
361
|
+
| **[dsh-translate](https://github.com/PerryLink/dsh-translate)** | |
|
|
362
|
+
| **[dsh-warranty-calc](https://github.com/PerryLink/dsh-warranty-calc)** | |
|
|
363
|
+
| **[dsh-budget](https://github.com/PerryLink/dsh-budget)** | 🧊 CONGELADO — ver el README del repositorio |
|
|
364
|
+
| **[dsh-claude-move](https://github.com/PerryLink/dsh-claude-move)** | 🧊 CONGELADO — ver el README del repositorio |
|
|
365
|
+
| **[dsh-defend](https://github.com/PerryLink/dsh-defend)** | 🧊 CONGELADO — ver el README del repositorio |
|
|
366
|
+
| **[dsh-draw](https://github.com/PerryLink/dsh-draw)** | 🧊 CONGELADO — ver el README del repositorio |
|
|
367
|
+
| **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | 🧊 CONGELADO — ver el README del repositorio |
|
|
368
|
+
| **[dsh-background-agents](https://github.com/PerryLink/dsh-background-agents)** | 🚫 RETIRADO — ver el README del repositorio |
|
|
369
|
+
| **[dsh-session-pin](https://github.com/PerryLink/dsh-session-pin)** | 🚫 RETIRADO — ver el README del repositorio |
|
|
370
|
+
| **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | 🚫 RETIRADO — ver el README del repositorio |
|
|
371
|
+
|
|
372
|
+
</details>
|
|
259
373
|
|
|
260
374
|
## License
|
|
261
375
|
|