dsh-permission-rules 0.6.12 → 0.6.15
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/CHANGELOG.md +36 -0
- package/README.es.md +10 -4
- package/README.hi.md +10 -4
- package/README.md +10 -4
- package/README.pt.md +10 -4
- package/README.zh.md +10 -4
- package/lib/index.js +19 -8
- package/lib/types/events.d.ts +12 -8
- package/lib/types/events.d.ts.map +1 -1
- package/lib/types/runtime.d.ts +18 -7
- package/lib/types/runtime.d.ts.map +1 -1
- package/package.json +30 -32
- package/scripts/repair-session-logs.mjs +46 -24
- package/src/events.ts +12 -8
- package/src/runtime.ts +19 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
## v0.6.15 - 2026-09-09
|
|
2
|
+
|
|
3
|
+
### Changed
|
|
4
|
+
|
|
5
|
+
- Vendor integration tarball updated to `dsh-auto-review` 0.12.1 (`vendor/dsh-auto-review-0.12.1.tgz`, packed from the sibling repo's `0.12.1` release source; the packed `files` are identical to tag `v0.12.1`), with the devDependency `file:` specifier and `pnpm-lock.yaml` refreshed. The sibling's runtime `@deepseek-ai/dsh-*` pins now follow the `0.1.5-alpha.1` host line, matching this repo's dev peers. The five historical vendor tarballs (`0.9.0`–`0.11.0`) stay in the tree.
|
|
6
|
+
|
|
7
|
+
### Tests
|
|
8
|
+
|
|
9
|
+
- `test/integration.spec.ts` (3 tests) re-run unchanged against the 0.12.1 tarball: the `ask` rule → official approval seam → scripted `autoReview/verdict` → `approval/decided` audit chain stays green, so no source adaptation was needed. The full gate chain (`typecheck`, `test` 23 files / 280 tests, `build`, `verify:self-contained`) passes with the new vendor artifact installed.
|
|
10
|
+
|
|
11
|
+
## v0.6.14 - 2026-09-09
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- `isUnmarkedHostVersion` now classifies the `0.1.5-alpha` line as non-stamping. On the published `0.1.5-alpha.1` package the envelope keeps its `ignorable` field for stored-log reads only: `Session.append` accepts the third argument and silently drops it, so the first `permissionRules/decision` row landed UNMARKED and the session was then refused by `validateStoredEvents` on the same host. The gate now covers every alpha build in minor 2 and later (`0.1.2-alpha` through `0.1.5-alpha`, `^0\.1\.(?:[2-9]|[1-9]\d)-alpha[.-]\d+$`); over-refusal stays harmless because `allowUnmarkedAudit: true` opts back in and `strip` remains available.
|
|
16
|
+
- `scripts/repair-session-logs.mjs` discovers every generation-addressed log by the canonical `session[.vN].jsonl[.zstd]` form, so the `0.1.5-alpha` line's `session.v3.jsonl` is no longer invisible to the tool; its embedded `KNOWN_SESSION_EVENT_TYPES` copy gains the `0.1.5-alpha.1` catalog additions (`system/message`, `feedback/message-put`, `feedback/message-delete`, `tool/ptc-dispatch`, `tool/ptc-dispatch-start`) while keeping the v1/v2-only spellings, so native v3 logs stop reporting `system/message` as foreign.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Regression coverage: `test/audit-support.spec.ts` runs the gate against the real installed `0.1.5-alpha.1` peer (no `peerVersion` mock) and asserts that no audit row is written and the one-time warning fires; `test/repair-session-logs.spec.ts` drives the shipped script on `%TEMP%` fixtures across every log generation (discovery, vocabulary, frame-preserving repair with backups, `strip`).
|
|
21
|
+
|
|
22
|
+
### Docs
|
|
23
|
+
|
|
24
|
+
- Five-language READMEs and AGENTS.md: the `0.1.5-alpha` line is documented as non-stamping and pre-checked before the first append, and the session-log repair section documents `strip` plus the per-generation matrix — native v3 logs only need `repair`, v2 logs must be `strip`ped before a `0.1.5-alpha` host migrates them (its v2→v3 gate refuses every unclassified event even when marked), and v1 logs before a 0.1.3-or-later host opens them.
|
|
25
|
+
|
|
1
26
|
## v0.6.12 - 2026-09-07
|
|
2
27
|
|
|
3
28
|
### Docs
|
|
@@ -312,3 +337,14 @@ All notable changes to dsh-permission-rules are recorded here, newest first.
|
|
|
312
337
|
- Per-workspace rule discovery (`<cwd>/.dsh/rules.yaml`), `fallbackPath`, Chokidar HMR with debounce, `/rules` session command.
|
|
313
338
|
- Fail-loud loading: invalid YAML, unknown fields/actions, bad globs/regexes, and rule counts over `maxRules` fail the load.
|
|
314
339
|
|
|
340
|
+
## [0.6.13] - 2026-09-09
|
|
341
|
+
|
|
342
|
+
### Changed
|
|
343
|
+
|
|
344
|
+
- Align the `@deepseek-ai/dsh-*` peer ranges to `>=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0` and pin the dev/test dependencies to the published `0.1.5-alpha.1` line: adaptation to DeepSeek Harness `dsh-v0.1.5-alpha.1` (session format V3, `ctx.agent` removal, `Inbox` type-only interface); runtime behavior is unchanged for every supported host line.
|
|
345
|
+
- Record `0.1.5-alpha.1` in `dshWorkshop.compatibility.dshVersions`.
|
|
346
|
+
|
|
347
|
+
### Docs
|
|
348
|
+
|
|
349
|
+
- Refresh the five-language README compatibility baseline to `dsh-v0.1.5-alpha.1` (verified 2026-09-09).
|
|
350
|
+
|
package/README.es.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
[](LICENSE)
|
|
11
11
|
[](https://github.com/topics/dsh-plugin)
|
|
12
|
+
[](https://github.com/PerryLink/dsh-plugin-doctor#verified-徽章)
|
|
12
13
|
[](#)
|
|
13
14
|
[](https://github.com/PerryLink/dsh-permission-rules/actions)
|
|
14
15
|
[](https://github.com/PerryLink/dsh-permission-rules/releases)
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
|
|
26
27
|
| Surface | Status |
|
|
27
28
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
29
|
+
| Harness | DeepSeek Harness `dsh-v0.1.5-alpha.1` (adaptado el 2026-09-09, cadena completa de gates + smoke de instalación de profile): su `Session.append` todavía no puede estampar el marcador `ignorable` —verificado en el paquete publicado `0.1.5-alpha.1`, donde el tercer argumento se descarta silenciosamente y el campo del sobre solo sobrevive para la lectura de logs almacenados—, así que toda la línea `0.1.5-alpha` se preverifica como no marcada y la auditoría del registro de sesión queda desactivada por defecto. La línea `0.1.3-alpha` mantiene la misma firma de append surface-only. Las migraciones de log de ambas líneas rechazan eventos de plugin sin clasificar incluso marcados: aplica `strip` a las filas de auditoría v1 antes de que un host `0.1.3-alpha` abra el log y a las v2 antes de que un host `0.1.5-alpha` lo migre (los logs v3 nativos solo necesitan `repair`). |
|
|
29
30
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
31
|
| Platforms | Todas (host + cliente web de settings) |
|
|
31
32
|
| Model | Cualquiera (las razones deny/ask se muestran a través de los resultados de herramienta) |
|
|
@@ -169,7 +170,7 @@ Todos los parámetros son campos Schemastery `Config` (modificables desde cordis
|
|
|
169
170
|
|
|
170
171
|
## Known limitations
|
|
171
172
|
|
|
172
|
-
- **Marcador de auditoría en hosts previos al marcador o que rechazan eventos.** `permissionRules/decision` se anexa con `ignorable: true`; los hosts cuyo `Session.append` es anterior al marcador (las líneas `0.1.0-rc.1`–`rc.7` y `0.1.1-rc.1`–`rc.7`) lo descartan silenciosamente, la línea `0.1.2-rc` trae la superficie alpha.5 (ninguna opción de append escribe el marcador), la línea `0.1.2-alpha` rechaza eventos de plugin al leerlos incluso marcados, y
|
|
173
|
+
- **Marcador de auditoría en hosts previos al marcador o que rechazan eventos.** `permissionRules/decision` se anexa con `ignorable: true`; los hosts cuyo `Session.append` es anterior al marcador (las líneas `0.1.0-rc.1`–`rc.7` y `0.1.1-rc.1`–`rc.7`) lo descartan silenciosamente, la línea `0.1.2-rc` trae la superficie alpha.5 (ninguna opción de append escribe el marcador), la línea `0.1.2-alpha` rechaza eventos de plugin al leerlos incluso marcados, y las líneas `0.1.3-alpha` y `0.1.5-alpha` mantienen la misma firma de append surface-only (verificado en los paquetes publicados `0.1.3-alpha.1`/`0.1.5-alpha.1`) — el runtime preverifica todas ellas antes del primer append y desactiva la auditoría de registro con una advertencia única. La migración entre generaciones también rechaza filas de auditoría marcadas: la puerta v1→v2 de `0.1.3-alpha` rechaza eventos v1 desconocidos, y la puerta v2→v3 de `0.1.5-alpha` rechaza todo evento sin clasificar (su inventario está congelado al vocabulario v2 publicado), así que aplica `strip` a las filas v1 antes de que un host 0.1.3 abra el log y a las v2 antes de actualizar a un host 0.1.5. Los logs v3 nativos aceptan filas de plugin marcadas, así que solo necesitan `repair`. Pon `allowUnmarkedAudit: true` para reactivar; repara registros ya escritos con `scripts/repair-session-logs.mjs` (su modo `strip` elimina filas de auditoría donde el marcador no ayuda).
|
|
173
174
|
- **Los candidatos de ruta son heurísticos.** Solo las claves de argumento documentadas alimentan el emparejamiento de rutas, y el emparejamiento relativo al workspace es insensible a mayúsculas ASCII solo con `caseInsensitivePaths` activado.
|
|
174
175
|
- **Los globs son un subconjunto conservador.** Sin expansión de llaves — escribe dos patrones, o usa modo regex.
|
|
175
176
|
- **La guardia de backtracking de regex es estructural, no exhaustiva.** Prefiere el modo glob para archivos no confiables.
|
|
@@ -187,9 +188,14 @@ Los registros de sesión escritos antes de que existiera el marcador `ignorable`
|
|
|
187
188
|
```sh
|
|
188
189
|
node scripts/repair-session-logs.mjs scan [--home DIR] # reporta filas ajenas, no cambia nada
|
|
189
190
|
node scripts/repair-session-logs.mjs repair [--home DIR] [--dry-run]
|
|
191
|
+
node scripts/repair-session-logs.mjs strip [--home DIR] [--dry-run]
|
|
190
192
|
```
|
|
191
193
|
|
|
192
|
-
`--home` por defecto es `$DSH_HOME/sessions` (o `~/.dsh/sessions`).
|
|
194
|
+
`--home` por defecto es `$DSH_HOME/sessions` (o `~/.dsh/sessions`). Descubre cada log por su nombre canónico de generación —`session.jsonl`, `session.v2.jsonl`, `session.v3.jsonl`, cada uno opcionalmente comprimido en `.zstd`—, así que elige el modo según la generación:
|
|
195
|
+
|
|
196
|
+
- **v3 (`session.v3.jsonl`, escrito nativamente por la línea `0.1.5-alpha`)** — la ruta de lectura acepta filas de plugin marcadas, así que basta `repair`.
|
|
197
|
+
- **v2 (`session.v2.jsonl`, escrito por la línea `0.1.3-alpha`)** — `repair` lo abre en el host que lo escribió, pero la migración v2→v3 de `0.1.5-alpha` rechaza todo evento sin clasificar incluso marcado: ejecuta `strip` sobre los logs v2 **antes** de actualizar a un host `0.1.5-alpha`.
|
|
198
|
+
- **v1 (`session.jsonl`)** — la migración v1→v2 de `0.1.3-alpha` rechaza eventos v1 desconocidos incluso marcados: ejecuta `strip` antes de que un host 0.1.3 o posterior abra el log por primera vez.
|
|
193
199
|
|
|
194
200
|
## Development
|
|
195
201
|
|
|
@@ -197,7 +203,7 @@ node scripts/repair-session-logs.mjs repair [--home DIR] [--dry-run]
|
|
|
197
203
|
pnpm install # node ^22.19 || >=24
|
|
198
204
|
pnpm run typecheck # tsc, src + tests
|
|
199
205
|
pnpm run lint # eslint, src + tests + scripts
|
|
200
|
-
pnpm test # vitest:
|
|
206
|
+
pnpm test # vitest: 280 tests, 23 files
|
|
201
207
|
pnpm run test:coverage # coverage gate (90/80/90/90)
|
|
202
208
|
pnpm run build # tsc declarations + tsdown bundles (lib/)
|
|
203
209
|
pnpm run pack:check # build + pack (the published artifact)
|
package/README.hi.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
[](LICENSE)
|
|
11
11
|
[](https://github.com/topics/dsh-plugin)
|
|
12
|
+
[](https://github.com/PerryLink/dsh-plugin-doctor#verified-徽章)
|
|
12
13
|
[](#)
|
|
13
14
|
[](https://github.com/PerryLink/dsh-permission-rules/actions)
|
|
14
15
|
[](https://github.com/PerryLink/dsh-permission-rules/releases)
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
|
|
26
27
|
| Surface | Status |
|
|
27
28
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
29
|
+
| Harness | DeepSeek Harness `dsh-v0.1.5-alpha.1` (2026-09-09 को अनुकूलित, पूर्ण gates शृंखला + profile इंस्टॉल smoke): इसका `Session.append` अभी भी `ignorable` मार्कर स्टैम्प नहीं कर सकता — प्रकाशित `0.1.5-alpha.1` पैकेज पर सत्यापित, जहाँ तीसरा आर्ग्युमेंट चुपचाप छोड़ दिया जाता है और लिफ़ाफ़ा फ़ील्ड केवल संग्रहीत-लॉग पठन के लिए बचता है — इसलिए पूरी `0.1.5-alpha` पंक्ति पहले append से पहले ही अनमार्क्ड के रूप में पूर्व-जाँची जाती है और सत्र-लॉग ऑडिट डिफ़ॉल्ट रूप से बंद रहता है। `0.1.3-alpha` पंक्ति वही surface-only append हस्ताक्षर रखती है। दोनों पंक्तियों का लॉग प्रवासन चिह्नित अन-क्लासिफ़ाइड प्लगइन घटनाओं को भी अस्वीकारता है: `0.1.3-alpha` host के लॉग खोलने से पहले v1 ऑडिट पंक्तियाँ और `0.1.5-alpha` host के प्रवासन से पहले v2 पंक्तियाँ `strip` करें (v3 मूल लॉग के लिए केवल `repair` चाहिए)। |
|
|
29
30
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
31
|
| Platforms | सभी (host + वेब settings क्लाइंट) |
|
|
31
32
|
| Model | कोई भी (deny/ask कारण टूल परिणामों के माध्यम से दिखते हैं) |
|
|
@@ -169,7 +170,7 @@ dsh --profile web --dump-config | grep -A4 'id: permission-rules'
|
|
|
169
170
|
|
|
170
171
|
## Known limitations
|
|
171
172
|
|
|
172
|
-
- **पूर्व-मार्कर hosts और घटना-अस्वीकार hosts पर ऑडिट मार्कर।** `permissionRules/decision` `ignorable: true` से जोड़ा जाता है; जिन hosts का `Session.append` मार्कर से पहले का है (`0.1.0-rc.1`–`rc.7` और `0.1.1-rc.1`–`rc.7` पंक्तियाँ) वे इसे चुपचाप छोड़ देते हैं, `0.1.2-rc` पंक्ति alpha.5 सतह लाती है (append का कोई विकल्प मार्कर नहीं लिखता), `0.1.2-alpha` पंक्ति पढ़ने पर चिह्नित प्लगइन घटनाओं को भी अस्वीकारती है, और `0.1.3-alpha`
|
|
173
|
+
- **पूर्व-मार्कर hosts और घटना-अस्वीकार hosts पर ऑडिट मार्कर।** `permissionRules/decision` `ignorable: true` से जोड़ा जाता है; जिन hosts का `Session.append` मार्कर से पहले का है (`0.1.0-rc.1`–`rc.7` और `0.1.1-rc.1`–`rc.7` पंक्तियाँ) वे इसे चुपचाप छोड़ देते हैं, `0.1.2-rc` पंक्ति alpha.5 सतह लाती है (append का कोई विकल्प मार्कर नहीं लिखता), `0.1.2-alpha` पंक्ति पढ़ने पर चिह्नित प्लगइन घटनाओं को भी अस्वीकारती है, और `0.1.3-alpha` तथा `0.1.5-alpha` पंक्तियाँ वही surface-only append हस्ताक्षर रखती हैं (प्रकाशित `0.1.3-alpha.1`/`0.1.5-alpha.1` पैकेजों पर सत्यापित) — runtime पहले append से पहले इन सबकी पूर्व-जाँच कर एक बार की चेतावनी से सत्र-लॉग ऑडिट अक्षम कर देता है। पीढ़ी-पार प्रवासन चिह्नित ऑडिट पंक्तियों को भी अस्वीकारता है: `0.1.3-alpha` का v1→v2 द्वार अज्ञात v1 घटनाओं को अस्वीकारता है, और `0.1.5-alpha` का v2→v3 द्वार हर अन-क्लासिफ़ाइड घटना को (उसकी सूची प्रकाशित v2 शब्दावली पर स्थिर है), इसलिए 0.1.3 host के लॉग खोलने से पहले v1 पंक्तियाँ और 0.1.5 host पर अपग्रेड से पहले v2 पंक्तियाँ `strip` करें। v3 मूल लॉग चिह्नित प्लगइन पंक्तियाँ स्वीकारते हैं, इसलिए उन्हें केवल `repair` चाहिए। पुनः सक्षम के लिए `allowUnmarkedAudit: true`; पहले से लिखे लॉग `scripts/repair-session-logs.mjs` से मरम्मत करें (जहाँ मार्कर मदद नहीं करता वहाँ इसका `strip` मोड ऑडिट पंक्तियाँ हटाता है)।
|
|
173
174
|
- **पथ उम्मीदवार अनुमानी हैं।** केवल दस्तावेज़ित तर्क कुंजियाँ पथ मिलान को खिलाती हैं, और कार्यक्षेत्र-सापेक्ष मिलान केवल `caseInsensitivePaths` चालू होने पर ASCII-केस-असंवेदी है।
|
|
174
175
|
- **globs एक रूढ़िवादी उपसमुच्चय हैं।** कोई ब्रेस विस्तार नहीं — दो पैटर्न लिखें, या regex मोड उपयोग करें।
|
|
175
176
|
- **regex बैकट्रैकिंग गार्ड संरचनात्मक है, संपूर्ण नहीं।** अविश्वसनीय फ़ाइलों के लिए glob मोड पसंद करें।
|
|
@@ -187,9 +188,14 @@ dsh --profile web --dump-config | grep -A4 'id: permission-rules'
|
|
|
187
188
|
```sh
|
|
188
189
|
node scripts/repair-session-logs.mjs scan [--home DIR] # विदेशी पंक्तियों की रिपोर्ट, कुछ नहीं बदलता
|
|
189
190
|
node scripts/repair-session-logs.mjs repair [--home DIR] [--dry-run]
|
|
191
|
+
node scripts/repair-session-logs.mjs strip [--home DIR] [--dry-run]
|
|
190
192
|
```
|
|
191
193
|
|
|
192
|
-
`--home` डिफ़ॉल्ट रूप से `$DSH_HOME/sessions` (या `~/.dsh/sessions`)।
|
|
194
|
+
`--home` डिफ़ॉल्ट रूप से `$DSH_HOME/sessions` (या `~/.dsh/sessions`)। यह हर पीढ़ी के लॉग को उसके विहित नाम से खोजता है — `session.jsonl`, `session.v2.jsonl`, `session.v3.jsonl`, प्रत्येक वैकल्पिक रूप से `.zstd`-संपीड़ित — इसलिए पीढ़ी के अनुसार मोड चुनें:
|
|
195
|
+
|
|
196
|
+
- **v3 (`session.v3.jsonl`, `0.1.5-alpha` पंक्ति द्वारा मूल रूप से लिखा)** — पठन पथ चिह्नित प्लगइन पंक्तियाँ स्वीकारता है, इसलिए `repair` पर्याप्त है।
|
|
197
|
+
- **v2 (`session.v2.jsonl`, `0.1.3-alpha` पंक्ति द्वारा लिखा)** — `repair` इसे लिखने वाले host पर खोल देता है, पर `0.1.5-alpha` का v2→v3 प्रवासन चिह्नित अन-क्लासिफ़ाइड घटनाओं को भी अस्वीकारता है: `0.1.5-alpha` host पर अपग्रेड करने से **पहले** v2 लॉग पर `strip` चलाएँ।
|
|
198
|
+
- **v1 (`session.jsonl`)** — `0.1.3-alpha` का v1→v2 प्रवासन चिह्नित अज्ञात v1 घटनाओं को भी अस्वीकारता है: 0.1.3 या बाद के host द्वारा लॉग पहली बार खोलने से पहले `strip` चलाएँ।
|
|
193
199
|
|
|
194
200
|
## Development
|
|
195
201
|
|
|
@@ -197,7 +203,7 @@ node scripts/repair-session-logs.mjs repair [--home DIR] [--dry-run]
|
|
|
197
203
|
pnpm install # node ^22.19 || >=24
|
|
198
204
|
pnpm run typecheck # tsc, src + tests
|
|
199
205
|
pnpm run lint # eslint, src + tests + scripts
|
|
200
|
-
pnpm test # vitest:
|
|
206
|
+
pnpm test # vitest: 280 tests, 23 files
|
|
201
207
|
pnpm run test:coverage # coverage gate (90/80/90/90)
|
|
202
208
|
pnpm run build # tsc declarations + tsdown bundles (lib/)
|
|
203
209
|
pnpm run pack:check # build + pack (the published artifact)
|
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
[](LICENSE)
|
|
12
12
|
[](https://github.com/topics/dsh-plugin)
|
|
13
|
+
[](https://github.com/PerryLink/dsh-plugin-doctor#verified-徽章)
|
|
13
14
|
[](#)
|
|
14
15
|
[](https://github.com/PerryLink/dsh-permission-rules/actions)
|
|
15
16
|
[](https://github.com/PerryLink/dsh-permission-rules/releases)
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
|
|
27
28
|
| Surface | Status |
|
|
28
29
|
|---|---|
|
|
29
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
30
|
+
| Harness | DeepSeek Harness `dsh-v0.1.5-alpha.1` (adapted 2026-09-09, full gate chain + profile install smoke): its `Session.append` still cannot stamp the `ignorable` marker — verified on the published `0.1.5-alpha.1` package, where the third argument is silently dropped and the envelope field survives for stored-log reads only — so the whole `0.1.5-alpha` line is pre-checked as unmarked and session-log audit stays disabled by default. The `0.1.3-alpha` line keeps the same surface-only append signature. Both lines' log migrations refuse unclassified plugin events even when marked, so `strip` v1 audit rows before a `0.1.3-alpha` host opens the log and v2 audit rows before a `0.1.5-alpha` host migrates it (native v3 logs only need `repair`). |
|
|
30
31
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
31
32
|
| Platforms | All (host + web settings client) |
|
|
32
33
|
| Model | Any (deny/ask reasons surface through tool results) |
|
|
@@ -170,7 +171,7 @@ All tunables are Schemastery `Config` fields (changeable from cordis.yml). An id
|
|
|
170
171
|
|
|
171
172
|
## Known limitations
|
|
172
173
|
|
|
173
|
-
- **Audit marker on pre-marker and refusing hosts.** `permissionRules/decision` is appended with `ignorable: true`; hosts whose `Session.append` predates the marker (the `0.1.0-rc.1`–`rc.7` and `0.1.1-rc.1`–`rc.7` lines) silently drop it, the `0.1.2-rc` line ships the alpha.5 surface (no append option writes the marker), the `0.1.2-alpha` line refuses plugin events on read even when marked, and the `0.1.3-alpha`
|
|
174
|
+
- **Audit marker on pre-marker and refusing hosts.** `permissionRules/decision` is appended with `ignorable: true`; hosts whose `Session.append` predates the marker (the `0.1.0-rc.1`–`rc.7` and `0.1.1-rc.1`–`rc.7` lines) silently drop it, the `0.1.2-rc` line ships the alpha.5 surface (no append option writes the marker), the `0.1.2-alpha` line refuses plugin events on read even when marked, and the `0.1.3-alpha` and `0.1.5-alpha` lines keep the same surface-only append signature (verified on the published `0.1.3-alpha.1`/`0.1.5-alpha.1` packages) — the runtime pre-checks all of these before the first append and disables session-log audit with a one-time warning. Cross-generation migration refuses marked audit rows too: the `0.1.3-alpha` v1→v2 gate refuses unknown v1 events, and the `0.1.5-alpha` v2→v3 gate refuses every unclassified event (its inventory is frozen to the released v2 vocabulary), so `strip` v1 rows before a 0.1.3 host opens the log and v2 rows before upgrading to a 0.1.5 host. Native v3 logs accept marked plugin rows, so they only need `repair`. Set `allowUnmarkedAudit: true` to opt back in; repair already-written logs with `scripts/repair-session-logs.mjs` (its `strip` mode removes audit rows where the marker cannot help).
|
|
174
175
|
- **Path candidates are heuristic.** Only the documented argument keys feed path matching, and workspace-relative matching is ASCII-case-insensitive only when `caseInsensitivePaths` is on.
|
|
175
176
|
- **Globs are a conservative subset.** No brace expansion — write two patterns, or use regex mode.
|
|
176
177
|
- **The regex backtracking guard is structural, not exhaustive.** Prefer glob mode for untrusted files.
|
|
@@ -188,9 +189,14 @@ Session logs written before the `ignorable` marker existed can be refused by new
|
|
|
188
189
|
```sh
|
|
189
190
|
node scripts/repair-session-logs.mjs scan [--home DIR] # report foreign rows, change nothing
|
|
190
191
|
node scripts/repair-session-logs.mjs repair [--home DIR] [--dry-run]
|
|
192
|
+
node scripts/repair-session-logs.mjs strip [--home DIR] [--dry-run]
|
|
191
193
|
```
|
|
192
194
|
|
|
193
|
-
`--home` defaults to `$DSH_HOME/sessions` (or `~/.dsh/sessions`).
|
|
195
|
+
`--home` defaults to `$DSH_HOME/sessions` (or `~/.dsh/sessions`). Every generation-addressed log is discovered by its canonical basename — `session.jsonl`, `session.v2.jsonl`, `session.v3.jsonl`, each optionally `.zstd`-compressed — so pick the mode by generation:
|
|
196
|
+
|
|
197
|
+
- **v3 (`session.v3.jsonl`, written natively by the `0.1.5-alpha` line)** — the read path accepts marked plugin rows, so `repair` is enough.
|
|
198
|
+
- **v2 (`session.v2.jsonl`, written by the `0.1.3-alpha` line)** — `repair` opens it on the host that wrote it, but the `0.1.5-alpha` v2→v3 migration refuses every unclassified event even when marked: run `strip` on v2 logs **before** upgrading to a `0.1.5-alpha` host.
|
|
199
|
+
- **v1 (`session.jsonl`)** — the `0.1.3-alpha` v1→v2 migration refuses unknown v1 events even when marked: run `strip` before a 0.1.3-or-later host first opens the log.
|
|
194
200
|
|
|
195
201
|
## Development
|
|
196
202
|
|
|
@@ -198,7 +204,7 @@ node scripts/repair-session-logs.mjs repair [--home DIR] [--dry-run]
|
|
|
198
204
|
pnpm install # node ^22.19 || >=24
|
|
199
205
|
pnpm run typecheck # tsc, src + tests
|
|
200
206
|
pnpm run lint # eslint, src + tests + scripts
|
|
201
|
-
pnpm test # vitest:
|
|
207
|
+
pnpm test # vitest: 280 tests, 23 files
|
|
202
208
|
pnpm run test:coverage # coverage gate (90/80/90/90)
|
|
203
209
|
pnpm run build # tsc declarations + tsdown bundles (lib/)
|
|
204
210
|
pnpm run pack:check # build + pack (the published artifact)
|
package/README.pt.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
[](LICENSE)
|
|
11
11
|
[](https://github.com/topics/dsh-plugin)
|
|
12
|
+
[](https://github.com/PerryLink/dsh-plugin-doctor#verified-徽章)
|
|
12
13
|
[](#)
|
|
13
14
|
[](https://github.com/PerryLink/dsh-permission-rules/actions)
|
|
14
15
|
[](https://github.com/PerryLink/dsh-permission-rules/releases)
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
|
|
26
27
|
| Surface | Status |
|
|
27
28
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
29
|
+
| Harness | DeepSeek Harness `dsh-v0.1.5-alpha.1` (adaptado em 2026-09-09, cadeia completa de gates + smoke de instalação de profile): o `Session.append` ainda não consegue estampar o marcador `ignorable` — verificado no pacote publicado `0.1.5-alpha.1`, onde o terceiro argumento é descartado silenciosamente e o campo do envelope só sobrevive para a leitura de logs armazenados —, então toda a linha `0.1.5-alpha` é pré-verificada como não marcada e a auditoria do log de sessão fica desativada por padrão. A linha `0.1.3-alpha` mantém a mesma assinatura de append surface-only. As migrações de log de ambas as linhas recusam eventos de plugin não classificados mesmo marcados: aplique `strip` nas linhas de auditoria v1 antes de um host `0.1.3-alpha` abrir o log e nas v2 antes de um host `0.1.5-alpha` migrá-lo (logs v3 nativos só precisam de `repair`). |
|
|
29
30
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
31
|
| Platforms | Todas (host + cliente web de settings) |
|
|
31
32
|
| Model | Qualquer (razões deny/ask aparecem pelos resultados de ferramenta) |
|
|
@@ -169,7 +170,7 @@ Todos os parâmetros são campos Schemastery `Config` (alteráveis pelo cordis.y
|
|
|
169
170
|
|
|
170
171
|
## Known limitations
|
|
171
172
|
|
|
172
|
-
- **Marcador de auditoria em hosts anteriores ao marcador ou que rejeitam eventos.** `permissionRules/decision` é anexado com `ignorable: true`; hosts cujo `Session.append` é anterior ao marcador (as linhas `0.1.0-rc.1`–`rc.7` e `0.1.1-rc.1`–`rc.7`) o descartam silenciosamente, a linha `0.1.2-rc` traz a superfície alpha.5 (nenhuma opção de append escreve o marcador), a linha `0.1.2-alpha` rejeita eventos de plugin na leitura mesmo marcados, e
|
|
173
|
+
- **Marcador de auditoria em hosts anteriores ao marcador ou que rejeitam eventos.** `permissionRules/decision` é anexado com `ignorable: true`; hosts cujo `Session.append` é anterior ao marcador (as linhas `0.1.0-rc.1`–`rc.7` e `0.1.1-rc.1`–`rc.7`) o descartam silenciosamente, a linha `0.1.2-rc` traz a superfície alpha.5 (nenhuma opção de append escreve o marcador), a linha `0.1.2-alpha` rejeita eventos de plugin na leitura mesmo marcados, e as linhas `0.1.3-alpha` e `0.1.5-alpha` mantêm a mesma assinatura de append surface-only (verificado nos pacotes publicados `0.1.3-alpha.1`/`0.1.5-alpha.1`) — o runtime pré-verifica todas elas antes do primeiro append e desativa a auditoria de log com um aviso único. A migração entre gerações também rejeita linhas de auditoria marcadas: a porta v1→v2 da `0.1.3-alpha` rejeita eventos v1 desconhecidos, e a porta v2→v3 da `0.1.5-alpha` rejeita todo evento não classificado (seu inventário é congelado ao vocabulário v2 publicado), então aplique `strip` nas linhas v1 antes de um host 0.1.3 abrir o log e nas v2 antes de atualizar para um host 0.1.5. Logs v3 nativos aceitam linhas de plugin marcadas, então só precisam de `repair`. Defina `allowUnmarkedAudit: true` para reativar; repare logs já escritos com `scripts/repair-session-logs.mjs` (seu modo `strip` remove linhas de auditoria onde o marcador não ajuda).
|
|
173
174
|
- **Candidatos de caminho são heurísticos.** Somente as chaves de argumento documentadas alimentam a correspondência de caminho, e a correspondência relativa ao workspace é insensível a maiúsculas ASCII apenas com `caseInsensitivePaths` ativado.
|
|
174
175
|
- **Globs são um subconjunto conservador.** Sem expansão de chaves — escreva dois padrões, ou use o modo regex.
|
|
175
176
|
- **A guarda de backtracking de regex é estrutural, não exaustiva.** Prefira o modo glob para arquivos não confiáveis.
|
|
@@ -187,9 +188,14 @@ Logs de sessão escritos antes de o marcador `ignorable` existir podem ser recus
|
|
|
187
188
|
```sh
|
|
188
189
|
node scripts/repair-session-logs.mjs scan [--home DIR] # relata linhas estranhas, não muda nada
|
|
189
190
|
node scripts/repair-session-logs.mjs repair [--home DIR] [--dry-run]
|
|
191
|
+
node scripts/repair-session-logs.mjs strip [--home DIR] [--dry-run]
|
|
190
192
|
```
|
|
191
193
|
|
|
192
|
-
`--home` por padrão é `$DSH_HOME/sessions` (ou `~/.dsh/sessions`).
|
|
194
|
+
`--home` por padrão é `$DSH_HOME/sessions` (ou `~/.dsh/sessions`). Ele descobre cada log pelo nome canônico da geração — `session.jsonl`, `session.v2.jsonl`, `session.v3.jsonl`, cada um opcionalmente comprimido em `.zstd` — então escolha o modo pela geração:
|
|
195
|
+
|
|
196
|
+
- **v3 (`session.v3.jsonl`, escrito nativamente pela linha `0.1.5-alpha`)** — o caminho de leitura aceita linhas de plugin marcadas, então `repair` basta.
|
|
197
|
+
- **v2 (`session.v2.jsonl`, escrito pela linha `0.1.3-alpha`)** — `repair` o abre no host que o escreveu, mas a migração v2→v3 da `0.1.5-alpha` rejeita todo evento não classificado mesmo marcado: execute `strip` nos logs v2 **antes** de atualizar para um host `0.1.5-alpha`.
|
|
198
|
+
- **v1 (`session.jsonl`)** — a migração v1→v2 da `0.1.3-alpha` rejeita eventos v1 desconhecidos mesmo marcados: execute `strip` antes de um host 0.1.3 ou posterior abrir o log pela primeira vez.
|
|
193
199
|
|
|
194
200
|
## Development
|
|
195
201
|
|
|
@@ -197,7 +203,7 @@ node scripts/repair-session-logs.mjs repair [--home DIR] [--dry-run]
|
|
|
197
203
|
pnpm install # node ^22.19 || >=24
|
|
198
204
|
pnpm run typecheck # tsc, src + tests
|
|
199
205
|
pnpm run lint # eslint, src + tests + scripts
|
|
200
|
-
pnpm test # vitest:
|
|
206
|
+
pnpm test # vitest: 280 tests, 23 files
|
|
201
207
|
pnpm run test:coverage # coverage gate (90/80/90/90)
|
|
202
208
|
pnpm run build # tsc declarations + tsdown bundles (lib/)
|
|
203
209
|
pnpm run pack:check # build + pack (the published artifact)
|
package/README.zh.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
[](LICENSE)
|
|
11
11
|
[](https://github.com/topics/dsh-plugin)
|
|
12
|
+
[](https://github.com/PerryLink/dsh-plugin-doctor#verified-徽章)
|
|
12
13
|
[](#)
|
|
13
14
|
[](https://github.com/PerryLink/dsh-permission-rules/actions)
|
|
14
15
|
[](https://github.com/PerryLink/dsh-permission-rules/releases)
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
|
|
26
27
|
| Surface | Status |
|
|
27
28
|
|---|---|
|
|
28
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
29
|
+
| Harness | DeepSeek Harness `dsh-v0.1.5-alpha.1`(2026-09-09 已适配,完整门禁链 + profile 安装冒烟):其 `Session.append` 仍无法盖章 `ignorable` 标记——已在已发布的 `0.1.5-alpha.1` 包上实测,第三参数被静默丢弃,信封字段仅用于存量日志读取——故整条 `0.1.5-alpha` 线在首次追加前即被预检为未盖章,会话日志审计默认停用。`0.1.3-alpha` 线同样沿用 surface-only 追加签名。两条线的日志迁移连已标记的未分类插件事件也拒绝:在 `0.1.3-alpha` 宿主打开日志前 `strip` 掉 v1 审计行,在 `0.1.5-alpha` 宿主迁移前 `strip` 掉 v2 审计行(v3 原生日志只需 `repair`)。 |
|
|
29
30
|
| Node | `^22.19.0 || >=24.0.0` |
|
|
30
31
|
| Platforms | 全部(host + Web 设置客户端) |
|
|
31
32
|
| Model | 任意(deny/ask 原因经工具结果呈现) |
|
|
@@ -169,7 +170,7 @@ dsh --profile web --dump-config | grep -A4 'id: permission-rules'
|
|
|
169
170
|
|
|
170
171
|
## Known limitations
|
|
171
172
|
|
|
172
|
-
- **前标记宿主与拒绝型宿主上的审计标记。** `permissionRules/decision` 以 `ignorable: true` 追加;`Session.append` 早于该标记的宿主(`0.1.0-rc.1`–`rc.7` 与 `0.1.1-rc.1`–`rc.7` 线)静默丢弃它,`0.1.2-rc` 线沿用 alpha.5 表面(append 无任何选项能写该标记),`0.1.2-alpha` 线在读取时连已标记的插件事件也拒绝,`0.1.3-alpha` 线同样沿用 surface-only
|
|
173
|
+
- **前标记宿主与拒绝型宿主上的审计标记。** `permissionRules/decision` 以 `ignorable: true` 追加;`Session.append` 早于该标记的宿主(`0.1.0-rc.1`–`rc.7` 与 `0.1.1-rc.1`–`rc.7` 线)静默丢弃它,`0.1.2-rc` 线沿用 alpha.5 表面(append 无任何选项能写该标记),`0.1.2-alpha` 线在读取时连已标记的插件事件也拒绝,`0.1.3-alpha` 与 `0.1.5-alpha` 线同样沿用 surface-only 追加签名(已在已发布的 `0.1.3-alpha.1`/`0.1.5-alpha.1` 包上核验)——运行时在首次追加前即预检这些线并以一次性警告禁用会话日志审计。跨代迁移同样拒绝已标记的审计行:`0.1.3-alpha` 的 v1→v2 门拒绝未知 v1 事件,`0.1.5-alpha` 的 v2→v3 门拒绝一切未分类事件(其清单冻结为已发布 v2 词汇),故在 0.1.3 宿主打开日志前 `strip` v1 行、在升级到 0.1.5 宿主前 `strip` v2 行。v3 原生日志接受已标记的插件行,只需 `repair`。设 `allowUnmarkedAudit: true` 重新启用;用 `scripts/repair-session-logs.mjs` 修复已写日志(标记无济于事的宿主用其 `strip` 模式移除审计行)。
|
|
173
174
|
- **路径候选是启发式的。** 只有文档化的参数键参与路径匹配,且工作区相对匹配仅在 `caseInsensitivePaths` 开启时忽略 ASCII 大小写。
|
|
174
175
|
- **glob 是保守子集。** 无花括号展开——写两个模式,或用正则模式。
|
|
175
176
|
- **正则回溯守卫是结构性的、非穷尽的。** 对不可信文件优先用 glob 模式。
|
|
@@ -187,9 +188,14 @@ dsh --profile web --dump-config | grep -A4 'id: permission-rules'
|
|
|
187
188
|
```sh
|
|
188
189
|
node scripts/repair-session-logs.mjs scan [--home DIR] # 报告外来行,不改任何内容
|
|
189
190
|
node scripts/repair-session-logs.mjs repair [--home DIR] [--dry-run]
|
|
191
|
+
node scripts/repair-session-logs.mjs strip [--home DIR] [--dry-run]
|
|
190
192
|
```
|
|
191
193
|
|
|
192
|
-
`--home` 默认 `$DSH_HOME/sessions`(或 `~/.dsh/sessions
|
|
194
|
+
`--home` 默认 `$DSH_HOME/sessions`(或 `~/.dsh/sessions`)。工具按规范基名发现每一代日志——`session.jsonl`、`session.v2.jsonl`、`session.v3.jsonl`,各自可选 `.zstd` 压缩——请按世代选择模式:
|
|
195
|
+
|
|
196
|
+
- **v3(`session.v3.jsonl`,`0.1.5-alpha` 线原生写出)** —— 读取路径接受已标记的插件行,`repair` 即可。
|
|
197
|
+
- **v2(`session.v2.jsonl`,`0.1.3-alpha` 线写出)** —— `repair` 可让写出它的宿主打开日志,但 `0.1.5-alpha` 的 v2→v3 迁移连已标记的未分类事件也拒绝:请在升级到 `0.1.5-alpha` 宿主**之前**对 v2 日志执行 `strip`。
|
|
198
|
+
- **v1(`session.jsonl`)** —— `0.1.3-alpha` 的 v1→v2 迁移连已标记的未知 v1 事件也拒绝:请在 0.1.3 或更新宿主首次打开日志前执行 `strip`。
|
|
193
199
|
|
|
194
200
|
## Development
|
|
195
201
|
|
|
@@ -197,7 +203,7 @@ node scripts/repair-session-logs.mjs repair [--home DIR] [--dry-run]
|
|
|
197
203
|
pnpm install # node ^22.19 || >=24
|
|
198
204
|
pnpm run typecheck # tsc, src + tests
|
|
199
205
|
pnpm run lint # eslint, src + tests + scripts
|
|
200
|
-
pnpm test # vitest:
|
|
206
|
+
pnpm test # vitest: 280 tests, 23 files
|
|
201
207
|
pnpm run test:coverage # coverage gate (90/80/90/90)
|
|
202
208
|
pnpm run build # tsc declarations + tsdown bundles (lib/)
|
|
203
209
|
pnpm run pack:check # build + pack (the published artifact)
|
package/lib/index.js
CHANGED
|
@@ -2796,10 +2796,12 @@ var PermissionRulesRuntime = class {
|
|
|
2796
2796
|
* decision (passthrough included unless `audit: 'hits'`), requesting the
|
|
2797
2797
|
* envelope's `ignorable: true` marker so any harness build can load the
|
|
2798
2798
|
* log. Hosts whose `Session.append` predates the marker (the rc.6 line)
|
|
2799
|
-
*
|
|
2800
|
-
*
|
|
2801
|
-
*
|
|
2802
|
-
*
|
|
2799
|
+
* or keeps the later surface-only signature (the `0.1.2-rc`, `0.1.3-alpha`
|
|
2800
|
+
* and `0.1.5-alpha` lines) silently drop the options bag, leaving the
|
|
2801
|
+
* event unmarked and sessions unresumable on stricter hosts — the runtime
|
|
2802
|
+
* therefore detects such hosts BEFORE the first append (peer version) and
|
|
2803
|
+
* re-checks after the first append (returned envelope), then degrades:
|
|
2804
|
+
* session-log audit is disabled with a one-time warning unless
|
|
2803
2805
|
* `allowUnmarkedAudit: true` opts back in. The `0.1.2-alpha` line refuses
|
|
2804
2806
|
* plugin event types on read even when marked, so its version gate
|
|
2805
2807
|
* disables audit the same way (see `isUnmarkedHostVersion`). `source`
|
|
@@ -3720,6 +3722,12 @@ async function apply(ctx, config) {
|
|
|
3720
3722
|
* - The `0.1.3-alpha` line keeps that surface-only append signature
|
|
3721
3723
|
* (verified against the `dsh-v0.1.3-alpha.1` tag), so its builds stamp
|
|
3722
3724
|
* the marker no more than rc.1 does and the line is treated as unmarked.
|
|
3725
|
+
* - The `0.1.5-alpha` line drops the third `Session.append` argument the
|
|
3726
|
+
* same way (verified on the published `0.1.5-alpha.1` package: the
|
|
3727
|
+
* returned envelope carries no `ignorable` field, and the field survives
|
|
3728
|
+
* only on the stored-log READ path), so its builds append unmarked audit
|
|
3729
|
+
* rows and the whole line is treated as unmarked too. Every later
|
|
3730
|
+
* `0.1.N-alpha` line shares that surface until proven otherwise.
|
|
3723
3731
|
* - The `0.1.2-alpha` line refuses to interpret logs containing plugin
|
|
3724
3732
|
* event types even when the envelope carries `ignorable: true` (verified
|
|
3725
3733
|
* on `0.1.2-alpha-1`, reported by @rgw87 in issue #15), so audit events
|
|
@@ -3733,19 +3741,22 @@ async function apply(ctx, config) {
|
|
|
3733
3741
|
* unchanged.
|
|
3734
3742
|
* - Every rc build in minor 2 and later is treated as unmarked too
|
|
3735
3743
|
* (defensive: a future `0.1.3-rc` line would ship at least the same
|
|
3736
|
-
* surface, and over-refusal is harmless for the reasons above)
|
|
3744
|
+
* surface, and over-refusal is harmless for the reasons above), and so is
|
|
3745
|
+
* every alpha build in minor 2 and later (`0.1.2-alpha` through
|
|
3746
|
+
* `0.1.5-alpha` and any later line: the marker surface was reintroduced
|
|
3747
|
+
* for stored-log reads, never for `Session.append`).
|
|
3737
3748
|
* Non-matching (later stable or unresolvable) versions are treated as
|
|
3738
3749
|
* possibly-marker-aware and verified by the append probe.
|
|
3739
3750
|
* @param version - the installed peer version string.
|
|
3740
3751
|
* @returns true for the known-unsafe rc.1–rc.7 lines of `0.1.0` and
|
|
3741
|
-
* `0.1.1`, every rc build in minor 2 and later, and
|
|
3742
|
-
* and `0.1.
|
|
3752
|
+
* `0.1.1`, every rc build in minor 2 and later, and every alpha build in
|
|
3753
|
+
* minor 2 and later (`0.1.2-alpha` through `0.1.5-alpha`).
|
|
3743
3754
|
*/
|
|
3744
3755
|
function isUnmarkedHostVersion(version) {
|
|
3745
3756
|
const v = version.trim();
|
|
3746
3757
|
const rc = /^0\.1\.([0-9]+)-rc\.(\d+)$/.exec(v);
|
|
3747
3758
|
if (rc !== null) return Number(rc[1]) >= 2 || Number(rc[2]) <= 7;
|
|
3748
|
-
return /^0\.1\.[
|
|
3759
|
+
return /^0\.1\.(?:[2-9]|[1-9]\d)-alpha[.-]\d+$/.test(v);
|
|
3749
3760
|
}
|
|
3750
3761
|
/**
|
|
3751
3762
|
* Identity candidates for the `agents` match dimension, derived from the
|
package/lib/types/events.d.ts
CHANGED
|
@@ -20,9 +20,12 @@
|
|
|
20
20
|
* {@link AuditAppend}). Harness builds that honor the marker (post-rc.6)
|
|
21
21
|
* stamp it on the envelope and skip unknown ignorable records when loading,
|
|
22
22
|
* so the audit can never refuse a session. Builds whose `Session.append`
|
|
23
|
-
* predates the marker
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* predates the marker (the `0.1.0-rc.6` line) or keeps the later
|
|
24
|
+
* surface-only signature (the `0.1.2-rc`, `0.1.3-alpha` and `0.1.5-alpha`
|
|
25
|
+
* lines — verified on the published `0.1.5-alpha.1` package, whose envelope
|
|
26
|
+
* field survives for stored-log reads only) silently DROP the options bag:
|
|
27
|
+
* the event then lands UNMARKED and makes the session unresumable on hosts
|
|
28
|
+
* with required-on-read semantics (`SessionFormatUnsupportedError`).
|
|
26
29
|
* The runtime detects this at first use (peer version pre-check plus a
|
|
27
30
|
* probe of the appended envelope) and disables session-log audit on such
|
|
28
31
|
* hosts with a one-time warning; `allowUnmarkedAudit: true` opts back in,
|
|
@@ -123,11 +126,12 @@ export interface AuditNetworkBlock {
|
|
|
123
126
|
/**
|
|
124
127
|
* `Session.append` narrowed to this plugin's audit event. The options bag
|
|
125
128
|
* exists only on host builds that expose the `ignorable` envelope-marker
|
|
126
|
-
* surface (post-rc.6 `@deepseek-ai/dsh-session`); an rc.6 host
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
129
|
+
* surface (post-rc.6 `@deepseek-ai/dsh-session`); an rc.6 host — and, since
|
|
130
|
+
* the alpha.5 surface, every `0.1.2-rc`, `0.1.3-alpha` and `0.1.5-alpha`
|
|
131
|
+
* build — accepts the call but silently drops the third argument: the event
|
|
132
|
+
* is appended WITHOUT the marker, which is exactly what breaks later resume
|
|
133
|
+
* on stricter hosts. The runtime treats the marker as optional-but-probed:
|
|
134
|
+
* see {@link isMarkedAuditEvent}.
|
|
131
135
|
*/
|
|
132
136
|
export type AuditAppend = (type: 'permissionRules/decision', data: AuditDecision, options?: {
|
|
133
137
|
ignorable?: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events.ts"],"names":[],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C3B,OAAO,CAAA;AAEZ;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAE3D"}
|
package/lib/types/runtime.d.ts
CHANGED
|
@@ -170,10 +170,12 @@ export declare class PermissionRulesRuntime {
|
|
|
170
170
|
* decision (passthrough included unless `audit: 'hits'`), requesting the
|
|
171
171
|
* envelope's `ignorable: true` marker so any harness build can load the
|
|
172
172
|
* log. Hosts whose `Session.append` predates the marker (the rc.6 line)
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
173
|
+
* or keeps the later surface-only signature (the `0.1.2-rc`, `0.1.3-alpha`
|
|
174
|
+
* and `0.1.5-alpha` lines) silently drop the options bag, leaving the
|
|
175
|
+
* event unmarked and sessions unresumable on stricter hosts — the runtime
|
|
176
|
+
* therefore detects such hosts BEFORE the first append (peer version) and
|
|
177
|
+
* re-checks after the first append (returned envelope), then degrades:
|
|
178
|
+
* session-log audit is disabled with a one-time warning unless
|
|
177
179
|
* `allowUnmarkedAudit: true` opts back in. The `0.1.2-alpha` line refuses
|
|
178
180
|
* plugin event types on read even when marked, so its version gate
|
|
179
181
|
* disables audit the same way (see `isUnmarkedHostVersion`). `source`
|
|
@@ -435,6 +437,12 @@ export declare function apply(ctx: Context, config: Config): Promise<void>;
|
|
|
435
437
|
* - The `0.1.3-alpha` line keeps that surface-only append signature
|
|
436
438
|
* (verified against the `dsh-v0.1.3-alpha.1` tag), so its builds stamp
|
|
437
439
|
* the marker no more than rc.1 does and the line is treated as unmarked.
|
|
440
|
+
* - The `0.1.5-alpha` line drops the third `Session.append` argument the
|
|
441
|
+
* same way (verified on the published `0.1.5-alpha.1` package: the
|
|
442
|
+
* returned envelope carries no `ignorable` field, and the field survives
|
|
443
|
+
* only on the stored-log READ path), so its builds append unmarked audit
|
|
444
|
+
* rows and the whole line is treated as unmarked too. Every later
|
|
445
|
+
* `0.1.N-alpha` line shares that surface until proven otherwise.
|
|
438
446
|
* - The `0.1.2-alpha` line refuses to interpret logs containing plugin
|
|
439
447
|
* event types even when the envelope carries `ignorable: true` (verified
|
|
440
448
|
* on `0.1.2-alpha-1`, reported by @rgw87 in issue #15), so audit events
|
|
@@ -448,13 +456,16 @@ export declare function apply(ctx: Context, config: Config): Promise<void>;
|
|
|
448
456
|
* unchanged.
|
|
449
457
|
* - Every rc build in minor 2 and later is treated as unmarked too
|
|
450
458
|
* (defensive: a future `0.1.3-rc` line would ship at least the same
|
|
451
|
-
* surface, and over-refusal is harmless for the reasons above)
|
|
459
|
+
* surface, and over-refusal is harmless for the reasons above), and so is
|
|
460
|
+
* every alpha build in minor 2 and later (`0.1.2-alpha` through
|
|
461
|
+
* `0.1.5-alpha` and any later line: the marker surface was reintroduced
|
|
462
|
+
* for stored-log reads, never for `Session.append`).
|
|
452
463
|
* Non-matching (later stable or unresolvable) versions are treated as
|
|
453
464
|
* possibly-marker-aware and verified by the append probe.
|
|
454
465
|
* @param version - the installed peer version string.
|
|
455
466
|
* @returns true for the known-unsafe rc.1–rc.7 lines of `0.1.0` and
|
|
456
|
-
* `0.1.1`, every rc build in minor 2 and later, and
|
|
457
|
-
* and `0.1.
|
|
467
|
+
* `0.1.1`, every rc build in minor 2 and later, and every alpha build in
|
|
468
|
+
* minor 2 and later (`0.1.2-alpha` through `0.1.5-alpha`).
|
|
458
469
|
*/
|
|
459
470
|
export declare function isUnmarkedHostVersion(version: string): boolean;
|
|
460
471
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,C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;;;;;;;;OAkBG;IACH,OAAO,CAAC,oBAAoB;IAwE5B,qHAAqH;IACrH,OAAO,CAAC,kBAAkB;IAU1B,8FAA8F;IAC9F,OAAO,CAAC,aAAa;IAarB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAYnB,4DAA4D;IAC5D,kBAAkB,IAAI,MAAM;IAI5B,2EAA2E;IAC3E,mBAAmB,IAAI,MAAM;IAI7B,sEAAsE;IACtE,kBAAkB,IAAI,MAAM;IAI5B;;;;;OAKG;IACH,OAAO,CAAC,cAAc;CAevB;AAED;;;;;GAKG;AACH,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BvE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAK9D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-permission-rules",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.15",
|
|
4
4
|
"description": "Declarative Claude Code-style permission rules plus a Codex-style process-level network policy for DeepSeek Harness: ordered allow/deny/ask rules with tool-name, argument (glob/regex), workspace-path, and network-target (domain/ip/port/scheme) matching on the tools/pre-execute waterfall, a built-in local HTTP/CONNECT proxy governing shell subprocess traffic, three network modes mapped onto the official sandbox presets, full session-log audit, HMR rule reload, and a settings page with a rule editor, block counters, and recent interception lists.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -76,9 +76,7 @@
|
|
|
76
76
|
"network:outbound"
|
|
77
77
|
],
|
|
78
78
|
"compatibility": {
|
|
79
|
-
"dshVersions": [
|
|
80
|
-
"0.1.2-rc.1"
|
|
81
|
-
]
|
|
79
|
+
"dshVersions": ["0.1.2-rc.1","0.1.5-alpha.1"]
|
|
82
80
|
},
|
|
83
81
|
"capability": {
|
|
84
82
|
"id": "rules",
|
|
@@ -120,18 +118,18 @@
|
|
|
120
118
|
},
|
|
121
119
|
"peerDependencies": {
|
|
122
120
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
123
|
-
"@deepseek-ai/dsh-agent": ">=0.1.2-rc.1 <0.2.0",
|
|
124
|
-
"@deepseek-ai/dsh-commands": ">=0.1.2-rc.1 <0.2.0",
|
|
125
|
-
"@deepseek-ai/dsh-llm": ">=0.1.2-rc.1 <0.2.0",
|
|
126
|
-
"@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0",
|
|
127
|
-
"@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0",
|
|
128
|
-
"@deepseek-ai/dsh-typert-protocol": ">=0.1.2-rc.1 <0.2.0",
|
|
121
|
+
"@deepseek-ai/dsh-agent": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
122
|
+
"@deepseek-ai/dsh-commands": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
123
|
+
"@deepseek-ai/dsh-llm": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
124
|
+
"@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
125
|
+
"@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
126
|
+
"@deepseek-ai/dsh-typert-protocol": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
129
127
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
130
128
|
"react": "^18.2.0",
|
|
131
|
-
"@deepseek-ai/dsh-client-connection": ">=0.1.2-rc.1 <0.2.0",
|
|
132
|
-
"@deepseek-ai/dsh-client-locale": ">=0.1.2-rc.1 <0.2.0",
|
|
133
|
-
"@deepseek-ai/dsh-client-ui-settings": ">=0.1.2-rc.1 <0.2.0",
|
|
134
|
-
"@deepseek-ai/dsh-client-web": ">=0.1.2-rc.1 <0.2.0"
|
|
129
|
+
"@deepseek-ai/dsh-client-connection": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
130
|
+
"@deepseek-ai/dsh-client-locale": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
131
|
+
"@deepseek-ai/dsh-client-ui-settings": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
132
|
+
"@deepseek-ai/dsh-client-web": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0"
|
|
135
133
|
},
|
|
136
134
|
"peerDependenciesMeta": {
|
|
137
135
|
"@deepseek-ai/dsh-client-connection": {
|
|
@@ -156,31 +154,31 @@
|
|
|
156
154
|
"zod": "^4.4.3"
|
|
157
155
|
},
|
|
158
156
|
"devDependencies": {
|
|
159
|
-
"@deepseek-ai/dsh-attachment": "0.1.
|
|
157
|
+
"@deepseek-ai/dsh-attachment": "0.1.5-alpha.1",
|
|
160
158
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
161
159
|
"@deepseek-ai/cordis-plugin-include": "^1.0.7",
|
|
162
160
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
163
|
-
"@deepseek-ai/dsh-agent": "0.1.
|
|
164
|
-
"@deepseek-ai/dsh-brand": "0.1.
|
|
165
|
-
"@deepseek-ai/dsh-client-connection": "0.1.
|
|
166
|
-
"@deepseek-ai/dsh-client-locale": "0.1.
|
|
167
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.1.
|
|
168
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.1.
|
|
169
|
-
"@deepseek-ai/dsh-client-web": "0.1.
|
|
170
|
-
"@deepseek-ai/dsh-commands": "0.1.
|
|
171
|
-
"@deepseek-ai/dsh-invariants": "0.1.
|
|
172
|
-
"@deepseek-ai/dsh-llm": "0.1.
|
|
173
|
-
"@deepseek-ai/dsh-session": "0.1.
|
|
174
|
-
"@deepseek-ai/dsh-session-projection": "0.1.
|
|
175
|
-
"@deepseek-ai/dsh-subagent": "0.1.
|
|
176
|
-
"@deepseek-ai/dsh-tools": "0.1.
|
|
177
|
-
"@deepseek-ai/dsh-typert-protocol": "0.1.
|
|
178
|
-
"@deepseek-ai/dsh-user-approval": "0.1.
|
|
161
|
+
"@deepseek-ai/dsh-agent": "0.1.5-alpha.1",
|
|
162
|
+
"@deepseek-ai/dsh-brand": "0.1.5-alpha.1",
|
|
163
|
+
"@deepseek-ai/dsh-client-connection": "0.1.5-alpha.1",
|
|
164
|
+
"@deepseek-ai/dsh-client-locale": "0.1.5-alpha.1",
|
|
165
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.5-alpha.1",
|
|
166
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.5-alpha.1",
|
|
167
|
+
"@deepseek-ai/dsh-client-web": "0.1.5-alpha.1",
|
|
168
|
+
"@deepseek-ai/dsh-commands": "0.1.5-alpha.1",
|
|
169
|
+
"@deepseek-ai/dsh-invariants": "0.1.5-alpha.1",
|
|
170
|
+
"@deepseek-ai/dsh-llm": "0.1.5-alpha.1",
|
|
171
|
+
"@deepseek-ai/dsh-session": "0.1.5-alpha.1",
|
|
172
|
+
"@deepseek-ai/dsh-session-projection": "0.1.5-alpha.1",
|
|
173
|
+
"@deepseek-ai/dsh-subagent": "0.1.5-alpha.1",
|
|
174
|
+
"@deepseek-ai/dsh-tools": "0.1.5-alpha.1",
|
|
175
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.5-alpha.1",
|
|
176
|
+
"@deepseek-ai/dsh-user-approval": "0.1.5-alpha.1",
|
|
179
177
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
180
178
|
"@eslint/js": "^10.0.1",
|
|
181
179
|
"@types/node": "^22.19.0",
|
|
182
180
|
"@vitest/coverage-v8": "^3.2.0",
|
|
183
|
-
"dsh-auto-review": "file:vendor/dsh-auto-review-0.
|
|
181
|
+
"dsh-auto-review": "file:vendor/dsh-auto-review-0.12.1.tgz",
|
|
184
182
|
"eslint": "^10.8.1",
|
|
185
183
|
"globals": "^17.11.0",
|
|
186
184
|
"react": "18.3.1",
|
|
@@ -13,27 +13,33 @@
|
|
|
13
13
|
* `strip` removes the targeted rows entirely. It exists for harness lines
|
|
14
14
|
* whose read path refuses out-of-vocabulary event types even when the
|
|
15
15
|
* envelope is marked — the `0.1.2-alpha` line (verified on `0.1.2-alpha-1`,
|
|
16
|
-
* issue #15) refuses them directly, and the
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
16
|
+
* issue #15) refuses them directly, and the cross-generation migration gates
|
|
17
|
+
* refuse unclassified rows no matter how they are marked: the
|
|
18
|
+
* `0.1.3-alpha.1` v1→v2 gate
|
|
19
|
+
* (`session-format-v1-to-v2/src/migration.ts`) refuses every v1 event type
|
|
20
|
+
* outside the released v0 vocabulary, and the `0.1.5-alpha.1` v2→v3 gate
|
|
21
|
+
* (`session-format-v2-to-v3/src/payload.ts`) refuses every event type
|
|
22
|
+
* outside the frozen released v2 inventory — audit rows included even when
|
|
23
|
+
* stamped. A v1 log containing audit rows therefore blocks the whole
|
|
24
|
+
* session load on a v2 host, and a v2 log containing them blocks the load on
|
|
25
|
+
* a v3 host: `strip` v1 logs before a `0.1.3-alpha` host first opens them,
|
|
26
|
+
* and `strip` v2 logs before a `0.1.5-alpha` host does. There the marker
|
|
27
|
+
* cannot help, and dropping the log-only audit rows is the only repair. The
|
|
28
|
+
* target vocabulary is reconstruction-safe by construction (never injected
|
|
29
|
+
* into the model context), so removal does not change how the session
|
|
30
|
+
* replays.
|
|
26
31
|
*
|
|
27
32
|
* It understands both physical encodings of the JSONL backend:
|
|
28
|
-
* - `session.jsonl.zstd` — a concatenation of checksummed Zstandard
|
|
29
|
-
* (frame 1 = header line, later frames = durable append batches);
|
|
30
|
-
* frame is decompressed, filtered, and recompressed independently
|
|
31
|
-
* frame boundaries survive.
|
|
32
|
-
* - `session.jsonl` — plaintext JSONL lines.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
33
|
+
* - `session[.vN].jsonl.zstd` — a concatenation of checksummed Zstandard
|
|
34
|
+
* frames (frame 1 = header line, later frames = durable append batches);
|
|
35
|
+
* each frame is decompressed, filtered, and recompressed independently
|
|
36
|
+
* so frame boundaries survive.
|
|
37
|
+
* - `session[.vN].jsonl` — plaintext JSONL lines.
|
|
38
|
+
* Every generation-addressed log is discovered by the canonical basename
|
|
39
|
+
* (`session.jsonl` for v0/v1, `session.v2.jsonl` for the `0.1.3-alpha` line,
|
|
40
|
+
* `session.v3.jsonl` for the `0.1.5-alpha` line, each optionally
|
|
41
|
+
* `.zstd`-compressed). Native v3 logs accept marked plugin rows on read, so
|
|
42
|
+
* they only need `repair` stamping.
|
|
37
43
|
*
|
|
38
44
|
* Usage:
|
|
39
45
|
* node scripts/repair-session-logs.mjs scan [--home DIR] # report foreign rows, change nothing
|
|
@@ -75,9 +81,13 @@ const STORAGE_ROW_TYPES = new Set([
|
|
|
75
81
|
|
|
76
82
|
/**
|
|
77
83
|
* The harness build's generated event vocabulary
|
|
78
|
-
* (`KNOWN_SESSION_EVENT_TYPES`, `packages/core/session/src/known-event-types.ts
|
|
79
|
-
*
|
|
80
|
-
*
|
|
84
|
+
* (`KNOWN_SESSION_EVENT_TYPES`, `packages/core/session/src/known-event-types.ts`,
|
|
85
|
+
* synced with the `0.1.5-alpha.1` catalog), plus the v1/v2-only spellings the
|
|
86
|
+
* older generations wrote (`assistant/chunk`, `tool/code-dispatch`,
|
|
87
|
+
* `tool/code-dispatch-start`; V3 renamed the latter two to `tool/ptc-dispatch`
|
|
88
|
+
* and `tool/ptc-dispatch-start`), so every generation scans clean. Rows whose
|
|
89
|
+
* type is outside this set are what the read path refuses when the envelope
|
|
90
|
+
* lacks `ignorable: true`; the scan reports them so nothing is missed.
|
|
81
91
|
* Regenerate this list from the harness checkout when it changes.
|
|
82
92
|
*/
|
|
83
93
|
const KNOWN_SESSION_EVENT_TYPES = new Set([
|
|
@@ -97,6 +107,8 @@ const KNOWN_SESSION_EVENT_TYPES = new Set([
|
|
|
97
107
|
'compaction/prune',
|
|
98
108
|
'compaction/start',
|
|
99
109
|
'compaction/summary',
|
|
110
|
+
'feedback/message-delete',
|
|
111
|
+
'feedback/message-put',
|
|
100
112
|
'feedback/record',
|
|
101
113
|
'goal/change',
|
|
102
114
|
'hook/invoked',
|
|
@@ -118,6 +130,7 @@ const KNOWN_SESSION_EVENT_TYPES = new Set([
|
|
|
118
130
|
'step/start',
|
|
119
131
|
'subagent/descriptor',
|
|
120
132
|
'subagent/model-selection-policy',
|
|
133
|
+
'system/message',
|
|
121
134
|
'team/member',
|
|
122
135
|
'team/message/delivered',
|
|
123
136
|
'team/message/queued',
|
|
@@ -130,6 +143,8 @@ const KNOWN_SESSION_EVENT_TYPES = new Set([
|
|
|
130
143
|
'tool/call',
|
|
131
144
|
'tool/code-dispatch',
|
|
132
145
|
'tool/code-dispatch-start',
|
|
146
|
+
'tool/ptc-dispatch',
|
|
147
|
+
'tool/ptc-dispatch-start',
|
|
133
148
|
'tool/result',
|
|
134
149
|
'turn/end',
|
|
135
150
|
'turn/start',
|
|
@@ -242,6 +257,13 @@ function filterFrame(text, targetTypes, foreignSeen, strip) {
|
|
|
242
257
|
return { text: out.join('\n') + '\n', changed }
|
|
243
258
|
}
|
|
244
259
|
|
|
260
|
+
/**
|
|
261
|
+
* Canonical generation-addressed log basenames (`session-format/src/filename.ts`):
|
|
262
|
+
* `session.jsonl` for format v0/v1, `session.vN.jsonl` for every later
|
|
263
|
+
* generation, each optionally `.zstd`-compressed.
|
|
264
|
+
*/
|
|
265
|
+
const LOG_FILENAME = /^session(?:\.v([1-9]\d*))?\.jsonl(?:\.zstd)?$/
|
|
266
|
+
|
|
245
267
|
/** Find every session artifact under a sessions root. */
|
|
246
268
|
function findLogs(root) {
|
|
247
269
|
const found = []
|
|
@@ -250,7 +272,7 @@ function findLogs(root) {
|
|
|
250
272
|
const full = join(dir, entry)
|
|
251
273
|
const stat = statSync(full)
|
|
252
274
|
if (stat.isDirectory()) walk(full)
|
|
253
|
-
else if (
|
|
275
|
+
else if (LOG_FILENAME.test(entry)) found.push(full)
|
|
254
276
|
}
|
|
255
277
|
}
|
|
256
278
|
walk(root)
|
|
@@ -360,7 +382,7 @@ for (const path of logs) {
|
|
|
360
382
|
if (foreignSeen.size > 0) {
|
|
361
383
|
console.log('\nforeign (non-harness) event rows found by type:')
|
|
362
384
|
for (const [type, count] of [...foreignSeen.entries()].sort()) {
|
|
363
|
-
const action = targetTypes.has(type) ? 'targeted — repair stamps ignorable; strip removes (v1 logs
|
|
385
|
+
const action = targetTypes.has(type) ? 'targeted — repair stamps ignorable; strip removes (strip v1 logs before a 0.1.3+ host loads them, and v2 logs before a 0.1.5-alpha host migrates them)' : 'NOT targeted — investigate before touching'
|
|
364
386
|
console.log(` ${type}: ${count} rows (${action})`)
|
|
365
387
|
}
|
|
366
388
|
}
|
package/src/events.ts
CHANGED
|
@@ -20,9 +20,12 @@
|
|
|
20
20
|
* {@link AuditAppend}). Harness builds that honor the marker (post-rc.6)
|
|
21
21
|
* stamp it on the envelope and skip unknown ignorable records when loading,
|
|
22
22
|
* so the audit can never refuse a session. Builds whose `Session.append`
|
|
23
|
-
* predates the marker
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* predates the marker (the `0.1.0-rc.6` line) or keeps the later
|
|
24
|
+
* surface-only signature (the `0.1.2-rc`, `0.1.3-alpha` and `0.1.5-alpha`
|
|
25
|
+
* lines — verified on the published `0.1.5-alpha.1` package, whose envelope
|
|
26
|
+
* field survives for stored-log reads only) silently DROP the options bag:
|
|
27
|
+
* the event then lands UNMARKED and makes the session unresumable on hosts
|
|
28
|
+
* with required-on-read semantics (`SessionFormatUnsupportedError`).
|
|
26
29
|
* The runtime detects this at first use (peer version pre-check plus a
|
|
27
30
|
* probe of the appended envelope) and disables session-log audit on such
|
|
28
31
|
* hosts with a one-time warning; `allowUnmarkedAudit: true` opts back in,
|
|
@@ -130,11 +133,12 @@ export interface AuditNetworkBlock {
|
|
|
130
133
|
/**
|
|
131
134
|
* `Session.append` narrowed to this plugin's audit event. The options bag
|
|
132
135
|
* exists only on host builds that expose the `ignorable` envelope-marker
|
|
133
|
-
* surface (post-rc.6 `@deepseek-ai/dsh-session`); an rc.6 host
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
136
|
+
* surface (post-rc.6 `@deepseek-ai/dsh-session`); an rc.6 host — and, since
|
|
137
|
+
* the alpha.5 surface, every `0.1.2-rc`, `0.1.3-alpha` and `0.1.5-alpha`
|
|
138
|
+
* build — accepts the call but silently drops the third argument: the event
|
|
139
|
+
* is appended WITHOUT the marker, which is exactly what breaks later resume
|
|
140
|
+
* on stricter hosts. The runtime treats the marker as optional-but-probed:
|
|
141
|
+
* see {@link isMarkedAuditEvent}.
|
|
138
142
|
*/
|
|
139
143
|
export type AuditAppend = (
|
|
140
144
|
type: 'permissionRules/decision',
|
package/src/runtime.ts
CHANGED
|
@@ -410,10 +410,12 @@ export class PermissionRulesRuntime {
|
|
|
410
410
|
* decision (passthrough included unless `audit: 'hits'`), requesting the
|
|
411
411
|
* envelope's `ignorable: true` marker so any harness build can load the
|
|
412
412
|
* log. Hosts whose `Session.append` predates the marker (the rc.6 line)
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
413
|
+
* or keeps the later surface-only signature (the `0.1.2-rc`, `0.1.3-alpha`
|
|
414
|
+
* and `0.1.5-alpha` lines) silently drop the options bag, leaving the
|
|
415
|
+
* event unmarked and sessions unresumable on stricter hosts — the runtime
|
|
416
|
+
* therefore detects such hosts BEFORE the first append (peer version) and
|
|
417
|
+
* re-checks after the first append (returned envelope), then degrades:
|
|
418
|
+
* session-log audit is disabled with a one-time warning unless
|
|
417
419
|
* `allowUnmarkedAudit: true` opts back in. The `0.1.2-alpha` line refuses
|
|
418
420
|
* plugin event types on read even when marked, so its version gate
|
|
419
421
|
* disables audit the same way (see `isUnmarkedHostVersion`). `source`
|
|
@@ -1315,6 +1317,12 @@ export async function apply(ctx: Context, config: Config): Promise<void> {
|
|
|
1315
1317
|
* - The `0.1.3-alpha` line keeps that surface-only append signature
|
|
1316
1318
|
* (verified against the `dsh-v0.1.3-alpha.1` tag), so its builds stamp
|
|
1317
1319
|
* the marker no more than rc.1 does and the line is treated as unmarked.
|
|
1320
|
+
* - The `0.1.5-alpha` line drops the third `Session.append` argument the
|
|
1321
|
+
* same way (verified on the published `0.1.5-alpha.1` package: the
|
|
1322
|
+
* returned envelope carries no `ignorable` field, and the field survives
|
|
1323
|
+
* only on the stored-log READ path), so its builds append unmarked audit
|
|
1324
|
+
* rows and the whole line is treated as unmarked too. Every later
|
|
1325
|
+
* `0.1.N-alpha` line shares that surface until proven otherwise.
|
|
1318
1326
|
* - The `0.1.2-alpha` line refuses to interpret logs containing plugin
|
|
1319
1327
|
* event types even when the envelope carries `ignorable: true` (verified
|
|
1320
1328
|
* on `0.1.2-alpha-1`, reported by @rgw87 in issue #15), so audit events
|
|
@@ -1328,19 +1336,22 @@ export async function apply(ctx: Context, config: Config): Promise<void> {
|
|
|
1328
1336
|
* unchanged.
|
|
1329
1337
|
* - Every rc build in minor 2 and later is treated as unmarked too
|
|
1330
1338
|
* (defensive: a future `0.1.3-rc` line would ship at least the same
|
|
1331
|
-
* surface, and over-refusal is harmless for the reasons above)
|
|
1339
|
+
* surface, and over-refusal is harmless for the reasons above), and so is
|
|
1340
|
+
* every alpha build in minor 2 and later (`0.1.2-alpha` through
|
|
1341
|
+
* `0.1.5-alpha` and any later line: the marker surface was reintroduced
|
|
1342
|
+
* for stored-log reads, never for `Session.append`).
|
|
1332
1343
|
* Non-matching (later stable or unresolvable) versions are treated as
|
|
1333
1344
|
* possibly-marker-aware and verified by the append probe.
|
|
1334
1345
|
* @param version - the installed peer version string.
|
|
1335
1346
|
* @returns true for the known-unsafe rc.1–rc.7 lines of `0.1.0` and
|
|
1336
|
-
* `0.1.1`, every rc build in minor 2 and later, and
|
|
1337
|
-
* and `0.1.
|
|
1347
|
+
* `0.1.1`, every rc build in minor 2 and later, and every alpha build in
|
|
1348
|
+
* minor 2 and later (`0.1.2-alpha` through `0.1.5-alpha`).
|
|
1338
1349
|
*/
|
|
1339
1350
|
export function isUnmarkedHostVersion(version: string): boolean {
|
|
1340
1351
|
const v = version.trim()
|
|
1341
1352
|
const rc = /^0\.1\.([0-9]+)-rc\.(\d+)$/.exec(v)
|
|
1342
1353
|
if (rc !== null) return Number(rc[1]) >= 2 || Number(rc[2]) <= 7
|
|
1343
|
-
return /^0\.1\.[
|
|
1354
|
+
return /^0\.1\.(?:[2-9]|[1-9]\d)-alpha[.-]\d+$/.test(v)
|
|
1344
1355
|
}
|
|
1345
1356
|
|
|
1346
1357
|
/**
|