Skip to content

fix(fs): absolute paths pass through Fs.path unprefixed on an unrestricted medium - #21

Merged
Snider merged 1 commit into
mainfrom
fix/fs-path-windows-abs
Aug 8, 2026
Merged

fix(fs): absolute paths pass through Fs.path unprefixed on an unrestricted medium#21
Snider merged 1 commit into
mainfrom
fix/fs-path-windows-abs

Conversation

@Snider

@Snider Snider commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The one-liner behind go-inference's windows CI red (Discover yielding nothing, model/pack's \C:\Users\… mangle — run 31101973970, and likely a chunk of that lane's other 46 failing packages). Fs.path prefixed "/" unconditionally before cleaning; harmless for POSIX absolute paths, fatal for drive-letter ones. The unrestricted ("/"-rooted) branch now cleans the path as given; the sandboxed branch keeps the prefix — there it is the sandbox contract.

Receipts: full suite green (GOWORK=off go test ./... -count=1 → ok), regression pinned in TestFs_Fs_path_UglyPathIsAbs knows the C:\ form on every platform, so the pin holds on POSIX runners, not just windows.

core/go is review-only by house rule — over to you.

🤖 Generated with Claude Code
Co-Authored-By: Virgil virgil@lethean.io

Summary by CodeRabbit

  • Bug Fixes
    • Improved path handling for unrestricted filesystems.
    • Preserved Windows drive-letter paths while continuing to sanitise and normalise absolute POSIX paths.
    • Maintained correct resolution of relative paths against the current working directory.

…icted medium

Fs.path bolted "/" onto every path before cleaning. On an
unrestricted ("/"-rooted) medium that prefix was a no-op for POSIX
absolute paths ("//x" cleans to "/x") and corrupted Windows
drive-letter ones: filepath.Clean(`/C:\models\x`) is `\C:\models\x`,
a path no Win32 open resolves. Every List/Read walk over an absolute
path on Windows failed on it — go-inference's Discover yielded
nothing and model/pack printed the mangled path verbatim in CI
(dAppCore/go-inference run 31101973970):

  CreateFile \C:\Users\RUNNER~1\...\pack-roundtrip-good-3323670468\src:
  The filename, directory name, or volume label syntax is incorrect.

The unrestricted branch now cleans the path as it stands. The
sandboxed branch keeps its prefix — there it IS the contract
(absolute paths map under root). Relative-path handling is untouched.

PathIsAbs recognises the drive-letter form on every platform, so the
regression test pins the contract on POSIX runners too.

Co-Authored-By: Virgil <virgil@lethean.io>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d83b5fbd-9a36-48aa-a3dd-90cc4c933cd1

📥 Commits

Reviewing files that changed from the base of the PR and between 702e8c4 and 150722a.

📒 Files selected for processing (2)
  • fs.go
  • fs_internal_test.go

📝 Walkthrough

Walkthrough

The filesystem path handling now preserves absolute Windows drive-letter paths and normalises absolute POSIX paths for an unrestricted root. Tests cover both behaviours.

Changes

Filesystem path handling

Layer / File(s) Summary
Path resolution and validation
fs.go, fs_internal_test.go
Unrestricted path handling cleans absolute paths directly and resolves relative paths against the current working directory. Tests verify unchanged Windows drive-letter paths and normalised absolute POSIX paths.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the Fs.path fix for absolute paths on unrestricted media.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant