fix(boot): keep host lookups native and fix source smoke fixtures

This commit is contained in:
imccyu committed 2026-09-21 14:00:52 +08:00
1 parent c9d4b7561d
commit cf41c158ba
16 files changed
+354 -61

No files matched your search

+2 -2
View File
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/user/develop/basic/publish.md
publish.md: bdc6f21ec6d3a4777cf3e0c14771c19a08ed4b5e
publish.zh.md: 43fcea22873733784f46d97bcd16bfdb297dc3ed
publish.md: b317943954972e63d0e4b741fb16d2fc19091f58
publish.zh.md: b7864f7e7596681f48fc87590772841294d2a039
+2
View File
@@ -104,6 +104,8 @@ A linked checkout keeps its own `node_modules`. Declare dsh packages whose insta
Ordinary linked imports follow Node's ancestor order and check each directory's current peer declarations. A nearer physical package wins before a higher peer declaration. A link target can lack `package.json`; ancestor peers still apply, even without a physical `node_modules` beside that manifest. Explicit `require.resolve(..., { paths })` is always native, including paths inside a profile. These rules are shared by npm, Desktop, and source launches; they do not invalidate loaded modules or validate peer version ranges. See the [resolution rules](../../../../.agents/notes/implemented/architecture/2026-09-19-profile-resolution-lookup-order.md) for scope and file-query behavior.
Linking a broad checkout does not apply peer interception to the running installation's own package directories. Links whose targets stay inside the profile, including its pnpm store, remain profile-owned installation content rather than external linked roots. Overlapping external links do not change lookup order: each request still starts from its importer's directory.
Verify the layer without booting, then boot:
```sh
+2
View File
@@ -104,6 +104,8 @@ dsh plugin --profile demo add ./hello-plugin
普通 linked import 遵循 Node 的祖先顺序,检查每个目录当前的 peer 声明。更近的物理包先于更高的 peer 声明。link 目标可以没有 `package.json`,祖先 peer 仍可生效,即使该 manifest 旁没有物理 `node_modules`。显式 `require.resolve(..., { paths })` 始终是原生查询,包括指向 profile 内的路径。npm、Desktop 与源码启动共用这些规则;规则不会使已加载模块失效,也不校验 peer 版本范围。作用域和文件查询行为见[解析规则](../../../../.agents/notes/implemented/architecture/2026-09-19-profile-resolution-lookup-order.zh.md)。
链接整个 checkout 不会对运行中安装自身的包目录应用 peer 拦截。目标仍位于 profile 内的链接(包括它的 pnpm store)属于 profile 自己安装的内容,不算外部 linked root。外部链接互相重叠也不改变查找顺序,每个请求仍从其 importer 所在目录开始。
先不启动、只验证该层,再启动:
```sh