Repository navigation
fix(sandbox): keep document and seed values out of host shell code #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f1f6ebf
fix(sandbox): quote signed URLs, agent env names and CLI paths in hos…
earakely-scale df94e06
fix(task): render seeds in one pass and keep shell syntax out of shel…
earakely-scale 262cf88
docs(task): name shell_fields among the step extension rules; trim th…
earakely-scale 82880f0
fix(task): name nested shell fields by path; quote the docker step's …
earakely-scale e8e16e3
refactor(task): drop the shell-field seed check; keep one-pass substi…
earakely-scale feca0a1
docs(verifier): say a stored command gets seeds as written, and data …
earakely-scale b6fc171
test(store): run the DynamoDB step-journal suite one AWS call at a time
earakely-scale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| """A run's seed fills each step's ``<key>`` placeholders in one left-to-right pass, so text a value brings in is | ||
| never read again as another placeholder.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from agent_env.task.task import substitute_seed_in_steps | ||
| from agent_env.task_step.task_steps.verifiers.run_container_unit_tests_verifier import ( | ||
| RunContainerUnitTestsVerifierTaskStep, | ||
| ) | ||
|
|
||
|
|
||
| def _verifier(**fields): | ||
| return RunContainerUnitTestsVerifierTaskStep(id="check", version=None, sandbox_name="h", container_name="c", | ||
| **{"command": "true", **fields}) | ||
|
|
||
|
|
||
| def test_each_placeholder_takes_its_value(): | ||
| step = _verifier(command='qc --task-id <task_id> --universe-id "<universe_id>" --turns <turns>') | ||
|
|
||
| seeded, = substitute_seed_in_steps([step], {"task_id": "task-12", "universe_id": "hg4/v3.1", "turns": 8}) | ||
|
|
||
| assert seeded.command == 'qc --task-id task-12 --universe-id "hg4/v3.1" --turns 8' | ||
|
|
||
|
|
||
| def test_substituted_text_is_never_rescanned(): | ||
| step = _verifier(env_vars={"A": "<a>", "B": "<b>"}) | ||
|
|
||
| seeded, = substitute_seed_in_steps([step], {"a": "<b>", "b": "$(id)"}) | ||
|
|
||
| assert seeded.env_vars == {"A": "<b>", "B": "$(id)"} |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.