Skip to content

Add recovery gate: require direct validation of primary target before new executable artifacts are used#287

Merged
mmprotest merged 1 commit into
mmprotest/implement-shell-normalization-for-command-executionfrom
mmprotest/add-generic-recovery-gate-for-failures
Apr 11, 2026
Merged

Add recovery gate: require direct validation of primary target before new executable artifacts are used#287
mmprotest merged 1 commit into
mmprotest/implement-shell-normalization-for-command-executionfrom
mmprotest/add-generic-recovery-gate-for-failures

Conversation

@mmprotest

Copy link
Copy Markdown
Owner

Motivation

  • Prevent runaway "sideways" recovery where a hard failure on the primary execution target leads the runner to create new executable/verifier artifacts that also fail instead of restoring the broken target.
  • Ensure the primary_execution_target and minimal-recovery state are actually reflected in the live mission snapshot used by execution/control, fixing the observed plumbing gap.

Description

  • Mirror recovery fields into mission snapshots by adding recovery_mode, primary_execution_target, and primary_target_minimally_valid to MissionState and wiring them into Runner._update_mission_state and state_runtime sync APIs.
  • Seed and sync the live primary target during verification via _seed_primary_execution_target and a new _sync_recovery_state_to_mission helper in villani_code/state_runtime.py.
  • On hard failure capture a snapshot of repository file paths and reset created-artifact tracking, and set _primary_target_minimally_valid = False so recovery is explicit.
  • Track newly created files during recovery in the tooling lifecycle by recording write-created files in villani_code/state_tooling.py.
  • Add a narrow recovery gate in small_model_tool_guard so, while runner._recovery_mode is active, any proposed validation/launch target that is confidently new (created during recovery or absent at failure snapshot) is blocked with structured feedback instead of permitting a switch to a newly introduced executable.
  • Clear recovery only after a direct minimal validation of the same primary_execution_target succeeds and mark _primary_target_minimally_valid = True when that validation passes.
  • Files changed: villani_code/mission_state.py, villani_code/state.py, villani_code/state_runtime.py, villani_code/state_tooling.py, and tests tests/test_state_runtime.py, tests/test_state_tooling_mutation_policy.py, tests/test_mission_state_runtime.py.

Testing

  • Ran pytest -q tests/test_state_runtime.py tests/test_state_tooling_mutation_policy.py tests/test_mission_state_runtime.py; the run completed successfully with all tests passing (74 passed).
  • Added/updated unit tests that assert: first meaningful validation seeds primary_execution_target, hard failure sets recovery_mode and clears minimal-valid flag, recovery blocks creation/use of new validation artifacts, helper edits and bounded patches remain allowed, and mission snapshot reflects the live recovery/primary-target state.

Codex Task

@mmprotest mmprotest merged commit a3bc6eb into mmprotest/implement-shell-normalization-for-command-execution Apr 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant