dsh-plugin-wsl-env 0.18.0 → 0.21.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 (123) hide show
  1. package/CHANGELOG.md +274 -0
  2. package/CONTRIBUTING.md +37 -5
  3. package/README.md +60 -5
  4. package/SUPPORT.md +3 -3
  5. package/agent/native/linux-aarch64/dsh-wsl-agent +0 -0
  6. package/agent/native/linux-x86_64/dsh-wsl-agent +0 -0
  7. package/agent/wsl-agent.sh +331 -11
  8. package/client.d.ts +5 -0
  9. package/client.js +98 -0
  10. package/cordis.patch.yml +66 -1
  11. package/docs/AGENT-PROTOCOL-V7.md +175 -0
  12. package/docs/API.md +25 -0
  13. package/docs/ARCHITECTURE.md +14 -1
  14. package/docs/CONFIGURATION.md +47 -6
  15. package/docs/CONFIGURATION.zh.md +20 -4
  16. package/docs/DIAGNOSTICS.md +83 -0
  17. package/docs/DIAGNOSTICS.zh.md +73 -0
  18. package/docs/LIMITATIONS.md +41 -4
  19. package/docs/LIMITATIONS.zh.md +27 -11
  20. package/docs/MIGRATION.md +4 -4
  21. package/docs/PEER-PARITY.md +50 -33
  22. package/docs/QUICKSTART.md +37 -4
  23. package/docs/QUICKSTART.zh.md +16 -1
  24. package/docs/README.zh.md +43 -4
  25. package/docs/RELEASING.md +4 -1
  26. package/docs/REQUIREMENTS.zh.md +3 -2
  27. package/docs/ROADMAP-1.0.md +75 -19
  28. package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +8 -1
  29. package/docs/UPSTREAM-OPEN-IN-APP.md +33 -0
  30. package/docs/UPSTREAM-SESSION-NOTICE.md +3 -1
  31. package/docs/UPSTREAM-TERMINAL-TITLE.md +3 -0
  32. package/docs/root-fs-routing.md +3 -3
  33. package/lib/agent-confined.js +4 -4
  34. package/lib/agent-errors.d.ts +1 -1
  35. package/lib/agent-errors.js +1 -1
  36. package/lib/agent-exec.d.ts +1 -1
  37. package/lib/agent-exec.js +1 -1
  38. package/lib/agent-protocol.d.ts +58 -8
  39. package/lib/agent-protocol.js +40 -7
  40. package/lib/agent-shared.d.ts +1 -1
  41. package/lib/agent-shared.js +1 -1
  42. package/lib/agent.d.ts +171 -1
  43. package/lib/agent.js +448 -288
  44. package/lib/auto-preset.d.ts +1 -1
  45. package/lib/auto-preset.js +1 -1
  46. package/lib/bwrap.d.ts +1 -1
  47. package/lib/bwrap.js +1 -1
  48. package/lib/client-host.d.ts +29 -0
  49. package/lib/client-host.js +29 -0
  50. package/lib/cwd-prompt-tool.d.ts +88 -0
  51. package/lib/cwd-prompt-tool.js +94 -0
  52. package/lib/cwd-prompt.d.ts +166 -0
  53. package/lib/cwd-prompt.js +203 -0
  54. package/lib/distro-route.d.ts +1 -1
  55. package/lib/distro-route.js +1 -1
  56. package/lib/doctor-live.d.ts +57 -0
  57. package/lib/doctor-live.js +38 -0
  58. package/lib/file-reference-wsl.d.ts +1 -1
  59. package/lib/file-reference-wsl.js +1 -1
  60. package/lib/fs-decisions.d.ts +1 -1
  61. package/lib/fs-decisions.js +1 -1
  62. package/lib/fs-routing.d.ts +1 -1
  63. package/lib/fs-routing.js +1 -1
  64. package/lib/fs-substrate.d.ts +90 -11
  65. package/lib/fs-substrate.js +202 -1
  66. package/lib/fs.d.ts +1 -1
  67. package/lib/fs.js +1 -1
  68. package/lib/fsio-agent.d.ts +128 -4
  69. package/lib/fsio-agent.js +224 -15
  70. package/lib/fsio-text.d.ts +1 -1
  71. package/lib/fsio-text.js +1 -1
  72. package/lib/git-exec.d.ts +1 -1
  73. package/lib/git-exec.js +1 -1
  74. package/lib/git-route.d.ts +1 -1
  75. package/lib/git-route.js +1 -1
  76. package/lib/index.d.ts +105 -30
  77. package/lib/index.js +272 -130
  78. package/lib/listing.d.ts +1 -1
  79. package/lib/listing.js +1 -1
  80. package/lib/messages.d.ts +157 -0
  81. package/lib/messages.js +199 -0
  82. package/lib/native-agent.d.ts +1 -1
  83. package/lib/native-agent.js +2 -2
  84. package/lib/paths.d.ts +6 -3
  85. package/lib/paths.js +4 -4
  86. package/lib/picker.d.ts +1 -1
  87. package/lib/picker.js +7 -7
  88. package/lib/ports.d.ts +1 -1
  89. package/lib/ports.js +1 -1
  90. package/lib/preflight.d.ts +25 -1
  91. package/lib/preflight.js +112 -12
  92. package/lib/sandbox-core.d.ts +1 -1
  93. package/lib/sandbox-core.js +9 -16
  94. package/lib/sandbox.d.ts +1 -1
  95. package/lib/sandbox.js +1 -1
  96. package/lib/search-exec.d.ts +1 -1
  97. package/lib/search-exec.js +1 -1
  98. package/lib/search-route.d.ts +1 -1
  99. package/lib/search-route.js +1 -1
  100. package/lib/session-runtime.d.ts +1 -1
  101. package/lib/session-runtime.js +2 -2
  102. package/lib/session-scope.d.ts +1 -1
  103. package/lib/session-scope.js +11 -6
  104. package/lib/shell-env.d.ts +26 -1
  105. package/lib/shell-env.js +57 -1
  106. package/lib/shell.d.ts +4 -2
  107. package/lib/shell.js +4 -2
  108. package/lib/subprocess.d.ts +1 -1
  109. package/lib/subprocess.js +2 -2
  110. package/lib/terminal-activity.d.ts +1 -1
  111. package/lib/terminal-activity.js +1 -1
  112. package/lib/terminal-route.d.ts +1 -1
  113. package/lib/terminal-route.js +1 -1
  114. package/lib/update-check.d.ts +197 -0
  115. package/lib/update-check.js +211 -0
  116. package/lib/watcher.d.ts +1 -1
  117. package/lib/watcher.js +1 -1
  118. package/lib/wsl-doctor-tool.d.ts +122 -0
  119. package/lib/wsl-doctor-tool.js +161 -0
  120. package/lib/wsl.d.ts +1 -31
  121. package/lib/wsl.js +1 -21
  122. package/package.json +55 -6
  123. package/scripts/doctor.mjs +1196 -166
@@ -21,8 +21,10 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
21
21
  会重新校验版本。不匹配时返回 `FS_STALE_VERSION`,但检查与 rename 之间发生的
22
22
  变更仍可能被覆盖。
23
23
  - **被取消的写入结果可能是未知的** —— 重试前先检查文件。
24
- - **写入成功不等于崩溃持久。** 被暂存的文件会 sync,但所在目录不会:
25
- 断电可能丢失该目录项。
24
+ - **写入的崩溃持久性取决于平台的 `sync -d`。** 被暂存的文件会 sync,
25
+ rename 之后所在目录也会尽力 fsync(shell agent)。native agent 目前只有
26
+ 文件级 `sync_all` —— 见 peer 对齐文档的分歧注记。拒绝目录 fsync 的
27
+ 文件系统保持与对端相同的承诺。
26
28
  - **含反斜杠的 Linux 文件名无法被寻址** —— 反斜杠是 UNC 分隔符,
27
29
  `a\b.ts` 会往返成 `a/b.ts`。请把文件名改掉,不要用反斜杠;
28
30
  这是坐标系自身的限制。
@@ -86,6 +88,13 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
86
88
  [ARCHITECTURE.md](ARCHITECTURE.md#reported-enforcement)。
87
89
  - **必须安装 `bubblewrap`**,否则两个提供者都会带着安装命令失败;
88
90
  会话启动预检会以建议性警告的形式给出同样的文本。
91
+ - **消息本地化按设计只覆盖一部分** —— 预检判定、`bwrap` 修复提示与
92
+ 发行版/工作目录错误跟随应用的语言设置
93
+ ([CONFIGURATION.zh.md](CONFIGURATION.zh.md#消息语言));`fs-decisions`
94
+ 中的 `FS_*` 拒绝文本与 fsio 复刻保持逐字节英文,因为工具层按这些字符串
95
+ 匹配;独立的 `scripts/doctor.mjs` 永远输出英文,因为它在应用之外运行,
96
+ 读不到宿主的语言偏好。探测时合成的修复文本保持探测发生时的语言,
97
+ 直到该探测再次运行。
89
98
  - 会话中途被删除的工作区目录会以 runner 错误失败;插件不会重建它。
90
99
  配置的 `cwd` 不存在时,报错会指明该目录。
91
100
 
@@ -95,6 +104,11 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
95
104
  因此版本管理器可用)且**非交互**(模型的输出流中没有提示符/插件输出)。
96
105
  设置 `loginShell: false` 后去掉登录旗标(`<shell> -c <command>`)。
97
106
 
107
+ `<shell>` 是 distro 用户的登录 shell(先 `getent passwd`,再 `$SHELL`)。
108
+ 两条探测都失败时——冷启动的 distro、首个 `wsl.exe` 调用抖动、没有 `getent`
109
+ 的 musl 系——命令**直接报错**,而不是静默落到 bash;失败不缓存,重试即重探测。
110
+ 需要钉死就用 `shell:` 指定绝对路径。
111
+
98
112
  - **`~/.zshrc` / `~/.bashrc` 永远不会被读取。** 把机器级的 PATH 设置
99
113
  (`fnm`、nvm、cargo)移进 `~/.zprofile` 或 `~/.zshenv`;提示符和补全
100
114
  留在 rc 文件里。
@@ -105,8 +119,10 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
105
119
  ## Agent 诊断
106
120
 
107
121
  - **doctor 的 `agent.handshake` 探测的是一个新起的常驻 agent**,而不是
108
- 在跑的那个——运行中常驻 agent 的 `lastError` 留在应用日志里
109
- (进程内可通过 `WslAgent.status()` 查看)。
122
+ 在跑的那个——存在共享 agent 时,doctorReport 会经
123
+ `mergeLiveResidentStatus` 合入 `WslAgent.status()` 的在驻视角(0.18.0),
124
+ 但 CLI 的握手检查仍会标注其探测来源(`probed: a fresh resident`);
125
+ 没有应用侧调用时,`lastError` 仍留在应用日志里。
110
126
  - **`dsh-wsl-*.scope` 计数是某一时刻的快照**;`--fix` 会执行预检的清扫。
111
127
  - **doctor 的 `git.win-safe` 探针通过 interop 的 `git.exe` 报告 Windows git
112
128
  的信任状态** —— 装了 Windows git 时,WSL 变更审查需要那份
@@ -158,13 +174,6 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
158
174
  `unattendedTimeoutMs`(2 h)。`terminalIdleReclaim: false` 恢复手动关闭。
159
175
  Windows 文件夹的宿主终端保持随包的不回收行为。
160
176
 
161
- ## 宿主的"在应用中打开"
162
-
163
- - **从"在应用中打开"启动 VS Code 可能独立于本插件而失败** ——
164
- 宿主带着 `ELECTRON_RUN_AS_NODE=1` 运行,启动器会继承它,于是
165
- `Code.exe` 以 Node 身份启动并以退出码 1 结束。不属于本仓库管:
166
- [UPSTREAM-OPEN-IN-APP.md](UPSTREAM-OPEN-IN-APP.md)。
167
-
168
177
  ## 在运行中的 profile 上启用本插件
169
178
 
170
179
  - **在繁忙的 profile 上通过 GUI 启用本 bundle 可能失败,重启应用即可生效。**
@@ -175,3 +184,10 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
175
184
  正确的)。启用前先关闭会话通常能让热路径成功——没有依赖方时,随包提供者会在
176
185
  重组期间释放。机制与复现:
177
186
  [UPSTREAM-SERVICE-SWAP.md](UPSTREAM-SERVICE-SWAP.md)。
187
+
188
+ ## 宿主的"在应用中打开"
189
+
190
+ - **从"在应用中打开"启动 VS Code 可能独立于本插件而失败** ——
191
+ 宿主带着 `ELECTRON_RUN_AS_NODE=1` 运行,启动器会继承它,于是
192
+ `Code.exe` 以 Node 身份启动并以退出码 1 结束。不属于本仓库管:
193
+ [UPSTREAM-OPEN-IN-APP.md](UPSTREAM-OPEN-IN-APP.md)。
package/docs/MIGRATION.md CHANGED
@@ -74,11 +74,11 @@ shows the composed value.
74
74
  | Gate | How | Runs where |
75
75
  |---|---|---|
76
76
  | Config docs and CHANGELOG current | review the diff; `lint:links` covers cross-references | CI |
77
- | `pnpm test` | style, links, syntax, build freshness, tsc, 40 unit files | CI (Node 22/24, Ubuntu + Windows) |
77
+ | `pnpm test` | style, links, syntax, build freshness, tsc, 42 unit files | CI (Node 22/24, Ubuntu + Windows) |
78
78
  | `pnpm run test:coverage` | lines 85 / branches 84 / functions 70 | CI (Node 24, Ubuntu) |
79
79
  | Peer line tested | `peer-canary` workflow resolves `next` and runs the scratch upgrade | CI schedule/manual |
80
- | Packed install/upgrade/uninstall | `pnpm run e2e:install` (temp `DSH_HOME`, 0.11.0 → current, marker) | manual, this machine (10/10 on 2026-10-19) |
81
- | Real-machine probe suite | `test/probe/run-all-when-closed.sh --include-fs` (needs the app closed) | manual; 15 probes passed on this Windows/WSL machine on 2026-10-31 |
80
+ | Packed install/upgrade/uninstall | `pnpm run e2e:install` (temp `DSH_HOME`, 0.17.1 → current over the peer raise, marker) | manual, this machine (10/10 on 2026-11-06; the origin moved 0.11.0 → 0.17.1 because dsh 0.2.2-rc.1 rightly rejects the exact-pin era) |
81
+ | Real-machine probe suite | `test/probe/run-all-when-closed.sh --include-fs` (needs the app closed) | manual; 15/15 on 2026-10-31 and again 2026-11-05 (docs/superpowers/probe-runs/); the suite grew to 17 on 2026-11-06 — the first 17-probe run on the same day passed 16 and failed the new `two-distro.sh` on a wrong assertion vehicle (session-scoped `DSH_WSL_DISTRO` is absent on a direct `ctx.shell` seam); after the probe was reworked to per-distro `/tmp` markers it passed alone, giving all 17 probes a pass on this machine (2026-11-06-probe-suite.md) |
82
82
  | Clean Win11 + Ubuntu first run ≤ 5 min | a clean machine, a stopwatch | **not run** (the project's machine is already configured) |
83
83
  | aarch64 executed | the native 18-check suite under qemu in CI | **run in CI** (physical aarch64 WSL is out of scope; see COMPATIBILITY.md) |
84
84
  | No open P0 bug for 30 days | issue tracker | time-based; cannot be asserted from a checkout |
@@ -94,7 +94,7 @@ ships through the tag workflow, but its notes say which gates were executed.
94
94
  ```bash
95
95
  pnpm run preset --distro default --check <profile>/cordis.patch.yml # no nested-row trap
96
96
  pnpm run doctor --json # effective environment facts
97
- dsh --profile <name> --dump-config # composed rows
97
+ dsh --profile <name> --dump-config # composed rows (CLI distribution)
98
98
  ```
99
99
 
100
100
  A profile that fails to boot after a migration should name the remedy in the
@@ -126,41 +126,58 @@ declared extensions, listed at the end.
126
126
  `FS_NOT_FOUND`). The peer throws `file changed since it was read`
127
127
  (`FS_STALE_VERSION`, `lib/index.js:937` via `requireFile` at `:1030`) for
128
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
129
+ 6. **Publication durability (shell agent, 2026-11-06).** After the publish
130
+ rename, the shell agent fsyncs the destination's containing directory
131
+ (`sync -d`, best effort), so a power loss cannot lose an entry whose file
132
+ contents already survived. The peer's publication makes no directory-fsync
133
+ promise, and the native agent keeps its file-level `sync_all` only
134
+ (`agent/native/spike/src/main.rs` stat write path) — the divergence holds
135
+ until the native binary's next build. Filesystems that refuse a directory
136
+ fsync (and `sync` builds without `-d`) degrade to the peer's promise
137
+ silently.
138
+
139
+ 7. **Frame-validation hardening (shell agent, 2026-11-06).** The shell agent
140
+ validates every numeric frame field it acts on — EXEC/FS `timeout_s` and
141
+ `nargs` (mirroring the FSB checks), and fs_read's `offset`/`max`, where a
142
+ malformed or non-positive window is a protocol-class refusal rather than a
143
+ silent empty answer. The native binary trusts the host's numerics the same
144
+ way it always has; the divergence holds until its next build. The host
145
+ always sends numerics, so this is drift-hardening at the trust boundary,
146
+ not a behavioral change for any caller.
147
+
148
+ ## The peer's 0.2.2-rc.1 operations: implemented over protocol v7
131
149
 
132
150
  `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.
151
+ `patchText` (hunks via `@deepseek-ai/dsh-fs-patch`, refusal
152
+ `FS_PATCH_MISMATCH`), `deleteFile`, and `moveFile` (same-target refusal
153
+ `FS_SAME_TARGET`). 0.18.0 shipped them as an honest refusal (an inherited
154
+ host call would touch the wrong filesystem); protocol v7
155
+ ([AGENT-PROTOCOL-V7.md](AGENT-PROTOCOL-V7.md)) now serves them for real:
156
+
157
+ - **`delete` / `move`** ride two new FS ops in both agent implementations,
158
+ with the peer's guard dialects (source `requireFile`, destination
159
+ `writeTarget`, version re-verification distro-side before the destructive
160
+ step, staging + atomic/no-replace publication, the two-effect
161
+ `sourceDeleted: false` outcome).
162
+ - **`patchText`** has no frame on purpose: hunks are applied in-process by
163
+ the peer's own `applyHunks` (`@deepseek-ai/dsh-fs-patch` is now a peer
164
+ dependency), so the mismatch dialect is the peer's byte-for-byte, then the
165
+ result publishes through the same guarded atomic write an edit takes.
166
+ - **Structured FS errors**: failed FS ops answer with `FSERR|id|reason|b64`
167
+ instead of the stderr sniffing notation (which stays parsed for older
168
+ agents).
169
+ - **Batched FS frames** (`FSB`): one round trip for the GUI preview's
170
+ stat+list+read shape; `readWholeText` and `listChildren` use it when the
171
+ resident advertises `batch`. Benchmark: `test/probe/gui-preview-batch.sh`.
172
+ - **Negotiation**: the host accepts agents 6–7 and gates every v7 frame on
173
+ the HELLO version, so a half-updated mirror degrades to v6 behaviour.
174
+
175
+ Pinned by `test/fs-substrate.test.mjs` (patch/delete/move over the live v7
176
+ script), `test/composition.test.mjs` (routing forwards the three ops),
177
+ `agent/native/spike/test.mjs` (both agents: batch, delete, move, capabilities)
178
+ and `test/agent-protocol.test.mjs` (HELLO caps, FSERR, FSB encoding).
179
+ Divergence 4's binary/UTF-8 dialect note now also covers the patch path, which
180
+ re-reads through `readForEdit`.
164
181
 
165
182
  ## Maintenance
166
183
 
@@ -5,6 +5,14 @@
5
5
  Steps from a Windows + WSL 2 machine to a working WSL session.
6
6
  This page is the entry point; every claim links to the document that owns it.
7
7
 
8
+ ## 0. Do you need this plugin?
9
+
10
+ If the harness can run inside the distro, installing the CLI there
11
+ (`npm install -g @deepseek-ai/dsh`) and skipping this plugin is simpler — the
12
+ [README's decision table](../README.md#do-i-need-this-plugin) has the cases.
13
+ The rest of this page assumes the desktop app stays on Windows and this plugin
14
+ supplies the WSL environment.
15
+
8
16
  ## 1. Prerequisites
9
17
 
10
18
  | Need | How to check | If missing |
@@ -15,14 +23,29 @@ This page is the entry point; every claim links to the document that owns it.
15
23
  | systemd + Linger (for the session runtime) | `node <plugin>/scripts/doctor.mjs` (installed) or `pnpm run doctor` (checkout) | `[boot] systemd=true` in `/etc/wsl.conf`, `wsl --shutdown`, then `loginctl enable-linger "$USER"`; or set `sessionSandbox: auto`/`false` |
16
24
  | Node `^22.19.0` or `>=24.0.0` | only needed for source/development work | not needed inside the distro to use the published plugin |
17
25
 
26
+ No terminal at hand? In a session, ask for a diagnosis: the model runs the
27
+ `wsl_doctor` tool (mounted by this plugin) and the verdict — `ready`, or
28
+ `blocked` with per-failure copy-paste remedies — lands in the transcript.
29
+ The session-start preflight announces the same verdict on every session
30
+ start. `DSH_WSL_DOCTOR` additionally carries a ready-to-run command for the
31
+ doctor script itself (`sh -c "$DSH_WSL_DOCTOR --json"`).
32
+
18
33
  The doctor (`scripts/doctor.mjs`, or `pnpm run doctor` from a checkout) checks
19
- the environment and prints remedies for detected failures. Confirm the distro's
20
- WSL version separately with `wsl.exe -l -v`. Doctor is read-only unless you pass `--fix` (stale scopes) or
21
- `--fix --install` (packages, after a confirmation).
34
+ the environment and ends in a verdict: `ready` means the first command should
35
+ succeed; `blocked` names the exact checks to fix, each with a copy-paste
36
+ remedy. It reads the distro's WSL mode from `wsl.exe -l -v` itself, so no
37
+ separate version check is needed. Doctor is read-only unless you pass `--fix`
38
+ (stale scopes, and the Windows git trust after a confirmation) or
39
+ `--fix --install` (packages, after a confirmation); `--bundle <path>` writes
40
+ the diagnostic file a setup report attaches.
22
41
 
23
42
  ## 2. Install
24
43
 
25
- From a Windows PowerShell where the DSH CLI is available:
44
+ The desktop app has no `dsh` command; open **Plugins** in the sidebar, choose
45
+ **Add plugin**, and enter the exact package name `dsh-plugin-wsl-env`. That
46
+ writes the profile's `package.json` and its `dsh.profile.bundles` entry.
47
+
48
+ With the CLI distribution (`dsh` on `PATH`), from Windows PowerShell:
26
49
 
27
50
  ```powershell
28
51
  dsh plugin --profile <profile> add dsh-plugin-wsl-env
@@ -37,6 +60,11 @@ targets `wsl-shell`/`wsl-fs` by id.
37
60
 
38
61
  ## 3. Open a WSL workspace
39
62
 
63
+ Start the desktop app the way its Start-menu shortcut does: `DeepSeek Harness.exe`,
64
+ no arguments — it opens the profile the app is configured with (the Plugins page
65
+ writes into that one). (CLI distribution: `dsh --profile <profile>` boots a
66
+ profile of that name.)
67
+
40
68
  In the GUI, open a folder through the picker (`\\wsl.localhost\<distro>\home\<you>\proj`)
41
69
  or an UNC path directly. The session's commands, file tools, terminal and previews
42
70
  all run in that distro; a Windows folder keeps the normal Windows environment.
@@ -77,6 +105,11 @@ distro kernel. If the first command fails, the error names the remedy; the
77
105
  [doctor](CONFIGURATION.md) and the [Troubleshooting table](../README.md#troubleshooting)
78
106
  cover the common cases.
79
107
 
108
+ First-write note: the sandbox asks for permission before a write the session
109
+ policy has not granted — the prompt names the command and the target, and
110
+ allowing it once is safe. Enabling `loginctl enable-linger <user>` inside the
111
+ distro prevents the repeat prompts a non-lingering user manager causes.
112
+
80
113
  The probe below runs the shipped kernel-enforced bwrap profiles live — writes
81
114
  inside the workspace land, tested writes outside are refused with `EROFS`, and
82
115
  the strict profile hides `/mnt` entirely
@@ -5,6 +5,13 @@ _本文是 [QUICKSTART](QUICKSTART.md) 的中文译本,以英文版为准。_
5
5
  从一台 Windows + WSL 2 机器到可用的 WSL 会话,只需以下步骤。
6
6
  本页是入口;每条说明都链接到负责该主题的文档。
7
7
 
8
+ ## 0. 需要这个插件吗?
9
+
10
+ 如果 harness 可以整个跑在发行版里,把 CLI 装进去(`npm install -g
11
+ @deepseek-ai/dsh`)并跳过本插件会更简单——判断表见
12
+ [README](README.zh.md#需要这个插件吗)。本页其余部分假定桌面应用留在 Windows,
13
+ 由本插件提供 WSL 环境。
14
+
8
15
  ## 1. 前置条件
9
16
 
10
17
  | 需求 | 如何检查 | 缺失时 |
@@ -22,7 +29,11 @@ doctor(`scripts/doctor.mjs`,或在检出目录中运行 `pnpm run doctor`)
22
29
 
23
30
  ## 2. 安装
24
31
 
25
- 在一个可以使用 DSH CLI 的 Windows PowerShell 中:
32
+ 桌面应用没有 `dsh` 命令;在侧边栏打开 **插件**,点 **Add plugin**,按精确包名
33
+ `dsh-plugin-wsl-env` 安装。这一步写入该 profile 的 `package.json` 与
34
+ `dsh.profile.bundles`。
35
+
36
+ 使用 CLI 发行版(`dsh` 在 `PATH` 上)时,在 Windows PowerShell 中:
26
37
 
27
38
  ```powershell
28
39
  dsh plugin --profile <profile> add dsh-plugin-wsl-env
@@ -37,6 +48,10 @@ dsh --profile <profile> --dump-config # 输出中必须包含插件的行
37
48
 
38
49
  ## 3. 打开 WSL 工作区
39
50
 
51
+ 启动桌面应用的方式与它安装的快捷方式一致:`DeepSeek Harness.exe`,不带参数——
52
+ 它打开的是应用自己配置的 profile(也就是 Plugins 页面写入的那个)。(CLI
53
+ 发行版:`dsh --profile <名字>` 启动指定名字的 profile。)
54
+
40
55
  在 GUI 中,通过选择器打开文件夹(`\\wsl.localhost\<distro>\home\<you>\proj`),
41
56
  或直接打开 UNC 路径。会话的命令、文件工具、终端和预览
42
57
  都在该发行版中运行;打开 Windows 文件夹则保留正常的 Windows 环境。
package/docs/README.zh.md CHANGED
@@ -12,6 +12,31 @@ Harness 进程仍在 Windows 上。命令执行、shell 脚本和文件访问都
12
12
 
13
13
  仅支持 Windows + WSL 2。
14
14
 
15
+ ## 需要这个插件吗?
16
+
17
+ 如果 harness 本身可以跑在发行版里,更简单的做法是**不用**这个插件:把 CLI 装在
18
+ 发行版里,直接在发行版终端运行。没有 UNC 路径、没有 9p 往返,也没有
19
+ Windows→发行版的 agent。
20
+
21
+ ```bash
22
+ # 在发行版内执行;CLI 要求 Node >= 24.9
23
+ npm install -g @deepseek-ai/dsh
24
+ dsh web # 浏览器界面,经 WSL 的 localhost 转发访问
25
+ dsh headless "run the tests" # 单任务、输出答案后退出
26
+ ```
27
+
28
+ 需要 harness 留在 Windows 时,才用本插件:
29
+
30
+ | 你的场景 | 用什么 |
31
+ |---|---|
32
+ | 工作区在 WSL 内,终端或浏览器界面够用 | 装在发行版里的 CLI |
33
+ | 想要 Windows 桌面应用,命令与文件落在发行版 | 本插件 |
34
+ | 同一会话要同时访问 Windows 与 WSL 工作区 | 本插件(按路径路由正是它的价值) |
35
+
36
+ 两者混用有一个坑:`desktop` 这个 profile 名由 Electron 应用独占,npm CLI 拒绝
37
+ 管理它的插件——桌面场景请用应用内的 Plugins 页面。[VALUE.zh.md](VALUE.zh.md)
38
+ 有完整对照和"不适用"清单。
39
+
15
40
  ## 为什么用这个插件
16
41
 
17
42
  Windows 上的编程工具要在 WSL 项目中工作,有三条路:把整个工具装进发行版、连接发行版内的辅助服务,或由插件直接提供发行版环境。本插件是第三条。两类会话共用一套流程,同时保留发行版的真实工具和命令沙箱。
@@ -57,7 +82,19 @@ Windows 上的编程工具要在 WSL 项目中工作,有三条路:把整个
57
82
 
58
83
  ## 安装
59
84
 
60
- 在 Windows 终端执行:
85
+ Windows 桌面应用**没有 `dsh` 可执行程序**:安装器只写 `DeepSeek Harness.exe`,
86
+ CLI 入口在 `resources/app.asar` 内部(探针脚本通过 `ELECTRON_RUN_AS_NODE` 启动它)。
87
+ 按你手上的发行版二选一。
88
+
89
+ **桌面应用**:在侧边栏打开 **插件**,点 **Add plugin**,填精确包名
90
+ `dsh-plugin-wsl-env` 并启用。插件管理器写入当前 profile 的 `package.json`
91
+ (依赖项与 `dsh.profile.bundles`),与下面的 CLI 命令得到的状态一致。从检出
92
+ 目录运行时,改为以链接形式添加该目录。启动方式与安装器创建的快捷方式一致:
93
+ `DeepSeek Harness.exe`,不带参数。桌面应用打开的是它自己配置的 profile——也就是
94
+ Plugins 页面写入的那个;要用别的 profile 属于 CLI 发行版的事
95
+ (`dsh --profile <名字>`)。
96
+
97
+ **CLI 发行版**(`dsh` 在 `PATH` 上),在 Windows 终端执行:
61
98
 
62
99
  ```powershell
63
100
  dsh wsl --from-default-profile web --dump-config # 创建 profile
@@ -74,7 +111,7 @@ wsl.exe -d <发行版> -u root -- apt-get install -y bubblewrap
74
111
 
75
112
  在插件检出目录中,`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
113
 
77
- 升级:再次执行 `add` 命令。卸载:`dsh plugin --profile wsl remove dsh-plugin-wsl-env`;之后可删除 `~/.cache/dsh-wsl`。如果你为了恢复预览在 profile 里加过 `workspace-files-wsl` 的临时覆盖,升级后请删掉:插件不再挂载该行。
114
+ 升级:在 Plugins 页面重新安装,或再次执行 `add` 命令。卸载:在 Plugins 页面移除,或在 CLI 发行版执行 `dsh plugin --profile wsl remove dsh-plugin-wsl-env`;之后可删除 `~/.cache/dsh-wsl`。如果你为了恢复预览在 profile 里加过 `workspace-files-wsl` 的临时覆盖,升级后请删掉:插件不再挂载该行。
78
115
 
79
116
  ## 使用
80
117
 
@@ -146,9 +183,9 @@ wsl preset(每个会话)
146
183
  | 现象 | 处理 |
147
184
  |---|---|
148
185
  | 每条命令都报 `SANDBOX_UNAVAILABLE` | 在发行版内安装 `bubblewrap`,或设置 `sandbox: false` |
149
- | 会话在第一条命令前就被拒绝 | 启用 systemd 和 linger,或在 `wsl-shell`、`wsl-fs` 上设置 `sessionSandbox: false` |
186
+ | 会话在第一条命令前就被拒绝 | 运行 `pnpm run doctor`;启用 systemd 和 linger,或在 `wsl-shell`、`wsl-fs` 上设置 `sessionSandbox: false` |
150
187
  | 发行版内 `glob`、`grep` 很慢 | 运行 `pnpm run bootstrap <发行版>`,使用打印的安装命令安装 `ripgrep` |
151
- | `dsh plugin add` 没有输出 | 插件已安装;这是成功 |
188
+ | `dsh plugin add` 没有输出,或 Plugins 页面装完没有日志 | 以 profile 的 `package.json` 与 `dsh.profile.bundles` 为准:列出插件即安装成功 |
152
189
  | 对 `wsl-shell`/`wsl-fs` 的 profile 补丁不生效 | 这些行嵌套在 `preset-wsl` 里。运行 `pnpm run preset --check <补丁>`;它会失败并输出需要粘贴的完整块 |
153
190
  | 改了 `lib/` 但不生效 | 运行 `pnpm run sync:windows`,然后重启应用 |
154
191
 
@@ -172,8 +209,10 @@ pnpm run sync:windows # 更新应用加载的 Windows 侧副本
172
209
 
173
210
  | 文档 | 内容 |
174
211
  |---|---|
212
+ | [docs/QUICKSTART.md](QUICKSTART.md) | 首次运行、常用配方、兼容性 |
175
213
  | [docs/CONFIGURATION.md](CONFIGURATION.md) | 所有配置键及覆盖方法 |
176
214
  | [docs/ARCHITECTURE.md](ARCHITECTURE.md) | 服务、路径路由、沙箱、错误码 |
215
+ | [docs/PERFORMANCE.md](PERFORMANCE.md) | ext4 agent 对比 9p 的实测延迟与复现方法 |
177
216
  | [docs/LIMITATIONS.md](LIMITATIONS.md) | 插件不做的事 |
178
217
  | [docs/ROADMAP.md](ROADMAP.md) | 当前计划和推迟项 |
179
218
  | [docs/ROADMAP-1.0.md](ROADMAP-1.0.md) | 1.0 与生态优化计划 |
package/docs/RELEASING.md CHANGED
@@ -46,7 +46,7 @@ integration layer is now measured, and part of what it leaves uncovered
46
46
  needs a live `wsl.exe` — the distro-bound paths in `lib/index.js` (the
47
47
  resolved home, the distro home, arming the watcher), the `wsl.exe` calls
48
48
  in `lib/wsl.js` (`defaultDistro`'s no-distro throw, `linuxHomePath`,
49
- `runInDistro`, and the other distro calls), and the real spawn internals
49
+ and the other distro calls), and the real spawn internals
50
50
  in `lib/watcher.js`. The real-machine probes cover that tail, not CI.
51
51
  The rest of the uncovered branches — the host-path arm of
52
52
  `wslWritableRoots`, the sandbox-error and rethrow arms, the
@@ -256,3 +256,6 @@ npm does not let a published version be replaced, so the fix goes forward:
256
256
  | The npm readme is chosen from the candidate files at the package root, and the rule is not fully explained. With `README.md` and `README.zh.md` side by side, version 0.1.1 published as `readmeFilename: README.zh.md`, so its npm page rendered Chinese — even though the tarball listed `README.md` first. Both names match the npm CLI's own selection code (`@npmcli/package-json/lib/normalize.js` globs `{README,README.*}` and accepts `/\.m?a?r?k?d?o?w?n?$/i`, which does match `.md`), so neither name is screened out. | Do not rely on the rule. Keep exactly one readme candidate at the package root, which `pnpm run lint:style` checks. The Chinese README lives in `docs/` for this reason. |
257
257
  | A local `~/.npmrc` may point at a mirror | Pass `--registry=https://registry.npmjs.org/` on every publish and every verification. |
258
258
  | The npm token is a credential | Keep it out of command arguments and the repository; revoke a temporary token after the release. |
259
+ | `gh api -f body="$var"` posts the variable as literal text, so a JSON-encoded string lands as visible `\uXXXX` escapes | The 0.19.0 announcement (2026-11-06) rendered as `\u5d2f\u53d1...` on discussion #8644 because the body was `json.dumps`-encoded and then passed through `-f`, which treats the value as raw. For non-ASCII content use `-F body=@file` (`-F` reads the file's bytes verbatim), and delete the bad comment via `deleteDiscussionComment` before reposting. |
260
+ | A successful write to an external system says nothing about the rendered content | Every release step that posts content (discussion comments, GitHub Release notes) must read the result back and compare it to the local source before declaring the step done. The API returns success for a double-encoded body; only the read-back — grep for `\u` escape sequences, diff the first lines against the source file — catches it. The workflow's release-verify step had to be re-created by hand on 0.19.0 for the sibling reason: its one-shot registry check ran inside the propagation window (now fixed to poll, cea5d4a). |
261
+ | WSL mounts drvfs per terminal session | After a `C:` 9p mount flips to read-only, `sudo mount -t drvfs 'C:' /mnt/c -o remount,rw` only fixes the session that ran it; another shell (a probe runner, an agent session) keeps the stale read-only mount and `sync-to-windows` fails with tar exit 2 ("Read-only file system"). Recover in the terminal that will run the sync: `sudo umount -l /mnt/c && sudo mount -t drvfs 'C:' /mnt/c -o rw,uid=1000,gid=1000`, then verify with `touch` before rerunning. |
@@ -1,6 +1,7 @@
1
1
  # 需求登记表与追溯矩阵
2
2
 
3
- 本文是维护者治理文档,不随包发布(不在 `files` 清单)。它把分散在 README 与
3
+ 本文是维护者治理文档,随包发布(在 `files` 清单里,因为 ARCHITECTURE 与
4
+ ROADMAP-1.0 的追溯链接指向它)。它把分散在 README 与
4
5
  docs/ 各篇里的行为承诺登记成带编号的需求条目,并给每条配上验证途径。它不是
5
6
  第二份「当前状态陈述」——每条需求的权威正文仍在所指向的文档里,本文只回答
6
7
  三个问题:**有哪些需求、在哪里规定、靠什么验证**。
@@ -50,7 +51,7 @@ docs/ 各篇里的行为承诺登记成带编号的需求条目,并给每条
50
51
  | 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 | — |
51
52
  | R18 | 配置面:每键默认值成文;层组合语义(整行替换、不深合并、后层胜) | CONFIGURATION;`cordis.patch.yml` 头注 | ⑤:随发键成表、未列表键点名;覆盖方式的正确心智模型(整行替换)成文 | `composition.test.mjs`(层组合);`style.mjs`(`files` 契约) | — |
52
53
  | R19 | 非目标集:不做什么与为什么 | LIMITATIONS 开篇原则;PARITY「Not applicable」 | ③:已知极限入册;不适用项「记下来免得像遗漏」 | —(文档性) | — |
53
- | R20 | 验证策略:三层(fake → 真脚本过真线 → 真机探针)+ CI 矩阵 + 覆盖率阈值 | ARCHITECTURE「Test layers」;README「Development」 | ④:CI 在 Node 22/24 × Linux/Windows 上跑 `pnpm test`,`pnpm run test:coverage` 只在 Node 24 上跑(门槛旗标需 Node 22.8);Node 20 有意排除(`engines` 下限);覆盖率阈值 85/84/70(行/分支/函数),测量集合覆盖 `test/` 下 40 个测试文件 | `pnpm test`、`pnpm run test:coverage`;CI(ci.yml) | 真机验证依赖 Windows 和可用的 WSL 发行版;非功能无量化目标(OI-1) |
54
+ | R20 | 验证策略:三层(fake → 真脚本过真线 → 真机探针)+ CI 矩阵 + 覆盖率阈值 | ARCHITECTURE「Test layers」;README「Development」 | ④:CI 在 Node 22/24 × Linux/Windows 上跑 `pnpm test`,`pnpm run test:coverage` 只在 Node 24 上跑(门槛旗标需 Node 22.8);Node 20 有意排除(`engines` 下限);覆盖率阈值 85/84/70(行/分支/函数),测量集合覆盖 `test/` 下 41 个测试文件,且 `lib/*.js` 必须逐个实测或带理由豁免 | `pnpm test`、`pnpm run test:coverage`;CI(ci.yml) | 真机验证依赖 Windows 和可用的 WSL 发行版;非功能无量化目标(OI-1) |
54
55
  | R21 | 安全过程:范围内外、响应时限、partial 属设计边界、凭据政策 | SECURITY 全文 | ②③⑥:范围、3/10/30 个工作日时限(标注「目标非合同」)、partial 定性、凭据零容忍成文 | —(过程性) | — |
55
56
  | 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 版本仍需验证 |
56
57
  | 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 与实机);由组合测试与真机探针覆盖 |
@@ -1,6 +1,6 @@
1
1
  # Roadmap 1.0: the WSL plugin the DSH ecosystem should have
2
2
 
3
- Status: working plan, last refreshed 2026-10-31 against `0.15.0`.
3
+ Status: working plan, last refreshed 2026-11-07 against `0.19.0` (WSL-316 doctor closed-loop planning; the §2 area tables were last refreshed at 0.15.0).
4
4
  The 0.12.0 baseline that motivated the plan is kept below as history.
5
5
  Audience: maintainers and contributors. This is a plan, not a release promise.
6
6
  The short version: **from "the only WSL plugin" to "the default WSL plugin"** —
@@ -57,7 +57,7 @@ North-star metrics:
57
57
  | Area | Strong today | Remaining gap |
58
58
  |---|---|---|
59
59
  | Execution | Native agent default; systemd session scope; `distro: auto` coordinate routing; concurrent distros | Physical aarch64 WSL (out of scope); non-systemd real-machine session probe unrun |
60
- | Files | in-distro agent substrate, root-plane `fs-routing` in unit+coverage, kernel-enforced confined writes | GUI previews still extra agent round trips (measured, deferred); `@` completion still 9p until the upstream seam |
60
+ | Files | in-distro agent substrate, root-plane `fs-routing` in unit+coverage, kernel-enforced confined writes; protocol v7 `FSB` batch (0.18.0) serves the GUI preview's stat+list+read shape in one round trip | `@` completion still 9p until the upstream `FileReferenceTraversal` seam; the preview's remaining round trips (open/patch) are one per op by design |
61
61
  | Sandbox | `bubblewrap`, fail-closed, `enforcement: partial`, `interopVisibility` / `maskWindowsDrive` | Plugin keys do not disable WSL interop; distro `[interop] enabled=false` must be configured separately |
62
62
  | Onboarding | `doctor`, `bootstrap` / `bootstrap-import`, session preflight, `profile-preset` helper | Clean-machine first-run timing still unmeasured; session UI has no toast seam |
63
63
  | Configuration | Every shipped key documented; nested `preset-wsl` rows edited through the helper | An id patch of `wsl-shell` / `wsl-fs` still only warns |
@@ -130,7 +130,7 @@ correct once configured" and "the plugin is correct on first contact".
130
130
  |---|---|---|---|
131
131
  | [P1.1](#wsl-201--sessionsandbox-auto) | `sessionSandbox: auto` for distros without systemd | Non-systemd distro runs the first command under per-command bwrap and reports the narrower scope; explicit `true` still refuses | M |
132
132
  | [P1.2](#wsl-202--compatibility-matrix-and-aarch64) | Compatibility matrix and real validation | Tier 1 (Ubuntu/Debian, systemd, x86_64) green; aarch64 spike runs under qemu; Tier 2 status documented | L |
133
- | [P1.3](#wsl-203--installupgradeuninstall-e2e) | Install/upgrade/uninstall E2E | Temporary `DSH_HOME`, packed tarball, `dsh plugin add`, `--dump-config`, remove; upgrade from the previous minor | M |
133
+ | [P1.3](#wsl-203--installupgradeuninstall-e2e) | Install/upgrade/uninstall E2E | Temporary `DSH_HOME`, packed tarball, profile install (Plugins page or `dsh plugin add`), `--dump-config` where the CLI exists, remove; upgrade from the previous minor | M |
134
134
  | [P1.4](#wsl-204--references-seam) | `@` references seam | Measure the 9p cost; land the upstream `FileReferenceTraversal` seam or a declared, tested fallback | L |
135
135
  | [P1.5](#wsl-205--lsp-provider-spike) | LSP provider spike | A documented plan and prototype for `ctx.lsp` over fs + subprocess, conditional on the desktop composition mounting LSP | M |
136
136
  | [P1.6](#wsl-206--gui-preview-performance) | GUI preview performance | Baseline measured; p95 <= 1s/MiB for a representative page; v6 only if the measurement justifies it | M |
@@ -197,6 +197,13 @@ editor/LSP rewrite without an upstream seam, and default telemetry.
197
197
 
198
198
  **Decision rules:**
199
199
 
200
+ - A new feature candidate originates from a logged pain in the
201
+ repository-local pain journal (`docs/superpowers/pains.md`), not from a
202
+ document-inferred gap; it
203
+ passes the three triage questions (who hurts, magnitude on the human time
204
+ scale, cost of not doing it) before entering this roadmap. The 2026-11-06
205
+ batch is the calibration: per-file watch events, the `@` seam push and the
206
+ clean-machine timing all died on these questions.
200
207
  - A P1 item moves only with a measured need or a concrete consumer.
201
208
  - A compatibility claim enters the matrix only with a test or a probe.
202
209
  - A security statement never exceeds what the sandbox actually enforces.
@@ -218,8 +225,15 @@ acceptance list in each issue is the contract; filter by priority:
218
225
  workspace in its own distro, reads a drive-letter path on the host plane, and
219
226
  refuses another distro's UNC — one leg of the acceptance below has real-machine
220
227
  evidence (a 2026-10-31 run passed all 15 probes on one machine; not a matrix
221
- result). The concurrent two-distro leg still has no dedicated probe and has
222
- not been run; the checkboxes stay unchecked until that leg exists.
228
+ result). The concurrent two-distro leg's dedicated probe
229
+ (`test/probe/two-distro.sh`) passed on the real machine on 2026-11-06
230
+ (`docs/superpowers/probe-runs/2026-11-06-probe-suite.md`): after its first run
231
+ failed on a wrong assertion vehicle (the session-scoped `DSH_WSL_DISTRO` is
232
+ absent on a direct `ctx.shell` seam), the probe was reworked to plant a marker
233
+ in each distro's `/tmp` and assert no leg sees the other's — sequential,
234
+ concurrent and burst interleave all stayed in their own distro. WSL-207's
235
+ kill/restart probe (`test/probe/agent-restart.sh`) passed in the same suite
236
+ run.
223
237
 
224
238
  **Priority:** P0 · **Size:** L · **Labels:** `area:multi-distro`,
225
239
  `type:feature`, `priority:P0`
@@ -229,15 +243,15 @@ another distro is refused instead of served.
229
243
 
230
244
  **Acceptance:**
231
245
 
232
- - [ ] `distro: "auto"` resolves the distro from the workspace UNC; an explicit
246
+ - [x] `distro: "auto"` resolves the distro from the workspace UNC; an explicit
233
247
  name still pins; `"default"` forces the WSL default.
234
- - [ ] `wsl-shell`, `wsl-fs`, `fs-routing`, `subprocess-wsl` and `shell-env`
248
+ - [x] `wsl-shell`, `wsl-fs`, `fs-routing`, `subprocess-wsl` and `shell-env`
235
249
  all follow the same coordinate rule.
236
- - [ ] The shared agent and session runtime are keyed by distro; two distros run
250
+ - [x] The shared agent and session runtime are keyed by distro; two distros run
237
251
  concurrently.
238
- - [ ] A workspace in its own distro never raises `FS_OUTSIDE_DISTRO`; another
252
+ - [x] A workspace in its own distro never raises `FS_OUTSIDE_DISTRO`; another
239
253
  distro's path still does.
240
- - [ ] Migration note documents the `""`/`auto`/`default` semantics.
254
+ - [x] Migration note documents the `""`/`auto`/`default` semantics.
241
255
 
242
256
  **Tests/probes:** unit tests for the resolver; two-distro real-machine probe;
243
257
  cross-distro refusal leg; composition test through the service proxy.
@@ -372,9 +386,13 @@ command.
372
386
  - [x] The preflight checks bwrap, systemd PID 1, `systemd-run` and Linger.
373
387
  - [x] The warning is visibly attached to the session through the
374
388
  runtime-context entry (not only logs).
375
- - [ ] A GUI notice/banner renders it: filed upstream as
376
- [#10263](https://github.com/deepseek-ai/deepseek-harness/discussions/10263);
377
- until a seam lands, the advisory stays in the log and runtime context.
389
+ - [x] The transcript renders it: the runtime-context entry now carries the
390
+ verdict on healthy sessions too (the ready line). A dedicated GUI
391
+ notice/banner remains the session-notice ask
392
+ ([#10263](https://github.com/deepseek-ai/deepseek-harness/discussions/10263)),
393
+ now self-sufficient: the `wsl_doctor` tool runs the doctor in-session
394
+ (the per-plugin diagnostics proposal #12499 was filed and withdrawn the
395
+ same day — the cohesive shape needs no upstream surface).
378
396
  - [x] The warning never installs anything and never changes fail-closed
379
397
  behavior.
380
398
  - [x] A session with a usable environment produces no warning.
@@ -590,11 +608,14 @@ agent queue; the service-level round-trip count remains qualitative.
590
608
  enters a bounded revival (2/4/8 s backoff, one fresh transport and one rebuild
591
609
  per attempt); after three deaths the refusal is permanent and names the restart
592
610
  remedy. `WslAgent.status()` exposes state, pid, lastError, deaths and pending.
593
- `pnpm run doctor` now probes a fresh shell resident (`agent.handshake`: pid,
594
- protocol, script digest) and still reports the agent cache and live/stale
595
- `dsh-wsl-*.scope` counts. The live app resident's last error has no IPC channel
596
- to the doctor, so the doctor reports its own probe failure and the app log
597
- keeps the live last error — documented in LIMITATIONS.
611
+ `pnpm run doctor` probes a fresh shell resident (`agent.handshake`: pid,
612
+ protocol, script digest) and reports the agent cache and live/stale
613
+ `dsh-wsl-*.scope` counts. Since 0.18.0 (WSL-313) `doctorReport` folds the live
614
+ resident's own view in where a shared agent exists (`mergeLiveResidentStatus`),
615
+ so an app-side report carries the live `lastError`; the CLI's handshake check
616
+ still names its probe source (`probed: a fresh resident`), and without an
617
+ app-side call the live last error stays in the app log — documented in
618
+ LIMITATIONS.
598
619
 
599
620
  **Why:** An in-flight agent death can take the filesystem substrate out until
600
621
  the app restarts; users experience "everything suddenly fails".
@@ -611,7 +632,8 @@ the app restarts; users experience "everything suddenly fails".
611
632
 
612
633
  **Tests/probes:** `test/agent.test.mjs` (revival, budget exhaustion, status,
613
634
  EXEC/read/write fault injection); `test/doctor.test.mjs` (handshake, digest
614
- mismatch); a real-machine kill/restart probe is still unrun.
635
+ mismatch); the real-machine kill/restart probe (`test/probe/agent-restart.sh`)
636
+ passed on 2026-11-06 (`docs/superpowers/probe-runs/2026-11-06-probe-suite.md`).
615
637
 
616
638
  **Depends on:** WSL-102 for status output.
617
639
 
@@ -802,6 +824,40 @@ release gate; full probe suite.
802
824
 
803
825
  **Depends on:** WSL-101, WSL-102, WSL-202, WSL-203.
804
826
 
827
+ ### WSL-316 — Doctor closed loop: WSL mode, `.wslconfig`/`wsl.conf` diagnostics, verdict and smoke legs
828
+
829
+ **Priority:** P2 · **Size:** L · **Labels:** `area:onboarding`,
830
+ `type:feature`, `priority:P2`
831
+
832
+ **Status:** implemented on the plugin side (2026-11-07); the app-closed probe suite legs and the GUI-session closed-loop leg are on the maintainer checklist — the real-machine record is [2026-11-07 doctor real-machine](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/superpowers/probe-runs/2026-11-07-doctor-real-machine.md). Designed and implemented the same day. The initial three
833
+ check groups (`distro.wsl-mode`, `config.wslconfig`, `distro.wsl-conf-*`) were
834
+ filed in [issue #35](https://github.com/Big-Dao/dsh-plugin-wsl-env/issues/35)
835
+ from the competitive triage (gaps #2/#3/#4). A commercial-doctor review added
836
+ A-level gaps (multi-distro `--all` with per-distro verdicts, the disk-full
837
+ class, `.wslconfig` semantics, the error-code matrix document, per-section
838
+ timing) and accepted B-level items (`--bundle`, DNS/clock legs, the
839
+ `git.win-safe` fix, `skipped` hygiene, deprecated-key detection) — the design
840
+ addendum and the acceptance list in the issue are the contract. Execution plan:
841
+ [2026-11-07 doctor closed-loop plan](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/superpowers/plans/2026-11-07-doctor-closed-loop.md).
842
+
843
+ **Why:** the doctor is the onboarding promise's enforcement point; the bar is
844
+ the closed loop — after `doctor` and its named remedies, the first command
845
+ works, and `verdict: ready | blocked` says so machine-readably under the
846
+ **effective configuration** (a `session.systemd` failure blocks only under
847
+ `sessionSandbox: true`; with `auto` the fallback runs).
848
+
849
+ **Acceptance:** the issue's revised checklist (fake-`wsl.exe` matrix per new
850
+ check, smoke-leg fault injection, the fix-loop before→after re-verify, the
851
+ Tier 1 closed loop run with the GUI-session leg executed by the maintainer,
852
+ bilingual DIAGNOSTICS coverage of every shipped error code).
853
+
854
+ **Tests/probes:** `test/doctor.test.mjs` fake-`wsl.exe`/`cmd.exe` matrix;
855
+ `pnpm run doctor` against the real `wsl.exe` (read-only); the app-closed probe
856
+ suite for the maintainer-run legs.
857
+
858
+ **Depends on:** none upstream; the GUI verdict surface stays behind the
859
+ session-notice seam (#10263, deferred).
860
+
805
861
  ## 10. Release gates
806
862
 
807
863
  A release is ready when: