-
fix(pi-fff): handle Windows cross-volume external paths (#684)
发布于
2026-07-20 21:45:10 +00:00 On Windows,
path.relative()returns an absolute path when the source
and target are on different drives (e.g.D:\→C:\). The existing
check inroutePathConstraint()only recognizes".."and"..\..."
as indicators that a path is outside the workspace — it misses the
cross-volume case entirely. The path is then treated as workspace-local,
and downstream code rejects it with:Path constraint must be relative to the workspaceExtract the workspace-outside check into
isOutsideWorkspaceRelativePath()so the logic is testable in
isolation, and addpath.isAbsolute()to the condition. A cross-volume
relative result is by definition outside the workspace.Add a Windows-specific regression test that verifies the helper
recognizes a cross-volumepath.win32.relative()result as outside the
workspace. The test is gated onprocess.platform === "win32"and has
no effect on Linux or macOS CI runs.下载附件