dsh-plugin-wsl-env 0.17.1 → 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.
Files changed (110) hide show
  1. package/CHANGELOG.md +225 -0
  2. package/CONTRIBUTING.md +37 -5
  3. package/README.md +61 -6
  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/cordis.patch.yml +10 -5
  9. package/docs/AGENT-PROTOCOL-V7.md +175 -0
  10. package/docs/API.md +24 -0
  11. package/docs/ARCHITECTURE.md +20 -6
  12. package/docs/COMPATIBILITY.md +1 -1
  13. package/docs/CONFIGURATION.md +33 -5
  14. package/docs/CONFIGURATION.zh.md +25 -4
  15. package/docs/LIMITATIONS.md +39 -7
  16. package/docs/LIMITATIONS.zh.md +31 -6
  17. package/docs/MIGRATION.md +4 -4
  18. package/docs/PEER-PARITY.md +94 -35
  19. package/docs/QUICKSTART.md +19 -2
  20. package/docs/QUICKSTART.zh.md +16 -1
  21. package/docs/README.zh.md +47 -7
  22. package/docs/RELEASING.md +3 -2
  23. package/docs/REQUIREMENTS.zh.md +11 -6
  24. package/docs/ROADMAP-1.0.md +40 -29
  25. package/docs/ROADMAP.md +10 -6
  26. package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +6 -1
  27. package/docs/UPSTREAM-FSIO-EXPORT.md +2 -2
  28. package/docs/UPSTREAM-SERVICE-SWAP.md +124 -0
  29. package/docs/UPSTREAM-SESSION-NOTICE.md +3 -1
  30. package/docs/UPSTREAM-TERMINAL-TITLE.md +3 -0
  31. package/docs/root-fs-routing.md +3 -3
  32. package/lib/agent-confined.js +4 -4
  33. package/lib/agent-errors.d.ts +1 -1
  34. package/lib/agent-errors.js +1 -1
  35. package/lib/agent-exec.d.ts +1 -1
  36. package/lib/agent-exec.js +1 -1
  37. package/lib/agent-protocol.d.ts +58 -8
  38. package/lib/agent-protocol.js +40 -7
  39. package/lib/agent-shared.d.ts +1 -1
  40. package/lib/agent-shared.js +1 -1
  41. package/lib/agent.d.ts +171 -1
  42. package/lib/agent.js +448 -288
  43. package/lib/auto-preset.d.ts +1 -1
  44. package/lib/auto-preset.js +1 -1
  45. package/lib/bwrap.d.ts +1 -1
  46. package/lib/bwrap.js +1 -1
  47. package/lib/distro-route.d.ts +1 -1
  48. package/lib/distro-route.js +1 -1
  49. package/lib/doctor-live.d.ts +53 -0
  50. package/lib/doctor-live.js +37 -0
  51. package/lib/file-reference-wsl.d.ts +1 -1
  52. package/lib/file-reference-wsl.js +1 -1
  53. package/lib/fs-decisions.d.ts +1 -1
  54. package/lib/fs-decisions.js +1 -1
  55. package/lib/fs-routing.d.ts +52 -2
  56. package/lib/fs-routing.js +56 -1
  57. package/lib/fs-substrate.d.ts +90 -11
  58. package/lib/fs-substrate.js +202 -1
  59. package/lib/fs.d.ts +1 -1
  60. package/lib/fs.js +1 -1
  61. package/lib/fsio-agent.d.ts +128 -4
  62. package/lib/fsio-agent.js +224 -15
  63. package/lib/fsio-text.d.ts +1 -1
  64. package/lib/fsio-text.js +1 -1
  65. package/lib/git-exec.d.ts +1 -1
  66. package/lib/git-exec.js +1 -1
  67. package/lib/git-route.d.ts +1 -1
  68. package/lib/git-route.js +1 -1
  69. package/lib/index.d.ts +127 -3
  70. package/lib/index.js +301 -99
  71. package/lib/listing.d.ts +1 -1
  72. package/lib/listing.js +1 -1
  73. package/lib/native-agent.d.ts +1 -1
  74. package/lib/native-agent.js +2 -2
  75. package/lib/paths.d.ts +6 -3
  76. package/lib/paths.js +4 -4
  77. package/lib/picker.d.ts +1 -1
  78. package/lib/picker.js +7 -7
  79. package/lib/ports.d.ts +1 -1
  80. package/lib/ports.js +1 -1
  81. package/lib/preflight.d.ts +1 -1
  82. package/lib/preflight.js +1 -1
  83. package/lib/sandbox-core.d.ts +1 -1
  84. package/lib/sandbox-core.js +2 -2
  85. package/lib/sandbox.d.ts +1 -1
  86. package/lib/sandbox.js +1 -1
  87. package/lib/search-exec.d.ts +1 -1
  88. package/lib/search-exec.js +1 -1
  89. package/lib/search-route.d.ts +1 -1
  90. package/lib/search-route.js +1 -1
  91. package/lib/session-runtime.d.ts +1 -1
  92. package/lib/session-runtime.js +2 -2
  93. package/lib/session-scope.d.ts +1 -1
  94. package/lib/session-scope.js +1 -1
  95. package/lib/shell-env.d.ts +1 -1
  96. package/lib/shell-env.js +1 -1
  97. package/lib/shell.d.ts +1 -1
  98. package/lib/shell.js +1 -1
  99. package/lib/subprocess.d.ts +1 -1
  100. package/lib/subprocess.js +2 -2
  101. package/lib/terminal-activity.d.ts +1 -1
  102. package/lib/terminal-activity.js +1 -1
  103. package/lib/terminal-route.d.ts +1 -1
  104. package/lib/terminal-route.js +1 -1
  105. package/lib/watcher.d.ts +1 -1
  106. package/lib/watcher.js +1 -1
  107. package/lib/wsl.d.ts +1 -31
  108. package/lib/wsl.js +1 -21
  109. package/package.json +41 -28
  110. package/scripts/doctor.mjs +34 -11
@@ -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,11 +30,15 @@ WSL version separately with `wsl.exe -l -v`. Doctor is read-only unless you pass
22
30
 
23
31
  ## 2. Install
24
32
 
25
- From a Windows PowerShell where the DSH CLI is available:
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
29
- # 若解析到旧版本(发布当天的元数据缓存),显式指定:
41
+ # if it resolves to a stale version (same-day registry metadata cache), pin it:
30
42
  # dsh plugin --profile <profile> add dsh-plugin-wsl-env@<latest>
31
43
  dsh --profile <profile> --dump-config # the plugin rows must be there
32
44
  ```
@@ -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.
@@ -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
@@ -72,9 +109,9 @@ dsh --profile wsl # 启动
72
109
  wsl.exe -d <发行版> -u root -- apt-get install -y bubblewrap
73
110
  ```
74
111
 
75
- 在插件检出目录中,`pnpm run bootstrap <发行版>` 检查四个发行版工具,并按包管理器打印安装命令;加 `--install` 仅在缺少 bubblewrap 时执行该命令。若只缺少其他工具,请自行执行打印的命令。
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
 
@@ -94,13 +131,13 @@ wsl.exe -d <发行版> -u root -- apt-get install -y bubblewrap
94
131
  |---|---|---|---|
95
132
  | `wsl-shell` | `distro` | `''` | 发行版模式;空/`auto` 跟随工作区,`default` 强制 WSL 默认 |
96
133
  | | `sandbox` | `true` | 用 `bubblewrap` 约束命令 |
97
- | | `sessionSandbox` | `true` | 会话命令跑在同一个 systemd user scope 中 |
134
+ | | `sessionSandbox` | 随包 `true` | 会话命令跑在同一个 systemd user scope 中 |
98
135
  | | `agentBackend` | `auto` | 发行版内 agent:`auto`、`native` 或 `shell` |
99
136
  | | `maskWindowsDrive` | `false` | 让受限命令看不到 `/mnt` |
100
137
  | `wsl-fs` | `distro` | `''` | 发行版模式;空/`auto` 跟随每个目标路径 |
101
138
  | | `restrictToDistro` | `true` | 固定发行版(`default` 或名字)时拒绝属于其他发行版的路径 |
102
139
  | | `sandbox` | `true` | 按策略检查受限写入 |
103
- | | `sessionSandbox` | `true` | 受限写入跑在会话 runtime 中 |
140
+ | | `sessionSandbox` | 随包 `true` | 受限写入跑在会话 runtime 中 |
104
141
  | | `substrate` | `agent` | 发行版内 agent;`share` 在启动时被拒绝 |
105
142
  | `directory-picker-wsl` | `includeHostHome` | `true` | 同时列出 Windows 家目录 |
106
143
  | `subprocess-wsl` | `distro` | `''` | 发行版模式;空/`auto` 跟随启动目录 |
@@ -146,9 +183,10 @@ 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` 为准:列出插件即安装成功 |
189
+ | 对 `wsl-shell`/`wsl-fs` 的 profile 补丁不生效 | 这些行嵌套在 `preset-wsl` 里。运行 `pnpm run preset --check <补丁>`;它会失败并输出需要粘贴的完整块 |
152
190
  | 改了 `lib/` 但不生效 | 运行 `pnpm run sync:windows`,然后重启应用 |
153
191
 
154
192
  更多错误码和拒绝原因见 [docs/ARCHITECTURE.md](ARCHITECTURE.md#error-codes),插件不做的事见 [docs/LIMITATIONS.md](LIMITATIONS.md)。
@@ -171,8 +209,10 @@ pnpm run sync:windows # 更新应用加载的 Windows 侧副本
171
209
 
172
210
  | 文档 | 内容 |
173
211
  |---|---|
212
+ | [docs/QUICKSTART.md](QUICKSTART.md) | 首次运行、常用配方、兼容性 |
174
213
  | [docs/CONFIGURATION.md](CONFIGURATION.md) | 所有配置键及覆盖方法 |
175
214
  | [docs/ARCHITECTURE.md](ARCHITECTURE.md) | 服务、路径路由、沙箱、错误码 |
215
+ | [docs/PERFORMANCE.md](PERFORMANCE.md) | ext4 agent 对比 9p 的实测延迟与复现方法 |
176
216
  | [docs/LIMITATIONS.md](LIMITATIONS.md) | 插件不做的事 |
177
217
  | [docs/ROADMAP.md](ROADMAP.md) | 当前计划和推迟项 |
178
218
  | [docs/ROADMAP-1.0.md](ROADMAP-1.0.md) | 1.0 与生态优化计划 |
package/docs/RELEASING.md CHANGED
@@ -46,13 +46,14 @@ 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
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
@@ -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
  三个问题:**有哪些需求、在哪里规定、靠什么验证**。
@@ -10,7 +11,11 @@ docs/ 各篇里的行为承诺登记成带编号的需求条目,并给每条
10
11
 
11
12
  维护规则与 [PARITY.md](PARITY.md) 的纪律一致:需求变更与登记表改动进同一笔
12
13
  变更;新增行为承诺先入表再实现;「验证」列与测试同改。登记表的唯一判定
13
- 来源是文档与代码的现状,不是意图。
14
+ 来源是文档与代码的现状,不是意图。「验证」列引用的测试由
15
+ `pnpm run lint:requirements`(`scripts/check-requirements.mjs`,已入
16
+ `pnpm test` 门禁链)机械校验:被引测试必须存在且列入 `test:unit` 与
17
+ `test:coverage` 两个脚本;ID 不得重复;未引用测试的行为/过程性条目会在
18
+ 输出中点名保留可见。
14
19
 
15
20
  ## 判尺
16
21
 
@@ -39,19 +44,19 @@ docs/ 各篇里的行为承诺登记成带编号的需求条目,并给每条
39
44
  | 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
45
  | 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
46
  | 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) | 无自动化守护 |
47
+ | 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 |
48
+ | R14 | bootstrap:bwrap/ripgrep 等的就地体检与安装 | README「Install」「Troubleshooting」;CONFIGURATION | ①②⑤:`--install` 与只读体检两式、体检对象、错误消息补救指引成文 | 0.7.4 起脚本随包(`files` 收录,补救指引在 npm 安装下可用) | 脚本本身无 CI 腿(真机排错路径覆盖) |
45
49
  | 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
50
  | R16 | 对端 parity 合同:fsio 文本机制逐字节复刻钉死的对端版本 | PEER-PARITY 全文 | ①④⑥:钉版、验证方法(npm pack 逐函数比对)、验证日期、刻意分歧逐条声明、bump 钉版即重跑的维护规则 | `fsio-agent.test.mjs`(distro 内半区 canary);对端比对为手动方法 | 钉版升级后需重跑比对(维护规则) |
47
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 | — |
48
52
  | R18 | 配置面:每键默认值成文;层组合语义(整行替换、不深合并、后层胜) | CONFIGURATION;`cordis.patch.yml` 头注 | ⑤:随发键成表、未列表键点名;覆盖方式的正确心智模型(整行替换)成文 | `composition.test.mjs`(层组合);`style.mjs`(`files` 契约) | — |
49
53
  | R19 | 非目标集:不做什么与为什么 | LIMITATIONS 开篇原则;PARITY「Not applicable」 | ③:已知极限入册;不适用项「记下来免得像遗漏」 | —(文档性) | — |
50
- | 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) |
51
55
  | R21 | 安全过程:范围内外、响应时限、partial 属设计边界、凭据政策 | SECURITY 全文 | ②③⑥:范围、3/10/30 个工作日时限(标注「目标非合同」)、partial 定性、凭据零容忍成文 | —(过程性) | — |
52
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 版本仍需验证 |
53
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 与实机);由组合测试与真机探针覆盖 |
54
58
  | 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` 保持启用、接管行不存在) | — |
59
+ | R25 | 安装/卸载/升级流:四步安装、幂等陷阱及补救、ES 模块重启须知 | README「Install」「Troubleshooting」 | ①③:每步预期输出、`add` 幂等性陷阱的补救(先 remove 再 add)、pnpm UNC 链接极限成文 | 人工步骤,无自动化(依赖真实 dsh CLI + Windows) | 无自动化守护 |
55
60
 
56
61
  登记覆盖面:上表登记 README 与 docs/ 中对外成文的行为承诺(含随发的服务面)。
57
62
  **有意未接线**的模块不设条目——`lib/file-reference-wsl.js`(`@` 补全的发行版侧
@@ -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-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 | 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 |
@@ -115,11 +115,11 @@ the 0.12.0 productization list.
115
115
 
116
116
  | ID | Outcome | Acceptance gate | Size |
117
117
  |---|---|---|---|
118
- | P0.1 | `distro: auto` coordinate routing across shell, fs, terminal, shell-env and the session runtime | Default Ubuntu + Debian workspace runs in Debian; two distro sessions concurrent; explicit pin still wins; cross-distro paths still refuse | L |
119
- | P0.2 | One `doctor`/`setup` path covering bwrap, systemd, Linger, optional tools, peers and config | Clean Win11 + Ubuntu passes in five minutes; missing bwrap, non-systemd, stopped distro and wrong peer each produce a copy-paste remedy | M |
120
- | P0.3 | Safe `preset-wsl` override helper and validation | Changing `sessionSandbox` or `distro` works in one step; an invalid nested patch fails loudly instead of warning | M |
121
- | P0.4 | Documentation and gate hygiene | The three known drifts are fixed; `fs-routing` enters the test lists; `probe:fs-routing` exists; links resolve | S |
122
- | P0.5 | Preflight visible before the first command | A missing bwrap or systemd/Linger is visible in the session UI, not only in `logger.warn` | M |
118
+ | [P0.1](#wsl-101--multi-distro-coordinate-routing) | `distro: auto` coordinate routing across shell, fs, terminal, shell-env and the session runtime | Default Ubuntu + Debian workspace runs in Debian; two distro sessions concurrent; explicit pin still wins; cross-distro paths still refuse | L |
119
+ | [P0.2](#wsl-102--doctor-and-one-command-setup) | One `doctor`/`setup` path covering bwrap, systemd, Linger, optional tools, peers and config | Clean Win11 + Ubuntu passes in five minutes; missing bwrap, non-systemd, stopped distro and wrong peer each produce a copy-paste remedy | M |
120
+ | [P0.3](#wsl-103--preset-override-guardrail) | Safe `preset-wsl` override helper and validation | Changing `sessionSandbox` or `distro` works in one step; an invalid nested patch fails loudly instead of warning | M |
121
+ | [P0.4](#wsl-104--documentation-and-gate-hygiene) | Documentation and gate hygiene | The three known drifts are fixed; `fs-routing` enters the test lists; `probe:fs-routing` exists; links resolve | S |
122
+ | [P0.5](#wsl-105--visible-preflight-and-systemdlinger-coverage) | Preflight visible before the first command | A missing bwrap or systemd/Linger is visible in the session UI, not only in `logger.warn` | M |
123
123
 
124
124
  P0 is not a performance phase. It is the difference between "the plugin is
125
125
  correct once configured" and "the plugin is correct on first contact".
@@ -128,15 +128,15 @@ correct once configured" and "the plugin is correct on first contact".
128
128
 
129
129
  | ID | Outcome | Acceptance gate | Size |
130
130
  |---|---|---|---|
131
- | P1.1 | `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
- | P1.2 | 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 | Install/upgrade/uninstall E2E | Temporary `DSH_HOME`, packed tarball, `dsh plugin add`, `--dump-config`, remove; upgrade from the previous minor | M |
134
- | P1.4 | `@` references seam | Measure the 9p cost; land the upstream `FileReferenceTraversal` seam or a declared, tested fallback | L |
135
- | P1.5 | LSP provider spike | A documented plan and prototype for `ctx.lsp` over fs + subprocess, conditional on the desktop composition mounting LSP | M |
136
- | P1.6 | GUI preview performance | Baseline measured; p95 <= 1s/MiB for a representative page; v6 only if the measurement justifies it | M |
137
- | P1.7 | Agent recovery and status | In-flight death recovers within 2s or fails with a named state; `doctor`/status shows agent and scope health | M |
138
- | P1.8 | Security posture | Strict preset documented and probed; interop visibility/mask matrix; no claim beyond `partial` | S |
139
- | P1.9 | Peer upgrade canary | A scheduled check against the latest DSH line reports breakage before users do | S |
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
+ | [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, profile install (Plugins page or `dsh plugin add`), `--dump-config` where the CLI exists, remove; upgrade from the previous minor | M |
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
+ | [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
+ | [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 |
137
+ | [P1.7](#wsl-207--agent-recovery-and-status) | Agent recovery and status | In-flight death recovers within 2s or fails with a named state; `doctor`/status shows agent and scope health | M |
138
+ | [P1.8](#wsl-208--security-strict-profile-and-interop-matrix) | Security posture | Strict preset documented and probed; interop visibility/mask matrix; no claim beyond `partial` | S |
139
+ | [P1.9](#wsl-209--peer-upgrade-canary) | Peer upgrade canary | A scheduled check against the latest DSH line reports breakage before users do | S |
140
140
 
141
141
  ### P2 — make it the ecosystem default (3-6 months)
142
142
 
@@ -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 still has no dedicated probe and has
222
- not been run; the checkboxes stay unchecked until that leg exists.
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
- - [ ] `distro: "auto"` resolves the distro from the workspace UNC; an explicit
239
+ - [x] `distro: "auto"` resolves the distro from the workspace UNC; an explicit
233
240
  name still pins; `"default"` forces the WSL default.
234
- - [ ] `wsl-shell`, `wsl-fs`, `fs-routing`, `subprocess-wsl` and `shell-env`
241
+ - [x] `wsl-shell`, `wsl-fs`, `fs-routing`, `subprocess-wsl` and `shell-env`
235
242
  all follow the same coordinate rule.
236
- - [ ] The shared agent and session runtime are keyed by distro; two distros run
243
+ - [x] The shared agent and session runtime are keyed by distro; two distros run
237
244
  concurrently.
238
- - [ ] A workspace in its own distro never raises `FS_OUTSIDE_DISTRO`; another
245
+ - [x] A workspace in its own distro never raises `FS_OUTSIDE_DISTRO`; another
239
246
  distro's path still does.
240
- - [ ] Migration note documents the `""`/`auto`/`default` semantics.
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` 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.
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); a real-machine kill/restart probe is still unrun.
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
 
package/docs/ROADMAP.md CHANGED
@@ -20,7 +20,7 @@ section.
20
20
  | A4 | the native-session probe (scope, EXEC, FS, KILL, digest, teardown, 8/8) in the real-machine suite; the warm-cache and stdin-EPIPE fixes |
21
21
  | A5 | the native agent is the documented default; 0.10.0 published (npm + GitHub Release) |
22
22
  | A6 | `WslAgent.metrics()` and `test/probe/fs-queue.mjs`; the shared shell read agent is the measured batch bottleneck |
23
- | A7 | native shared read agent (v5); 16 concurrent shared reads 2.4–4.1 ms; shell remains the fallback |
23
+ | A7 | native shared read agent (protocol v5 at the time); 16 concurrent shared reads 2.4–4.1 ms at the A7 measurement; shell remains the fallback |
24
24
  | A8 | aarch64 18-check under qemu-user in CI (built binary and committed `linux-aarch64` artifact); physical aarch64 WSL out of scope, see COMPATIBILITY.md |
25
25
 
26
26
  ## Next
@@ -40,12 +40,14 @@ shell as the fallback:
40
40
  probe); the `WslAgent` with `expectedDigest` and `signalable: false`; on a
41
41
  preparation or HELLO failure the shell agent serves the reads — fail-open to
42
42
  the shell, never fail-closed;
43
- - **surface:** the same six v5 FS ops and `dsh-fs` side channel; the
43
+ - **surface:** the same six FS ops (unchanged since v5) and `dsh-fs` side
44
+ channel; the
44
45
  `fs-substrate`/`DistroFs` parse is unchanged; the A2 differential covers the
45
46
  records;
46
47
  - **result:** `WslAgent` gained a `prepare()` hook and the shared agent now
47
48
  selects the native entry through it. `test/probe/fs-queue.mjs` measures 16
48
- concurrent shared reads at **2.4-4.1 ms** (from 342-614 ms); the first start
49
+ concurrent shared reads at **2.4-4.1 ms** (from 342-614 ms; later reruns
50
+ span 2.4-8.2 ms); the first start
49
51
  pays the ensure/cache cost (~70 ms once). The shell still serves the reads
50
52
  under `agentBackend: shell` and after a native failure.
51
53
 
@@ -65,10 +67,12 @@ real aarch64 hardware is not planned.
65
67
 
66
68
  ## Deferred
67
69
 
68
- - **v6 (FS concurrency / ERR frames / per-request env).** The A6 measurement
70
+ - **v6 remainder (FS write-lock removal / per-request ERR frames).** The EXEC
71
+ stdin payload and the per-request env (`env --` argv prefix) landed with
72
+ protocol v6 in 0.17.0. The A6 measurement
69
73
  shows the lock-removal gain is marginal (~7.7 -> ~5 ms per 16 writes, ~12.2
70
- -> ~8 ms per 16 reads). Revisit only if the native shared v5 still queues
71
- measurably or the ERR/env framing is needed for another reason.
74
+ -> ~8 ms per 16 reads). Revisit only if the native shared agent still queues
75
+ measurably or per-request ERR framing is needed for another reason.
72
76
  - **Event stream.** No current consumer: the `fs.watch` contract is coarse and
73
77
  the inotify watcher satisfies it; terminal activity and ports poll.
74
78
  - **Shell retirement.** Not planned. The shell agent remains the fallback
@@ -1,6 +1,11 @@
1
1
  # Upstream seam: `@` references over a WSL workspace
2
2
 
3
- Status: measured and deferred (2026-10-19). The `@` completion in
3
+ Status: measured and deferred (2026-10-19; checked against a
4
+ `dsh-v0.2.1-rc.2`-era upstream — the checked version was not recorded at
5
+ the time. Plugin-side behavior re-verified 2026-11-02 against the current
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
4
9
  `@deepseek-ai/dsh-file-reference-local` walks the workspace with
5
10
  `node:fs/promises` (`readdir` + `lstat`) from the **Windows** harness process.
6
11
  For a WSL workspace that walk crosses the 9p share on every directory; the
@@ -120,8 +120,8 @@ locally (`src/fsio-agent.ts:27-36`, `src/fs-substrate.ts:37`,
120
120
  are.
121
121
 
122
122
  Importing from the entry costs this consumer nothing new: it already imports
123
- `LocalFileSystem` from the same entry (`src/index.ts:45`,
124
- `src/fs-routing.ts:35`) and `@deepseek-ai/dsh-fs` (`src/index.ts:46`). The
123
+ `LocalFileSystem` from the same entry (`src/index.ts:46`,
124
+ `src/fs-routing.ts:36`) and `@deepseek-ai/dsh-fs` (`src/index.ts:47`). The
125
125
  entry's non-builtin static imports are `chokidar` (`lib/index.js:3`),
126
126
  `@deepseek-ai/schemastery` (`:6`) and the `@deepseek-ai/dsh-fs` peer (`:7`) —
127
127
  all three already in this consumer's graph; `koffi` loads lazily (`await
@@ -0,0 +1,124 @@
1
+ # Upstream proposal: a same-name service swap that survives live recomposition
2
+
3
+ Status: observed, not yet filed. The failure was first seen on the desktop
4
+ `0.2.2-rc.1` release (app-bundled `@deepseek-ai/cordis@4.1.0` +
5
+ `@deepseek-ai/cordis-plugin-loader@1.1.0`; the npm line still ships
6
+ cordis `4.0.5` / loader `1.0.5`, which this repository pins), reproduced
7
+ in isolation against both version pairs on 2026-11-05, and the mechanism
8
+ is confirmed down to the `_unload` diff. Filing payload not yet drafted.
9
+
10
+ ## The gap
11
+
12
+ A plugin row that **replaces** a shipped row providing the same cordis
13
+ service (this plugin's `subprocess-wsl` over `subprocess`,
14
+ `fs-routing` over `fs-sandbox`, `directory-picker-wsl` over
15
+ `directory-picker`) cannot activate through a **live** bundle
16
+ enable/disable cycle while any consumer still holds the shipped
17
+ service. The enable reports `operation-error` with a diagnostic of the
18
+ shape:
19
+
20
+ ```
21
+ dsh: warning: 3 entries did not activate
22
+ subprocess-wsl (dsh-plugin-wsl-env/subprocess): Error: service "subprocess" has been registered at <LocalSubprocessRuntime>
23
+ directory-picker-wsl (dsh-plugin-wsl-env/picker): Error: service "directoryPicker" has been registered at <NativeDirectoryPicker>
24
+ fs-routing (dsh-plugin-wsl-env/fs-routing): Error: service "fs" has been registered at <SandboxedFileSystem>
25
+ ```
26
+
27
+ The composition itself is correct — the same patch list over an empty
28
+ root (a restart, or the install-time path) disables the shipped rows and
29
+ activates the replacements cleanly. Only the hot path fails.
30
+
31
+ ## Mechanism
32
+
33
+ Two independent version changes compose into the failure.
34
+
35
+ 1. **cordis 4.1.0 defers provision disposal behind dependent drain.**
36
+ `Fiber._unload` gained a first step that 4.0.5 did not have:
37
+
38
+ ```js
39
+ // 4.1.0 — provisions release only after every dependent has released
40
+ while ([...this.provisions].some((impl) => impl.dependents.size))
41
+ await new Promise((resolve) => this._release = resolve);
42
+ await Promise.all(this._disposables.clear().map(...)); // disposers run HERE
43
+ ```
44
+
45
+ 4.0.5 ran the disposers first thing. The provide disposer's
46
+ synchronous `delete this.store[...]` — the moment the service
47
+ registration slot frees — therefore moves from "at dispose() call
48
+ time" to "after every dependent fiber has released the service".
49
+
50
+ 2. **loader 1.1.0 awaits the disabled transition.** `Entry.update`'s
51
+ disabled branch changed from `this.fiber?.dispose()` (1.0.5,
52
+ fire-and-forget) to `await this.fiber?.dispose()` (1.1.0), so the
53
+ disable parks on the same dependent drain.
54
+
55
+ `EntryGroup.update` runs the disable and the insert of one
56
+ recomposition in one `Promise.all`, so the challenger fiber starts —
57
+ imports, applies, calls `ctx.provide` — while the shipped fiber still
58
+ holds the registration. Cordis's guard throws, the challenger's fiber
59
+ enters `FAILED`, and `recompose` reports every such entry as an
60
+ introduced failure. With live sessions holding the service, the drain
61
+ gate is exactly the thing that cannot clear: the old implementation
62
+ waits for dependents to release, and the dependents would only release
63
+ onto a replacement that cannot register. The enable fails deterministically
64
+ on a busy profile and stays failed until a restart.
65
+
66
+ ## Isolated reproduction
67
+
68
+ One file, driven against both version pairs (`cordis:group` group, one
69
+ provider, one challenger for the same service name, one dependent that
70
+ releases on a 2 s timer):
71
+
72
+ | Versions | During the hold | Error |
73
+ |---|---|---|
74
+ | cordis 4.0.5 + loader 1.0.5 (the 0.2.1 npm line) | challenger `ACTIVE` | none — the shipped slot frees at dispose() call time |
75
+ | cordis 4.1.0 + loader 1.1.0 (bundled in 0.2.2-rc.1) | challenger `FAILED`, shipped `UNLOADING` | `service "demo" has been registered at <shipper>` |
76
+
77
+ After the hold drains, the 4.1.0 challenger stays `FAILED` — the
78
+ collision error is terminal for that fiber; recomposition does not
79
+ retry it.
80
+
81
+ ## Impact scope
82
+
83
+ Any bundle whose rows take over a shipped service **by the same service
84
+ name** on a profile that hot-reloads (the desktop with HMR enabled).
85
+ Rows that provide distinct service names, config-only patches, and
86
+ preset-realm mounts are unaffected — the collision needs the same
87
+ isolate label on the same realm. This plugin's three root-plane
88
+ takeovers are the full affected set here; `wsl-shell-env`,
89
+ `auto-preset`, `wsl-preflight`, and `preset-wsl` activate through the
90
+ same toggle without complaint.
91
+
92
+ ## What would fix it upstream
93
+
94
+ The disable-then-insert ordering inside one group update cannot fix
95
+ this by itself — under the retain-until-drained semantics the old
96
+ registration survives the whole drain, however ordered. Directions
97
+ that would:
98
+
99
+ - **Stage the swap on the provide side**: when a fiber's
100
+ `ctx.provide` collides with an implementation that is currently
101
+ UNLOADING, queue the registration and complete it when the old
102
+ implementation's disposer frees the slot, instead of throwing.
103
+ - **Two-phase group updates**: run every disable transition to
104
+ settlement (or at least to provision release) before starting any
105
+ insert transition — the reverse of the `Promise.all` ordering, and
106
+ enough for every takeover where the old service's dependents can
107
+ drain onto nothing (no live sessions) or onto preset-realm
108
+ replacements.
109
+ - **A loader-level retry**: an entry whose activation failed with a
110
+ registration collision against a draining fiber is retried once that
111
+ fiber reaches `DISPOSED`. The failed state is otherwise terminal, so
112
+ today's behavior converts a transient overlap into a permanent
113
+ per-entry failure.
114
+
115
+ ## The plugin's posture until then
116
+
117
+ [docs/LIMITATIONS.md](LIMITATIONS.md#enabling-the-plugin-on-a-running-profile)
118
+ records the operator-facing rule: enabling (or re-enabling) the bundle
119
+ on a running profile reports the three entries as failed; the selection
120
+ is persisted, and **restarting the app applies it** — the cold
121
+ composition is correct. Closing sessions first also clears the drain
122
+ gate on the hot path, since with no dependents the shipped
123
+ implementation releases within the recomposition and the challengers
124
+ activate.
@@ -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). The exact filing payload (title, body,
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,
@@ -4,6 +4,9 @@ Status: proposed upstream as
4
4
  [deepseek-ai/deepseek-harness#8769](https://github.com/deepseek-ai/deepseek-harness/discussions/8769)
5
5
  (targeting `packages/api/terminal-controller`, version line `0.2.1-rc.x`; the
6
6
  gap was re-checked against `dsh-v0.2.1-rc.2` on 2026-10-17 and is unchanged —
7
+ and an online check on 2026-11-06 found upstream `v0.2.2-rc.1` (2026-11-04)
8
+ still without it (release notes to that version add sidebar-terminal FONT
9
+ settings, not a display-name seam) —
7
10
  `packages/api/terminal-controller/src/index.ts:327` still builds the terminal
8
11
  info with `title: shell.name`, and the spawn spec still carries no display-name
9
12
  field). The