[BUGFIX] reusable container path quoting and visualization - #38
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses path-safety issues when building shell commands and when generating per-case scratch/visualization files, particularly in reusable-container execution paths.
Changes:
- Quote container file paths in run/judge/visualization command builders using
shlex.quoteto handle spaces and shell-sensitive characters. - Introduce
build_case_file_prefix()to sanitizeproblem_idfor per-case scratch filenames and use it throughoutcase_iter_func. - Adjust reusable-container visualization execution to run in
/tmpand copy the generated visualization artifact from/tmp/{vis.html|out.svg}.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/ale_bench/tool_wrappers/case_runner.py |
Adds robust shell-quoting, sanitizes per-case filename prefixes, and updates reusable visualization execution to use /tmp. |
tests/tool_wrappers/test_case_runner.py |
Expands tests to cover quoting behavior and adds unit tests for build_case_file_prefix(). |
tests/judge/test_reuse_containers.py |
Adds an integration test ensuring reusable containers handle unsafe problem_id characters successfully. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.