fix(pi-fff): handle Windows cross-volume external paths - #684
Merged
dmtrKovalenko merged 1 commit intoJul 20, 2026
Merged
dmtrKovalenko merged 1 commit into
dmtrKovalenko merged 1 commit into
Conversation
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.
abhijit-s
pushed a commit
to abhijit-s/fff
that referenced
this pull request
Jul 21, 2026
Upstream 0.10.1 batch (5 commits): pi-fff fixes (install fff-bun dmtrKovalenko#689/dmtrKovalenko#694, Windows cross-volume paths dmtrKovalenko#684), node/bun Android arm64 Termux support (dmtrKovalenko#695), and the 0.10.1 release/version bumps. No Rust source changes reach the fork — all JS-SDK/packaging/CI. Conflicts (config only, no code): - All crate Cargo.toml + workspace: take ours (fork stays 0.17.1; upstream's 0.10.1 is its own release line). fff-mcp keeps daemon deps (fff-ipc/dirs/libc). - install-mcp.sh: ours (fork installs from HEAD/source, not upstream release-pin). - release.yaml: ours — keep the Android C-FFI matrix entry commented, consistent with the fork's policy of disabling non-macOS C builds to keep CI lean. - Cargo.lock: ours (workspace unchanged vs f5db5c1). Daemon rust verified intact (server.rs proxy path present); build-daemon green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
routePathConstraint()decides whether apathparameter pointsoutside the workspace and should be served by an aux (secondary)
file index. The existing outside-workspace check only handles
Unix-style
../and Windows..\escapes:On Windows,
path.relative('D:\workspace', 'C:\target')returnsC:\target— an absolute path, not a..-prefixed one. Thisslips through the check, the path is misclassified as
workspace-local, and downstream code rejects it with:
Fix
Introduce
isOutsideWorkspaceRelativePath()— a named, testablehelper that checks:
path.isAbsolute(rel)— catches Windows cross-volume resultsrel === ".."— parent directory escaperel.startsWith(..${path.sep})— nested escape (../fooor..\foo)Use it in
routePathConstraint()in place of the inlinecondition.
The change is a single semantic addition (
path.isAbsolute()) thatcompletes the existing "is this path outside the workspace?" test
for a case that was simply overlooked.
Testing
npm run typecheck --workspace=@ff-labs/pi-fff: passesbun test test/aux-finders.test.tswith the new Windows test: 1pass, 0 fail (20 existing tests unchanged)
process.platform === "win32"— skipped on Linux/macOS CIScope
packages/pi-fff/only. No changes to Rust crates, C header, MCPserver, Neovim plugin, or other packages.