Add lightweight runner guards for repeated failure thrashing#279
Open
mmprotest wants to merge 1 commit into
Open
Add lightweight runner guards for repeated failure thrashing#279mmprotest 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
Runner:_recent_failed_actions,_recent_failed_shell_forms,_surface_grounding_block,_shell_retry_block_form, and relatedpendingmessage fields to hold short-window failure history. (files:villani_code/state.py)_normalize_failure_reason,_failure_kind,_shell_failure_from_result,_normalize_shell_command,_is_brittle_shell_command,_is_grounding_action,_record_failure_and_update_guards, and_check_transient_action_guards, enforcing the exact trigger rules in the last-3/last-5 windows. (file:villani_code/state.py)villani_code/state.py)execute_tool_with_policyto detect and block transient guarded actions (including brittle near-duplicate shell retries), emit atransient_action_guard_blockedevent, and return an explicit short block message as a normal tool error. (file:villani_code/state_tooling.py)tests/test_loop.py. (file:tests/test_loop.py)Testing
tests/test_loop.pycovering: repeated tool failures triggering a regrounding intervention and temporary mutation block, grounding clearing the block, near-duplicate brittle shell retry blocking and clearing, and that isolated single failures do not trigger guards.pytest -q tests/test_loop.py -k 'failure_loop_guard_blocks_mutation_until_grounding or brittle_near_duplicate_shell_retry_guard_and_clear or single_failures_do_not_trigger_thrash_guards', which passed with3 passed, 25 deselected.Codex Task