dsh-plugin-wsl-env 0.17.1 → 0.18.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.
package/CHANGELOG.md CHANGED
@@ -14,6 +14,79 @@ document: the 0.1.0 entry's `design-history §` references are to
14
14
  keeps the superseded designs under the section numbers they had while they
15
15
  were part of the record.
16
16
 
17
+ ## [Unreleased]
18
+
19
+ ## [0.18.0] - 2026-11-05
20
+
21
+ Track the desktop `0.2.2-rc.1` release: the bundle layer is regenerated from
22
+ its shipped patch file, the peer floor moves to the `0.2.2-rc.1` npm line with
23
+ the peer-parity re-run the layering rule requires, and the one genuinely broken
24
+ path is documented with its operator rule.
25
+
26
+ ### Changed
27
+
28
+ - **Raised the peer floor and dev pins to the `0.2.2-rc.1` npm line, with the
29
+ peer-parity re-run the layering rule requires.** All ten `@deepseek-ai/dsh-*`
30
+ peers move to `0.2.2-rc.1` (`peerDependencies >=0.2.2-rc.1`), cordis to
31
+ `^4.1.0` with dev pins `4.1.0`, and schemastery to `^3.19.0` — the release's
32
+ own pairing. Two companion fixes rode the move: the `cordis-plugin-*` dev
33
+ pins (`*`) resolved to `1.0.x`, which cordis 4.1.0 breaks at boot (the
34
+ `internal/config` waterfall dereferences a null `parent`; both pins are now
35
+ the release's `1.1.0`), and the `pnpm-workspace.yaml`
36
+ `minimumReleaseAgeExclude` list follows the pins as pnpm rewrites it.
37
+ `src/` changes, all defensive and documented in
38
+ [PEER-PARITY.md](docs/PEER-PARITY.md): the peer's new `patchText`/
39
+ `deleteFile`/`moveFile` operations are refused honestly on the distro side
40
+ (`FS_IO_ERROR` naming the substrate gap — the inherited host implementation
41
+ would target the wrong filesystem) and routed by the usual coordinates
42
+ otherwise; `wslWritableRoots` now honors `additionalWritableRoots` under the
43
+ upstream together-grant contract (a same-distro UNC extra root is granted,
44
+ a Windows-path extra root in a distro workspace fails closed with the
45
+ peer's `SandboxInvalidRootError`). The parity table was re-walked against
46
+ the `0.2.2-rc.1` tarballs: every replicated read/edit string survived
47
+ verbatim, both declared divergences stand, and the line references were
48
+ re-recorded (`dsh-fs-local`'s `lib/index.js` grew 909 → 1048 lines).
49
+
50
+ ### Fixed
51
+
52
+ - **Adapted to the desktop `0.2.2-rc.1` release.** The `preset-wsl` row is
53
+ regenerated from the release's `standard.patch.yml` (`dsh-v0.2.2-rc.1`):
54
+ `tool-fs` pins `applyPatch: false` (the base `patchText` is the host-side
55
+ implementation and must not quietly cross the 9p share for a distro
56
+ workspace), the removed `tool-subagent-list-agents` row is dropped,
57
+ `tool-subagent` moves from `modelSelectionSettings` to
58
+ `modelSelection` + `modelDiscovery`, and `tool-plugin-manager` follows the
59
+ shipped contextual disable. No `src/` changes were needed: every peer
60
+ symbol the plugin imports survives unchanged in the release's bundled
61
+ copies (`dsh-fs-local` gained patch machinery the preset keeps disabled;
62
+ `dsh-sandbox`'s `writableRoots` now honors `additionalWritableRoots`,
63
+ matching the upstream dialect), and the compatibility audit ran against
64
+ the release's bundled peer copies. The `peerDependencies` floor against
65
+ the freshly published `0.2.2-rc.1` npm line is raised in its own
66
+ commit — the peer-parity re-run the layering rule requires — not in
67
+ this one.
68
+ - Documented the one genuinely broken path: **enabling the bundle through
69
+ the GUI on a running profile fails on app `0.2.2-rc.1`** while sessions
70
+ hold the replaced services, because cordis 4.1.0 retains a disposing
71
+ provider's registrations until its dependents drain
72
+ ([UPSTREAM-SERVICE-SWAP.md](docs/UPSTREAM-SERVICE-SWAP.md) — mechanism,
73
+ isolated repro on both version pairs, and upstream remediation
74
+ directions; [LIMITATIONS.md](docs/LIMITATIONS.md) records the
75
+ operator rule: the selection persists and a restart applies it).
76
+ Cold-boot composition is unaffected and verified against the release's
77
+ actual bundle layers.
78
+
79
+ ## [0.17.1] - 2026-11-01
80
+
81
+ ### Fixed
82
+
83
+ - **The npm package now ships the Chinese user docs** (`QUICKSTART.zh.md`,
84
+ `CONFIGURATION.zh.md`, `LIMITATIONS.zh.md` — added to the files list after
85
+ the packaging link check caught their absence from the 0.17.0 tarball), and
86
+ `package.json`'s Chinese `description` is readable again instead of
87
+ `\uXXXX` escapes (a release-script `ensure_ascii` slip; the parsed value
88
+ was always correct). No shipped-code changes.
89
+
17
90
  ## [0.17.0] - 2026-11-01
18
91
 
19
92
  ### Changed
package/README.md CHANGED
@@ -96,13 +96,13 @@ Settings live on named rows in `$DSH_HOME/profiles/<name>/cordis.patch.yml`. The
96
96
  |---|---|---|---|
97
97
  | `wsl-shell` | `distro` | `''` | distro mode; empty/`auto` follows the workspace, `default` forces WSL's default |
98
98
  | | `sandbox` | `true` | confine commands with `bubblewrap` |
99
- | | `sessionSandbox` | `true` | run the session's commands in one systemd user scope |
99
+ | | `sessionSandbox` | shipped `true` | run the session's commands in one systemd user scope |
100
100
  | | `agentBackend` | `auto` | `auto`, `native` or `shell` for the in-distro agent |
101
101
  | | `maskWindowsDrive` | `false` | hide `/mnt` from confined commands |
102
102
  | `wsl-fs` | `distro` | `''` | distro mode; empty/`auto` follows each target path |
103
103
  | | `restrictToDistro` | `true` | under a fixed distro, refuse paths that belong to another distro |
104
104
  | | `sandbox` | `true` | check confined writes against the policy |
105
- | | `sessionSandbox` | `true` | run confined writes in the session runtime |
105
+ | | `sessionSandbox` | shipped `true` | run confined writes in the session runtime |
106
106
  | | `substrate` | `agent` | in-distro agent; `share` is rejected at startup |
107
107
  | `directory-picker-wsl` | `includeHostHome` | `true` | also list the Windows home directory |
108
108
  | `subprocess-wsl` | `distro` | `''` | distro mode; empty/`auto` follows the launch directory |
package/cordis.patch.yml CHANGED
@@ -191,7 +191,7 @@
191
191
  # Generated from the shipped standard preset so the embedded plan-mode
192
192
  # section and every nested group survive byte-for-byte: this copy is
193
193
  # `packages/bundle/web-app/presets/standard.patch.yml` of the
194
- # `dsh-v0.2.1-rc.3` source tree (unchanged since `0.2.1-rc.2`), changed
194
+ # `dsh-v0.2.2-rc.1` source tree, changed
195
195
  # in exactly three ways —
196
196
  # 1. every shipped row mounts inside `wsl-env`, so the preset's tools see
197
197
  # the distro's shell and fs (the realm is declared on the group);
@@ -288,6 +288,12 @@
288
288
  disabled: true
289
289
  - id: tool-fs
290
290
  name: '@deepseek-ai/dsh-tool-fs'
291
+ config:
292
+ # Set false to drop the apply_patch tool beside edit. The
293
+ # base patchText is the host-side implementation; the distro
294
+ # substrate serves read/write/edit itself and must not have
295
+ # a patch path that quietly crosses the 9p share instead.
296
+ applyPatch: false
291
297
  - id: tool-fs-search
292
298
  name: '@deepseek-ai/dsh-tool-fs-search'
293
299
  config:
@@ -350,14 +356,13 @@
350
356
  config:
351
357
  - id: tool-subagent-control
352
358
  name: '@deepseek-ai/dsh-tool-subagent-control'
353
- - id: tool-subagent-list-agents
354
- name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
355
359
  - id: tool-subagent
356
360
  name: '@deepseek-ai/dsh-tool-subagent'
357
361
  config:
358
362
  provider: spawn
359
363
  toolName: subagent
360
- modelSelectionSettings: true
364
+ modelSelection: true
365
+ modelDiscovery: true
361
366
  - id: tool-subagent-fork
362
367
  name: '@deepseek-ai/dsh-tool-subagent'
363
368
  config:
@@ -384,7 +389,7 @@
384
389
  name: '@deepseek-ai/dsh-tool-present'
385
390
  - id: tool-plugin-manager
386
391
  name: '@deepseek-ai/dsh-plugin-manager/tools'
387
- disabled: true
392
+ disabled: !!js "!ctx.get('profileContext')"
388
393
  - id: tool-plugin-market
389
394
  name: '@deepseek-ai/dsh-plugin-market/tools'
390
395
  disabled: true
@@ -361,14 +361,15 @@ step with the checkout, and `pnpm run sync:windows` runs that script.
361
361
  | Build consistency | [`test/build-freshness.mjs`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/build-freshness.mjs) | no; it re-runs the real build and byte-compares the committed `lib/`, so it also catches an orphan there |
362
362
  | Type check | `tsc --noEmit` over `test/**` and `types/*.d.ts` (`src/` is checked by the build itself) | no |
363
363
  | Unit tests | `test/*.test.mjs` | no |
364
+ | Requirements matrix | [`scripts/check-requirements.mjs`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/scripts/check-requirements.mjs) | no; every cited test must exist and stay wired |
364
365
  | Sandbox probe | [`test/probe/sandbox.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/sandbox.sh) | no; it applies the profile arguments directly |
365
- | Harness probes | [`test/probe/run.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/run.sh), `terminal.sh`, `sandbox-shell.sh`, `interop-shell.sh`, `picker.sh`, `fs-routing.sh`, `missing-wsl.sh`, `sandbox-off.sh` | yes: Windows, WSL2, a mounted profile, and a linked checkout |
366
- | Distro probes | [`test/probe/substrate.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/substrate.sh), `watch.sh`, `agent.sh`, `exec.sh` | Windows and WSL2, but no harness boot and no profile: they run from a distro terminal with Node available, reaching `wsl.exe` through interop |
366
+ | Harness probes | [`test/probe/run.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/run.sh), `terminal.sh`, `sandbox-shell.sh`, `interop-shell.sh`, `picker.sh`, `fs-routing.sh`, `missing-wsl.sh`, `sandbox-off.sh`, `native-session.sh` | yes: Windows, WSL2, a mounted profile, and a linked checkout |
367
+ | Distro probes | [`test/probe/substrate.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/substrate.sh), `watch.sh`, `agent.sh`, `exec.sh`, `session-sandbox.sh`, `gui-preview.sh`, `file-reference-9p.sh` | Windows and WSL2, but no harness boot and no profile: they run from a distro terminal with Node available, reaching `wsl.exe` through interop |
367
368
  | Host probe | [`test/probe/mode.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/mode.sh) | Windows Node, no harness |
368
- | Probe plugins | the `*-probe.mjs` and `*-probe.yml` files in `test/probe/` | loaded by the scripts above |
369
+ | Probe plugins | the `*-probe.mjs` and `*-probe.yml` files in `test/probe/` (plus standalone measurers such as `gui-preview.mjs`, `native-session.mjs`, `fs-probe.mjs`, `fs-queue.mjs`) | loaded or invoked by the scripts above |
369
370
 
370
- `pnpm test` runs `lint:style`, `lint:links`, `test:syntax`, `lint:build`,
371
- `lint:types` and `test:unit`, in that order.
371
+ `pnpm test` runs `lint:style`, `lint:links`, `lint:requirements`,
372
+ `test:syntax`, `lint:build`, `lint:types` and `test:unit`, in that order.
372
373
  [`test/probe/run-all-when-closed.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/run-all-when-closed.sh)
373
374
  waits for the app to exit and then runs the whole real-machine suite once —
374
375
  `--include-fs` prepends `run.sh`.
@@ -5,7 +5,7 @@ Measured evidence for the support tiers in [`ROADMAP-1.0.md`](ROADMAP-1.0.md)
5
5
  (x86_64, Windows 11, WSL 2, kernel 6.18) on **2026-10-26**, with the probe
6
6
  suite in [`test/probe/`](https://github.com/Big-Dao/dsh-plugin-wsl-env/tree/main/test/probe/) run from inside each distro against a
7
7
  fresh `--depth 1` clone. The aarch64 native agent is additionally executed per
8
- push under qemu in CI — see the `native packages` job in
8
+ push under qemu in CI — see the `native-package` job in
9
9
  [`.github/workflows/ci.yml`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/.github/workflows/ci.yml); VM-only by
10
10
  decision — see "Scope decisions" below.
11
11
 
@@ -217,6 +217,27 @@ gives the `visible` behavior.
217
217
  When `interopVisibility` is set, it takes precedence over
218
218
  `maskWindowsDrive`.
219
219
 
220
+ ### Three scenarios across four surfaces
221
+
222
+ What a setting changes depends on which surface acts. Confined commands run
223
+ in the `wsl-shell` sandbox; confined writes are checked by the `wsl-fs`
224
+ write sandbox; unrestricted file reads go through the shared read agent and
225
+ are not sandbox-governed; a Windows-side host operation is anything that
226
+ ends up executing on Windows.
227
+
228
+ | Surface | `visible` (default) | `masked` | distro-level `enabled=false` |
229
+ |---|---|---|---|
230
+ | Confined command (`wsl-shell`) | reads Windows files and launches Windows executables under `/mnt` | `/mnt` is an empty tmpfs in the profile: path operations under it fail | interop is refused by the distro itself; `/mnt` visibility still follows the mask above |
231
+ | Confined write (`wsl-fs`) | the write policy checks the target; `/mnt` visibility plays no role | the same mask applies to the write profile | unchanged — the write boundary was never interop-dependent |
232
+ | Unrestricted read (shared read agent) | reads `/mnt` freely | **not covered**: the mask lives in confined profiles only, the read agent still sees `/mnt` | **not governed by the plugin** |
233
+ | Windows-side host operation | reachable through `/mnt` | **still reachable**: `binfmt_misc` dispatches by file content, so a Windows executable copied into the workspace runs anyway (`enforcement: partial`) | the only real closure — and it is a manual `wsl.conf` step |
234
+
235
+ Masking affects real workflows on purpose: a script living under a Windows
236
+ path (a checkout under `/mnt/c`, tools on the Windows `PATH`) can no longer
237
+ be read or run by confined commands — move it into the distro or grant the
238
+ visible stance. Masking never deletes anything: the tmpfs shadows the view
239
+ inside one confined profile; the files on `/mnt/c` are untouched.
240
+
220
241
  Masking narrows access; it does not close interop. WSL can still run a Windows
221
242
  executable written into the workspace because `binfmt_misc` dispatches by file
222
243
  content. Enforcement therefore remains `partial`, and results report
@@ -61,7 +61,7 @@ profile 层;检测到时会打印应使用的块。`--out` 会整体替换目
61
61
  | `timeoutMs` / `maxTimeoutMs` | `120000` / `600000`(shipped) | 默认的单次调用超时,以及一次调用可请求的最大超时。 |
62
62
  | `wslPath` | `wsl.exe` | `wsl.exe` 的路径。 |
63
63
  | `hostCwd` | 未设置 | `wsl.exe` 进程的 Windows 工作目录。可用时默认为 `%SystemRoot%`。 |
64
- | `forwardEnv` | `[]` | 额外通过 `WSLENV` 转发的宿主环境变量名。见 [环境变量转发](#environment-forwarding)。 |
64
+ | `forwardEnv` | `[]` | 额外通过 `WSLENV` 转发的宿主环境变量名。见 [环境变量转发](#环境变量转发)。 |
65
65
 
66
66
  ### `wsl-fs`
67
67
 
@@ -213,6 +213,25 @@ unset _fnm_env
213
213
  设置了 `interopVisibility` 时,它优先于
214
214
  `maskWindowsDrive`。
215
215
 
216
+ ### 三个场景 × 四个作用面
217
+
218
+ 设置改变什么,取决于哪个面在起作用。受限命令运行在 `wsl-shell`
219
+ 沙箱中;受限写入由 `wsl-fs` 的写入沙箱检查;非受限文件读取走共享读
220
+ agent,不受沙箱管辖;Windows 侧宿主操作指最终在 Windows 上执行的任何
221
+ 东西。
222
+
223
+ | 作用面 | `visible`(默认) | `masked` | 发行版级 `enabled=false` |
224
+ |---|---|---|---|
225
+ | 受限命令(`wsl-shell`) | 可读 Windows 文件、经 `/mnt` 启动 Windows 可执行文件 | profile 中 `/mnt` 是空 tmpfs:其下的路径操作失败 | interop 由发行版自身拒绝;`/mnt` 可见性仍遵循上方的遮蔽设置 |
226
+ | 受限写入(`wsl-fs`) | 写入策略检查目标;`/mnt` 可见性不起作用 | 同样的遮蔽作用于写入 profile | 不变——写入边界从来不依赖 interop |
227
+ | 非受限读取(共享读 agent) | 自由读 `/mnt` | **不在覆盖范围**:遮蔽只存在于受限 profile 中,读 agent 仍能看到 `/mnt` | **不归插件管辖** |
228
+ | Windows 侧宿主操作 | 可经 `/mnt` 到达 | **仍然可达**:`binfmt_misc` 按文件内容分发,被拷进工作区的 Windows 可执行文件照样运行(`enforcement: partial`) | 唯一真正的关闭手段——且是手工的 `wsl.conf` 步骤 |
229
+
230
+ 遮蔽刻意影响真实工作流:放在 Windows 路径下的脚本(`/mnt/c` 下的
231
+ 检出、Windows `PATH` 上的工具)不再能被受限命令读取或执行——把它移进
232
+ 发行版,或改用 `visible` 姿态。遮蔽不会删除任何东西:tmpfs 只遮蔽单个
233
+ 受限 profile 内的视图,`/mnt/c` 上的文件原样保留。
234
+
216
235
  遮蔽只是收窄访问,并不关闭 interop。WSL 仍能运行被写入工作区的
217
236
  Windows 可执行文件,因为 `binfmt_misc` 按文件内容分发。
218
237
  因此强制级别仍是 `partial`,结果会报告 `windowsDrive: 'masked'`。
@@ -84,8 +84,10 @@ operations never use the 9p share.
84
84
  preflight sweeps stale scopes on the next WSL session (never another live
85
85
  session's).
86
86
  - **The sandbox does not govern WSL interop** — reported as `enforcement: partial`.
87
- `maskWindowsDrive` narrows `/mnt` but is not a closure; distro-level
88
- `[interop] enabled=false` in `wsl.conf` must be configured separately.
87
+ `maskWindowsDrive` and `interopVisibility` narrow `/mnt` but are not a closure;
88
+ even `interopVisibility: "disabled"` only produces the `wsl.conf`
89
+ `[interop] enabled=false` remedy (printed by `doctor`) — the distro-level
90
+ setting must still be applied manually.
89
91
  [ARCHITECTURE.md](ARCHITECTURE.md#reported-enforcement).
90
92
  - **`bubblewrap` must be installed**, or both providers fail with the install
91
93
  command; a session-start preflight surfaces the same text as an advisory warning.
@@ -97,7 +99,7 @@ operations never use the 9p share.
97
99
 
98
100
  Commands run as `<shell> -lc <command>` — login (profile scripts sourced, so version
99
101
  managers work) and **non-interactive** (no prompt/plugin output in the model's
100
- streams).
102
+ streams). With `loginShell: false` the login flag is dropped (`<shell> -c <command>`).
101
103
 
102
104
  - **`~/.zshrc` / `~/.bashrc` are never read.** Move machine-level PATH setup
103
105
  (`fnm`, nvm, cargo) into `~/.zprofile` or `~/.zshenv`; keep prompts and completion
@@ -150,6 +152,9 @@ streams).
150
152
  app. Two alternatives: the doctor's `git.win-safe` probe reports the state, and a
151
153
  machine **without** Windows git needs nothing — the provider routes discovery into
152
154
  the distro and translates the output into UNC form.
155
+ - **Colon-separated multi-directory `GIT_*` values pass through untranslated.**
156
+ The git environment translation rewrites single Windows directory values; a
157
+ colon-separated list (no current caller sets one) is forwarded as-is.
153
158
  - **A NEW tab's title reads `WSL`** whatever it runs — the controller titles from the
154
159
  composition's profile before the provider rewrites the launch, and a plugin cannot
155
160
  correct the default ([UPSTREAM-TERMINAL-TITLE.md](UPSTREAM-TERMINAL-TITLE.md)).
@@ -162,6 +167,21 @@ streams).
162
167
  close-by-hand. Windows-folder host terminals keep the shipped no-reclamation
163
168
  behaviour.
164
169
 
170
+ ## Enabling the plugin on a running profile
171
+
172
+ - **A GUI enable of this bundle can fail on a busy profile, and a restart
173
+ applies it.** The three root-plane takeovers (`subprocess`, `fs`,
174
+ `directoryPicker`) replace shipped services under the same names. On
175
+ app `0.2.2-rc.1` (cordis 4.1.0), a disposing provider keeps its service
176
+ registration until every dependent releases, so the replacements
177
+ collide with the shipped providers while sessions are live and the
178
+ enable reports them as failed. The selection is persisted either way;
179
+ **restarting the app loads the plugin** (the cold composition is
180
+ correct). Closing sessions before enabling usually lets the hot path
181
+ succeed — with no dependents the shipped providers release inside the
182
+ recomposition. Mechanism and repro:
183
+ [UPSTREAM-SERVICE-SWAP.md](UPSTREAM-SERVICE-SWAP.md).
184
+
165
185
  ## Host "Open in app"
166
186
 
167
187
  - **Opening VS Code from "Open in app" can fail independently of this plugin** — the
@@ -79,8 +79,10 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
79
79
  按命令形态。应用硬崩溃可能留下过期的 `dsh-wsl-*.scope`;预检会在下一个
80
80
  WSL 会话时清扫过期 scope(从不清扫其他活跃会话的)。
81
81
  - **沙箱不管辖 WSL interop** —— 上报为 `enforcement: partial`。
82
- `maskWindowsDrive` 收窄 `/mnt` 但不是关闭;发行版级 `wsl.conf` 中的
83
- `[interop] enabled=false` 需要另行配置。
82
+ `maskWindowsDrive` 和 `interopVisibility` 收窄 `/mnt` 但不是关闭;即使是
83
+ `interopVisibility: "disabled"` 也只是给出 `wsl.conf` 中
84
+ `[interop] enabled=false` 的补救命令(由 `doctor` 打印)——发行版级设置
85
+ 仍需手工执行。
84
86
  [ARCHITECTURE.md](ARCHITECTURE.md#reported-enforcement)。
85
87
  - **必须安装 `bubblewrap`**,否则两个提供者都会带着安装命令失败;
86
88
  会话启动预检会以建议性警告的形式给出同样的文本。
@@ -91,6 +93,7 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
91
93
 
92
94
  命令以 `<shell> -lc <command>` 运行——登录 shell(会 source profile 脚本,
93
95
  因此版本管理器可用)且**非交互**(模型的输出流中没有提示符/插件输出)。
96
+ 设置 `loginShell: false` 后去掉登录旗标(`<shell> -c <command>`)。
94
97
 
95
98
  - **`~/.zshrc` / `~/.bashrc` 永远不会被读取。** 把机器级的 PATH 设置
96
99
  (`fnm`、nvm、cargo)移进 `~/.zprofile` 或 `~/.zshenv`;提示符和补全
@@ -142,6 +145,8 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
142
145
  应用。两个替代方案:doctor 的 `git.win-safe` 探针可报告该状态;而
143
146
  **没有** Windows git 的机器什么都不用做——提供者把发现请求路由进
144
147
  发行版,并把输出转写成 UNC 形式。
148
+ - **冒号分隔的多目录 `GIT_*` 值不做转写直接透传。** git 环境转写只改写单个
149
+ Windows 目录值;冒号分隔的列表(当前没有调用方设置这种形态)原样转发。
145
150
  - **NEW 标签页的标题显示 `WSL`**,无论它实际运行什么——控制器在提供者
146
151
  改写启动命令之前就按 composition 的 profile 命名了,而插件无法纠正
147
152
  这个默认值([UPSTREAM-TERMINAL-TITLE.md](UPSTREAM-TERMINAL-TITLE.md))。
@@ -159,3 +164,14 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
159
164
  宿主带着 `ELECTRON_RUN_AS_NODE=1` 运行,启动器会继承它,于是
160
165
  `Code.exe` 以 Node 身份启动并以退出码 1 结束。不属于本仓库管:
161
166
  [UPSTREAM-OPEN-IN-APP.md](UPSTREAM-OPEN-IN-APP.md)。
167
+
168
+ ## 在运行中的 profile 上启用本插件
169
+
170
+ - **在繁忙的 profile 上通过 GUI 启用本 bundle 可能失败,重启应用即可生效。**
171
+ 三个根面接管行(`subprocess`、`fs`、`directoryPicker`)以同名替换随包服务。
172
+ 在应用 `0.2.2-rc.1`(cordis 4.1.0)上,正在销毁的提供者在全部依赖方释放之前
173
+ 一直持有服务注册,因此会话存活期间替换行会与随包提供者相撞,启用操作将它们
174
+ 报告为失败。无论如何选择都会持久化;**重启应用即可加载插件**(冷启动组合是
175
+ 正确的)。启用前先关闭会话通常能让热路径成功——没有依赖方时,随包提供者会在
176
+ 重组期间释放。机制与复现:
177
+ [UPSTREAM-SERVICE-SWAP.md](UPSTREAM-SERVICE-SWAP.md)。
@@ -7,20 +7,25 @@ same refusal dialect on both substrates. The **read path** holds end to end;
7
7
  the **edit path** carries two declared divergences, listed at the end. This
8
8
  file records the verification against the real peers.
9
9
 
10
- - Peers: `@deepseek-ai/dsh-fs-local@0.2.1-rc.3` (the exact version the
11
- devDependencies pin, and the floor the peer range `>=0.2.1-rc.3` was
12
- verified against), plus `@deepseek-ai/dsh-fs@0.2.1-rc.3` for the
10
+ - Peers: `@deepseek-ai/dsh-fs-local@0.2.2-rc.1` (the exact version the
11
+ devDependencies pin, and the floor the peer range `>=0.2.2-rc.1` was
12
+ verified against), plus `@deepseek-ai/dsh-fs@0.2.2-rc.1` for the
13
13
  `FsVersion` brand the local package imports. Divergence 2 is measured
14
- against a third peer, `@deepseek-ai/dsh-bash-local@0.2.1-rc.3` — the shell
14
+ against a third peer, `@deepseek-ai/dsh-bash-local@0.2.2-rc.1` — the shell
15
15
  executor carries the collect-budget/spill machinery; `spill` and
16
16
  `maxSpillBytes` do not appear in `dsh-fs-local` at all.
17
- - The `0.2.1-rc.3` move leaves every line reference below intact: all three
18
- peers' shipped `lib/index.js` are **byte-identical** to the `0.2.1-rc.2`
19
- ones (`cmp` clean; `dsh-fs-local`'s is still 909 lines), so only the
20
- tarballs' digests changed — upstream shipped the manifests' version fields
21
- and nothing else in these packages. `dsh-fs@0.2.1-rc.3` still has no
22
- `./invariant` export subpath (dropped back at `0.2.1-rc.2`); this plugin
23
- imports neither it nor `dsh-invariants`.
17
+ - The `0.2.2-rc.1` move grows `dsh-fs-local`'s shipped `lib/index.js` from 909
18
+ to 1048 lines (patch/move/delete operations, `expandHomePrefix`, `writeIoError`,
19
+ multi-key locks), so every line reference below was re-walked on 2026-11-05.
20
+ Every replicated string survived verbatim; the fsio **read path** holds end
21
+ to end and the **edit path** carries the same two declared divergences, listed
22
+ at the end. The release also added a `FS_ERROR_CODES` const export with two
23
+ new codes (`FS_PATCH_MISMATCH`, `FS_SAME_TARGET`) for operations this plugin
24
+ does not serve — see the new-peer-operations section at the end.
25
+ `dsh-bash-local@0.2.2-rc.1`'s `lib/index.js` is byte-identical to
26
+ `0.2.1-rc.3`'s (only manifests and locale files changed), so its references
27
+ stand. `dsh-fs@0.2.2-rc.1` still has no `./invariant` export subpath; this
28
+ plugin imports neither it nor `dsh-invariants`.
24
29
  - What "not imported" means: the peer's **fsio module** is not reachable from
25
30
  the package's exports, so `lib/fsio-text.js` reimplements it and imports
26
31
  nothing from it (the export is proposed in `docs/UPSTREAM-FSIO-EXPORT.md`).
@@ -42,17 +47,19 @@ wc -l package/lib/index.js # expect 909
42
47
  ```
43
48
 
44
49
  The tarballs this audit compared, by content — the same values
45
- `npm view <pkg>@0.2.1-rc.3 dist.integrity` reports:
50
+ `npm view <pkg>@0.2.2-rc.1 dist.integrity` reports (re-recorded 2026-11-05;
51
+ the `0.2.1-rc.3` values they supersede are in git history):
46
52
 
47
53
  ```
48
- @deepseek-ai/dsh-fs-local@0.2.1-rc.3 sha512-bB2CwCqvYAdAKl28+5XXMRRq1NBtRmYX3wNOpJ2JlGBm7uj2Aix9Vl9rFig4AQcXXd5Bk738b5KNsOIkbXy+XQ==
49
- @deepseek-ai/dsh-fs@0.2.1-rc.3 sha512-tENLWe471WlAXMc13J4cns8xU6lFyu1smwpkSKR85vhGr6FyWZhTlpVohZYm66LbwKTmSWiDhd9Urk7VxN9B9w==
54
+ @deepseek-ai/dsh-fs-local@0.2.2-rc.1 sha512-tibC9z4YJx7C6DhiWmTc9AYeF+GSh22XVaaDdumwTgBgvFuiNITNGn3E0DTL3skugB3MKnvAvrjybdveNQ7MmQ==
55
+ @deepseek-ai/dsh-fs@0.2.2-rc.1 sha512-sbr+u+3dG4KAUdY7FoMLJg/gSE39gvgBMwmvVeR/6acNrlHaIducvnuxRUYAq2V0+NOVnG8fA9sdfBq2uGAfUw==
50
56
  ```
51
57
 
52
58
  Each row of the table below names the peer's `lib/index.js` line and the
53
59
  literal both sides must produce. Verified 2026-10-03; the read/edit split
54
60
  re-verified 2026-10-06; the whole table re-checked against `0.2.1-rc.2`,
55
- 2026-10-17 and against `0.2.1-rc.3`, 2026-10-26.
61
+ 2026-10-17, against `0.2.1-rc.3`, 2026-10-26, and against `0.2.2-rc.1`,
62
+ 2026-11-05 (line numbers shifted; strings identical).
56
63
 
57
64
  ## Verdict
58
65
 
@@ -69,22 +76,22 @@ declared extensions, listed at the end.
69
76
 
70
77
  | Item | Evidence (peer `lib/index.js`) | Ours |
71
78
  |---|---|---|
72
- | `normalizeLineEndings` | `:584` `content.replaceAll("\r\n", "\n")` | identical |
73
- | `detectLineEndings` | `:587` 4096-char sample; `crlf > lf - crlf` | identical |
74
- | `restoreLineEndings` | `:600` LF unchanged; CRLF re-normalizes then `\n` → `\r\n` | identical (`replaceAll` vs `split/join` — equivalent) |
75
- | occurrence counting | `:603` non-overlapping left-to-right | `split(needle).length - 1` — equivalent |
76
- | `applyLiteralEdit` | `:698` empty needle, not-found, and ambiguous refusals; single-pass `split/join` without rescanning | identical |
77
- | edit refusal strings | `:700`, `:703`, `:704` — `old_string must be a non-empty string` (`FS_EDIT_NOT_FOUND`); ``old_string was not found in "${displayPath}"``; ``old_string matched ${n} times in "${displayPath}"; provide a more specific old_string or set replace_all to true`` (`FS_AMBIGUOUS_EDIT`) | identical |
78
- | invalid UTF-8, read path | `:328`, `:331` — ``cannot ${verb} "${displayPath}": invalid UTF-8 text`` (`FS_NOT_TEXT`), verb `read` | identical (the edit path's verb differs; see 4) |
79
- | binary detection, read path | `:369` (guard at `:373`), stream at `:457` — 8192-byte sample, NUL check; ``cannot read "${displayPath}": binary file`` (`FS_NOT_TEXT`) | identical — both accept a NUL at offset 8500, past the sample; the edit path's bound differs, see 4 |
80
- | size caps | `:389`, `:400` — ``cannot read "${displayPath}": ${size} bytes exceeds the ${maxBytes}-byte limit`` and ``content exceeds the ${maxBytes}-byte limit`` (`FS_TOO_LARGE`) | identical |
81
- | `writeText` guards | `:867`, `:869-870`, `:871` — not-regular (`FS_NOT_REGULAR_FILE`), `file no longer exists` / `file changed since it was read` (`FS_STALE_VERSION`), ``cannot overwrite existing "${displayPath}" without reading it first`` (`FS_NOT_OBSERVED`) | identical |
82
- | `editText` guards — not-regular and stale version | `:887`, `:888` — ``cannot edit "${displayPath}": not a regular file`` (`FS_NOT_REGULAR_FILE`); `file changed since it was read` (`FS_STALE_VERSION`) when the expected version differs | identical |
83
- | `editText` guards — missing file | `:886` — one refusal for every caller: `file changed since it was read` (`FS_STALE_VERSION`), with or without an expected version | **diverges by design** — we split on the caller's evidence: with an expected version `file no longer exists` (`FS_STALE_VERSION`), without one `file does not exist` (`FS_NOT_FOUND`). See 5 |
84
- | `listDir` refusal | `:296` — ``cannot list "${displayPath}": not a directory`` (`FS_NOT_DIRECTORY`) | identical |
85
- | diff-basis gate | `:872` — `existing !== null && Buffer.byteLength(content) < diffBasisMaxBytes` — keyed on the NEW content's size, `null` above the cap | identical — the gate's new-size keying is inherited by design, not a divergence |
86
- | outcome shapes | `:876`, `:905` — `operation: "update" \| "create"`, the `missing:${targetKey}` sentinel version, `before`/`after` | identical |
87
- | version join | `:145` — `` `${info.dev}:${info.ino}:${info.size}:${info.mtimeNs}:${info.ctimeNs}` `` (branded by `dsh-fs`'s `FsVersion`) | `versionOf` — identical shape |
79
+ | `normalizeLineEndings` | `:628` `content.replaceAll("\r\n", "\n")` | identical |
80
+ | `detectLineEndings` | `:630` 4096-char sample; `crlf > lf - crlf` | identical |
81
+ | `restoreLineEndings` | `:643` LF unchanged; CRLF re-normalizes then `\n` → `\r\n` | identical (`replaceAll` vs `split/join` — equivalent) |
82
+ | occurrence counting | `:650` non-overlapping left-to-right | `split(needle).length - 1` — equivalent |
83
+ | `applyLiteralEdit` | `:741` empty needle, not-found, and ambiguous refusals; single-pass `split/join` without rescanning | identical |
84
+ | edit refusal strings | `:743`, `:746`, `:747` — `old_string must be a non-empty string` (`FS_EDIT_NOT_FOUND`); ``old_string was not found in "${displayPath}"``; ``old_string matched ${n} times in "${displayPath}"; provide a more specific old_string or set replace_all to true`` (`FS_AMBIGUOUS_EDIT`) | identical |
85
+ | invalid UTF-8, read path | `:343` — ``cannot ${verb} "${displayPath}": invalid UTF-8 text`` (`FS_NOT_TEXT`), verb `read` | identical (the edit path's verb differs; see 4) |
86
+ | binary detection, read path | `:99`/`:387` (sample const, guard), stream at `:471-473` — 8192-byte sample, NUL check; ``cannot read "${displayPath}": binary file`` (`FS_NOT_TEXT`) | identical — both accept a NUL at offset 8500, past the sample; the edit path's bound differs, see 4 |
87
+ | size caps | `:403`, `:414` — ``cannot read "${displayPath}": ${size} bytes exceeds the ${maxBytes}-byte limit`` and ``content exceeds the ${maxBytes}-byte limit`` (`FS_TOO_LARGE`) | identical |
88
+ | `writeText` guards | `:505`, `:506-508` — not-regular (`FS_NOT_REGULAR_FILE`), `file no longer exists` / `file changed since it was read` (`FS_STALE_VERSION`) via `writeTarget` at `:1021-1025`, ``cannot overwrite existing "${displayPath}" without reading it first`` (`FS_NOT_OBSERVED`) | identical |
89
+ | `editText` guards — not-regular and stale version | `:938`, `:939` — ``cannot edit "${displayPath}": not a regular file`` (`FS_NOT_REGULAR_FILE`); `file changed since it was read` (`FS_STALE_VERSION`) when the expected version differs (`requireFile` at `:1030-1032`) | identical |
90
+ | `editText` guards — missing file | `:937` — one refusal for every caller: `file changed since it was read` (`FS_STALE_VERSION`), with or without an expected version | **diverges by design** — we split on the caller's evidence: with an expected version `file no longer exists` (`FS_STALE_VERSION`), without one `file does not exist` (`FS_NOT_FOUND`). See 5 |
91
+ | `listDir` refusal | `:310` — ``cannot list "${displayPath}": not a directory`` (`FS_NOT_DIRECTORY`) | identical |
92
+ | diff-basis gate | `:920` — `existing !== null && Buffer.byteLength(content) < diffBasisMaxBytes` — keyed on the NEW content's size, `null` above the cap (the move path inherits the same keying at `:983`/`:997`) | identical — the gate's new-size keying is inherited by design, not a divergence |
93
+ | outcome shapes | `:927`, `:992` — `operation: "update" \| "create"`, the `missing:${targetKey}` sentinel version (`:1044`), `before`/`after` | identical |
94
+ | version join | `:148` — `` `${info.dev}:${info.ino}:${info.size}:${info.mtimeNs}:${info.ctimeNs}` `` (branded by `dsh-fs`'s `FsVersion`) | `versionOf` — identical shape |
88
95
 
89
96
  ## Deliberate divergences (declared, not drift)
90
97
 
@@ -104,10 +111,10 @@ declared extensions, listed at the end.
104
111
  dialect, but a divergence all the same, so it is declared: an edit refused
105
112
  for its bytes reads ``cannot read "…": binary file`` or
106
113
  ``cannot read "…": invalid UTF-8 text`` — verb `read`, where the peer's
107
- `readForEdit` (`lib/index.js:621`) says ``cannot edit "…": …``. The NUL
114
+ `readForEdit` (`lib/index.js:664`) says ``cannot edit "…": …``. The NUL
108
115
  check is likewise the read path's 8192-byte sample
109
116
  (`src/fsio-agent.ts:377-384`, guard at `:380`), where the peer scans the
110
- whole buffer (`lib/index.js:625`): a file whose first 8192 bytes are clean
117
+ whole buffer (`lib/index.js:668`): a file whose first 8192 bytes are clean
111
118
  but that carries a NUL later is edited by us and refused by the peer.
112
119
  Measured on a 9000-byte fixture with a NUL at offset 8500 — ours `EDITED`,
113
120
  the peer `FS_NOT_TEXT: cannot edit "…"`.
@@ -117,8 +124,43 @@ declared extensions, listed at the end.
117
124
  behind it names a file that never answered the stat, so it takes the read
118
125
  path's missing-file dialect (`cannot edit "…": file does not exist`,
119
126
  `FS_NOT_FOUND`). The peer throws `file changed since it was read`
120
- (`FS_STALE_VERSION`, `lib/index.js:886`) for both. Pinned by
121
- `test/fs-substrate.test.mjs`.
127
+ (`FS_STALE_VERSION`, `lib/index.js:937` via `requireFile` at `:1030`) for
128
+ both. Pinned by `test/fs-substrate.test.mjs`.
129
+
130
+ ## The peer's 0.2.2-rc.1 operations: declared gap, refused at the provider
131
+
132
+ `0.2.2-rc.1` added three operations to the peer's `FileSystem` base —
133
+ `patchText` (hunks via the new `@deepseek-ai/dsh-fs-patch`, refusal
134
+ `FS_PATCH_MISMATCH` at `lib/index.js:1036`), `deleteFile`, and `moveFile`
135
+ (same-target refusal `FS_SAME_TARGET`). The agent substrate serves read,
136
+ write and edit only; implementing these would mean a patch-hunks wire op and
137
+ a delete/move pair in the resident protocol, which is substrate work, not
138
+ parity drift. What the release makes load-bearing is that the operations now
139
+ exist on the base class this plugin extends: an inherited call with a distro
140
+ target would run the **host** implementation against a same-named Windows
141
+ path (or refuse with a host-dialect `FS_NOT_FOUND` naming the wrong world).
142
+
143
+ So the providers refuse honestly instead of inheriting:
144
+ `WslFileSystem.patchText`/`deleteFile`/`moveFile` (`src/index.ts`) throw
145
+ `FS_IO_ERROR` naming the substrate's gap, and `WslRoutingFileSystem`
146
+ (`src/fs-routing.ts`) routes by the same coordinate rule as `editText` — a
147
+ distro-side endpoint reaches the refusing backend, two Windows endpoints keep
148
+ the inherited host implementation. The shipped preset disables the patch
149
+ tool beside edit (`applyPatch: false` in `cordis.patch.yml`), so no
150
+ model-facing path reaches the refusal today; the overrides exist because the
151
+ peer's own consumers may. Pinned by `test/composition.test.mjs` (distro
152
+ refusals and a host-side `moveFile` round trip). Peer-side mechanics for the
153
+ record: `patchText` re-reads via the whole-buffer `readForEdit`, applies
154
+ `applyHunks`, and publishes through the same atomic write — so divergence 4's
155
+ binary/UTF-8 dialect carries over to the peer's patch path too.
156
+
157
+ A related `0.2.2-rc.1` surface change lands in the sandbox vocabulary:
158
+ `SandboxExecutionPolicy.additionalWritableRoots` and the
159
+ `workspaceWritableRoots` derivation (`roots.js`), whose together-grant
160
+ contract this backend honors in `wslWritableRoots` (`src/index.ts`) — a
161
+ same-distro UNC extra root is granted as-is; a Windows-path extra root in a
162
+ distro workspace fails closed with the peer's `SandboxInvalidRootError`,
163
+ because the grant cannot be enforced there without lying about the mode.
122
164
 
123
165
  ## Maintenance
124
166
 
@@ -26,7 +26,7 @@ From a Windows PowerShell where the DSH CLI is available:
26
26
 
27
27
  ```powershell
28
28
  dsh plugin --profile <profile> add dsh-plugin-wsl-env
29
- # 若解析到旧版本(发布当天的元数据缓存),显式指定:
29
+ # if it resolves to a stale version (same-day registry metadata cache), pin it:
30
30
  # dsh plugin --profile <profile> add dsh-plugin-wsl-env@<latest>
31
31
  dsh --profile <profile> --dump-config # the plugin rows must be there
32
32
  ```
package/docs/README.zh.md CHANGED
@@ -72,7 +72,7 @@ dsh --profile wsl # 启动
72
72
  wsl.exe -d <发行版> -u root -- apt-get install -y bubblewrap
73
73
  ```
74
74
 
75
- 在插件检出目录中,`pnpm run bootstrap <发行版>` 检查四个发行版工具,并按包管理器打印安装命令;加 `--install` 仅在缺少 bubblewrap 时执行该命令。若只缺少其他工具,请自行执行打印的命令。
75
+ 在插件检出目录中,`pnpm run doctor` 是一键环境体检:Windows/WSL 版本、发行版及其 shell、bubblewrap 可用性、systemd / user manager / Linger、可选工具、peer 版本、agent 缓存、新 agent 握手、残留会话 scope 和已知的 profile 补丁陷阱。每个失败都打印一条可复制的处理办法;`--json` 供脚本使用,`--fix` 清理残留 scope(安装包需要 `--fix --install` 并显式确认)。`pnpm run diagnose` 是其只读别名。`pnpm run bootstrap <发行版>` 仍是较窄的工具安装助手:检查四个发行版工具,并按包管理器打印安装命令;加 `--install` 仅在缺少 bubblewrap 时执行该命令。若只缺少其他工具,请自行执行打印的命令。
76
76
 
77
77
  升级:再次执行 `add` 命令。卸载:`dsh plugin --profile wsl remove dsh-plugin-wsl-env`;之后可删除 `~/.cache/dsh-wsl`。如果你为了恢复预览在 profile 里加过 `workspace-files-wsl` 的临时覆盖,升级后请删掉:插件不再挂载该行。
78
78
 
@@ -94,13 +94,13 @@ wsl.exe -d <发行版> -u root -- apt-get install -y bubblewrap
94
94
  |---|---|---|---|
95
95
  | `wsl-shell` | `distro` | `''` | 发行版模式;空/`auto` 跟随工作区,`default` 强制 WSL 默认 |
96
96
  | | `sandbox` | `true` | 用 `bubblewrap` 约束命令 |
97
- | | `sessionSandbox` | `true` | 会话命令跑在同一个 systemd user scope 中 |
97
+ | | `sessionSandbox` | 随包 `true` | 会话命令跑在同一个 systemd user scope 中 |
98
98
  | | `agentBackend` | `auto` | 发行版内 agent:`auto`、`native` 或 `shell` |
99
99
  | | `maskWindowsDrive` | `false` | 让受限命令看不到 `/mnt` |
100
100
  | `wsl-fs` | `distro` | `''` | 发行版模式;空/`auto` 跟随每个目标路径 |
101
101
  | | `restrictToDistro` | `true` | 固定发行版(`default` 或名字)时拒绝属于其他发行版的路径 |
102
102
  | | `sandbox` | `true` | 按策略检查受限写入 |
103
- | | `sessionSandbox` | `true` | 受限写入跑在会话 runtime 中 |
103
+ | | `sessionSandbox` | 随包 `true` | 受限写入跑在会话 runtime 中 |
104
104
  | | `substrate` | `agent` | 发行版内 agent;`share` 在启动时被拒绝 |
105
105
  | `directory-picker-wsl` | `includeHostHome` | `true` | 同时列出 Windows 家目录 |
106
106
  | `subprocess-wsl` | `distro` | `''` | 发行版模式;空/`auto` 跟随启动目录 |
@@ -149,6 +149,7 @@ wsl preset(每个会话)
149
149
  | 会话在第一条命令前就被拒绝 | 启用 systemd 和 linger,或在 `wsl-shell`、`wsl-fs` 上设置 `sessionSandbox: false` |
150
150
  | 发行版内 `glob`、`grep` 很慢 | 运行 `pnpm run bootstrap <发行版>`,使用打印的安装命令安装 `ripgrep` |
151
151
  | `dsh plugin add` 没有输出 | 插件已安装;这是成功 |
152
+ | 对 `wsl-shell`/`wsl-fs` 的 profile 补丁不生效 | 这些行嵌套在 `preset-wsl` 里。运行 `pnpm run preset --check <补丁>`;它会失败并输出需要粘贴的完整块 |
152
153
  | 改了 `lib/` 但不生效 | 运行 `pnpm run sync:windows`,然后重启应用 |
153
154
 
154
155
  更多错误码和拒绝原因见 [docs/ARCHITECTURE.md](ARCHITECTURE.md#error-codes),插件不做的事见 [docs/LIMITATIONS.md](LIMITATIONS.md)。
package/docs/RELEASING.md CHANGED
@@ -52,7 +52,8 @@ The rest of the uncovered branches — the host-path arm of
52
52
  `wslWritableRoots`, the sandbox-error and rethrow arms, the
53
53
  unrestricted-path result, all in `lib/index.js` — is ordinary
54
54
  CI-coverable code. Do not raise the branch number without either covering
55
- the `wsl.exe` tail on the Windows CI legs or moving the coverage job to
55
+ the `wsl.exe` tail on the Windows CI legs or moving the coverage job
56
+ (currently `runs-on: ubuntu-latest` in `.github/workflows/ci.yml`) to
56
57
  `windows-latest`.
57
58
 
58
59
  Run the full real-machine suite when behaviour changed, and keep its output for
@@ -10,7 +10,11 @@ docs/ 各篇里的行为承诺登记成带编号的需求条目,并给每条
10
10
 
11
11
  维护规则与 [PARITY.md](PARITY.md) 的纪律一致:需求变更与登记表改动进同一笔
12
12
  变更;新增行为承诺先入表再实现;「验证」列与测试同改。登记表的唯一判定
13
- 来源是文档与代码的现状,不是意图。
13
+ 来源是文档与代码的现状,不是意图。「验证」列引用的测试由
14
+ `pnpm run lint:requirements`(`scripts/check-requirements.mjs`,已入
15
+ `pnpm test` 门禁链)机械校验:被引测试必须存在且列入 `test:unit` 与
16
+ `test:coverage` 两个脚本;ID 不得重复;未引用测试的行为/过程性条目会在
17
+ 输出中点名保留可见。
14
18
 
15
19
  ## 判尺
16
20
 
@@ -39,9 +43,8 @@ docs/ 各篇里的行为承诺登记成带编号的需求条目,并给每条
39
43
  | R10 | 文件搜索跑发行版自身的 rg,绝不跨 9p share | PARITY「Contract audit」第 2 条;LIMITATIONS「glob 和 grep」条 | ①②③:拦截点与参数逐字转发成文;缺 rg 浮出 exit 127 附 bootstrap 指引;grep 回退被拒绝且理由明文(不读 `.gitignore`,非 rg 替身) | `search-route.test.mjs`、`search-exec.test.mjs` | — |
40
44
  | R11 | watch():inotify 优先(无界目录),轮询回退;粗粒度失效 | PARITY「Contract audit」第 1 条;LIMITATIONS watch 两条 | ①②③:契约向上追溯到宿主接缝(`changed()` 无载荷 → 粗粒度失效即可);inotify 递归且 0.5s 合并、文件/限深/无 inotify-tools 回退轮询;更旧 mtime 盲区只属轮询路径、`watchMaxDepth` 旋钮、目标消失响亮报错成文 | `watcher.test.mjs`;probe:watch(无 inotify 时 7/7;装 inotify-tools 后盲区检查改为期望事件) | 轮询回退的 mtime 盲区已声明;inotify 路径依赖发行版的 inotify-tools |
41
45
  | R12 | share 基座退役:携带 `substrate: "share"` 的 profile 在 boot 被拒并附迁移 | README/CONFIGURATION/LIMITATIONS 三处一致 | ①②⑤:旧值处置与用户所见成文,迁移指引内嵌 | `fs-decisions.test.mjs`(拒绝消息与迁移指引文案) | boot 期拒绝分支无测试(构造器调 `shareSubstrateRefusal`,`src/index.ts:1056`):`fs.boot.test.mjs` 只以 `sandbox: true` 启动该行,仓内没有构造 `substrate: "share"` profile 的测试 |
42
- | R14 | 会话级 systemd scope:命令共享后台进程/真实 `/tmp`/`ps`,scope 随会话结束停止;systemd + linger 缺失时预检带修复拒绝 | ADR 0001;README/CONFIGURATION/LIMITATIONS 的 `sessionSandbox` 条 | ①②③⑤:scope 生命周期(agent 为主进程、refcount、dispose stop)、`sessionSandbox: false` 退出、systemd/linger/systemd-run 四项预检与缓存策略成文;`/tmp` 与后台进程的保真边界限定在 runtime 开时 | `session-scope.test.mjs`、`session-runtime.test.mjs`、`provider.test.mjs`;真机会话验证(active scope、跨命令后台/`/tmp`、会话结束 0 units) | 硬崩溃可能留下 stale scope(启动清扫未随发,入 LIMITATIONS);受限写入已共享 runtime,读仍走无约束共享 agent,根级 fs-routing 不持有 session runtime |
43
- | R13 | bootstrap:bwrap/ripgrep 等的就地体检与安装 | README「Install」「Troubleshooting」;CONFIGURATION | ①②⑤:`--install` 与只读体检两式、体检对象、错误消息补救指引成文 | 0.7.4 起脚本随包(`files` 收录,补救指引在 npm 安装下可用) | 脚本本身无 CI 腿(真机排错路径覆盖) |
44
- | R14 | 安装/卸载/升级流:四步安装、幂等陷阱及补救、ES 模块重启须知 | README「Install」「Troubleshooting」 | ①③:每步预期输出、`add` 幂等性陷阱的补救(先 remove 再 add)、pnpm UNC 链接极限成文 | 人工步骤,无自动化(依赖真实 dsh CLI + Windows) | 无自动化守护 |
46
+ | R13 | 会话级 systemd scope:命令共享后台进程/真实 `/tmp`/`ps`,scope 随会话结束停止;systemd + linger 缺失时预检带修复拒绝 | ADR 0001;README/CONFIGURATION/LIMITATIONS 的 `sessionSandbox` 条 | ①②③⑤:scope 生命周期(agent 为主进程、refcount、dispose stop)、`sessionSandbox: false` 退出、systemd/linger/systemd-run 四项预检与缓存策略成文;`/tmp` 与后台进程的保真边界限定在 runtime 开时 | `session-scope.test.mjs`、`session-runtime.test.mjs`、`provider.test.mjs`;真机会话验证(active scope、跨命令后台/`/tmp`、会话结束 0 units) | 硬崩溃可能留下 stale scope(启动清扫未随发,入 LIMITATIONS);受限写入已共享 runtime,读仍走无约束共享 agent,根级 fs-routing 不持有 session runtime |
47
+ | R14 | bootstrap:bwrap/ripgrep 等的就地体检与安装 | README「Install」「Troubleshooting」;CONFIGURATION | ①②⑤:`--install` 与只读体检两式、体检对象、错误消息补救指引成文 | 0.7.4 起脚本随包(`files` 收录,补救指引在 npm 安装下可用) | 脚本本身无 CI 腿(真机排错路径覆盖) |
45
48
  | R15 | 错误码方言:每个 `FS_*` 码给出抛出者、含义、解除条件;`wsl.exe` 自身失败显式收编 | ARCHITECTURE「Error codes」表 | ①②:逐码三列成表;两类历史隐形失败(UTF-16 stdout、cwd 回退 exit 0)收编;`FS_OUTSIDE_DISTRO` 独立成码的理由明文 | `fs-decisions.test.mjs`、`fsio-agent.test.mjs`、`fs-substrate.test.mjs`、`provider.test.mjs`(断言码与消息) | — |
46
49
  | R16 | 对端 parity 合同:fsio 文本机制逐字节复刻钉死的对端版本 | PEER-PARITY 全文 | ①④⑥:钉版、验证方法(npm pack 逐函数比对)、验证日期、刻意分歧逐条声明、bump 钉版即重跑的维护规则 | `fsio-agent.test.mjs`(distro 内半区 canary);对端比对为手动方法 | 钉版升级后需重跑比对(维护规则) |
47
50
  | R17 | 常驻 agent 协议:ACK 计时看门狗、只读帧才重放、逐流输出上限、sha256 部署校验、租约存活、进程组两段杀 | CHANGELOG 0.3.0/0.6.0/0.7.3;PARITY Phase 1/Phase 3 | ①②④:每条健壮性属性有规格出处与实证记录;「EXEC/变异 FS 帧禁止盲重发」是写明的不变量 | `agent-protocol.test.mjs`(HELLO 版本+摘要)、`agent.test.mjs`、`agent-exec.test.mjs`(truncated 旗标)、`agent-fs-script.test.mjs`;probe:agent、probe:exec | — |
@@ -52,6 +55,7 @@ docs/ 各篇里的行为承诺登记成带编号的需求条目,并给每条
52
55
  | R22 | 支持矩阵:Windows 10/11 + WSL2 + Node `^22.19.0 \|\| >=24.0.0` + peer 版本范围 | SUPPORT 全文 | ⑥:支持与不受支持清单、peer 范围及精确开发依赖成文;Node 20 在范围外(理由见 SUPPORT,`engines` 为准) | `peerDependencies`、`devDependencies` 与 `engines`(`package.json`);CI 矩阵(ci.yml) | 新 peer 版本仍需验证 |
53
56
  | R23 | 根平面 `ctx.fs` 按坐标路由:发行版 UNC 由发行版内 agent 服务(inotify 或轮询 watch),盘符路径留在宿主;接替随发的 `fs-sandbox` 行 | README「Architecture」;ARCHITECTURE「The root-plane filesystem takeover」;CONFIGURATION `fs-routing` 行;root-fs-routing.md(设计) | ①②③⑤:路由判定与接替理由(写围栏在根平面无消费者)成文;`distro` 的 `auto`/`default`/pin 三态、每个 UNC 目标由自身 distro 服务、pin 下拒外来路径,以及 `distroCwd`/`restrictToDistro`/`sandbox`/`maskWindowsDrive`/`watchMaxDepth` 逐键成表,且自成一行、不与会话级行联动;`sandbox` 失败关闭成文 | `fs-routing.test.mjs`(纯谓词与路径助手)、`provider.test.mjs`(per-distro substrate/worldPath) | 类本体无单测(需 DSH peers 与实机);由组合测试与真机探针覆盖 |
54
57
  | R24 | GUI 文件树与预览在发行版内服务:沿用随包 `workspace-files` 行(server/client 成对),经根级 `fs-routing` 读写 distro UNC;盘符 scope 交宿主 | README「Architecture」;ARCHITECTURE「The root-plane filesystem takeover」;CONFIGURATION `workspace-files` 行 | ①②③⑤:沿用官方 server/client,浏览器 `file` provider 不丢,预览可用;路由与宿主/发行版 scope 成文;容量键由官方行承载、可覆盖;较直连多 4–6 次往返及其取舍在 LIMITATIONS 成文 | `fs-routing.test.mjs`、组合测试(`workspace-files` 保持启用、接管行不存在) | — |
58
+ | R25 | 安装/卸载/升级流:四步安装、幂等陷阱及补救、ES 模块重启须知 | README「Install」「Troubleshooting」 | ①③:每步预期输出、`add` 幂等性陷阱的补救(先 remove 再 add)、pnpm UNC 链接极限成文 | 人工步骤,无自动化(依赖真实 dsh CLI + Windows) | 无自动化守护 |
55
59
 
56
60
  登记覆盖面:上表登记 README 与 docs/ 中对外成文的行为承诺(含随发的服务面)。
57
61
  **有意未接线**的模块不设条目——`lib/file-reference-wsl.js`(`@` 补全的发行版侧