Repository navigation
fix(alfworld): confine rollout task output directory to predictions path - #348
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks for extending the #264/#309 confinement to ALFWorld — the goal is right, but this cannot merge as is because it breaks real ALFWorld runs. The ids shipped in Suggested change, matching LiveMathematicianBench: rebase onto current Reviewed head: |
Summary
Extend the task output confinement established in #264 and #309 to the ALFWorld benchmark rollout (
skillopt/envs/alfworld/rollout.py).Previously,
run_alfworld_batch()joined unvalidatedtask_idvalues underpredictions/(conv_dir = os.path.join(pred_dir, task_id)), leaving ALFWorld as the only benchmark rollout in the repository that did not confine its persistent task outputs usingconfined_task_output_dir(). An unconfined or path-traversing task identifier (e.g.../../escape) would write outsidepredictions/and run without early validation.Key Changes
Rollout confinement (
skillopt/envs/alfworld/rollout.py):result_idsagainstconfined_task_output_dir(out_root, str(rid))upfront whenout_rootis provided, failing fast before environment reset, thread allocation, or target model calls.confined_task_output_dir(out_root, task_id)when constructingconv_dirto ensure the conversation log is strictly confined withinout_root/predictions/.encoding="utf-8"when writingconversation.json.Unit Tests (
tests/test_alfworld_task_output_confinement.py):../../escape) are rejected before environment reset or target model execution.env_000) identifiers.out_rootis unset.Verification
pytest tests/test_alfworld_task_output_confinement.py tests/test_alfworld_paths.py tests/test_spreadsheetbench_task_id_confinement.py -v: all 31 tests passed.ruff check skillopt/envs/alfworld/rollout.py tests/test_alfworld_task_output_confinement.py: all checks passed.mkdocs build --strict: passed with 0 warnings/errors.