Finalization-only cleanup gate for provisional shell scratch artifacts#315
Open
mmprotest wants to merge 1 commit into
Open
Finalization-only cleanup gate for provisional shell scratch artifacts#315mmprotest wants to merge 1 commit into
mmprotest wants to merge 1 commit into
Conversation
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.
Motivation
Description
Bashtool execution and addingafter - beforetorunner._provisional_scratch_candidates, while recording explicitWrite/Patchtargets inrunner._non_scratch_created_filesso they are excluded from cleanup (changes invillani_code/state_tooling.py)._provisional_scratch_candidates,_non_scratch_created_files,_cleanup_telemetry) and a single finalization call site in the successful path inside_finish_boundedthat invokes_cleanup_provisional_scratch_after_successafter post-execution validation (changes invillani_code/state.py)._cleanup_provisional_scratch_after_success(...)which conservatively filters eligible candidates (existence, regular file, inside repo, not Write/Patch-created, not under detected source/test/package roots, and requires repo root confidence), backs up bytes/mode, removes candidates, reruns verification using the existingself._run_verificationpath, and restores files on failure or error; it records telemetry fields into the runner debug summary payload (changes invillani_code/state.py).tests/test_finalization_cleanup.pyto verify removal-on-pass, restore-on-fail, and protection of files undersrc/andtests/.Testing
pytest -q tests/test_finalization_cleanup.pyand all tests passed.pytest -q tests/test_loop.py::test_run_injects_diagnosis_hint_into_existing_prompt_contextandpytest -q tests/test_trace_runtime_path.py::test_real_bash_execution_emits_canonical_tool_lifecycleand both passed.Codex Task