Repository navigation
Verify rebuilt DSH plugin contents after local installation - #10118
loopx-agent wants to merge 7 commits into
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-astra · OpenAI · runtime_reported · high
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
HEAD: fb39844b4854bd76e36e8b682842da0274b0d7b8
[P2] 保留 DSH 返回的 POSIX profile 路径。 安装器在第 105 行把每个反斜杠换成斜杠。在 macOS 上,反斜杠可以是目录名的一部分。我让真实 DSH 在名称含字面反斜杠的临时目录中创建 web profile。它返回的 cwd 与所选目录指向同一位置,转换后的路径却不存在,安装器随即报 unable to locate DSH profile。如果转换后的另一个目录恰好存在,第 107 行的目录检查也会放行,随后归档会写到错误的位置。后一种结果来自代码审读。建议在 POSIX 原样使用 cwd,仅在 Windows 转换分隔符,并补测归档确实位于 DSH 选定的目录中。安装器第 105 行
动机 / Motivation
受影响的是从深层工作树安装插件的 DSH 操作者。此前深路径会让 pnpm 10 创建过长的依赖名;当前提交在同一路径完成安装。相同 Driver 的重压缩包被拒,确实不同的旧 Driver 被替换。POSIX profile 目录名中的反斜杠仍被改写。本次未验证发布或全局安装。
从深层工作树安装插件时,pnpm 10 会把原归档路径编码到依赖目录名中。同版本重建还需要确认进程实际能读到新的 Driver。两个问题都关系到安装器何时可以向操作者报告成功。
改动思路 / Approach
DSH 提供当前 profile 目录,安装器在其中按归档摘要保留包,再通过该 profile 解析已安装包,逐文件与归档比对。摘要区分归档字节,升级测试另外比较旧、新 Driver 字节,以区分重新压缩和实际代码替换。
具体改动 / Changes
在 macOS、DSH 0.2.2-rc.3 和 pnpm 10.33.0 的含空格深路径上,上一提交 bfe6f684afea 复现 ERR_PNPM_ENAMETOOLONG,当前提交完成安装、同版本替换与卸载。pnpm 11.25.0 的默认安装用例也通过。另将同一 tar 内容重新压缩再作为旧包,验收按预期拒绝;使用 Driver 字节确实不同的同版本旧包,安装后的 Driver 与目标一致。上轮关于假阳性的 P2 已解决。对照包文档,本次分别核验了 profile-local-archive(归档位置)与 driver-replacement(同版本替换)。packages/dsh-loopx-plugin/README.md
对主干的风险 / Risks
在字面反斜杠用例中,PR 基线 f8f19b11ed3a 已写入所选 profile 的 Driver,随后在 Node 模块解析阶段退出 1。当前提交同样退出 1,但在归档前已经丢失了 profile 身份。这份对照能确认路径选择发生变化,不能证明基线曾在该路径完整安装成功。原生 Linux 和 Windows 未实跑。
完整 premerge 首次运行未通过。根目录缺少 TypeScript 依赖,按锁文件准备后词汇检查单独通过;DSH quality 阶段在 Vitest 运行期间超时。依赖就绪后,DSH quality 与 package 两个阶段以 pnpm 10 单独重跑均通过。上述深路径和同版本安装器的结果来自另行完成的真实宿主测试。
我的整体评价 / Verdict
改动集中在源码安装器、验收用例与包文档。POSIX profile 目录名中的反斜杠仍被改写。复用 DSH 提供的工作目录和安装包校验即可修复。请修正 profile 根目录转换,并在保留现有对照的同时覆盖含字面反斜杠的 POSIX 目录。若某种路径无法支持,应在向其他目录写归档前明确拒绝。
English verdict: REQUEST_CHANGES. The earlier Driver replacement issue is fixed. Preserve the selected POSIX profile directory when resolving the retained archive.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-astra · OpenAI · runtime_reported · high
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
HEAD: 26e3db8e8d39dd13f4f53b8c6a56afa40b6bef17
[P2] 传递 profile 目录时会丢失路径里的回车或换行。 第 105 行用 sed -n 按行提取 cwd,随后 tr -d 删除所有回车。两种字符在 POSIX 目录名中都合法。DSH 能找到实际目录,安装器却按另一种拼写查询,报 unable to locate DSH profile。若转换后的路径碰巧是另一个目录,随后的目录存在性检查也无法保证归档属于选定的 profile。实测的是安装失败,写入其他目录是代码审读结论。安装器第 105 行
动机 / Motivation
受影响的是将 DSH_HOME 指向这类目录的源码安装用户。相同的两个 macOS 目录在基线均安装成功,当前提交均在定位 profile 时退出。深路径下的同版本 Driver 替换通过,字面反斜杠也已在写入前被拒绝。含回车或换行的有效目录仍无法安装。本轮范围限于安装器与隔离的 web profile。
改动思路 / Approach
安装器借助 DSH 在目标 profile 中执行 Node,取到真实工作目录,在该目录保留按内容摘要命名的 tarball。改用宿主自己的路径分隔符后,POSIX 的字面反斜杠能被识别并给出明确提示。目录传出子进程时仍经过文本行过滤,文件名里的回车与换行因而与输出格式发生冲突。
具体改动 / Changes
我用真实 macOS DSH 0.2.2-rc.3、Node 24.21 和 pnpm 10.33 建立两组隔离的 web profile,目录名中间分别放一个 CR 和 LF。通过 DSH 子进程用 JSON 独立读回 cwd,两组均与所选目录指向同一位置。基线 f8f19b11ed3a 两组均退出 0,安装校验通过且 Driver 存在。当前提交两组均退出 1,目标 profile 中没有归档或 Driver。
对上轮反斜杠用例,本提交按预期退出 2,给出更换 DSH_HOME 的说明,真实目录和可能被混淆的目录均无归档和插件。含空格的深工作树完成安装、同版本不同 Driver 替换、版本/宿主拒绝和卸载;对同一 tar 内容仅重新压缩,验收按预期拒绝。这两项分别覆盖包文档的 profile-local-archive 与 driver-replacement。packages/dsh-loopx-plugin/README.md
对主干的风险 / Risks
受影响的是较少见、但基线能够正常使用的目录名。当前文档只排除了字面反斜杠。要保持原有支持范围,可以先将 cwd 编码为单行数据,在本机解码后再检查完整路径,或在目标 profile 的 Node 进程中直接处理归档。我在 DSH 调用边界记录了真实 argv:当前探针是一个 92 字符的参数,不含 CR 或 LF;上一提交的参数含换行。该参数已由 macOS DSH 执行。Windows 命令解释器和 Linux 本轮未原生实跑。完整本地 premerge 通过。
我的整体评价 / Verdict
修复可以集中在目录传递和安装器验收。让 Node 和 shell 交接完整路径,即可继续使用现有的归档和安装校验。建议在修复时保留反斜杠拒绝、深路径和同版本 Driver 的既有用例,并验证 CR、LF 两个目录安装后各自的归档与 Driver。PR 可继续开放等待修正。
English verdict: REQUEST_CHANGES. The previous backslash issue is fixed. The installer still rejects two POSIX profile paths that the base installs successfully.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-astra · OpenAI · runtime_reported · high
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
HEAD: 244b21dd9f55eafec4f771ed803de49703c75fd1
[P2] 安装成功时,归档仍可能落在所选 profile 之外。 第 105 行用 sed 按行提取 DSH 返回的 cwd,再用 tr 删除回车。如果目录名含换行,且换行前的路径恰好是现有目录,第 110 行的目录检查就会通过。pnpm 10.33.0 和 11.25.0 上我都实际读到了这个结果:安装器退出 0,Driver 位于正确的 web profile,归档却留在另一个目录。目标 profile 中没有 .loopx-archives,我在安装器报告的位置读回了 tarball,并核对了 SHA-256。install.sh 第 105 行
动机 / Motivation
受影响的是从源码安装 DSH 插件并自定义 profile 目录的用户。基线在含回车和换行的目录均安装成功;当前版把换行前的目录当作归档根。两代 pnpm 都能替换同版本 Driver,也都能在反斜杠用例中保护相邻目录。安装器仍可能报告成功并把归档写在所选 profile 之外。本轮只检查隔离 profile 内的安装和回读。
改动思路 / Approach
此次补丁保留了探针子进程的错误诊断。pnpm 10 能运行 Node 并返回含反斜杠的目录,安装器随后给出更换 DSH_HOME 的提示,退出 2。pnpm 11 在加载该 profile 的 pnpmfile 时已遇到编码分隔符错误,安装器保留了这个原因,补充查询失败提示后退出 1。这两条失败路径现在都能与安装成功区分。
具体改动 / Changes
在 macOS 上用真实 DSH 0.2.2-rc.3 分别运行了两代 pnpm 的完整安装器 smoke:正常安装、同版本不同 Driver 的替换、旧版本拒绝、不兼容宿主拒绝及卸载均通过。pnpm 10 使用带空格的深工作树。仅重新压缩同一份 tar 内容时,同版本替换证据仍被拒绝。独立检查反斜杠负例后,所选目录和相邻目录均没有新增归档或插件。实际 DSH 调用边界记录到的 Node 探针是一个不含回车或换行的参数。
针对包文档的 profile-local-archive 和 driver-replacement 两项要求,我还用 JSON 独立回读了 DSH 选定的目录。含回车的用例在基线安装成功,在当前提交的两代 pnpm 上均报找不到 profile。含换行的用例在基线同样安装成功;当前版即使取错归档目录,后续校验仍能通过,因为 DSH 是从实际选定的 profile 中解析 Driver 的。packages/dsh-loopx-plugin/README.md
对主干的风险 / Risks
按 profile 迁移或清理文件时,已安装依赖引用的归档可能在该目录之外。目录名含控制字符较少见,但这两个用例均是基线可接受的输入。补丁已处理字面反斜杠,仍需无损传递其余受支持的路径字符。完整本地 premerge 通过。本轮未在原生 Windows 或 Linux 上执行安装器,单行参数的实测范围是 macOS 的 DSH 调用边界。
我的整体评价 / Verdict
改动范围可以限于安装器和它的路径验收用例。用可无损解码的形式传递 cwd,即可保留既有归档和包内容校验。请保留两代 pnpm 各自的反斜杠诊断,再增加一项回归:给有效 profile 的目录名加入换行并预先建好截断后的目录,按实际选定的 profile 身份核对归档位置和 Driver。含回车的正例也应继续安装成功。
English verdict: REQUEST_CHANGES. Both pnpm versions preserve the backslash rejection, but an install can still report success and retain its archive outside the selected profile.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-astra · OpenAI · runtime_reported · high
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
HEAD: d72f8d110e3ad9416f41ea091793bbfdf072337c
结论:上轮的目录错写已修复。 我对 pnpm 10.33.0 和 11.25.0 分别运行了独立路径用例。包含回车或换行时,安装器报告的归档位置、实际文件和 DSH 选定的 profile 一致。原生 Windows 的整机验证仍待完成。
动机 / Motivation
受影响的是从源码安装 DSH 插件并自定义 profile 目录的用户。上一版会在有效目录含换行时把归档留在相邻目录;本版在相同条件下将归档和 Driver 放入同一个 web profile。两代 pnpm 的独立安装、不同 Driver 的同版本更换和卸载均通过。四份 CR/LF 归档均位于 DSH 实际选择的 web profile,目录名与文件 SHA-256 相同,包内 Driver 与已安装文件逐字节一致。本次结论覆盖源码安装器;原生 Windows 整机分发仍需单独验收。
改动思路 / Approach
DSH 在选定的 web profile 内读取 cwd,先按宿主路径分隔符归一,再编码为单行 Base64。安装器解码后检查目录,保留原始的回车和换行。包以内容摘要作为保留目录名,安装完成后,从该 profile 内解析包并核对已安装文件。这样既保留了深工作树下较短的依赖路径,也能分辨版本相同但内容不同的 Driver。安装器
具体改动 / Changes
用真实 DSH 0.2.2-rc.3 运行两代 pnpm,pnpm 10 使用带空格的深工作树。按 packages/dsh-loopx-plugin/README.md 的 profile-local-archive 和 driver-replacement 两项检查,完整 smoke 先在带换行及回车的 profile 安装,核对 SHA-256、相邻目录及四条配置,再安装一个同版本但 Driver 内容不同的夹具,重新安装并读回预期字节,最后卸载。我另行读取了两代 pnpm 各自的 CR、LF 四份归档,逐一比较实际 Driver。pnpm 10 和 11 均拒绝含字面反斜杠的 POSIX profile,目标和相邻目录均未写入归档。相同 Driver 仅重新压缩的对照包被拒绝作为同版本更换证据。旧版本和不兼容宿主的拒绝路径也通过。按包指定版本重跑的本地 premerge 通过。安装与升级契约
对主干的风险 / Risks
本提交让 shell 打开 tarball,再把文件内容作为标准输入交给 tar。GNU tar 因此收到归档参数 -,不会将盘符解释成远端主机。我在 Linux GNU tar 1.35 上用实际带 C: 的路径验证了解包和结果文件摘要。macOS 的真实安装覆盖了 DSH 调用、包内容核验和卸载;Windows 上 Git Bash、Node 和 DSH 的组合尚无本轮原生实跑记录。此前 Windows 的失败记录属于前一提交,本次平台分发资格仍应单独记录。平台验收范围
我的整体评价 / Verdict
修复集中在已有 Bash 安装器和插件验收用例。目录身份继续由 DSH 提供,安装器仅处理传输和内容核验。这个提交修复了已复现的目录身份问题,也直接排除了 GNU tar 解释盘符的机制。就本次源码安装器变更同意通过;Windows 整机验收和发布另行处理。
English verdict: APPROVE. Profile-local archive identity, same-version Driver replacement and streamed GNU tar extraction were verified. Native Windows qualification remains open.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-astra · OpenAI · runtime_reported · high
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
HEAD: 06e105f25415e72422e255adc1a7427e42276b45
独评通过。 我用相同的 tarball 复现了 pnpm 10 的路径过长错误,也核对了实际写入的依赖。两代 pnpm 在真实 DSH 选定的 profile 中都能解析该依赖,包内与已安装的 Driver 字节一致。
动机 / Motivation
受影响的是从源码安装 DSH 插件并自定义 profile 目录的用户。在隔离 pnpm 10 中,绝对别名使相同归档的安装报 ENAMETOOLONG;改用 profile 相对路径后安装成功。pnpm 10 和 11 均从选定的 web profile 读回了相对依赖,归档 SHA-256 和已安装 Driver 字节均吻合;同版本更换与卸载通过。本次评审覆盖源码安装器及其包管理依赖。原生 Windows 上的新提交端到端结果仍待验证。
改动思路 / Approach
上一提交已经按实际 profile 和归档摘要保存 tarball,但调用 DSH 时仍把完整绝对路径交给 pnpm。本提交从同一个目录名、相同的摘要和归档文件名构造 file:.loopx-archives/<sha256>/<文件名>。DSH 在 web profile 中启动 pnpm,所以路径的起点与保留归档的位置相同。安装器仍然从该 profile 解析包并逐文件核对安装内容。安装器
具体改动 / Changes
对照试验使用 pnpm 10.33.0、两个隔离的 store 和完全相同的包字节。通过长路径别名传入绝对文件名时,pnpm 创建索引报错,退出 1;使用相对依赖后退出 0,安装文件内容正确。随后用 DSH 0.2.2-rc.3 分别运行 pnpm 10.33.0 和 11.25.0。我从另一个工作目录调用安装器,直接读取 web profile 的 package.json,按其中的 file: 值打开归档,核验目录名、SHA-256、归档内 Driver 和已安装 Driver。两组结果均一致,调用目录、相邻目录与另一个 profile 中都没有新增归档。
按 packages/dsh-loopx-plugin/README.md 的 profile-local-archive 和 driver-replacement 两项要求,我也运行了完整安装、同版本不同 Driver 替换和卸载。已有截断目录且目标含 CR/LF 的用例通过;只重压缩相同内容的同版本包仍被升级用例拒绝。本地差异 premerge 通过。安装与替换契约
对主干的风险 / Risks
归档仅放在调用目录时,真实 DSH 从所选 profile 找包并报 ENOENT,未写入依赖或安装 Driver。这条负例排除了依赖恰好从启动安装器的位置解析成功的可能。长路径别名对照在 macOS 上运行,复现的是 pnpm 索引文件名过长。前一提交的 Windows 记录只能说明当时已通过解包,无法证明当前提交在 Windows 短文件名和 Git Bash 环境下的完整安装与卸载。
我的整体评价 / Verdict
这次修订只改安装器传给 DSH 的依赖参数,并在现有 smoke 中核对写入的 manifest。DSH 继续选择 profile,pnpm 负责在该目录解析依赖。真实依赖、归档与 Driver 的读回支持这次安装器修复。原生 Windows 分发验收可继续使用相同的 manifest、摘要和卸载检查。
English verdict: APPROVE. Profile-relative dependency resolution, retained archive identity and same-version replacement were verified; native Windows qualification remains open.
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
DSH can reuse an old Driver when a local archive is rebuilt at the same path and version. The package version and profile rows can still look correct.
The source installer retains each archive under its SHA-256 in the selected profile and compares the installed package files with that archive. Keeping the dependency path short relative to the profile also avoids a pnpm 10 store filename limit exposed by a deeply nested checkout.
On
d72f8d11, the Ubuntu distribution job and frozen-lockfile matrix passed. Windows extracted the archive successfully but pnpm 10 failed when its store index filename included the absolute short-name path to the profile. Windows job.Commit
06e105f2uses a profile-relativefile:dependency. In an isolated pnpm 10 comparison, an absolute alias produced ENAMETOOLONG while the relative spec installed the identical archive. The real source-installer smoke passed on macOS with both pnpm 10.33.0 and 11.25.0. It reads back the persisted dependency, the selected profile's archive and hash, the changed Driver at the same version, and removal. The profile path includes CR and LF and has an existing sibling at the truncated path. Earlier verification also covered rejection of an identical recompressed Driver and an incompatible host. On this revision the native Windows installer still failed while pnpm added the relative dependency. Its store index key contained parent segments and the short user directory name.Cold restore on macOS (DSH 0.2.2-rc.3, pnpm 10.33.0): after moving the installed profile and removing its installed modules, a frozen offline install into an empty store restored the exact package from its retained archive. Withholding the archive failed. A changed Driver repacked at the original path failed the lockfile integrity check without installing that Driver. Restoring the original archive and retrying with the same store passed. The lockfile was unchanged, installed files matched the original archive, and the profile had all four plugin rows.
Commit
6b2ec9f4supplies the native path of the selected DSH profile as pnpm’s project directory. The manifest and lockfile still refer to the archive by a relative path. A controlled macOS experiment with pnpm 10.33 and an empty store reproduced ENAMETOOLONG by simulating different ordinary and native spellings for the same profile. Passing the canonical project directory installed the archive and preserved the relative lockfile reference. The actual source-installer lifecycle passed on macOS with pnpm 10.33 and 11.25, including replacement of a same-version Driver and removal. Native Windows verification of this revision is outstanding.