dsh-plugin-wsl-env 0.18.0 → 0.19.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 +152 -0
- package/CONTRIBUTING.md +37 -5
- package/README.md +59 -4
- package/SUPPORT.md +3 -3
- package/agent/native/linux-aarch64/dsh-wsl-agent +0 -0
- package/agent/native/linux-x86_64/dsh-wsl-agent +0 -0
- package/agent/wsl-agent.sh +331 -11
- package/docs/AGENT-PROTOCOL-V7.md +175 -0
- package/docs/API.md +24 -0
- package/docs/ARCHITECTURE.md +14 -1
- package/docs/CONFIGURATION.md +12 -5
- package/docs/CONFIGURATION.zh.md +5 -3
- package/docs/LIMITATIONS.md +16 -4
- package/docs/LIMITATIONS.zh.md +20 -11
- package/docs/MIGRATION.md +4 -4
- package/docs/PEER-PARITY.md +50 -33
- package/docs/QUICKSTART.md +18 -1
- package/docs/QUICKSTART.zh.md +16 -1
- package/docs/README.zh.md +43 -4
- package/docs/RELEASING.md +1 -1
- package/docs/REQUIREMENTS.zh.md +3 -2
- package/docs/ROADMAP-1.0.md +27 -16
- package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +3 -1
- package/docs/UPSTREAM-SESSION-NOTICE.md +3 -1
- package/docs/UPSTREAM-TERMINAL-TITLE.md +3 -0
- package/docs/root-fs-routing.md +3 -3
- package/lib/agent-confined.js +4 -4
- package/lib/agent-errors.d.ts +1 -1
- package/lib/agent-errors.js +1 -1
- package/lib/agent-exec.d.ts +1 -1
- package/lib/agent-exec.js +1 -1
- package/lib/agent-protocol.d.ts +58 -8
- package/lib/agent-protocol.js +40 -7
- package/lib/agent-shared.d.ts +1 -1
- package/lib/agent-shared.js +1 -1
- package/lib/agent.d.ts +171 -1
- package/lib/agent.js +448 -288
- package/lib/auto-preset.d.ts +1 -1
- package/lib/auto-preset.js +1 -1
- package/lib/bwrap.d.ts +1 -1
- package/lib/bwrap.js +1 -1
- package/lib/distro-route.d.ts +1 -1
- package/lib/distro-route.js +1 -1
- package/lib/doctor-live.d.ts +53 -0
- package/lib/doctor-live.js +37 -0
- package/lib/file-reference-wsl.d.ts +1 -1
- package/lib/file-reference-wsl.js +1 -1
- package/lib/fs-decisions.d.ts +1 -1
- package/lib/fs-decisions.js +1 -1
- package/lib/fs-routing.d.ts +1 -1
- package/lib/fs-routing.js +1 -1
- package/lib/fs-substrate.d.ts +90 -11
- package/lib/fs-substrate.js +202 -1
- package/lib/fs.d.ts +1 -1
- package/lib/fs.js +1 -1
- package/lib/fsio-agent.d.ts +128 -4
- package/lib/fsio-agent.js +224 -15
- package/lib/fsio-text.d.ts +1 -1
- package/lib/fsio-text.js +1 -1
- package/lib/git-exec.d.ts +1 -1
- package/lib/git-exec.js +1 -1
- package/lib/git-route.d.ts +1 -1
- package/lib/git-route.js +1 -1
- package/lib/index.d.ts +105 -30
- package/lib/index.js +266 -122
- package/lib/listing.d.ts +1 -1
- package/lib/listing.js +1 -1
- package/lib/native-agent.d.ts +1 -1
- package/lib/native-agent.js +2 -2
- package/lib/paths.d.ts +6 -3
- package/lib/paths.js +4 -4
- package/lib/picker.d.ts +1 -1
- package/lib/picker.js +7 -7
- package/lib/ports.d.ts +1 -1
- package/lib/ports.js +1 -1
- package/lib/preflight.d.ts +1 -1
- package/lib/preflight.js +1 -1
- package/lib/sandbox-core.d.ts +1 -1
- package/lib/sandbox-core.js +2 -2
- package/lib/sandbox.d.ts +1 -1
- package/lib/sandbox.js +1 -1
- package/lib/search-exec.d.ts +1 -1
- package/lib/search-exec.js +1 -1
- package/lib/search-route.d.ts +1 -1
- package/lib/search-route.js +1 -1
- package/lib/session-runtime.d.ts +1 -1
- package/lib/session-runtime.js +2 -2
- package/lib/session-scope.d.ts +1 -1
- package/lib/session-scope.js +1 -1
- package/lib/shell-env.d.ts +1 -1
- package/lib/shell-env.js +1 -1
- package/lib/shell.d.ts +1 -1
- package/lib/shell.js +1 -1
- package/lib/subprocess.d.ts +1 -1
- package/lib/subprocess.js +2 -2
- package/lib/terminal-activity.d.ts +1 -1
- package/lib/terminal-activity.js +1 -1
- package/lib/terminal-route.d.ts +1 -1
- package/lib/terminal-route.js +1 -1
- package/lib/watcher.d.ts +1 -1
- package/lib/watcher.js +1 -1
- package/lib/wsl.d.ts +1 -31
- package/lib/wsl.js +1 -21
- package/package.json +15 -4
- package/scripts/doctor.mjs +34 -11
package/docs/CONFIGURATION.md
CHANGED
|
@@ -43,7 +43,8 @@ that row unless you pass `--force`. Prefer manual merging for existing profiles.
|
|
|
43
43
|
To edit the preset manually, replace the entire `preset-wsl` row. Its config is
|
|
44
44
|
not deep-merged: preserve `id`, `order`, and every item in `plugins`. Copy the
|
|
45
45
|
current block from `cordis.patch.yml` or from
|
|
46
|
-
`dsh --profile <name> --dump-config
|
|
46
|
+
`dsh --profile <name> --dump-config` (CLI distribution — the desktop app has no
|
|
47
|
+
`dsh` command), then change the nested values. Re-copy it
|
|
47
48
|
after a plugin upgrade that changes the preset.
|
|
48
49
|
|
|
49
50
|
### `wsl-shell`
|
|
@@ -51,7 +52,7 @@ after a plugin upgrade that changes the preset.
|
|
|
51
52
|
| Key | Default / shipped value | Description |
|
|
52
53
|
|---|---|---|
|
|
53
54
|
| `distro` | `''` (shipped) | Empty or `auto` follows the request workdir's distro. `default` selects WSL's default distro; a name pins commands to that distro. |
|
|
54
|
-
| `shell` | `''` | Empty resolves the distro user's login shell.
|
|
55
|
+
| `shell` | `''` | Empty resolves the distro user's login shell (`getent passwd`, then `$SHELL`). When both probes fail the command errors out instead of running under another shell — set an absolute Linux path here to pin one. |
|
|
55
56
|
| `loginShell` | `true` (shipped) | Use login semantics for POSIX shells. Non-POSIX shells use their own command form. |
|
|
56
57
|
| `agent` | `true` | Use the resident agent. If it is unavailable, commands use the one-shot `wsl.exe` path. Set `false` to always use that path. Cwd and sandbox refusals are returned directly. |
|
|
57
58
|
| `agentBackend` | `auto` (shipped) | `auto` selects the packaged static-musl binary at `agent/native/linux-<arch>/dsh-wsl-agent` or the `DSH_WSL_AGENT_NATIVE` override; otherwise it uses the shell agent. `native` fails if it cannot prepare; `shell` forces the shell agent. Applies to commands, confined writes, and shared reads. |
|
|
@@ -299,9 +300,15 @@ mutation fence; that row reports `sandboxMode: undefined` either way.
|
|
|
299
300
|
|
|
300
301
|
## Diagnose configuration and refusals
|
|
301
302
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
`pnpm run doctor` is the one-command environment check: Windows/WSL versions,
|
|
304
|
+
the distro and its shell, bubblewrap, systemd/Linger, the peer floor, a fresh
|
|
305
|
+
agent handshake, stale session scopes and the known profile-patch traps — each
|
|
306
|
+
failure with a copyable remedy (`--json` for scripts, `--fix` for the stale
|
|
307
|
+
scopes). With the CLI distribution, `dsh --profile <name> --dump-config` inspects
|
|
308
|
+
the composed profile without booting it and shows whether a row override
|
|
309
|
+
applied; the desktop app has no `dsh` command, so read `cordis.patch.yml` and
|
|
310
|
+
the Plugins page there.
|
|
311
|
+
Use `scripts/bootstrap.sh <distro>` to inspect distro prerequisites.
|
|
305
312
|
|
|
306
313
|
| Symptom | Result | Action |
|
|
307
314
|
|---|---|---|
|
package/docs/CONFIGURATION.zh.md
CHANGED
|
@@ -42,6 +42,7 @@ profile 层;检测到时会打印应使用的块。`--out` 会整体替换目
|
|
|
42
42
|
要手动编辑 preset,需替换整个 `preset-wsl` 行。它的 config
|
|
43
43
|
不做深度合并:保留 `id`、`order` 以及 `plugins` 中的每一项。
|
|
44
44
|
从 `cordis.patch.yml` 或 `dsh --profile <name> --dump-config`
|
|
45
|
+
(CLI 发行版;桌面应用没有 `dsh` 命令)
|
|
45
46
|
复制当前块,再修改嵌套的值。插件升级改变了 preset 后要重新复制。
|
|
46
47
|
|
|
47
48
|
### `wsl-shell`
|
|
@@ -49,7 +50,7 @@ profile 层;检测到时会打印应使用的块。`--out` 会整体替换目
|
|
|
49
50
|
| 键 | 默认 / shipped 值 | 说明 |
|
|
50
51
|
|---|---|---|
|
|
51
52
|
| `distro` | `''`(shipped) | 空或 `auto` 跟随请求工作目录所属的发行版。`default` 选择 WSL 默认发行版;给出名字则把命令固定到该发行版。 |
|
|
52
|
-
| `shell` | `''` | 空则解析发行版用户的登录 shell
|
|
53
|
+
| `shell` | `''` | 空则解析发行版用户的登录 shell(先 `getent passwd`,再 `$SHELL`)。两条探测都失败时命令直接报错,而不是落到另一个 shell——在此设置绝对 Linux 路径可固定一个。 |
|
|
53
54
|
| `loginShell` | `true`(shipped) | 对 POSIX shell 使用登录语义。非 POSIX shell 使用各自的命令形式。 |
|
|
54
55
|
| `agent` | `true` | 使用常驻 agent。不可用时,命令走一次性的 `wsl.exe` 路径。设为 `false` 则总是走该路径。Cwd 与沙箱拒绝会被直接返回。 |
|
|
55
56
|
| `agentBackend` | `auto`(shipped) | `auto` 选择包内 `agent/native/linux-<arch>/dsh-wsl-agent` 的静态 musl 二进制或 `DSH_WSL_AGENT_NATIVE` 覆盖;否则使用 shell agent。`native` 在准备失败时报错;`shell` 强制使用 shell agent。适用于命令、受限写入和共享读取。 |
|
|
@@ -288,8 +289,9 @@ profile 不使用会话 runtime 时,设置 `sessionSandbox: false`。
|
|
|
288
289
|
|
|
289
290
|
## 诊断配置问题与拒绝
|
|
290
291
|
|
|
291
|
-
|
|
292
|
-
|
|
292
|
+
CLI 发行版可用 `dsh --profile <name> --dump-config` 检查合成后的 profile,
|
|
293
|
+
无需真正启动;输出会显示某行的覆盖是否生效。桌面应用没有 `dsh` 命令,
|
|
294
|
+
请直接查看 `cordis.patch.yml` 与 Plugins 页面。
|
|
293
295
|
使用 `scripts/bootstrap.sh <distro>` 检查发行版前置依赖。
|
|
294
296
|
|
|
295
297
|
| 现象 | 结果 | 处理 |
|
package/docs/LIMITATIONS.md
CHANGED
|
@@ -24,8 +24,11 @@ operations never use the 9p share.
|
|
|
24
24
|
`FS_STALE_VERSION`, but a change between check and rename can still be overwritten.
|
|
25
25
|
- **A cancelled write can have an unknown outcome** — inspect the file before
|
|
26
26
|
retrying.
|
|
27
|
-
- **A successful write is
|
|
28
|
-
|
|
27
|
+
- **A successful write is as crash-durable as the platform's `sync -d`.** The
|
|
28
|
+
staged file is synced, and the containing directory is fsynced best effort
|
|
29
|
+
after the rename (shell agent). The native agent keeps its file-level
|
|
30
|
+
`sync_all` only — see the peer-parity divergence note. A filesystem that
|
|
31
|
+
refuses a directory fsync keeps the peer's own promise.
|
|
29
32
|
- **A Linux filename containing a backslash cannot be addressed** — the backslash is
|
|
30
33
|
the UNC separator, so `a\b.ts` round-trips to `a/b.ts`. Rename away from backslash
|
|
31
34
|
names; this is the coordinate system's own limit.
|
|
@@ -101,6 +104,12 @@ Commands run as `<shell> -lc <command>` — login (profile scripts sourced, so v
|
|
|
101
104
|
managers work) and **non-interactive** (no prompt/plugin output in the model's
|
|
102
105
|
streams). With `loginShell: false` the login flag is dropped (`<shell> -c <command>`).
|
|
103
106
|
|
|
107
|
+
`<shell>` is the distro user's login shell (`getent passwd`, then `$SHELL`). When
|
|
108
|
+
both probes fail — a cold distro, a flaky first `wsl.exe` call, a musl distro
|
|
109
|
+
without `getent` — the command **errors out** instead of silently running under
|
|
110
|
+
bash; the failure is not cached, so a retry re-probes. Set `shell:` to an
|
|
111
|
+
absolute path to pin one.
|
|
112
|
+
|
|
104
113
|
- **`~/.zshrc` / `~/.bashrc` are never read.** Move machine-level PATH setup
|
|
105
114
|
(`fnm`, nvm, cargo) into `~/.zprofile` or `~/.zshenv`; keep prompts and completion
|
|
106
115
|
in the rc file.
|
|
@@ -111,8 +120,11 @@ streams). With `loginShell: false` the login flag is dropped (`<shell> -c <comma
|
|
|
111
120
|
## Agent diagnostics
|
|
112
121
|
|
|
113
122
|
- **The doctor's `agent.handshake` probes a fresh resident**, not the live one —
|
|
114
|
-
a running resident's
|
|
115
|
-
|
|
123
|
+
a running resident's own view is folded in where a shared agent exists
|
|
124
|
+
(`doctorReport` merges `WslAgent.status()` via `mergeLiveResidentStatus`,
|
|
125
|
+
0.18.0), but the CLI's handshake check still names its probe source
|
|
126
|
+
(`probed: a fresh resident`); without an app-side call the `lastError`
|
|
127
|
+
stays in the app log.
|
|
116
128
|
- **`dsh-wsl-*.scope` counts are point-in-time**; `--fix` runs the preflight's sweep.
|
|
117
129
|
- **The doctor's `git.win-safe` probe reports the Windows git trust through interop
|
|
118
130
|
`git.exe`** — the `safe.directory` whitelist that WSL change review needs when
|
package/docs/LIMITATIONS.zh.md
CHANGED
|
@@ -21,8 +21,10 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
|
|
|
21
21
|
会重新校验版本。不匹配时返回 `FS_STALE_VERSION`,但检查与 rename 之间发生的
|
|
22
22
|
变更仍可能被覆盖。
|
|
23
23
|
- **被取消的写入结果可能是未知的** —— 重试前先检查文件。
|
|
24
|
-
-
|
|
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
|
这是坐标系自身的限制。
|
|
@@ -95,6 +97,11 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
|
|
|
95
97
|
因此版本管理器可用)且**非交互**(模型的输出流中没有提示符/插件输出)。
|
|
96
98
|
设置 `loginShell: false` 后去掉登录旗标(`<shell> -c <command>`)。
|
|
97
99
|
|
|
100
|
+
`<shell>` 是 distro 用户的登录 shell(先 `getent passwd`,再 `$SHELL`)。
|
|
101
|
+
两条探测都失败时——冷启动的 distro、首个 `wsl.exe` 调用抖动、没有 `getent`
|
|
102
|
+
的 musl 系——命令**直接报错**,而不是静默落到 bash;失败不缓存,重试即重探测。
|
|
103
|
+
需要钉死就用 `shell:` 指定绝对路径。
|
|
104
|
+
|
|
98
105
|
- **`~/.zshrc` / `~/.bashrc` 永远不会被读取。** 把机器级的 PATH 设置
|
|
99
106
|
(`fnm`、nvm、cargo)移进 `~/.zprofile` 或 `~/.zshenv`;提示符和补全
|
|
100
107
|
留在 rc 文件里。
|
|
@@ -105,8 +112,10 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
|
|
|
105
112
|
## Agent 诊断
|
|
106
113
|
|
|
107
114
|
- **doctor 的 `agent.handshake` 探测的是一个新起的常驻 agent**,而不是
|
|
108
|
-
|
|
109
|
-
|
|
115
|
+
在跑的那个——存在共享 agent 时,doctorReport 会经
|
|
116
|
+
`mergeLiveResidentStatus` 合入 `WslAgent.status()` 的在驻视角(0.18.0),
|
|
117
|
+
但 CLI 的握手检查仍会标注其探测来源(`probed: a fresh resident`);
|
|
118
|
+
没有应用侧调用时,`lastError` 仍留在应用日志里。
|
|
110
119
|
- **`dsh-wsl-*.scope` 计数是某一时刻的快照**;`--fix` 会执行预检的清扫。
|
|
111
120
|
- **doctor 的 `git.win-safe` 探针通过 interop 的 `git.exe` 报告 Windows git
|
|
112
121
|
的信任状态** —— 装了 Windows git 时,WSL 变更审查需要那份
|
|
@@ -158,13 +167,6 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
|
|
|
158
167
|
`unattendedTimeoutMs`(2 h)。`terminalIdleReclaim: false` 恢复手动关闭。
|
|
159
168
|
Windows 文件夹的宿主终端保持随包的不回收行为。
|
|
160
169
|
|
|
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
170
|
## 在运行中的 profile 上启用本插件
|
|
169
171
|
|
|
170
172
|
- **在繁忙的 profile 上通过 GUI 启用本 bundle 可能失败,重启应用即可生效。**
|
|
@@ -175,3 +177,10 @@ Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL
|
|
|
175
177
|
正确的)。启用前先关闭会话通常能让热路径成功——没有依赖方时,随包提供者会在
|
|
176
178
|
重组期间释放。机制与复现:
|
|
177
179
|
[UPSTREAM-SERVICE-SWAP.md](UPSTREAM-SERVICE-SWAP.md)。
|
|
180
|
+
|
|
181
|
+
## 宿主的"在应用中打开"
|
|
182
|
+
|
|
183
|
+
- **从"在应用中打开"启动 VS Code 可能独立于本插件而失败** ——
|
|
184
|
+
宿主带着 `ELECTRON_RUN_AS_NODE=1` 运行,启动器会继承它,于是
|
|
185
|
+
`Code.exe` 以 Node 身份启动并以退出码 1 结束。不属于本仓库管:
|
|
186
|
+
[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,
|
|
77
|
+
| `pnpm test` | style, links, syntax, build freshness, tsc, 41 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.
|
|
81
|
-
| Real-machine probe suite | `test/probe/run-all-when-closed.sh --include-fs` (needs the app closed) | manual; 15
|
|
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
|
|
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
|
package/docs/PEER-PARITY.md
CHANGED
|
@@ -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
|
-
|
|
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
|
|
134
|
-
`FS_PATCH_MISMATCH`
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
`
|
|
159
|
-
`
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -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 |
|
|
@@ -22,7 +30,11 @@ WSL version separately with `wsl.exe -l -v`. Doctor is read-only unless you pass
|
|
|
22
30
|
|
|
23
31
|
## 2. Install
|
|
24
32
|
|
|
25
|
-
|
|
33
|
+
The desktop app has no `dsh` command; open **Plugins** in the sidebar, choose
|
|
34
|
+
**Add plugin**, and enter the exact package name `dsh-plugin-wsl-env`. That
|
|
35
|
+
writes the profile's `package.json` and its `dsh.profile.bundles` entry.
|
|
36
|
+
|
|
37
|
+
With the CLI distribution (`dsh` on `PATH`), from Windows PowerShell:
|
|
26
38
|
|
|
27
39
|
```powershell
|
|
28
40
|
dsh plugin --profile <profile> add dsh-plugin-wsl-env
|
|
@@ -37,6 +49,11 @@ targets `wsl-shell`/`wsl-fs` by id.
|
|
|
37
49
|
|
|
38
50
|
## 3. Open a WSL workspace
|
|
39
51
|
|
|
52
|
+
Start the desktop app the way its Start-menu shortcut does: `DeepSeek Harness.exe`,
|
|
53
|
+
no arguments — it opens the profile the app is configured with (the Plugins page
|
|
54
|
+
writes into that one). (CLI distribution: `dsh --profile <profile>` boots a
|
|
55
|
+
profile of that name.)
|
|
56
|
+
|
|
40
57
|
In the GUI, open a folder through the picker (`\\wsl.localhost\<distro>\home\<you>\proj`)
|
|
41
58
|
or an UNC path directly. The session's commands, file tools, terminal and previews
|
|
42
59
|
all run in that distro; a Windows folder keeps the normal Windows environment.
|
package/docs/QUICKSTART.zh.md
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
| 会话在第一条命令前就被拒绝 |
|
|
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
|
-
|
|
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
|
package/docs/REQUIREMENTS.zh.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# 需求登记表与追溯矩阵
|
|
2
2
|
|
|
3
|
-
|
|
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/` 下
|
|
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 与实机);由组合测试与真机探针覆盖 |
|
package/docs/ROADMAP-1.0.md
CHANGED
|
@@ -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-
|
|
3
|
+
Status: working plan, last refreshed 2026-11-06 against `0.18.0` (autonomous run: coverage arms, `two-distro.sh`/`agent-restart.sh` authored, directory-fsync durability).
|
|
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
|
|
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
|
|
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 |
|
|
@@ -218,8 +218,15 @@ acceptance list in each issue is the contract; filter by priority:
|
|
|
218
218
|
workspace in its own distro, reads a drive-letter path on the host plane, and
|
|
219
219
|
refuses another distro's UNC — one leg of the acceptance below has real-machine
|
|
220
220
|
evidence (a 2026-10-31 run passed all 15 probes on one machine; not a matrix
|
|
221
|
-
result). The concurrent two-distro leg
|
|
222
|
-
|
|
221
|
+
result). The concurrent two-distro leg's dedicated probe
|
|
222
|
+
(`test/probe/two-distro.sh`) passed on the real machine on 2026-11-06
|
|
223
|
+
(`docs/superpowers/probe-runs/2026-11-06-probe-suite.md`): after its first run
|
|
224
|
+
failed on a wrong assertion vehicle (the session-scoped `DSH_WSL_DISTRO` is
|
|
225
|
+
absent on a direct `ctx.shell` seam), the probe was reworked to plant a marker
|
|
226
|
+
in each distro's `/tmp` and assert no leg sees the other's — sequential,
|
|
227
|
+
concurrent and burst interleave all stayed in their own distro. WSL-207's
|
|
228
|
+
kill/restart probe (`test/probe/agent-restart.sh`) passed in the same suite
|
|
229
|
+
run.
|
|
223
230
|
|
|
224
231
|
**Priority:** P0 · **Size:** L · **Labels:** `area:multi-distro`,
|
|
225
232
|
`type:feature`, `priority:P0`
|
|
@@ -229,15 +236,15 @@ another distro is refused instead of served.
|
|
|
229
236
|
|
|
230
237
|
**Acceptance:**
|
|
231
238
|
|
|
232
|
-
- [
|
|
239
|
+
- [x] `distro: "auto"` resolves the distro from the workspace UNC; an explicit
|
|
233
240
|
name still pins; `"default"` forces the WSL default.
|
|
234
|
-
- [
|
|
241
|
+
- [x] `wsl-shell`, `wsl-fs`, `fs-routing`, `subprocess-wsl` and `shell-env`
|
|
235
242
|
all follow the same coordinate rule.
|
|
236
|
-
- [
|
|
243
|
+
- [x] The shared agent and session runtime are keyed by distro; two distros run
|
|
237
244
|
concurrently.
|
|
238
|
-
- [
|
|
245
|
+
- [x] A workspace in its own distro never raises `FS_OUTSIDE_DISTRO`; another
|
|
239
246
|
distro's path still does.
|
|
240
|
-
- [
|
|
247
|
+
- [x] Migration note documents the `""`/`auto`/`default` semantics.
|
|
241
248
|
|
|
242
249
|
**Tests/probes:** unit tests for the resolver; two-distro real-machine probe;
|
|
243
250
|
cross-distro refusal leg; composition test through the service proxy.
|
|
@@ -590,11 +597,14 @@ agent queue; the service-level round-trip count remains qualitative.
|
|
|
590
597
|
enters a bounded revival (2/4/8 s backoff, one fresh transport and one rebuild
|
|
591
598
|
per attempt); after three deaths the refusal is permanent and names the restart
|
|
592
599
|
remedy. `WslAgent.status()` exposes state, pid, lastError, deaths and pending.
|
|
593
|
-
`pnpm run doctor`
|
|
594
|
-
protocol, script digest) and
|
|
595
|
-
`dsh-wsl-*.scope` counts.
|
|
596
|
-
|
|
597
|
-
|
|
600
|
+
`pnpm run doctor` probes a fresh shell resident (`agent.handshake`: pid,
|
|
601
|
+
protocol, script digest) and reports the agent cache and live/stale
|
|
602
|
+
`dsh-wsl-*.scope` counts. Since 0.18.0 (WSL-313) `doctorReport` folds the live
|
|
603
|
+
resident's own view in where a shared agent exists (`mergeLiveResidentStatus`),
|
|
604
|
+
so an app-side report carries the live `lastError`; the CLI's handshake check
|
|
605
|
+
still names its probe source (`probed: a fresh resident`), and without an
|
|
606
|
+
app-side call the live last error stays in the app log — documented in
|
|
607
|
+
LIMITATIONS.
|
|
598
608
|
|
|
599
609
|
**Why:** An in-flight agent death can take the filesystem substrate out until
|
|
600
610
|
the app restarts; users experience "everything suddenly fails".
|
|
@@ -611,7 +621,8 @@ the app restarts; users experience "everything suddenly fails".
|
|
|
611
621
|
|
|
612
622
|
**Tests/probes:** `test/agent.test.mjs` (revival, budget exhaustion, status,
|
|
613
623
|
EXEC/read/write fault injection); `test/doctor.test.mjs` (handshake, digest
|
|
614
|
-
mismatch);
|
|
624
|
+
mismatch); the real-machine kill/restart probe (`test/probe/agent-restart.sh`)
|
|
625
|
+
passed on 2026-11-06 (`docs/superpowers/probe-runs/2026-11-06-probe-suite.md`).
|
|
615
626
|
|
|
616
627
|
**Depends on:** WSL-102 for status output.
|
|
617
628
|
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Status: measured and deferred (2026-10-19; checked against a
|
|
4
4
|
`dsh-v0.2.1-rc.2`-era upstream — the checked version was not recorded at
|
|
5
5
|
the time. Plugin-side behavior re-verified 2026-11-02 against the current
|
|
6
|
-
peer floor, `>=0.2.1-rc.3`).
|
|
6
|
+
peer floor, `>=0.2.1-rc.3`). Online check 2026-11-06: upstream `v0.2.2-rc.1` (2026-11-04) still mounts no
|
|
7
|
+
`FileReferenceTraversal`; the interface lives in open discussion
|
|
8
|
+
[#10264](https://github.com/deepseek-ai/deepseek-harness/discussions/10264) with no implementation. The `@` completion in
|
|
7
9
|
`@deepseek-ai/dsh-file-reference-local` walks the workspace with
|
|
8
10
|
`node:fs/promises` (`readdir` + `lstat`) from the **Windows** harness process.
|
|
9
11
|
For a WSL workspace that walk crosses the 9p share on every directory; the
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Status: filed upstream as
|
|
4
4
|
[deepseek-ai/deepseek-harness#10263](https://github.com/deepseek-ai/deepseek-harness/discussions/10263)
|
|
5
5
|
(version line `0.2.1-rc.x`; the gap was checked
|
|
6
|
-
against `dsh-v0.2.1-rc.2` on 2026-10-19).
|
|
6
|
+
against `dsh-v0.2.1-rc.2` on 2026-10-19). Online check 2026-11-06: upstream `v0.2.2-rc.1`
|
|
7
|
+
(2026-11-04) still ships no session-notice seam, and the discussion is open with no
|
|
8
|
+
maintainer response. The exact filing payload (title, body,
|
|
7
9
|
command) is [proposal-session-notice.md](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/docs/upstream/proposal-session-notice.md). The plugin ships the workaround
|
|
8
10
|
described at the end: the advisory goes to the log **and** into the session's
|
|
9
11
|
runtime context, which is model-visible and appears in the session transcript,
|