Gate completion on active-solution validation and restrict full rewrites during recovery#285
Merged
mmprotest merged 1 commit intoApr 11, 2026
Conversation
65a2038
into
mmprotest/implement-shell-normalization-for-command-execution
2 checks passed
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
_active_solution_last_validation_ok,_active_solution_last_validation_summary) and initialize/reset them with run state (inRunner.__init__and run reset). (file:villani_code/state.py)_budget_reason) and funneling final textual/no-tool completion branches through_finish_boundedso the termination reason reflects blocked completion when validation is missing/failed. (file:villani_code/state.py, function:Runner.runinternals /_budget_reason/ completion paths)_active_solution_last_validation_ok = Falsewhenever the command shows a hard failure signal (non-zero exit or crash tokens likeSyntaxError,NameError,ImportError,ModuleNotFoundError, traceback/unhandled exception); set it back to True on clean validation. Added helper utilities_command_targets_active_solutionand_has_hard_failure_signal. (file:villani_code/state_runtime.py, function:run_verification+ helpers)_recovery_modeis active and the active solution file has a recent hard failure (_active_solution_last_validation_ok is False), block broad full-fileWritereplacements of the active file and return compact structured JSON feedback; allow boundedPatchedits and edits to helper files. (file:villani_code/state_runtime.py, function:small_model_tool_guard)tests/test_state_runtime.py,tests/test_bounded_execution.py,tests/test_state_tooling_mutation_policy.py)Testing
pytest -q tests/test_state_runtime.py tests/test_state_tooling_mutation_policy.py tests/test_bounded_execution.pyand all tests passed (61 passed).Codex Task