Fix: path resolution in sh:// commands reads wrong files (P0-8) - #98
Open
yannrichet wants to merge 2 commits into
Open
yannrichet wants to merge 2 commits into
yannrichet wants to merge 2 commits into
Conversation
…r and absent from case dir Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RhG7KcNHxMhoJrsZJFtC4Y
…f the old resolver) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RhG7KcNHxMhoJrsZJFtC4Y
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
Fixes a critical bug in
sh://command path resolution that caused incorrect results when using input/output files by bare name. The resolver was converting every word that looked like a file path to an absolute path in the launch directory without checking existence or precedence, leading to:Related Issues
Fixes P0-8
Type of Change
Changes Made
resolve_all_paths_in_command()to accept an optionalworking_dirparameter (case directory)original_cwd)working_dir) — compiled inputs take precedence>,>>,2>, etc.)run_local_calculation()to pass the case directory (.) to the resolverfz.fzr()for both redirected output and launch-only scriptsTesting Performed
Automated Tests
tests/test_p0_8_sh_path_resolution.pyfz.fzr()scenariosDocumentation
NEWS.mdwith detailed explanation of the fix and migration guidanceresolve_all_paths_in_command()and_resolve_paths_in_segment()Code Quality
Breaking Changes
This is a bug fix with potential impact on existing results:
sh://cat in.txt > out.txtwill now behave correctly (read compiled file, write in case dir)sh://bash script.sh) continue to work as beforeAdditional Notes
The fix is conservative: it only resolves paths that provably exist in the launch directory and don't shadow case files. Output redirection targets are never resolved (stricter than just checking existence, since the defect was writing outside case directories). Each resolved word is logged for auditability.
https://claude.ai/code/session_01RhG7KcNHxMhoJrsZJFtC4Y