dsh-plugin-wsl-env 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -0
- package/README.md +2 -2
- package/cordis.patch.yml +10 -5
- package/docs/ARCHITECTURE.md +6 -5
- package/docs/COMPATIBILITY.md +1 -1
- package/docs/CONFIGURATION.md +23 -0
- package/docs/CONFIGURATION.zh.md +307 -0
- package/docs/LIMITATIONS.md +149 -336
- package/docs/LIMITATIONS.zh.md +177 -0
- package/docs/PEER-PARITY.md +77 -35
- package/docs/QUICKSTART.md +3 -1
- package/docs/QUICKSTART.zh.md +168 -0
- package/docs/README.zh.md +4 -3
- package/docs/RELEASING.md +2 -1
- package/docs/REQUIREMENTS.zh.md +8 -4
- package/docs/ROADMAP-1.0.md +14 -14
- package/docs/ROADMAP.md +10 -6
- package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +4 -1
- package/docs/UPSTREAM-FSIO-EXPORT.md +2 -2
- package/docs/UPSTREAM-SERVICE-SWAP.md +124 -0
- package/lib/fs-routing.d.ts +51 -1
- package/lib/fs-routing.js +55 -0
- package/lib/index.d.ts +50 -1
- package/lib/index.js +66 -8
- package/package.json +31 -26
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Limitations
|
|
2
|
+
|
|
3
|
+
_本文是 [LIMITATIONS](LIMITATIONS.md) 的中文译本,以英文版为准。_
|
|
4
|
+
|
|
5
|
+
插件不做什么,以及为什么。写进文档的限制是设计边界;
|
|
6
|
+
没写进文档的迟早会变成 bug 报告。每一条都说明限制本身和补救方法;
|
|
7
|
+
推理过程在 [ARCHITECTURE.md](ARCHITECTURE.md) 及其链接的文档中。
|
|
8
|
+
|
|
9
|
+
## 文件系统 substrate(`wsl-fs`)
|
|
10
|
+
|
|
11
|
+
只有一个 substrate:发行版内的常驻 agent(发行版文件用 ext4)。已退役的
|
|
12
|
+
Windows 侧 share 后端(`substrate: "share"`)在启动时被拒绝;WSL 路由的
|
|
13
|
+
操作永远不会走 9p 共享。
|
|
14
|
+
|
|
15
|
+
- **新建文件以 0600 权限发布。** 覆盖与编辑保留原有权限位;
|
|
16
|
+
新文件需要可执行时请 `chmod`。
|
|
17
|
+
- **agent 不在时,文件操作关闭(fail closed)** —— 报 `FS_IO_ERROR`,指明
|
|
18
|
+
substrate,并附带恢复路径。一次崩溃可用一次重建;重建耗尽后进入有界复活
|
|
19
|
+
(2/4/8 s);三次死亡则永久退出,直到应用重启。没有回退 I/O——这是有意为之。
|
|
20
|
+
- **变更守卫不是原子的比较并交换。** 创建使用不可替换的 link;覆盖在 rename 前
|
|
21
|
+
会重新校验版本。不匹配时返回 `FS_STALE_VERSION`,但检查与 rename 之间发生的
|
|
22
|
+
变更仍可能被覆盖。
|
|
23
|
+
- **被取消的写入结果可能是未知的** —— 重试前先检查文件。
|
|
24
|
+
- **写入成功不等于崩溃持久。** 被暂存的文件会 sync,但所在目录不会:
|
|
25
|
+
断电可能丢失该目录项。
|
|
26
|
+
- **含反斜杠的 Linux 文件名无法被寻址** —— 反斜杠是 UNC 分隔符,
|
|
27
|
+
`a\b.ts` 会往返成 `a/b.ts`。请把文件名改掉,不要用反斜杠;
|
|
28
|
+
这是坐标系自身的限制。
|
|
29
|
+
- **受限写入运行在各自的 bwrap 约束常驻 agent 上** —— 由内核强制,
|
|
30
|
+
工作区之外以 `FS_SANDBOX_DENIED` 拒绝。代价:需要 `bubblewrap`;
|
|
31
|
+
策略变更要付出一次 agent 启动;授予 `/tmp` 的写入落在发行版真实的
|
|
32
|
+
`/tmp` 中。
|
|
33
|
+
- **`glob`/`grep` 使用发行版的 rg**;没有 rg 的发行版搜索失败
|
|
34
|
+
(退出码 127)。安装:`wsl.exe -d <distro> -u root -- apt-get install -y bubblewrap
|
|
35
|
+
git ripgrep inotify-tools`(或检测到的包管理族对应的写法)。`--install` 只在
|
|
36
|
+
缺少 `bubblewrap` 时才执行安装。
|
|
37
|
+
- **`watch()` 是粗粒度失效,不是逐文件通知**:inotify 事件合并到 0.5 s,
|
|
38
|
+
否则使用 `find -newer` 轮询循环。轮询路径会遗漏原地的 `cp -p`,以及恢复
|
|
39
|
+
较旧 mtime 的 `tar -x`;FILE 目标监视的是 `mtime:size` 指纹。从 Windows
|
|
40
|
+
侧做 9p 监视仍然不支持。
|
|
41
|
+
- **`sessionSandbox: false` 时,受限命令的 `/tmp` 与写入工具的 `/tmp`
|
|
42
|
+
不同** —— 请通过会话工作区交接文件。随包 preset(`sessionSandbox: true`)
|
|
43
|
+
共享同一个真实 `/tmp`,不存在这种分裂。
|
|
44
|
+
- `editText` 在写回之前把整个文件读进内存。
|
|
45
|
+
- 发行版在请求进行中死亡,会耗尽常驻 agent 的唯一一次重建;
|
|
46
|
+
仍未恢复时,常驻 agent 将保持不可用,直到应用重启。
|
|
47
|
+
|
|
48
|
+
## GUI 的 workspace-files 服务
|
|
49
|
+
|
|
50
|
+
- GUI 文件树和预览使用随包的 `workspace-files` 行,通过被路由的根文件系统
|
|
51
|
+
读取 WSL 路径——这是有意不替换的(服务端单方面接管会丢掉侧边栏预览
|
|
52
|
+
所依赖的浏览器 `file` 资源提供者)。
|
|
53
|
+
- **预期多出几轮往返**(每次 listDir/stat/分页约 4-6 次;实测 p95:
|
|
54
|
+
`stat` 2.7 ms、`listDir` 5.1 ms、1 MiB 读取 63.5 ms/MiB —— 2026-10-19,
|
|
55
|
+
[探针](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/gui-preview.sh))。
|
|
56
|
+
模型自己的文件操作不受影响。
|
|
57
|
+
- `fs-routing` 是接缝:禁用它即可恢复宿主 9p 支撑的根文件系统。
|
|
58
|
+
随包行的上限可以在 `workspace-files` 行上覆盖。
|
|
59
|
+
|
|
60
|
+
## `@` 补全
|
|
61
|
+
|
|
62
|
+
- **`@` 引用走 9p 共享**(在已探针的目录树上比 ext4 慢约 56 倍,
|
|
63
|
+
2026-10-19)。发行版侧的遍历已经写好,但尚未挂载——它需要上游的
|
|
64
|
+
`FileReferenceTraversal` 接缝:
|
|
65
|
+
[UPSTREAM-FILE-REFERENCE-SEAM.md](UPSTREAM-FILE-REFERENCE-SEAM.md)。
|
|
66
|
+
|
|
67
|
+
## 沙箱
|
|
68
|
+
|
|
69
|
+
- **一次性回退路径只有宿主截止时间** —— `wsl.exe` 被杀时不会把 kill 传进
|
|
70
|
+
发行版,因此 Linux 进程树可能比调用活得更久。长命令建议
|
|
71
|
+
`agent: true` 并使用会话 runtime。
|
|
72
|
+
- **批量读取按发行版共享一个原生 agent**(16 个并发调用 2.4-4.1 ms;
|
|
73
|
+
第一次调用要付出约 70 ms 的准备)。
|
|
74
|
+
- **aarch64 只在 CI 中于 qemu 下运行**(身边没有 Windows-on-ARM 机器——
|
|
75
|
+
[COMPATIBILITY.md](COMPATIBILITY.md#scope-decisions))。`auto` 仍会选择
|
|
76
|
+
包内二进制;`native` 在准备失败时拒绝;`shell` 强制使用 shell agent。
|
|
77
|
+
- **会话 runtime 需要 systemd 和带 linger 的 user manager** —— 否则在
|
|
78
|
+
第一条命令时被拒绝并给出补救方法;`sessionSandbox: false` 保留旧的
|
|
79
|
+
按命令形态。应用硬崩溃可能留下过期的 `dsh-wsl-*.scope`;预检会在下一个
|
|
80
|
+
WSL 会话时清扫过期 scope(从不清扫其他活跃会话的)。
|
|
81
|
+
- **沙箱不管辖 WSL interop** —— 上报为 `enforcement: partial`。
|
|
82
|
+
`maskWindowsDrive` 和 `interopVisibility` 收窄 `/mnt` 但不是关闭;即使是
|
|
83
|
+
`interopVisibility: "disabled"` 也只是给出 `wsl.conf` 中
|
|
84
|
+
`[interop] enabled=false` 的补救命令(由 `doctor` 打印)——发行版级设置
|
|
85
|
+
仍需手工执行。
|
|
86
|
+
[ARCHITECTURE.md](ARCHITECTURE.md#reported-enforcement)。
|
|
87
|
+
- **必须安装 `bubblewrap`**,否则两个提供者都会带着安装命令失败;
|
|
88
|
+
会话启动预检会以建议性警告的形式给出同样的文本。
|
|
89
|
+
- 会话中途被删除的工作区目录会以 runner 错误失败;插件不会重建它。
|
|
90
|
+
配置的 `cwd` 不存在时,报错会指明该目录。
|
|
91
|
+
|
|
92
|
+
## shell 启动语义(`wsl-shell`)
|
|
93
|
+
|
|
94
|
+
命令以 `<shell> -lc <command>` 运行——登录 shell(会 source profile 脚本,
|
|
95
|
+
因此版本管理器可用)且**非交互**(模型的输出流中没有提示符/插件输出)。
|
|
96
|
+
设置 `loginShell: false` 后去掉登录旗标(`<shell> -c <command>`)。
|
|
97
|
+
|
|
98
|
+
- **`~/.zshrc` / `~/.bashrc` 永远不会被读取。** 把机器级的 PATH 设置
|
|
99
|
+
(`fnm`、nvm、cargo)移进 `~/.zprofile` 或 `~/.zshenv`;提示符和补全
|
|
100
|
+
留在 rc 文件里。
|
|
101
|
+
- **fnm 的 multishell PATH 在沙箱内无法形成**(`/run` 只读)——
|
|
102
|
+
使用 [Configuration](CONFIGURATION.md#zshfnm-recipe-for-model-run-commands)
|
|
103
|
+
中的回退配方。
|
|
104
|
+
|
|
105
|
+
## Agent 诊断
|
|
106
|
+
|
|
107
|
+
- **doctor 的 `agent.handshake` 探测的是一个新起的常驻 agent**,而不是
|
|
108
|
+
在跑的那个——运行中常驻 agent 的 `lastError` 留在应用日志里
|
|
109
|
+
(进程内可通过 `WslAgent.status()` 查看)。
|
|
110
|
+
- **`dsh-wsl-*.scope` 计数是某一时刻的快照**;`--fix` 会执行预检的清扫。
|
|
111
|
+
- **doctor 的 `git.win-safe` 探针通过 interop 的 `git.exe` 报告 Windows git
|
|
112
|
+
的信任状态** —— 装了 Windows git 时,WSL 变更审查需要那份
|
|
113
|
+
`safe.directory` 白名单(见下文"终端")。
|
|
114
|
+
|
|
115
|
+
## 会话启动建议
|
|
116
|
+
|
|
117
|
+
- **DSH 0.2.1 没有会话 UI 通知接缝。** `wsl-preflight` 的失败进入宿主日志
|
|
118
|
+
和会话的 runtime context(下次组装时对模型可见)——仅供参考,从不安装、
|
|
119
|
+
从不取消。对上游的请求见:
|
|
120
|
+
[UPSTREAM-SESSION-NOTICE.md](UPSTREAM-SESSION-NOTICE.md)。
|
|
121
|
+
- **runtime context 条目是重复的快照,不是可关闭的通知。**
|
|
122
|
+
移除 `wsl-preflight` 行即可让该探针完全静音。
|
|
123
|
+
|
|
124
|
+
## 端口
|
|
125
|
+
|
|
126
|
+
- **端口轮询让常驻 agent 在每个活跃发行版上永久保温**
|
|
127
|
+
(10 s 刷新)。把 `portsRefreshMs` 调到超过 agent 的空闲超时即可恢复
|
|
128
|
+
空闲关停,代价是端口事实更陈旧。
|
|
129
|
+
|
|
130
|
+
## 目录选择器
|
|
131
|
+
|
|
132
|
+
- 发行版层级从发行版内部一次往返完成列举(NUL 分隔,因此含换行的
|
|
133
|
+
目录名也能精确列出——WSL-306);常驻 agent 不在时用一次性的
|
|
134
|
+
`wsl.exe --exec find`。
|
|
135
|
+
|
|
136
|
+
## 终端
|
|
137
|
+
|
|
138
|
+
- 终端路由按会话的工作区坐标进行:WSL 文件夹会话获得发行版 shell,
|
|
139
|
+
Windows 文件夹会话在其自身目录获得 `powershell.exe`。shell 菜单的
|
|
140
|
+
默认条目保持为配置的 profile;不带目录的启动落在发行版内。
|
|
141
|
+
- **Windows git 必须信任该共享**(`safe.directory`),否则 WSL 工作区的
|
|
142
|
+
changed-files 卡片会无声消失(发现调用返回 `detected dubious ownership`)。
|
|
143
|
+
Windows 上的一次性补救:
|
|
144
|
+
`git config --global --add safe.directory "//wsl.localhost/*"`,然后重启
|
|
145
|
+
应用。两个替代方案:doctor 的 `git.win-safe` 探针可报告该状态;而
|
|
146
|
+
**没有** Windows git 的机器什么都不用做——提供者把发现请求路由进
|
|
147
|
+
发行版,并把输出转写成 UNC 形式。
|
|
148
|
+
- **冒号分隔的多目录 `GIT_*` 值不做转写直接透传。** git 环境转写只改写单个
|
|
149
|
+
Windows 目录值;冒号分隔的列表(当前没有调用方设置这种形态)原样转发。
|
|
150
|
+
- **NEW 标签页的标题显示 `WSL`**,无论它实际运行什么——控制器在提供者
|
|
151
|
+
改写启动命令之前就按 composition 的 profile 命名了,而插件无法纠正
|
|
152
|
+
这个默认值([UPSTREAM-TERMINAL-TITLE.md](UPSTREAM-TERMINAL-TITLE.md))。
|
|
153
|
+
菜单附带宿主候选(`powershell`、`cmd`):手动选择的 shell 会以自身命名;
|
|
154
|
+
双击重命名也可行。
|
|
155
|
+
- **发行版终端空闲时确实会被回收** —— 通过常驻 agent 对被标记的进程计数
|
|
156
|
+
(提示符处恰好一个进程 = `idle`;嵌套 shell 或启动文件拉起的
|
|
157
|
+
`ssh-agent` 按设计读作 `busy`)。阈值是控制器的
|
|
158
|
+
`unattendedTimeoutMs`(2 h)。`terminalIdleReclaim: false` 恢复手动关闭。
|
|
159
|
+
Windows 文件夹的宿主终端保持随包的不回收行为。
|
|
160
|
+
|
|
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
|
+
## 在运行中的 profile 上启用本插件
|
|
169
|
+
|
|
170
|
+
- **在繁忙的 profile 上通过 GUI 启用本 bundle 可能失败,重启应用即可生效。**
|
|
171
|
+
三个根面接管行(`subprocess`、`fs`、`directoryPicker`)以同名替换随包服务。
|
|
172
|
+
在应用 `0.2.2-rc.1`(cordis 4.1.0)上,正在销毁的提供者在全部依赖方释放之前
|
|
173
|
+
一直持有服务注册,因此会话存活期间替换行会与随包提供者相撞,启用操作将它们
|
|
174
|
+
报告为失败。无论如何选择都会持久化;**重启应用即可加载插件**(冷启动组合是
|
|
175
|
+
正确的)。启用前先关闭会话通常能让热路径成功——没有依赖方时,随包提供者会在
|
|
176
|
+
重组期间释放。机制与复现:
|
|
177
|
+
[UPSTREAM-SERVICE-SWAP.md](UPSTREAM-SERVICE-SWAP.md)。
|
package/docs/PEER-PARITY.md
CHANGED
|
@@ -7,20 +7,25 @@ same refusal dialect on both substrates. The **read path** holds end to end;
|
|
|
7
7
|
the **edit path** carries two declared divergences, listed at the end. This
|
|
8
8
|
file records the verification against the real peers.
|
|
9
9
|
|
|
10
|
-
- Peers: `@deepseek-ai/dsh-fs-local@0.2.
|
|
11
|
-
devDependencies pin, and the floor the peer range `>=0.2.
|
|
12
|
-
verified against), plus `@deepseek-ai/dsh-fs@0.2.
|
|
10
|
+
- Peers: `@deepseek-ai/dsh-fs-local@0.2.2-rc.1` (the exact version the
|
|
11
|
+
devDependencies pin, and the floor the peer range `>=0.2.2-rc.1` was
|
|
12
|
+
verified against), plus `@deepseek-ai/dsh-fs@0.2.2-rc.1` for the
|
|
13
13
|
`FsVersion` brand the local package imports. Divergence 2 is measured
|
|
14
|
-
against a third peer, `@deepseek-ai/dsh-bash-local@0.2.
|
|
14
|
+
against a third peer, `@deepseek-ai/dsh-bash-local@0.2.2-rc.1` — the shell
|
|
15
15
|
executor carries the collect-budget/spill machinery; `spill` and
|
|
16
16
|
`maxSpillBytes` do not appear in `dsh-fs-local` at all.
|
|
17
|
-
- The `0.2.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
and
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
- The `0.2.2-rc.1` move grows `dsh-fs-local`'s shipped `lib/index.js` from 909
|
|
18
|
+
to 1048 lines (patch/move/delete operations, `expandHomePrefix`, `writeIoError`,
|
|
19
|
+
multi-key locks), so every line reference below was re-walked on 2026-11-05.
|
|
20
|
+
Every replicated string survived verbatim; the fsio **read path** holds end
|
|
21
|
+
to end and the **edit path** carries the same two declared divergences, listed
|
|
22
|
+
at the end. The release also added a `FS_ERROR_CODES` const export with two
|
|
23
|
+
new codes (`FS_PATCH_MISMATCH`, `FS_SAME_TARGET`) for operations this plugin
|
|
24
|
+
does not serve — see the new-peer-operations section at the end.
|
|
25
|
+
`dsh-bash-local@0.2.2-rc.1`'s `lib/index.js` is byte-identical to
|
|
26
|
+
`0.2.1-rc.3`'s (only manifests and locale files changed), so its references
|
|
27
|
+
stand. `dsh-fs@0.2.2-rc.1` still has no `./invariant` export subpath; this
|
|
28
|
+
plugin imports neither it nor `dsh-invariants`.
|
|
24
29
|
- What "not imported" means: the peer's **fsio module** is not reachable from
|
|
25
30
|
the package's exports, so `lib/fsio-text.js` reimplements it and imports
|
|
26
31
|
nothing from it (the export is proposed in `docs/UPSTREAM-FSIO-EXPORT.md`).
|
|
@@ -42,17 +47,19 @@ wc -l package/lib/index.js # expect 909
|
|
|
42
47
|
```
|
|
43
48
|
|
|
44
49
|
The tarballs this audit compared, by content — the same values
|
|
45
|
-
`npm view <pkg>@0.2.
|
|
50
|
+
`npm view <pkg>@0.2.2-rc.1 dist.integrity` reports (re-recorded 2026-11-05;
|
|
51
|
+
the `0.2.1-rc.3` values they supersede are in git history):
|
|
46
52
|
|
|
47
53
|
```
|
|
48
|
-
@deepseek-ai/dsh-fs-local@0.2.
|
|
49
|
-
@deepseek-ai/dsh-fs@0.2.
|
|
54
|
+
@deepseek-ai/dsh-fs-local@0.2.2-rc.1 sha512-tibC9z4YJx7C6DhiWmTc9AYeF+GSh22XVaaDdumwTgBgvFuiNITNGn3E0DTL3skugB3MKnvAvrjybdveNQ7MmQ==
|
|
55
|
+
@deepseek-ai/dsh-fs@0.2.2-rc.1 sha512-sbr+u+3dG4KAUdY7FoMLJg/gSE39gvgBMwmvVeR/6acNrlHaIducvnuxRUYAq2V0+NOVnG8fA9sdfBq2uGAfUw==
|
|
50
56
|
```
|
|
51
57
|
|
|
52
58
|
Each row of the table below names the peer's `lib/index.js` line and the
|
|
53
59
|
literal both sides must produce. Verified 2026-10-03; the read/edit split
|
|
54
60
|
re-verified 2026-10-06; the whole table re-checked against `0.2.1-rc.2`,
|
|
55
|
-
2026-10-17
|
|
61
|
+
2026-10-17, against `0.2.1-rc.3`, 2026-10-26, and against `0.2.2-rc.1`,
|
|
62
|
+
2026-11-05 (line numbers shifted; strings identical).
|
|
56
63
|
|
|
57
64
|
## Verdict
|
|
58
65
|
|
|
@@ -69,22 +76,22 @@ declared extensions, listed at the end.
|
|
|
69
76
|
|
|
70
77
|
| Item | Evidence (peer `lib/index.js`) | Ours |
|
|
71
78
|
|---|---|---|
|
|
72
|
-
| `normalizeLineEndings` | `:
|
|
73
|
-
| `detectLineEndings` | `:
|
|
74
|
-
| `restoreLineEndings` | `:
|
|
75
|
-
| occurrence counting | `:
|
|
76
|
-
| `applyLiteralEdit` | `:
|
|
77
|
-
| edit refusal strings | `:
|
|
78
|
-
| invalid UTF-8, read path | `:
|
|
79
|
-
| binary detection, read path | `:
|
|
80
|
-
| size caps | `:
|
|
81
|
-
| `writeText` guards | `:
|
|
82
|
-
| `editText` guards — not-regular and stale version | `:
|
|
83
|
-
| `editText` guards — missing file | `:
|
|
84
|
-
| `listDir` refusal | `:
|
|
85
|
-
| diff-basis gate | `:
|
|
86
|
-
| outcome shapes | `:
|
|
87
|
-
| version join | `:
|
|
79
|
+
| `normalizeLineEndings` | `:628` `content.replaceAll("\r\n", "\n")` | identical |
|
|
80
|
+
| `detectLineEndings` | `:630` 4096-char sample; `crlf > lf - crlf` | identical |
|
|
81
|
+
| `restoreLineEndings` | `:643` LF unchanged; CRLF re-normalizes then `\n` → `\r\n` | identical (`replaceAll` vs `split/join` — equivalent) |
|
|
82
|
+
| occurrence counting | `:650` non-overlapping left-to-right | `split(needle).length - 1` — equivalent |
|
|
83
|
+
| `applyLiteralEdit` | `:741` empty needle, not-found, and ambiguous refusals; single-pass `split/join` without rescanning | identical |
|
|
84
|
+
| edit refusal strings | `:743`, `:746`, `:747` — `old_string must be a non-empty string` (`FS_EDIT_NOT_FOUND`); ``old_string was not found in "${displayPath}"``; ``old_string matched ${n} times in "${displayPath}"; provide a more specific old_string or set replace_all to true`` (`FS_AMBIGUOUS_EDIT`) | identical |
|
|
85
|
+
| invalid UTF-8, read path | `:343` — ``cannot ${verb} "${displayPath}": invalid UTF-8 text`` (`FS_NOT_TEXT`), verb `read` | identical (the edit path's verb differs; see 4) |
|
|
86
|
+
| binary detection, read path | `:99`/`:387` (sample const, guard), stream at `:471-473` — 8192-byte sample, NUL check; ``cannot read "${displayPath}": binary file`` (`FS_NOT_TEXT`) | identical — both accept a NUL at offset 8500, past the sample; the edit path's bound differs, see 4 |
|
|
87
|
+
| size caps | `:403`, `:414` — ``cannot read "${displayPath}": ${size} bytes exceeds the ${maxBytes}-byte limit`` and ``content exceeds the ${maxBytes}-byte limit`` (`FS_TOO_LARGE`) | identical |
|
|
88
|
+
| `writeText` guards | `:505`, `:506-508` — not-regular (`FS_NOT_REGULAR_FILE`), `file no longer exists` / `file changed since it was read` (`FS_STALE_VERSION`) via `writeTarget` at `:1021-1025`, ``cannot overwrite existing "${displayPath}" without reading it first`` (`FS_NOT_OBSERVED`) | identical |
|
|
89
|
+
| `editText` guards — not-regular and stale version | `:938`, `:939` — ``cannot edit "${displayPath}": not a regular file`` (`FS_NOT_REGULAR_FILE`); `file changed since it was read` (`FS_STALE_VERSION`) when the expected version differs (`requireFile` at `:1030-1032`) | identical |
|
|
90
|
+
| `editText` guards — missing file | `:937` — one refusal for every caller: `file changed since it was read` (`FS_STALE_VERSION`), with or without an expected version | **diverges by design** — we split on the caller's evidence: with an expected version `file no longer exists` (`FS_STALE_VERSION`), without one `file does not exist` (`FS_NOT_FOUND`). See 5 |
|
|
91
|
+
| `listDir` refusal | `:310` — ``cannot list "${displayPath}": not a directory`` (`FS_NOT_DIRECTORY`) | identical |
|
|
92
|
+
| diff-basis gate | `:920` — `existing !== null && Buffer.byteLength(content) < diffBasisMaxBytes` — keyed on the NEW content's size, `null` above the cap (the move path inherits the same keying at `:983`/`:997`) | identical — the gate's new-size keying is inherited by design, not a divergence |
|
|
93
|
+
| outcome shapes | `:927`, `:992` — `operation: "update" \| "create"`, the `missing:${targetKey}` sentinel version (`:1044`), `before`/`after` | identical |
|
|
94
|
+
| version join | `:148` — `` `${info.dev}:${info.ino}:${info.size}:${info.mtimeNs}:${info.ctimeNs}` `` (branded by `dsh-fs`'s `FsVersion`) | `versionOf` — identical shape |
|
|
88
95
|
|
|
89
96
|
## Deliberate divergences (declared, not drift)
|
|
90
97
|
|
|
@@ -104,10 +111,10 @@ declared extensions, listed at the end.
|
|
|
104
111
|
dialect, but a divergence all the same, so it is declared: an edit refused
|
|
105
112
|
for its bytes reads ``cannot read "…": binary file`` or
|
|
106
113
|
``cannot read "…": invalid UTF-8 text`` — verb `read`, where the peer's
|
|
107
|
-
`readForEdit` (`lib/index.js:
|
|
114
|
+
`readForEdit` (`lib/index.js:664`) says ``cannot edit "…": …``. The NUL
|
|
108
115
|
check is likewise the read path's 8192-byte sample
|
|
109
116
|
(`src/fsio-agent.ts:377-384`, guard at `:380`), where the peer scans the
|
|
110
|
-
whole buffer (`lib/index.js:
|
|
117
|
+
whole buffer (`lib/index.js:668`): a file whose first 8192 bytes are clean
|
|
111
118
|
but that carries a NUL later is edited by us and refused by the peer.
|
|
112
119
|
Measured on a 9000-byte fixture with a NUL at offset 8500 — ours `EDITED`,
|
|
113
120
|
the peer `FS_NOT_TEXT: cannot edit "…"`.
|
|
@@ -117,8 +124,43 @@ declared extensions, listed at the end.
|
|
|
117
124
|
behind it names a file that never answered the stat, so it takes the read
|
|
118
125
|
path's missing-file dialect (`cannot edit "…": file does not exist`,
|
|
119
126
|
`FS_NOT_FOUND`). The peer throws `file changed since it was read`
|
|
120
|
-
(`FS_STALE_VERSION`, `lib/index.js:
|
|
121
|
-
`test/fs-substrate.test.mjs`.
|
|
127
|
+
(`FS_STALE_VERSION`, `lib/index.js:937` via `requireFile` at `:1030`) for
|
|
128
|
+
both. Pinned by `test/fs-substrate.test.mjs`.
|
|
129
|
+
|
|
130
|
+
## The peer's 0.2.2-rc.1 operations: declared gap, refused at the provider
|
|
131
|
+
|
|
132
|
+
`0.2.2-rc.1` added three operations to the peer's `FileSystem` base —
|
|
133
|
+
`patchText` (hunks via the new `@deepseek-ai/dsh-fs-patch`, refusal
|
|
134
|
+
`FS_PATCH_MISMATCH` at `lib/index.js:1036`), `deleteFile`, and `moveFile`
|
|
135
|
+
(same-target refusal `FS_SAME_TARGET`). The agent substrate serves read,
|
|
136
|
+
write and edit only; implementing these would mean a patch-hunks wire op and
|
|
137
|
+
a delete/move pair in the resident protocol, which is substrate work, not
|
|
138
|
+
parity drift. What the release makes load-bearing is that the operations now
|
|
139
|
+
exist on the base class this plugin extends: an inherited call with a distro
|
|
140
|
+
target would run the **host** implementation against a same-named Windows
|
|
141
|
+
path (or refuse with a host-dialect `FS_NOT_FOUND` naming the wrong world).
|
|
142
|
+
|
|
143
|
+
So the providers refuse honestly instead of inheriting:
|
|
144
|
+
`WslFileSystem.patchText`/`deleteFile`/`moveFile` (`src/index.ts`) throw
|
|
145
|
+
`FS_IO_ERROR` naming the substrate's gap, and `WslRoutingFileSystem`
|
|
146
|
+
(`src/fs-routing.ts`) routes by the same coordinate rule as `editText` — a
|
|
147
|
+
distro-side endpoint reaches the refusing backend, two Windows endpoints keep
|
|
148
|
+
the inherited host implementation. The shipped preset disables the patch
|
|
149
|
+
tool beside edit (`applyPatch: false` in `cordis.patch.yml`), so no
|
|
150
|
+
model-facing path reaches the refusal today; the overrides exist because the
|
|
151
|
+
peer's own consumers may. Pinned by `test/composition.test.mjs` (distro
|
|
152
|
+
refusals and a host-side `moveFile` round trip). Peer-side mechanics for the
|
|
153
|
+
record: `patchText` re-reads via the whole-buffer `readForEdit`, applies
|
|
154
|
+
`applyHunks`, and publishes through the same atomic write — so divergence 4's
|
|
155
|
+
binary/UTF-8 dialect carries over to the peer's patch path too.
|
|
156
|
+
|
|
157
|
+
A related `0.2.2-rc.1` surface change lands in the sandbox vocabulary:
|
|
158
|
+
`SandboxExecutionPolicy.additionalWritableRoots` and the
|
|
159
|
+
`workspaceWritableRoots` derivation (`roots.js`), whose together-grant
|
|
160
|
+
contract this backend honors in `wslWritableRoots` (`src/index.ts`) — a
|
|
161
|
+
same-distro UNC extra root is granted as-is; a Windows-path extra root in a
|
|
162
|
+
distro workspace fails closed with the peer's `SandboxInvalidRootError`,
|
|
163
|
+
because the grant cannot be enforced there without lying about the mode.
|
|
122
164
|
|
|
123
165
|
## Maintenance
|
|
124
166
|
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Quickstart
|
|
2
2
|
|
|
3
|
+
*A Chinese translation lives at [QUICKSTART.zh](QUICKSTART.zh.md); the English version is authoritative.*
|
|
4
|
+
|
|
3
5
|
Steps from a Windows + WSL 2 machine to a working WSL session.
|
|
4
6
|
This page is the entry point; every claim links to the document that owns it.
|
|
5
7
|
|
|
@@ -24,7 +26,7 @@ From a Windows PowerShell where the DSH CLI is available:
|
|
|
24
26
|
|
|
25
27
|
```powershell
|
|
26
28
|
dsh plugin --profile <profile> add dsh-plugin-wsl-env
|
|
27
|
-
#
|
|
29
|
+
# if it resolves to a stale version (same-day registry metadata cache), pin it:
|
|
28
30
|
# dsh plugin --profile <profile> add dsh-plugin-wsl-env@<latest>
|
|
29
31
|
dsh --profile <profile> --dump-config # the plugin rows must be there
|
|
30
32
|
```
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Quickstart
|
|
2
|
+
|
|
3
|
+
_本文是 [QUICKSTART](QUICKSTART.md) 的中文译本,以英文版为准。_
|
|
4
|
+
|
|
5
|
+
从一台 Windows + WSL 2 机器到可用的 WSL 会话,只需以下步骤。
|
|
6
|
+
本页是入口;每条说明都链接到负责该主题的文档。
|
|
7
|
+
|
|
8
|
+
## 1. 前置条件
|
|
9
|
+
|
|
10
|
+
| 需求 | 如何检查 | 缺失时 |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| Windows 10/11,启用 WSL 2 | `wsl.exe -l -v` 显示 `VERSION 2` | `wsl.exe --install` |
|
|
13
|
+
| 一个发行版 | 上面列表中有一行 | `wsl.exe --install -d Ubuntu` |
|
|
14
|
+
| `bubblewrap` | `wsl.exe -d <distro> -- which bwrap` | `wsl.exe -d <distro> -u root -- apt-get install -y bubblewrap` |
|
|
15
|
+
| systemd + Linger(会话 runtime 需要) | `node <plugin>/scripts/doctor.mjs`(已安装)或 `pnpm run doctor`(检出目录) | 在 `/etc/wsl.conf` 设置 `[boot] systemd=true`,`wsl --shutdown`,然后 `loginctl enable-linger "$USER"`;或设置 `sessionSandbox: auto`/`false` |
|
|
16
|
+
| Node `^22.19.0` 或 `>=24.0.0` | 仅源码/开发工作需要 | 使用已发布的插件时,发行版内不需要 Node |
|
|
17
|
+
|
|
18
|
+
doctor(`scripts/doctor.mjs`,或在检出目录中运行 `pnpm run doctor`)会检查
|
|
19
|
+
环境并针对检测到的失败打印补救方法。发行版的 WSL 版本请单独用
|
|
20
|
+
`wsl.exe -l -v` 确认。doctor 默认只读,除非传入 `--fix`(清理过期 scope)或
|
|
21
|
+
`--fix --install`(安装软件包,需确认)。
|
|
22
|
+
|
|
23
|
+
## 2. 安装
|
|
24
|
+
|
|
25
|
+
在一个可以使用 DSH CLI 的 Windows PowerShell 中:
|
|
26
|
+
|
|
27
|
+
```powershell
|
|
28
|
+
dsh plugin --profile <profile> add dsh-plugin-wsl-env
|
|
29
|
+
# 若解析到旧版本(发布当天的元数据缓存),显式指定:
|
|
30
|
+
# dsh plugin --profile <profile> add dsh-plugin-wsl-env@<latest>
|
|
31
|
+
dsh --profile <profile> --dump-config # 输出中必须包含插件的行
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
如果 profile 已覆盖 preset,请保持覆盖为完整的
|
|
35
|
+
`preset-wsl` 块——当某个层直接按 id 指向 `wsl-shell`/`wsl-fs` 时,
|
|
36
|
+
`pnpm run preset --check <patch>` 会明确报错。
|
|
37
|
+
|
|
38
|
+
## 3. 打开 WSL 工作区
|
|
39
|
+
|
|
40
|
+
在 GUI 中,通过选择器打开文件夹(`\\wsl.localhost\<distro>\home\<you>\proj`),
|
|
41
|
+
或直接打开 UNC 路径。会话的命令、文件工具、终端和预览
|
|
42
|
+
都在该发行版中运行;打开 Windows 文件夹则保留正常的 Windows 环境。
|
|
43
|
+
两个发行版可以同时打开,各自拥有自己的环境。
|
|
44
|
+
|
|
45
|
+
### 在 VS Code 中打开工作区(Remote-WSL)
|
|
46
|
+
|
|
47
|
+
把 WSL 文件夹当作 Windows UNC 共享打开也可行,但属于降级模式:
|
|
48
|
+
文件走 9p,终端是 PowerShell,扩展运行在 Windows 上。完整的
|
|
49
|
+
集成方式是 VS Code 的 Remote-WSL——server 运行在发行版内,集成终端
|
|
50
|
+
是发行版的 shell,文件操作直接落在本地 ext4 上:
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
# from the plugin checkout:
|
|
54
|
+
scripts/open-wsl-vscode.ps1 -Path "\\wsl.localhost\ubuntu\home\me\proj"
|
|
55
|
+
# or by hand:
|
|
56
|
+
code --folder-uri "vscode-remote://wsl+ubuntu/home/me/proj"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
要求 PATH 上有 `code` shim(VS Code 安装器会添加),以及
|
|
60
|
+
Remote-WSL 扩展。
|
|
61
|
+
|
|
62
|
+

|
|
63
|
+
|
|
64
|
+
终端面板运行在同一个发行版中——`uname -a` 返回的是
|
|
65
|
+
发行版的内核,而不是 Windows 的:
|
|
66
|
+
|
|
67
|
+

|
|
68
|
+
|
|
69
|
+
侧边栏的预览也能就地渲染 WSL 文件:
|
|
70
|
+
|
|
71
|
+

|
|
72
|
+
|
|
73
|
+
## 4. 验证
|
|
74
|
+
|
|
75
|
+
让模型执行一条命令,例如 `pwd && uname -a`。预期结果:Linux 路径和
|
|
76
|
+
发行版内核。如果第一条命令失败,错误信息会给出补救方法;
|
|
77
|
+
[doctor](CONFIGURATION.md) 和[故障排查表](../README.md#troubleshooting)
|
|
78
|
+
覆盖了常见情况。
|
|
79
|
+
|
|
80
|
+
下面的探针会实时运行随包的、由内核强制的 bwrap profile——
|
|
81
|
+
工作区内的写入生效,测试性的区外写入被以 `EROFS` 拒绝,
|
|
82
|
+
严格 profile 则把 `/mnt` 完全隐藏
|
|
83
|
+
([`test/probe/sandbox.sh`](https://github.com/Big-Dao/dsh-plugin-wsl-env/blob/main/test/probe/sandbox.sh)):
|
|
84
|
+
|
|
85
|
+
这是部分隔离,不是 Windows 安全边界:Windows interop
|
|
86
|
+
仍可启动 `/mnt` 之外的可执行文件。见 [LIMITATIONS.md](LIMITATIONS.md)。
|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
## 配方
|
|
91
|
+
|
|
92
|
+
命令在模型的会话中运行,位于发行版内,从工作区根目录出发。
|
|
93
|
+
|
|
94
|
+
### Node / TypeScript
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
node -v && pnpm -v
|
|
98
|
+
pnpm install
|
|
99
|
+
pnpm test
|
|
100
|
+
pnpm dev # a dev server survives the command that started it with sessionSandbox: true
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
快照成功后(默认每 10 s 刷新一次),server 的端口可能出现在 `DSH_WSL_PORTS`
|
|
104
|
+
中;从 Windows 通过 `http://localhost:<port>` 访问转发的端口。
|
|
105
|
+
|
|
106
|
+
### Python
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
python3 -m venv .venv && . .venv/bin/activate
|
|
110
|
+
pip install -r requirements.txt
|
|
111
|
+
python -m pytest
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
使用发行版的解释器,而不是 Windows 的:会话的 `python3` 是
|
|
115
|
+
发行版 `PATH` 上的那个(包括 pyenv/conda shim)。
|
|
116
|
+
|
|
117
|
+
### Rust
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
cargo build --release
|
|
121
|
+
cargo test
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
target 会针对发行版的架构(x86_64 或 aarch64)原生编译;
|
|
125
|
+
不要复用 Windows 的 `target/` 目录。
|
|
126
|
+
|
|
127
|
+
### Go
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
go build ./...
|
|
131
|
+
go test ./...
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
模块缓存通常位于发行版用户的 `$GOPATH` 下;其实际位置和底层文件系统
|
|
135
|
+
取决于 Go 环境和挂载情况。
|
|
136
|
+
|
|
137
|
+
### Monorepo
|
|
138
|
+
|
|
139
|
+
把仓库根目录作为工作区打开。每个包的命令都在同一个发行版中运行;
|
|
140
|
+
`pnpm -r`、`turbo`、`nx` 和 `make` 看到的是同一个 Linux 文件系统。
|
|
141
|
+
当 `inotifywait` 可用时,无上限目录的文件监视使用 inotify;
|
|
142
|
+
否则回退到轮询。如果遗漏了某次变更,见
|
|
143
|
+
[CONFIGURATION.md](CONFIGURATION.md) 中的监视器边界。
|
|
144
|
+
|
|
145
|
+
## 兼容性
|
|
146
|
+
|
|
147
|
+
诚实的现状,不是承诺。"已探针"指本仓库记录了一次真机运行;
|
|
148
|
+
"目标"指设计上支持,但这条腿尚未在这里执行过。
|
|
149
|
+
|
|
150
|
+
| 层级 | 配置 | 状态 |
|
|
151
|
+
|---|---|---|
|
|
152
|
+
| 1 | Ubuntu / Debian,systemd,x86_64 | 已探针。Debian 的 harness 级探针针对 `wslfs-debian` profile 通过(2026-10-26)。 |
|
|
153
|
+
| 2 | Fedora、openSUSE、Arch、Alpine;aarch64 原生 agent | 发行版矩阵见 [COMPATIBILITY.md](COMPATIBILITY.md)。aarch64 的 18 项检查在 CI 中于 qemu 下运行;物理 aarch64 WSL 不在范围内。 |
|
|
154
|
+
| 不支持 | WSL 1、Linux/macOS 宿主、无 WSL 2 的 Windows | 不支持;插件依附于 `wsl.exe` |
|
|
155
|
+
|
|
156
|
+
设置 `sessionSandbox: auto` 时,没有 systemd/Linger 的发行版仍能获得
|
|
157
|
+
按命令的 `bubblewrap` 沙箱,且结果会报告更窄的 scope;
|
|
158
|
+
`true` 则直接拒绝。沙箱取舍见
|
|
159
|
+
[CONFIGURATION.md](CONFIGURATION.md#sandbox-and-preflight),实测延迟见
|
|
160
|
+
[PERFORMANCE.md](PERFORMANCE.md)。
|
|
161
|
+
|
|
162
|
+
## 演示
|
|
163
|
+
|
|
164
|
+
上面的截图展示了选择器、终端、预览和沙箱探针。
|
|
165
|
+
目前还没有 GIF。[故障排查表](../README.md#troubleshooting)
|
|
166
|
+
和探针输出(`pnpm run probe:sandbox`、`pnpm run probe:gui-preview`)
|
|
167
|
+
提供了可复现的证据;其余演示工作在
|
|
168
|
+
[ROADMAP-1.0.md](ROADMAP-1.0.md#wsl-302--discoverability-and-docs-entry) 中跟踪。
|
package/docs/README.zh.md
CHANGED
|
@@ -72,7 +72,7 @@ dsh --profile wsl # 启动
|
|
|
72
72
|
wsl.exe -d <发行版> -u root -- apt-get install -y bubblewrap
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
在插件检出目录中,`pnpm run bootstrap <发行版>`
|
|
75
|
+
在插件检出目录中,`pnpm run doctor` 是一键环境体检:Windows/WSL 版本、发行版及其 shell、bubblewrap 可用性、systemd / user manager / Linger、可选工具、peer 版本、agent 缓存、新 agent 握手、残留会话 scope 和已知的 profile 补丁陷阱。每个失败都打印一条可复制的处理办法;`--json` 供脚本使用,`--fix` 清理残留 scope(安装包需要 `--fix --install` 并显式确认)。`pnpm run diagnose` 是其只读别名。`pnpm run bootstrap <发行版>` 仍是较窄的工具安装助手:检查四个发行版工具,并按包管理器打印安装命令;加 `--install` 仅在缺少 bubblewrap 时执行该命令。若只缺少其他工具,请自行执行打印的命令。
|
|
76
76
|
|
|
77
77
|
升级:再次执行 `add` 命令。卸载:`dsh plugin --profile wsl remove dsh-plugin-wsl-env`;之后可删除 `~/.cache/dsh-wsl`。如果你为了恢复预览在 profile 里加过 `workspace-files-wsl` 的临时覆盖,升级后请删掉:插件不再挂载该行。
|
|
78
78
|
|
|
@@ -94,13 +94,13 @@ wsl.exe -d <发行版> -u root -- apt-get install -y bubblewrap
|
|
|
94
94
|
|---|---|---|---|
|
|
95
95
|
| `wsl-shell` | `distro` | `''` | 发行版模式;空/`auto` 跟随工作区,`default` 强制 WSL 默认 |
|
|
96
96
|
| | `sandbox` | `true` | 用 `bubblewrap` 约束命令 |
|
|
97
|
-
| | `sessionSandbox` | `true` | 会话命令跑在同一个 systemd user scope 中 |
|
|
97
|
+
| | `sessionSandbox` | 随包 `true` | 会话命令跑在同一个 systemd user scope 中 |
|
|
98
98
|
| | `agentBackend` | `auto` | 发行版内 agent:`auto`、`native` 或 `shell` |
|
|
99
99
|
| | `maskWindowsDrive` | `false` | 让受限命令看不到 `/mnt` |
|
|
100
100
|
| `wsl-fs` | `distro` | `''` | 发行版模式;空/`auto` 跟随每个目标路径 |
|
|
101
101
|
| | `restrictToDistro` | `true` | 固定发行版(`default` 或名字)时拒绝属于其他发行版的路径 |
|
|
102
102
|
| | `sandbox` | `true` | 按策略检查受限写入 |
|
|
103
|
-
| | `sessionSandbox` | `true` | 受限写入跑在会话 runtime 中 |
|
|
103
|
+
| | `sessionSandbox` | 随包 `true` | 受限写入跑在会话 runtime 中 |
|
|
104
104
|
| | `substrate` | `agent` | 发行版内 agent;`share` 在启动时被拒绝 |
|
|
105
105
|
| `directory-picker-wsl` | `includeHostHome` | `true` | 同时列出 Windows 家目录 |
|
|
106
106
|
| `subprocess-wsl` | `distro` | `''` | 发行版模式;空/`auto` 跟随启动目录 |
|
|
@@ -149,6 +149,7 @@ wsl preset(每个会话)
|
|
|
149
149
|
| 会话在第一条命令前就被拒绝 | 启用 systemd 和 linger,或在 `wsl-shell`、`wsl-fs` 上设置 `sessionSandbox: false` |
|
|
150
150
|
| 发行版内 `glob`、`grep` 很慢 | 运行 `pnpm run bootstrap <发行版>`,使用打印的安装命令安装 `ripgrep` |
|
|
151
151
|
| `dsh plugin add` 没有输出 | 插件已安装;这是成功 |
|
|
152
|
+
| 对 `wsl-shell`/`wsl-fs` 的 profile 补丁不生效 | 这些行嵌套在 `preset-wsl` 里。运行 `pnpm run preset --check <补丁>`;它会失败并输出需要粘贴的完整块 |
|
|
152
153
|
| 改了 `lib/` 但不生效 | 运行 `pnpm run sync:windows`,然后重启应用 |
|
|
153
154
|
|
|
154
155
|
更多错误码和拒绝原因见 [docs/ARCHITECTURE.md](ARCHITECTURE.md#error-codes),插件不做的事见 [docs/LIMITATIONS.md](LIMITATIONS.md)。
|
package/docs/RELEASING.md
CHANGED
|
@@ -52,7 +52,8 @@ The rest of the uncovered branches — the host-path arm of
|
|
|
52
52
|
`wslWritableRoots`, the sandbox-error and rethrow arms, the
|
|
53
53
|
unrestricted-path result, all in `lib/index.js` — is ordinary
|
|
54
54
|
CI-coverable code. Do not raise the branch number without either covering
|
|
55
|
-
the `wsl.exe` tail on the Windows CI legs or moving the coverage job
|
|
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
|
package/docs/REQUIREMENTS.zh.md
CHANGED
|
@@ -10,7 +10,11 @@ docs/ 各篇里的行为承诺登记成带编号的需求条目,并给每条
|
|
|
10
10
|
|
|
11
11
|
维护规则与 [PARITY.md](PARITY.md) 的纪律一致:需求变更与登记表改动进同一笔
|
|
12
12
|
变更;新增行为承诺先入表再实现;「验证」列与测试同改。登记表的唯一判定
|
|
13
|
-
|
|
13
|
+
来源是文档与代码的现状,不是意图。「验证」列引用的测试由
|
|
14
|
+
`pnpm run lint:requirements`(`scripts/check-requirements.mjs`,已入
|
|
15
|
+
`pnpm test` 门禁链)机械校验:被引测试必须存在且列入 `test:unit` 与
|
|
16
|
+
`test:coverage` 两个脚本;ID 不得重复;未引用测试的行为/过程性条目会在
|
|
17
|
+
输出中点名保留可见。
|
|
14
18
|
|
|
15
19
|
## 判尺
|
|
16
20
|
|
|
@@ -39,9 +43,8 @@ docs/ 各篇里的行为承诺登记成带编号的需求条目,并给每条
|
|
|
39
43
|
| R10 | 文件搜索跑发行版自身的 rg,绝不跨 9p share | PARITY「Contract audit」第 2 条;LIMITATIONS「glob 和 grep」条 | ①②③:拦截点与参数逐字转发成文;缺 rg 浮出 exit 127 附 bootstrap 指引;grep 回退被拒绝且理由明文(不读 `.gitignore`,非 rg 替身) | `search-route.test.mjs`、`search-exec.test.mjs` | — |
|
|
40
44
|
| R11 | watch():inotify 优先(无界目录),轮询回退;粗粒度失效 | PARITY「Contract audit」第 1 条;LIMITATIONS watch 两条 | ①②③:契约向上追溯到宿主接缝(`changed()` 无载荷 → 粗粒度失效即可);inotify 递归且 0.5s 合并、文件/限深/无 inotify-tools 回退轮询;更旧 mtime 盲区只属轮询路径、`watchMaxDepth` 旋钮、目标消失响亮报错成文 | `watcher.test.mjs`;probe:watch(无 inotify 时 7/7;装 inotify-tools 后盲区检查改为期望事件) | 轮询回退的 mtime 盲区已声明;inotify 路径依赖发行版的 inotify-tools |
|
|
41
45
|
| R12 | share 基座退役:携带 `substrate: "share"` 的 profile 在 boot 被拒并附迁移 | README/CONFIGURATION/LIMITATIONS 三处一致 | ①②⑤:旧值处置与用户所见成文,迁移指引内嵌 | `fs-decisions.test.mjs`(拒绝消息与迁移指引文案) | boot 期拒绝分支无测试(构造器调 `shareSubstrateRefusal`,`src/index.ts:1056`):`fs.boot.test.mjs` 只以 `sandbox: true` 启动该行,仓内没有构造 `substrate: "share"` profile 的测试 |
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
| R14 | 安装/卸载/升级流:四步安装、幂等陷阱及补救、ES 模块重启须知 | README「Install」「Troubleshooting」 | ①③:每步预期输出、`add` 幂等性陷阱的补救(先 remove 再 add)、pnpm UNC 链接极限成文 | 人工步骤,无自动化(依赖真实 dsh CLI + Windows) | 无自动化守护 |
|
|
46
|
+
| R13 | 会话级 systemd scope:命令共享后台进程/真实 `/tmp`/`ps`,scope 随会话结束停止;systemd + linger 缺失时预检带修复拒绝 | ADR 0001;README/CONFIGURATION/LIMITATIONS 的 `sessionSandbox` 条 | ①②③⑤:scope 生命周期(agent 为主进程、refcount、dispose stop)、`sessionSandbox: false` 退出、systemd/linger/systemd-run 四项预检与缓存策略成文;`/tmp` 与后台进程的保真边界限定在 runtime 开时 | `session-scope.test.mjs`、`session-runtime.test.mjs`、`provider.test.mjs`;真机会话验证(active scope、跨命令后台/`/tmp`、会话结束 0 units) | 硬崩溃可能留下 stale scope(启动清扫未随发,入 LIMITATIONS);受限写入已共享 runtime,读仍走无约束共享 agent,根级 fs-routing 不持有 session runtime |
|
|
47
|
+
| R14 | bootstrap:bwrap/ripgrep 等的就地体检与安装 | README「Install」「Troubleshooting」;CONFIGURATION | ①②⑤:`--install` 与只读体检两式、体检对象、错误消息补救指引成文 | 0.7.4 起脚本随包(`files` 收录,补救指引在 npm 安装下可用) | 脚本本身无 CI 腿(真机排错路径覆盖) |
|
|
45
48
|
| R15 | 错误码方言:每个 `FS_*` 码给出抛出者、含义、解除条件;`wsl.exe` 自身失败显式收编 | ARCHITECTURE「Error codes」表 | ①②:逐码三列成表;两类历史隐形失败(UTF-16 stdout、cwd 回退 exit 0)收编;`FS_OUTSIDE_DISTRO` 独立成码的理由明文 | `fs-decisions.test.mjs`、`fsio-agent.test.mjs`、`fs-substrate.test.mjs`、`provider.test.mjs`(断言码与消息) | — |
|
|
46
49
|
| R16 | 对端 parity 合同:fsio 文本机制逐字节复刻钉死的对端版本 | PEER-PARITY 全文 | ①④⑥:钉版、验证方法(npm pack 逐函数比对)、验证日期、刻意分歧逐条声明、bump 钉版即重跑的维护规则 | `fsio-agent.test.mjs`(distro 内半区 canary);对端比对为手动方法 | 钉版升级后需重跑比对(维护规则) |
|
|
47
50
|
| R17 | 常驻 agent 协议:ACK 计时看门狗、只读帧才重放、逐流输出上限、sha256 部署校验、租约存活、进程组两段杀 | CHANGELOG 0.3.0/0.6.0/0.7.3;PARITY Phase 1/Phase 3 | ①②④:每条健壮性属性有规格出处与实证记录;「EXEC/变异 FS 帧禁止盲重发」是写明的不变量 | `agent-protocol.test.mjs`(HELLO 版本+摘要)、`agent.test.mjs`、`agent-exec.test.mjs`(truncated 旗标)、`agent-fs-script.test.mjs`;probe:agent、probe:exec | — |
|
|
@@ -52,6 +55,7 @@ docs/ 各篇里的行为承诺登记成带编号的需求条目,并给每条
|
|
|
52
55
|
| R22 | 支持矩阵:Windows 10/11 + WSL2 + Node `^22.19.0 \|\| >=24.0.0` + peer 版本范围 | SUPPORT 全文 | ⑥:支持与不受支持清单、peer 范围及精确开发依赖成文;Node 20 在范围外(理由见 SUPPORT,`engines` 为准) | `peerDependencies`、`devDependencies` 与 `engines`(`package.json`);CI 矩阵(ci.yml) | 新 peer 版本仍需验证 |
|
|
53
56
|
| R23 | 根平面 `ctx.fs` 按坐标路由:发行版 UNC 由发行版内 agent 服务(inotify 或轮询 watch),盘符路径留在宿主;接替随发的 `fs-sandbox` 行 | README「Architecture」;ARCHITECTURE「The root-plane filesystem takeover」;CONFIGURATION `fs-routing` 行;root-fs-routing.md(设计) | ①②③⑤:路由判定与接替理由(写围栏在根平面无消费者)成文;`distro` 的 `auto`/`default`/pin 三态、每个 UNC 目标由自身 distro 服务、pin 下拒外来路径,以及 `distroCwd`/`restrictToDistro`/`sandbox`/`maskWindowsDrive`/`watchMaxDepth` 逐键成表,且自成一行、不与会话级行联动;`sandbox` 失败关闭成文 | `fs-routing.test.mjs`(纯谓词与路径助手)、`provider.test.mjs`(per-distro substrate/worldPath) | 类本体无单测(需 DSH peers 与实机);由组合测试与真机探针覆盖 |
|
|
54
57
|
| R24 | GUI 文件树与预览在发行版内服务:沿用随包 `workspace-files` 行(server/client 成对),经根级 `fs-routing` 读写 distro UNC;盘符 scope 交宿主 | README「Architecture」;ARCHITECTURE「The root-plane filesystem takeover」;CONFIGURATION `workspace-files` 行 | ①②③⑤:沿用官方 server/client,浏览器 `file` provider 不丢,预览可用;路由与宿主/发行版 scope 成文;容量键由官方行承载、可覆盖;较直连多 4–6 次往返及其取舍在 LIMITATIONS 成文 | `fs-routing.test.mjs`、组合测试(`workspace-files` 保持启用、接管行不存在) | — |
|
|
58
|
+
| R25 | 安装/卸载/升级流:四步安装、幂等陷阱及补救、ES 模块重启须知 | README「Install」「Troubleshooting」 | ①③:每步预期输出、`add` 幂等性陷阱的补救(先 remove 再 add)、pnpm UNC 链接极限成文 | 人工步骤,无自动化(依赖真实 dsh CLI + Windows) | 无自动化守护 |
|
|
55
59
|
|
|
56
60
|
登记覆盖面:上表登记 README 与 docs/ 中对外成文的行为承诺(含随发的服务面)。
|
|
57
61
|
**有意未接线**的模块不设条目——`lib/file-reference-wsl.js`(`@` 补全的发行版侧
|