Skip to content

refactor: introduce opaque NativePath type for PathAccess#177

Merged
branchseer merged 1 commit intomainfrom
patr0nus/native-path
Mar 1, 2026
Merged

refactor: introduce opaque NativePath type for PathAccess#177
branchseer merged 1 commit intomainfrom
patr0nus/native-path

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Feb 28, 2026

Summary

  • Introduce opaque NativePath type wrapping NativeStr in new native_path.rs
  • On Windows, tracked paths are NT Object Manager paths (\?? prefix) whose raw data is not meaningful for direct consumption. NativePath only exposes strip_path_prefix, which normalizes platform differences and extracts a workspace-relative path
  • Change PathAccess.path from &NativeStr to &NativePath and make native_str module pub(crate)
  • Update sender-side callbacks to use (AccessMode, &Path) directly instead of PathAccess
  • Refactor consumers (e2e tests, CLI example, oxlint test) to use strip_path_prefix API

Test plan

  • cargo check --all-targets passes
  • just lint passes
  • just fmt passes
  • cargo test passes
  • CI (cross-platform lint + tests)

🤖 Generated with Claude Code

On Windows, tracked paths are NT Object Manager paths (`\??` prefix),
whose raw data is not meaningful for direct consumption. Introduce
NativePath as an opaque wrapper over NativeStr that only exposes
`strip_path_prefix`, which normalizes platform differences and extracts
a workspace-relative path.

- Add NativePath in new native_path.rs with strip_path_prefix and clone_in
- Change PathAccess.path from &NativeStr to &NativePath
- Make native_str module pub(crate) to prevent external raw access
- Update sender-side callbacks to use (AccessMode, &Path) directly
- Refactor consumers to use strip_path_prefix API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@branchseer branchseer merged commit 1128edc into main Mar 1, 2026
7 checks passed
@branchseer branchseer deleted the patr0nus/native-path branch March 1, 2026 03:12
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.

2 participants