Repository navigation
fix(webarena): keep the mounted map_setup.py standard-library only - #173
Merged
Merged
Conversation
The Map acceptance check runs from this repository, yet its top-level harness import sat in the file mounted alone into the upstream Map image. Move verify_map_endpoint and map_check_main to map_check.py and run the mounted script under -I -S in a test.
lanyue-llk
commented
Nov 3, 2026
lanyue-llk
left a comment
Contributor
Author
There was a problem hiding this comment.
Independent review, round 1
Head reviewed: 3486c18b8f810d299bc58bce9bf92cd3463bff84. No defects found.
What I verified
The fix
- The base version of the mounted file fails under
python -I -S map_setup.py --helpwithModuleNotFoundError: No module named 'harness'. The head version prints its usage. - An AST walk of the head
map_setup.py, including imports inside functions, finds only standard-library modules. This also covers the--servepath, which the new test does not run.
The move
verify_map_endpointandmap_check_mainare identical at byte level between the basemap_setup.pyand the newmap_check.py. The only diff is the two trailing blank lines before the next function.map_setup.pystill usesHTTPError,urlopenandargparse, and the removedurlencodehas no remaining uses.- No caller of the old path remains.
scripts/verify_webarena_map.pyis the only entry point, and it keeps its name and arguments. No compatibility re-export was left inmap_setup.py. - The stated reason for a new module holds:
cli.pyimportswebarena_verified, andmap_archives.pyimportsharness.distributionand covers a different stage.
The new test
- It fails without the fix: with the old import line put back into
map_setup.py, it fails on its return-code assertion. - It copies the file alone into a temporary directory, runs it with
-I -S, and completes a full offline setup from local archives.
Scope
Closes #167is accurate. The PR does the suggested move and adds the-I -Stest.- The PR states that the script was not run inside the pinned Map image. I did not run it there either.
Repository rules
- The diff touches no evidence, frozen profiles, golden snapshots or workflows.
- It adds no private data, and the PR text has no attribution lines.
Local test and lint runs
pytest tests/environments tests/test_golden_reports.py -n 2: 132 passed, with golden snapshots unchanged.- Lint gate (
F,TID252, then the default config): passed.
CI at this head
- Passed: Tests and static checks, Installation and packaging, Rendered reference and report checks, Python 3.11, Select check scope, OCR dispatch and ocr-review.
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.
Issues
Closes #167
Summary
deploy/webarena/README.mdmountsmap_setup.pyalone at/opt/map_setup.pyin the upstream Map image, but the file importedharness.web_fetch.safetyat the top level for an acceptance check that never runs there. Underpython -I -Sthe previous file stops withModuleNotFoundError: No module named 'harness'. As the issue notes, this was reproduced with-I -Sand not against the pinned image.verify_map_endpointandmap_check_mainunchanged intosrc/harness/environments/webarena/map_check.py, which only runs from this repository. A new module was needed becausecli.pyimportswebarena_verifiedandmap_archives.pycovers a different stage.scripts/verify_webarena_map.pykeeps its name, arguments and behaviour, and now imports frommap_check.map_setup.pynow imports only the standard library, as its docstring already said. Its setup and serve code is unchanged.Rendered reports, frozen profiles and evidence are not affected.
Test plan
test_mounted_script_initializes_a_volume_with_only_the_standard_library: copies the script alone into a temporary directory and runs it with-I -S, completing an offline setup from local archives. This covers the whole setup path, not only--help.python -I -S ... --helpfails withModuleNotFoundError: No module named 'harness'. The new file prints its usage.scripts/verify_webarena_map.py --helpprints its usage.pytest tests/environments tests/test_golden_reports.py -n 2: 132 passed. The golden snapshots are unchanged.ruff checkwithF,TID252, then the default config): passed.