dsh-plugin-wsl-env 0.26.3 → 0.27.0

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.
Files changed (82) hide show
  1. package/CHANGELOG.md +142 -0
  2. package/CONTRIBUTING.md +32 -25
  3. package/CONTRIBUTING.zh.md +3 -2
  4. package/README.md +1 -1
  5. package/SECURITY.md +21 -7
  6. package/SECURITY.zh.md +18 -5
  7. package/SUPPORT.md +2 -2
  8. package/SUPPORT.zh.md +2 -2
  9. package/client.js +351 -48
  10. package/cordis.patch.yml +26 -10
  11. package/docs/AGENT-PROTOCOL-V7.md +4 -2
  12. package/docs/API.md +3 -1
  13. package/docs/API.zh.md +3 -1
  14. package/docs/ARCHITECTURE.md +22 -4
  15. package/docs/ARCHITECTURE.zh.md +18 -4
  16. package/docs/CONFIGURATION.md +117 -17
  17. package/docs/CONFIGURATION.zh.md +97 -11
  18. package/docs/DIAGNOSTICS.md +22 -11
  19. package/docs/DIAGNOSTICS.zh.md +17 -9
  20. package/docs/LIMITATIONS.md +27 -4
  21. package/docs/LIMITATIONS.zh.md +20 -3
  22. package/docs/MIGRATION.md +2 -2
  23. package/docs/MIGRATION.zh.md +2 -2
  24. package/docs/PARITY.md +3 -1
  25. package/docs/QUICKSTART.md +31 -20
  26. package/docs/QUICKSTART.zh.md +16 -9
  27. package/docs/README.zh.md +1 -1
  28. package/docs/RELEASING.md +25 -3
  29. package/docs/REQUIREMENTS.zh.md +7 -6
  30. package/docs/ROADMAP-1.0.md +11 -7
  31. package/lib/agent-confined.d.ts +9 -1
  32. package/lib/agent-confined.js +3 -3
  33. package/lib/agent.d.ts +54 -18
  34. package/lib/agent.js +86 -19
  35. package/lib/bwrap.d.ts +16 -0
  36. package/lib/bwrap.js +9 -0
  37. package/lib/fs-routing.d.ts +6 -0
  38. package/lib/fs-routing.js +7 -0
  39. package/lib/fs-substrate.d.ts +1 -1
  40. package/lib/fs-substrate.js +10 -18
  41. package/lib/fsio-agent.d.ts +4 -0
  42. package/lib/fsio-agent.js +37 -10
  43. package/lib/listing.d.ts +2 -2
  44. package/lib/listing.js +5 -4
  45. package/lib/messages.d.ts +70 -0
  46. package/lib/messages.js +80 -0
  47. package/lib/open-in-app.js +12 -9
  48. package/lib/picker.d.ts +4 -1
  49. package/lib/picker.js +35 -11
  50. package/lib/plugin-update.d.ts +212 -0
  51. package/lib/plugin-update.js +283 -0
  52. package/lib/ports.js +8 -1
  53. package/lib/provider-common.d.ts +22 -0
  54. package/lib/provider-common.js +18 -0
  55. package/lib/provider-marker.d.ts +23 -0
  56. package/lib/provider-marker.js +21 -0
  57. package/lib/sandbox-core.d.ts +2 -0
  58. package/lib/sandbox-core.js +5 -3
  59. package/lib/session-runtime.d.ts +10 -1
  60. package/lib/session-runtime.js +3 -1
  61. package/lib/shell-env.js +1 -1
  62. package/lib/socket-isolation.d.ts +103 -0
  63. package/lib/socket-isolation.js +166 -0
  64. package/lib/status.d.ts +21 -8
  65. package/lib/status.js +61 -23
  66. package/lib/subprocess.d.ts +3 -0
  67. package/lib/subprocess.js +5 -0
  68. package/lib/takeover-report.js +4 -11
  69. package/lib/update-check.d.ts +49 -9
  70. package/lib/update-check.js +81 -28
  71. package/lib/watcher.d.ts +1 -1
  72. package/lib/watcher.js +1 -1
  73. package/lib/wsl-doctor-command.d.ts +6 -2
  74. package/lib/wsl-doctor-command.js +24 -15
  75. package/lib/wsl-doctor-tool.js +2 -0
  76. package/lib/wsl-filesystem.d.ts +53 -12
  77. package/lib/wsl-filesystem.js +90 -31
  78. package/lib/wsl-shell.d.ts +109 -40
  79. package/lib/wsl-shell.js +128 -54
  80. package/package.json +8 -3
  81. package/scripts/doctor.mjs +199 -3
  82. package/scripts/profile-preset.mjs +10 -2
package/CHANGELOG.md CHANGED
@@ -16,6 +16,148 @@ were part of the record.
16
16
 
17
17
  ## [Unreleased]
18
18
 
19
+ ## [0.27.0] - 2026-11-19
20
+
21
+ Minor release: harden the opt-in sandbox's process-authority surface and add the diagnostics and panel upgrades around it.
22
+
23
+ ### Added
24
+
25
+ - **The WSL environment panel now shows the plugin's version and upgrades it
26
+ in one click.** A **插件版本** card reports the installed and running
27
+ versions, asks the host's plugin manager (`listVersions`) for the newest
28
+ installable stable release, and labels a newer compatible release with a
29
+ reminder. **一键升级** posts to the new `wsl-plugin-update` route, which calls
30
+ the host's `updateBundle` only after that click; the panel reports
31
+ `applied`, `restart-required`, rollback, pending build scripts, and a
32
+ `not-updatable`/old-host fallback instead of claiming success. The route
33
+ caches its read for `wsl-plugin-update.cacheMs` (ten minutes by default), and
34
+ the periodic check remains read-only.
35
+
36
+ - **The WSL environment panel clears stored check results.** Each checked row
37
+ offers **清除** and the card offers **清除全部**: both `DELETE`
38
+ `/api/wsl-env/status` (with or without `?distro=<name>`), which drops the
39
+ in-memory and persisted verdict so the next load shows "not checked" again.
40
+ Clearing is host-local — it lists and probes no distro — so it still works
41
+ when `wsl.exe` or the doctor is unavailable; the panel disables it while a
42
+ check is in flight so an answer cannot restore a cleared row.
43
+
44
+ - **`socketIsolation` masks the sockets a confined process would use to escape
45
+ the mount profile.** The key applies to the command, write and routed rows
46
+ (`wsl-shell`, `wsl-fs`, `fs-routing`). `off` keeps the previous behavior;
47
+ `session-bus` binds `/dev/null` over `$XDG_RUNTIME_DIR/bus` and
48
+ `$XDG_RUNTIME_DIR/systemd/private`, so `systemd-run --user`/`systemctl --user`
49
+ fail inside the profile; `strict` also masks `/run/dbus/system_bus_socket`,
50
+ the container sockets the distro user can reach, and `/run/WSL` — the WSL
51
+ interop transport — so a Windows executable copied into the workspace fails
52
+ at the host bridge. The doctor's
53
+ `sandbox.isolation` row reports the effective stance and the detected
54
+ surfaces; `pnpm run preset --socket-isolation` (or `--strict`, which also
55
+ enables the `/mnt` mask) writes the nested rows, and the top-level
56
+ `fs-routing` row takes the same value by hand. The masks are a narrowing,
57
+ not a closure: same-user `/proc` and other IPC remain, the distro-wide
58
+ interop switch is still `[interop] enabled=false`, `enforcement` stays
59
+ `partial`, and `pnpm run probe:sandbox` proves the default reaches the user
60
+ manager while both stances do not (and strict blocks a copied PE).
61
+
62
+ - **The doctor names the effective `workspace-write` writable roots, and a
63
+ real-machine probe proves them.** `sandbox.grants` lists the `writableRoots`
64
+ configured on both nested rows, expands `~`, checks the physical-directory
65
+ rule, names a missing, unreadable or symlinked root with its remedy, and
66
+ warns when `wsl-shell` and `wsl-fs` disagree. `pnpm run probe:cache-write`
67
+ drives the per-command bwrap profile and the session runtime with a temporary
68
+ cache root: the granted directory is writable and an ungranted sibling stays
69
+ `EROFS`.
70
+
71
+ ### Changed
72
+
73
+ - **The panel's check actions are two fixed buttons: 快速检查 and 完整检查.**
74
+ No row relabels its action to **重新检查** after a result, and the full run
75
+ no longer appears as **修复** when it can repair plugin-owned state. Both
76
+ buttons are present before and after a check, and every click runs the doctor
77
+ again; **完整检查** still performs the `--fix-owned` run and shows its
78
+ before → after rows.
79
+
80
+ ## [0.26.4] - 2026-11-18
81
+
82
+ Patch release: bound a wedged resident agent's request, localize the remaining
83
+ UI text, harden the v7 FS frame, and keep the picker's category level in one
84
+ language. Documentation and internal refactors ride along.
85
+
86
+ ### Fixed
87
+
88
+ - **The picker's first category level no longer mixes two languages.** The
89
+ entries were labelled before `preferredDistro`/`homeOf` awaited, while the
90
+ crumbs were labelled after; if the harness's stored locale preference
91
+ arrived during those awaits, one level rendered half in the default OS
92
+ language and half in the chosen one. Build every label after the awaits so
93
+ one response uses one catalog.
94
+ - **Protocol hardening for the v7 FS frame (#55).** Four independent gaps:
95
+ an out-of-order FSB record is now refused as `FS_IO_ERROR` instead of being
96
+ attributed to the next op by line position; the FS budget grows with the
97
+ content a `write`/`move` must handle (30 s base, one second per MiB, ten
98
+ minutes maximum) instead of failing a multi-GB move at a fixed 30 s; the
99
+ directory picker and port survey now pass explicit capture caps instead of
100
+ allowing a transport-sized RES line; and the SETENV section of
101
+ `docs/AGENT-PROTOCOL-V7.md` names the real two-field frame.
102
+ - **All plugin-authored UI text follows the harness locale (#50).** The status
103
+ route's errors, the open-in-app route's refusals, the directory picker's
104
+ breadcrumbs and branch labels, and the `/wsl-doctor` command's usage,
105
+ errors, description, and hint were hardcoded Chinese while the rest of the
106
+ plugin followed the Language setting. They now render through
107
+ `src/messages.ts`; a new style check rejects raw CJK literals anywhere under
108
+ `src/` except the catalog, so the next such string fails the gate instead of
109
+ reaching an English-locale user.
110
+ - **A written request that is never ACKed no longer hangs the agent queue
111
+ (#49).** The execution watchdog was armed only by the dequeue `ACK`, so a
112
+ resident that stayed alive but stopped dequeuing (a wedged `wait`, a blocked
113
+ stdin pipe) left the request pending forever and the serial queue behind it
114
+ blocked. A separate, looser frame-written ceiling (120 s) now turns that
115
+ state into a transport failure: the resident is killed, the request fails as
116
+ unknown-state/`AgentUnavailableError`, and the caller's usual fallback
117
+ applies. An ACK replaces it with the existing execution budget.
118
+
119
+ ### Changed
120
+
121
+ - **Release and CI hardening (#52).** The release workflow now compares the
122
+ registry's `dist.integrity` with the local `npm pack` product, not just the
123
+ file count and readme name; the stale `0.2.1-rc.2` entries were removed from
124
+ `minimumReleaseAgeExclude` and the restore condition is recorded; and
125
+ `docs/RELEASING.md` records the deliberate decision to run `npm-publish`
126
+ without required reviewers. The nightly `probes` schedule and its
127
+ `probe-heartbeat` were removed after confirming no self-hosted runner is
128
+ registered for the repository: the manual `probes` dispatch now fails loudly
129
+ when the runner has no WSL topology, and real-machine evidence comes from the
130
+ local closed-app suite (`test/probe/run-all-when-closed.sh --include-fs`).
131
+ - **The filesystem and shell providers share their runtime bookkeeping and
132
+ config narrowing (#54).** The two classes kept identical maps for distro
133
+ homes, held session runtimes, the session-runtime preflight, and the `auto`
134
+ verdicts; a semantic change had to be made twice. Those four now live in
135
+ `ProviderRuntimeBook` (`provider-common.ts`), and the 30 repeated
136
+ `this.config as unknown as …` casts collapse to one private `wslConfig`
137
+ accessor per row. No behavior change; the provider, session-runtime, and
138
+ boot suites pin the existing semantics.
139
+ - **The takeover report identifies providers by a symbol brand, not
140
+ `instanceof` (#53).** `takeover-report` used to import the three provider
141
+ classes to tell this plugin's `subprocess`/`fs`/`directoryPicker` from the
142
+ shipped ones, which pulled the whole filesystem provider graph — including
143
+ `agent-shared`'s module-load script digest — into every diagnostic surface
144
+ that reads the report, including the preset realm. Each provider now carries
145
+ a `Symbol.for` brand on its prototype and the report compares that, so the
146
+ doctor snapshot loads only the marker module. A static import-graph test
147
+ keeps the provider stack out of `lib/takeover-report.js`.
148
+
149
+ ### Documentation
150
+
151
+ - **Documentation and comment drift swept, with the peer floor now checked
152
+ mechanically (#51).** SUPPORT advertised the old `0.2.2-rc.1` peer floor;
153
+ `lint:docs` now compares the support page's version literals with
154
+ `package.json` and fails on a stale one. API and CONFIGURATION gained the
155
+ `./open-in-app` / `wsl-open-in-app` surface, CONFIGURATION documents the
156
+ host `directory-picker-browse-surface` row and the command-only scope of
157
+ `/mnt` masking, REQUIREMENTS' R20 test count and R29/R30 baselines are
158
+ current, the roadmap and parity notes state their real baselines, and four
159
+ displaced or duplicated source comments were put back on their declarations.
160
+
19
161
  ## [0.26.3] - 2026-11-17
20
162
 
21
163
  Promotes 0.26.3-rc.0 after the HMR gate passed: a 0.26.1 profile with a live
package/CONTRIBUTING.md CHANGED
@@ -198,7 +198,8 @@ terminal if you would rather not see the prompt.
198
198
  | `pnpm run e2e:install` | packed-tarball install/upgrade/uninstall into a temporary `DSH_HOME`; the newest published → current leg boots the profile with an overlay probe and asserts the three takeovers mount | yes; Windows + WSL |
199
199
  | `pnpm run doctor` | the environment prerequisites, peers and caches (`--json` for scripts; `diagnose` is the read-only alias) | no; inside the distro |
200
200
  | `pnpm run probe` | filesystem behaviour against a real distro | yes |
201
- | `pnpm run probe:sandbox` | what bubblewrap confines and what it does not | no |
201
+ | `pnpm run probe:sandbox` | what bubblewrap confines and what it does not, including the socket-isolation stances and the strict interop-transport mask | no |
202
+ | `pnpm run probe:cache-write` | the writable-root grants through the per-command profile and the session runtime | no; inside the distro |
202
203
  | `pnpm run probe:sandbox-shell` | the confined executor through a real boot | yes |
203
204
  | `pnpm run probe:interop-shell` | resident and one-shot interop for drive and copied executables, with and without the `/mnt` mask | yes |
204
205
  | `pnpm run probe:terminal` | the terminal provider | yes |
@@ -236,27 +237,31 @@ still need Windows and WSL2, but no harness boot and no profile: run them from a
236
237
  distro terminal with Node available, and they reach `wsl.exe` through interop.
237
238
 
238
239
  Two conveniences for the real-machine set. `test/probe/run-all-when-closed.sh
239
- --include-fs` runs all seventeen probes once the app has exited. The interop shell
240
- matrix uses the `wslfs` profile, systemd and a lingering user manager; it fails
241
- when Windows interop or its temporary marker cannot be verified. And `ci.yml` has a
242
- scheduled and manually dispatched `probes` job: `sandbox` runs whenever a default distro
243
- actually launches, then `mode`, `terminal`, `picker` and `missing-wsl` where the
244
- harness app is installed. It is named for a self-hosted Windows runner although
245
- its `runs-on` carries the GitHub-hosted `windows-latest` label; when the hosted
246
- runner has no usable distro the job is a green no-op (`skip all`). Where a default
247
- distro launches without bubblewrap, the `sandbox` leg fails, not skips.
248
-
249
- **Self-hosted runner label collision — known exposure.** The development
250
- machine's self-hosted runner fulfills the GitHub-hosted `windows-latest` label,
251
- so the unit matrix's Windows legs execute there on every push and PR. PR code
252
- from a fork is skipped on those legs (`ci.yml`'s step-level fork gate), but the
253
- durable fix is renaming the runner's label to something unambiguous (for
254
- example `self-hosted-wsl`) in the runner's settings and repointing the two
255
- `windows-latest` consumers in `ci.yml` at it — until then, treat the label as
256
- shared infrastructure, not hosted capacity. Also note the install steps carry
257
- `--config.minimum-release-age=0` (pnpm 11.7's lockfile re-verification ignores
258
- `minimumReleaseAgeExclude`; the flag is the documented remedy in
259
- `release.yml`).
240
+ --include-fs` runs the full closed-app suite once the app has exited. The interop
241
+ shell matrix uses the `wslfs` profile, systemd and a lingering user manager; it
242
+ fails when Windows interop or its temporary marker cannot be verified.
243
+
244
+ The `ci.yml` `probes` job is **manual-only** (`workflow_dispatch`) and requires a
245
+ self-hosted Windows+WSL runner with the harness app and a configured profile;
246
+ `runs-on` is the GitHub-hosted `windows-latest` label, so dispatching it without
247
+ such a runner fails with a named error rather than passing (`skip all` is gone).
248
+ No self-hosted runner is registered for this repository today (2026-11-18), so
249
+ the documented path is the local closed-app command above. The nightly schedule
250
+ and its `probe-heartbeat` were removed on the same date for that reason; there is
251
+ no scheduled probe evidence to miss. A manual run still uploads
252
+ `probe-evidence-<run>` as the evidence artifact.
253
+
254
+ **Self-hosted runners.** None is currently registered for this repository, so
255
+ the Windows matrix legs run on GitHub-hosted `windows-latest`. If one is added
256
+ later, give it a custom label such as `self-hosted-wsl` rather than the hosted
257
+ `windows-latest` label, and update every matrix / `runs-on` / fork-gate
258
+ reference together. The release workflow's `npm-publish` environment
259
+ intentionally has no required reviewers (single-maintainer decision).
260
+
261
+ Also note the install steps carry `--config.minimum-release-age=0` (pnpm 11.7's
262
+ lockfile re-verification ignores `minimumReleaseAgeExclude`; the flag is the
263
+ documented remedy in `release.yml`). The restore condition and all seven call
264
+ sites are recorded in `pnpm-workspace.yaml` and tracked by #52.
260
265
 
261
266
  ## Adding a test
262
267
 
@@ -322,9 +327,11 @@ and `*-probe.yml` files in the same directory. Harness probes including `run.sh`
322
327
  `terminal.sh`, `sandbox-shell.sh`, `interop-shell.sh`, `picker.sh`,
323
328
  `fs-routing.sh`, `missing-wsl.sh` and `sandbox-off.sh` use the throwaway profile
324
329
  whose setup is documented in the header of `test/probe/run.sh`. The distro probes
325
- (`substrate.sh`, `watch.sh`, `agent.sh`, `exec.sh`) boot no harness: they run
326
- from a distro terminal and drive the resident agent through the `wsl.exe` interop
327
- transport. `sandbox.sh` and `mode.sh` need neither a harness boot nor a profile.
330
+ (`substrate.sh`, `watch.sh`, `agent.sh`, `exec.sh`, `cache-write.sh`) boot no
331
+ harness: they run from a distro terminal and drive the resident agent through the
332
+ `wsl.exe` interop transport; `cache-write.sh` additionally starts its own session
333
+ runtime scope and a per-command profile to prove the writable-root grants.
334
+ `sandbox.sh` and `mode.sh` need neither a harness boot nor a profile.
328
335
 
329
336
  Keep probe output idempotent. Several probes delete their scratch files at the
330
337
  start, because a leftover file from an earlier run changes the result.
@@ -92,7 +92,8 @@ pnpm run sync:windows
92
92
  | `pnpm run e2e:install` | 在临时 `DSH_HOME` 中安装/升级/卸载打包 tarball;“最新已发布版 → 当前版本”leg 会用 overlay 探针启动 profile,断言三个接管实际挂载 | 是;Windows + WSL |
93
93
  | `pnpm run doctor` | 环境前置项、peer 和缓存(脚本使用 `--json`;`diagnose` 是只读别名) | 否;在发行版内 |
94
94
  | `pnpm run probe` | 针对真实发行版的文件系统行为 | 是 |
95
- | `pnpm run probe:sandbox` | bubblewrap 隔离了什么、没有隔离什么 | 否 |
95
+ | `pnpm run probe:sandbox` | bubblewrap 隔离了什么、没有隔离什么,含 socket 隔离档位与 strict 的 interop 传输遮蔽 | 否 |
96
+ | `pnpm run probe:cache-write` | 通过 per-command profile 与 session runtime 验证可写根授权 | 否;在发行版内 |
96
97
  | `pnpm run probe:sandbox-shell` | 通过真实启动验证受限执行器 | 是 |
97
98
  | `pnpm run probe:interop-shell` | 对盘符可执行文件和复制出的可执行文件进行驻留式与一次性互操作,含/不含 `/mnt` 掩码 | 是 |
98
99
  | `pnpm run probe:terminal` | 终端 provider | 是 |
@@ -146,7 +147,7 @@ import 固定版本 `@deepseek-ai/*` 包的测试也进入同样的列表,无
146
147
 
147
148
  先运行一次 `pnpm exec playwright install chromium`,再运行测试套件:`pnpm run test:browser`。CI 的 `browser` 任务在 `ubuntu-latest` 上做同样的事;`pnpm test` 不依赖浏览器,因此没有浏览器的检出仍能运行常规检查。
148
149
 
149
- 探针是 shell 脚本,外加它们加载的小型插件文件:同目录下的 `*-probe.mjs` 和 `*-probe.yml`。harness 探针包括 `run.sh`、`terminal.sh`、`sandbox-shell.sh`、`interop-shell.sh`、`picker.sh`、`fs-routing.sh`、`missing-wsl.sh` 和 `sandbox-off.sh`,它们使用一次性 profile,其设置记录在 `test/probe/run.sh` 的文件头中。发行版探针(`substrate.sh`、`watch.sh`、`agent.sh`、`exec.sh`)不启动 harness:它们从发行版终端运行,并通过 `wsl.exe` 互操作传输驱动驻留 agent。`sandbox.sh` 和 `mode.sh` 既不需要启动 harness,也不需要 profile。
150
+ 探针是 shell 脚本,外加它们加载的小型插件文件:同目录下的 `*-probe.mjs` 和 `*-probe.yml`。harness 探针包括 `run.sh`、`terminal.sh`、`sandbox-shell.sh`、`interop-shell.sh`、`picker.sh`、`fs-routing.sh`、`missing-wsl.sh` 和 `sandbox-off.sh`,它们使用一次性 profile,其设置记录在 `test/probe/run.sh` 的文件头中。发行版探针(`substrate.sh`、`watch.sh`、`agent.sh`、`exec.sh`、`cache-write.sh`)不启动 harness:它们从发行版终端运行,并通过 `wsl.exe` 互操作传输驱动驻留 agent;`cache-write.sh` 还会自行启动一个 session runtime scope 与一个 per-command profile,以验证可写根授权。`sandbox.sh` 和 `mode.sh` 既不需要启动 harness,也不需要 profile。
150
151
 
151
152
  保持探针输出幂等。若干探针会在开始时删除自己的临时文件,因为早先运行遗留的文件会改变结果。
152
153
 
package/README.md CHANGED
@@ -43,7 +43,7 @@ Remaining prerequisites (no Node.js needed inside the distro):
43
43
  | systemd + Linger (default session sandbox) | `[boot] systemd=true` in `/etc/wsl.conf`, `wsl --shutdown`, run `loginctl enable-linger "$USER"` once; without systemd set `sessionSandbox` to `auto` or `false` |
44
44
  | Optional: `ripgrep`, `git`, `inotify-tools` | `pnpm run bootstrap <distro>` prints the install commands |
45
45
 
46
- The plugin never edits the installed `resources/app.asar`. Upgrade = install again and restart; uninstall on the Plugins page, then `~/.cache/dsh-wsl` can be deleted. Details in [docs/QUICKSTART.md](docs/QUICKSTART.md).
46
+ The plugin never edits the installed `resources/app.asar`. The sidebar **WSL environment** panel shows the installed and running plugin versions, checks the registry through the host's plugin manager, and offers a one-click upgrade when a newer stable release exists; installing again from the Plugins page remains the fallback. An upgrade takes effect after a restart, or after a page reload when the host reports HMR applied it. Uninstall on the Plugins page, then `~/.cache/dsh-wsl` can be deleted. Details in [docs/QUICKSTART.md](docs/QUICKSTART.md).
47
47
 
48
48
  ## Do I need this plugin?
49
49
 
package/SECURITY.md CHANGED
@@ -105,13 +105,27 @@ A report is still welcome if you find an escape that does not depend on interop,
105
105
  if the masked profile is bypassable from `/mnt`, or if the plugin ever reports
106
106
  `full` while interop is reachable.
107
107
 
108
- One escape of that kind is known and unfixed: a confined command can ask the
109
- distro user's own service manager to start a unit, and that unit runs outside the
110
- mount profile — a write to the distro user's home succeeds where the same write
111
- from inside the fence is refused. Masking `/mnt` does not narrow this path
112
- because it never involves interop. The socket paths and the reproduction steps are
113
- withheld until a fix ships; the finding, its verification and the deferred
114
- decision are recorded in
108
+ One escape of that kind is known and narrowed by an opt-in profile: a
109
+ confined command can ask the distro user's own service manager to start a unit,
110
+ and that unit runs outside the mount profile — a write to the distro user's home
111
+ succeeds where the same write from inside the fence is refused. Masking `/mnt`
112
+ does not narrow this path because it never involves interop. The confined rows'
113
+ (`wsl-shell`, `wsl-fs`, `fs-routing`) `socketIsolation` key masks the path when
114
+ enabled: `session-bus` binds `/dev/null` over `$XDG_RUNTIME_DIR/bus` and
115
+ `$XDG_RUNTIME_DIR/systemd/private` (so `systemd-run --user` fails inside the
116
+ profile), and `strict` also masks `/run/dbus/system_bus_socket`, the container
117
+ sockets the distro user can reach, and `/run/WSL` (the WSL interop transport);
118
+ in strict, an executable copied into the workspace still fails because `/init`
119
+ cannot reach the host bridge. The doctor's `sandbox.isolation` row reports the
120
+ effective stance and the detected surfaces. The default is `off`: the escape
121
+ remains reachable unless an operator chooses a stance, and the masks are a
122
+ user-level narrowing, not a closure — same-user `/proc` and other IPC remain,
123
+ and `enforcement` stays `partial`. The distro-wide switch is still `[interop]
124
+ enabled=false` plus `wsl.exe --shutdown`. The reproduction steps stay private; the exact
125
+ paths are listed in
126
+ [docs/CONFIGURATION.md](docs/CONFIGURATION.md#socket-isolation) because an
127
+ operator must know what the key covers. The finding, its verification and the
128
+ remaining decision are recorded in
115
129
  [docs/superpowers/value-discovery-2026-11-10.md](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/superpowers/value-discovery-2026-11-10.md)
116
130
  (E4). Report new instances through the private channel above, as with any escape.
117
131
 
package/SECURITY.zh.md CHANGED
@@ -93,11 +93,24 @@ WSL interop 启动 Windows 程序,例如 `/mnt/c/.../*.exe`。该程序在 Lin
93
93
  如果你发现不依赖 interop 的逃逸、遮蔽后的 profile 可从 `/mnt` 绕过,或插件
94
94
  在 interop 可达时报告 `full`,仍欢迎报告。
95
95
 
96
- 已知有一类逃逸尚未修复:受限命令可以请求发行版用户自己的服务管理器启动一个
97
- unit,而该 unit 在挂载 profile 之外运行——对发行版用户主目录的写入会成功,
98
- 而围栏内同样的写入会被拒绝。遮蔽 `/mnt` 不能收窄这条路径,因为它从不涉及
99
- interop。在修复发布前,socket 路径与复现步骤暂不公开;发现、验证与推迟决定
100
- 记录在
96
+ 已知有一类逃逸可被一个默认关闭的档位收窄:受限命令可以请求发行版用户自己的
97
+ 服务管理器启动一个 unit,而该 unit 在挂载 profile 之外运行——对发行版用户
98
+ 主目录的写入会成功,而围栏内同样的写入会被拒绝。遮蔽 `/mnt` 不能收窄这条
99
+ 路径,因为它从不涉及 interop。启用受限行(`wsl-shell`、`wsl-fs`、
100
+ `fs-routing`)的 `socketIsolation` 后,该路径会被遮蔽:`session-bus` 把
101
+ `/dev/null` 绑到
102
+ `$XDG_RUNTIME_DIR/bus` 与 `$XDG_RUNTIME_DIR/systemd/private`(受限 profile
103
+ 内的 `systemd-run --user` 失败),`strict` 还会遮蔽
104
+ `/run/dbus/system_bus_socket`、发行版用户可触达的容器 socket 与 `/run/WSL`
105
+ (WSL interop 传输);strict 下复制进工作区的可执行文件仍会失败,因为
106
+ `/init` 连不到 host bridge。doctor 的 `sandbox.isolation` 行报告生效档位与
107
+ 探测到的面。默认值是 `off`:除非 operator 选择档位,逃逸仍然可达;遮蔽是
108
+ 用户级收窄,不是关闭——同用户 `/proc` 与其他 IPC 仍在,`enforcement` 仍是
109
+ `partial`。整发行版开关仍是 `[interop] enabled=false` 加
110
+ `wsl.exe --shutdown`。
111
+ 复现步骤仍不公开;具体路径列在
112
+ [docs/CONFIGURATION.zh.md](docs/CONFIGURATION.zh.md#socket-isolation),因为
113
+ operator 需要知道该键覆盖什么。发现、验证与剩余决定记录在
101
114
  [docs/superpowers/value-discovery-2026-11-10.md](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/superpowers/value-discovery-2026-11-10.md)
102
115
  (E4)。与其他逃逸一样,请通过上方的私有渠道报告新实例。
103
116
 
package/SUPPORT.md CHANGED
@@ -8,7 +8,7 @@
8
8
  |---|---|
9
9
  | Operating system | Windows 10 and Windows 11 |
10
10
  | Linux side | WSL2 with at least one distro, and systemd as PID 1 with a lingering user manager (`loginctl enable-linger`) for the shipped session runtime. Set `sessionSandbox: false` on both `wsl-shell` and `wsl-fs` in the preset to keep the per-command sandbox instead |
11
- | DSH packages | `peerDependencies` declares a `0.2.2-rc.1` floor; newer versions require compatibility validation |
11
+ | DSH packages | `peerDependencies` declares a `0.2.2-rc.2` floor; newer versions require compatibility validation |
12
12
  | Plugin version | the latest published version only |
13
13
  | Node | 22.19+ (`^22.19.0`), or 24 and later (`>=24.0.0`) |
14
14
 
@@ -62,7 +62,7 @@ issue for one.
62
62
 
63
63
  ## Compatibility expectations
64
64
 
65
- The DSH peer ranges start at `0.2.2-rc.1`; development dependencies pin that
65
+ The DSH peer ranges start at `0.2.2-rc.2`; development dependencies pin that
66
66
  version exactly for testing. Cordis and Schemastery use caret peer ranges.
67
67
  The accepted range does not guarantee compatibility with every newer release:
68
68
  an upstream change can require a new release of this plugin.
package/SUPPORT.zh.md CHANGED
@@ -8,7 +8,7 @@
8
8
  |---|---|
9
9
  | 操作系统 | Windows 10 与 Windows 11 |
10
10
  | Linux 侧 | WSL2,至少一个发行版;随包的会话 runtime 需要 systemd 作为 PID 1,并启用 lingering 用户管理器(`loginctl enable-linger`)。若要在 preset 中保留逐命令沙箱,请在 `wsl-shell` 和 `wsl-fs` 上都设置 `sessionSandbox: false` |
11
- | DSH 包 | `peerDependencies` 声明 `0.2.2-rc.1` 下限;更新的版本需要兼容性验证 |
11
+ | DSH 包 | `peerDependencies` 声明 `0.2.2-rc.2` 下限;更新的版本需要兼容性验证 |
12
12
  | 插件版本 | 仅最新发布版本 |
13
13
  | Node | 22.19+(`^22.19.0`),或 24 及以后(`>=24.0.0`) |
14
14
 
@@ -54,7 +54,7 @@ https://github.com/Big-Dao/dsh-plugin-wsl-env/issues/new/choose
54
54
 
55
55
  ## 兼容性预期
56
56
 
57
- DSH peer 区间从 `0.2.2-rc.1` 开始;开发依赖为测试精确钉定该版本。Cordis 与
57
+ DSH peer 区间从 `0.2.2-rc.2` 开始;开发依赖为测试精确钉定该版本。Cordis 与
58
58
  Schemastery 使用 caret peer 区间。接受的区间并不保证与每个更新的版本兼容:
59
59
  上游变更可能需要本插件发布新版本。
60
60