发布

  • fix(pi-fff): handle Windows cross-volume external paths (#684)

    frostbyte_neo 发布于 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 in routePathConstraint() 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 workspace
    

    Extract the workspace-outside check into
    isOutsideWorkspaceRelativePath() so the logic is testable in
    isolation, and add path.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-volume path.win32.relative() result as outside the
    workspace. The test is gated on process.platform === "win32" and has
    no effect on Linux or macOS CI runs.

    下载附件