Repository navigation
fix(runner): preflight extra_info staging against basename and personal-info collisions - #412
Open
phatloi0010 wants to merge 1 commit into
Conversation
…al-info collisions Reject duplicate extra_info attachment basenames and collisions with reserved or existing personal-info files before staging any files or building the task instruction, and classify native extra_info validation failures as task_data. Fixes TIGER-AI-Lab#409
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.
Summary
Fixes #409.
Native
copy_extra_infoandbuild_instructionpreviously flattenedextra_info[].pathentries by basename (src.name) without preflight collision checks, allowing duplicate basenames across subdirectories (e.g.a/reference.txtandb/reference.txt) or reserved personal-info filenames (alex_green_personal_info.json,email_credentials.json,alex_green_resume.pdf) to silently overwrite earlier staged attachments or generated disposable credentials.Changes
RESERVED_PERSONAL_INFO_FILESandvalidate_extra_info_entries()insrc/clawbench/runner/run_support/task.pyto preflight allextra_infodestination names before any file is copied.extra_info basename collision: ...), reserved personal-info filenames, and collisions with existing files inpersonal_info_dirwith aValueErrorbefore performing anyshutil.copy2writes, leaving generated personal-info files and previously staged attachments untouched.extra_infoentries invalidate_task_data(),build_instruction(), andcopy_extra_info(), and classifyValueErrorduringpreparing_personal_infoinsrc/clawbench/runner/run.pyastask_data.tests/test_extra_info_staging.pycovering the Native extra_info staging silently overwrites same-name attachments and generated personal files #409 reproduction, duplicate basenames, reserved personal-info collisions, existing staged file collisions,task_dataclassification inrun.py, and ordinary distinct attachments.Testing
pytest tests/test_extra_info_staging.py tests/test_host_resources.py -v(20 passed)ruff check&ruff format --check