From 058d1d779b01cb6ba82ca6b87e3dbf9f4c3ac910 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Sat, 19 Sep 2026 16:13:19 +0800 Subject: [PATCH] docs(boot): keep the ancestor chain code block language neutral MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The numbered chain lists directories only; the legend for ①-⑤ moves into prose so both language sides can read it while the code block stays byte-identical for the pairing gate. --- .../2026-09-19-profile-resolution-lookup-order.md | 10 ++++++---- .../2026-09-19-profile-resolution-lookup-order.zh.md | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.agents/notes/implemented/architecture/2026-09-19-profile-resolution-lookup-order.md b/.agents/notes/implemented/architecture/2026-09-19-profile-resolution-lookup-order.md index 245de9a2e9..39821120c6 100644 --- a/.agents/notes/implemented/architecture/2026-09-19-profile-resolution-lookup-order.md +++ b/.agents/notes/implemented/architecture/2026-09-19-profile-resolution-lookup-order.md @@ -25,13 +25,15 @@ Symlinks are followed to their real path per Node's default behavior. Once a mod The chain below defines the numbering that every table in this Note references. The importer is `$DSH_HOME/profiles/web/node_modules/my-plugin/index.js`: ```text -① $DSH_HOME/profiles/web/node_modules/my-plugin/node_modules 插件私有依赖 -② $DSH_HOME/profiles/web/node_modules profile 安装的包 -③ $DSH_HOME/profiles/node_modules 拦截层:runtime resolution 占据其中有条目的包目录 +① $DSH_HOME/profiles/web/node_modules/my-plugin/node_modules +② $DSH_HOME/profiles/web/node_modules +③ $DSH_HOME/profiles/node_modules ④ $DSH_HOME/node_modules -⑤ /node_modules,随后是 NODE_PATH 与全局目录 +⑤ /node_modules ``` +① holds the plugin's private dependencies, ② the packages the profile installed, ③ the interception layer where the runtime resolution occupies the package directories it has entries for, ④ the Harness home, and ⑤ the filesystem root followed by `NODE_PATH` and the global directories. + #### 2. The interception layer: the runtime resolution occupies `$DSH_HOME/profiles/node_modules/` The interception layer is the first ancestor `node_modules` above the importer's profile directory (`$DSH_HOME/profiles/`). For every profile inside the tree this layer is `$DSH_HOME/profiles/node_modules`. diff --git a/.agents/notes/implemented/architecture/2026-09-19-profile-resolution-lookup-order.zh.md b/.agents/notes/implemented/architecture/2026-09-19-profile-resolution-lookup-order.zh.md index f1b6964d34..dcfa653ac9 100644 --- a/.agents/notes/implemented/architecture/2026-09-19-profile-resolution-lookup-order.zh.md +++ b/.agents/notes/implemented/architecture/2026-09-19-profile-resolution-lookup-order.zh.md @@ -25,13 +25,15 @@ importer 指发起 `import` 或 `require` 的那个模块文件。Node 从 impor 下面这条链是全文表格引用的编号。importer 为 `$DSH_HOME/profiles/web/node_modules/my-plugin/index.js`: ```text -① $DSH_HOME/profiles/web/node_modules/my-plugin/node_modules 插件私有依赖 -② $DSH_HOME/profiles/web/node_modules profile 安装的包 -③ $DSH_HOME/profiles/node_modules 拦截层:runtime resolution 占据其中有条目的包目录 +① $DSH_HOME/profiles/web/node_modules/my-plugin/node_modules +② $DSH_HOME/profiles/web/node_modules +③ $DSH_HOME/profiles/node_modules ④ $DSH_HOME/node_modules -⑤ /node_modules,随后是 NODE_PATH 与全局目录 +⑤ /node_modules ``` +① 是插件私有依赖,② 是 profile 安装的包,③ 是拦截层,runtime resolution 占据其中有条目的包目录,④ 是 Harness home,⑤ 是文件系统根,随后是 `NODE_PATH` 与全局目录。 + #### 2. 拦截层:runtime resolution 占据 `$DSH_HOME/profiles/node_modules/<包名>` 拦截层是 importer 所属 profile 目录(`$DSH_HOME/profiles/`)之上的第一个祖先 `node_modules`。树内所有 profile 的这一层都是 `$DSH_HOME/profiles/node_modules`。