Repository navigation
Conversation
VfsKernel made each path absolute with a private helper, and Box's kernel keeps its own copy of the same code. Move it to a public vfs::absolute so every kernel reads a path the same way. No behavior change.
This branch has not been deployed
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.
Description
VfsKernelturns each path into an absolute one with a private helper,abs(). Box's kernel keeps a line-for-line copy of that helper incrates/shell/src/resolve.rs. Two copies can drift, and a change to how a path is read has to land twice.This PR moves the helper to a public
vfs::absolute(cwd, path), next tovfs::normalize, which Box already uses.VfsKernelcalls it at the 18 places that calledabs(). Box can then drop its copy and call the same function.There's no behavior change. The body is the same code, and one unit test pins what it returns for a relative path and an absolute path.
Related Issues
Box will switch its kernel to this helper in a follow-up PR once this merges.
Documentation PR
None.
Type of Change
Other (please describe): refactor, adding one public function
Testing
cargo test --lib: 86 passedcargo test --test vfs_unit: 98 passed, including the new testcargo test --test custom_kernel: 14 passedcargo test --test shell_integration: 1978 passedcargo test --test differential: 93 passed.command_v_slash_namefails the same way on main, because feat(which): add which, resolved like command -v #272 fixed it and itsknown-differencemarker is now stale. test: remove resolved command lookup difference marker #315 removes the marker.Box's kernel crate (
cargo test -p strands-box-shell), built against this branch with Box switched to the helper: 145 passedI ran the relevant test suites for the bindings I touched (
cargo test --workspace --all-targets,pytest tests/python,npm test)If I touched Rust, I ran
cargo fmtandcargo clippyChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.