Skip to content

Pin recovery flow to a primary execution target#286

Merged
mmprotest merged 1 commit into
mmprotest/implement-shell-normalization-for-command-executionfrom
mmprotest/add-recovery-guard-for-primary-execution-target
Apr 11, 2026
Merged

Pin recovery flow to a primary execution target#286
mmprotest merged 1 commit into
mmprotest/implement-shell-normalization-for-command-executionfrom
mmprotest/add-recovery-guard-for-primary-execution-target

Conversation

@mmprotest

Copy link
Copy Markdown
Owner

Motivation

  • Prevent the runner from silently pivoting to a different execution/validation target after a hard syntax/import/runtime failure and keep recovery focused on the original failing target.
  • Introduce a minimal, generic guard scoped to recovery behavior without adding task-specific heuristics or redesigning the runner.

Description

  • Added a minimal runtime field _primary_execution_target to Runner state and initialized/reset it alongside existing recovery/active-solution fields in villani_code/state.py.
  • Introduced helpers _primary_execution_target and _seed_primary_execution_target and seeded the primary target the first time a meaningful validation/launch/active-solution target is discovered in villani_code/state_runtime.py.
  • During recovery, blocked Bash validation/launch attempts that would switch to a different target by comparing attempted target vs primary_execution_target and returning compact structured feedback from the existing small_model_tool_guard path in villani_code/state_runtime.py.
  • On hard failure, pinned/seeded the primary execution target, included it in the emitted recovery activation event payload, and ensured _recovery_mode remains focused on that primary target.
  • Made recovery clearing conservative: PASS/REPAIRED only clears recovery when the primary target itself was validated (or if no primary target exists), and updated completion gating to prefer primary_execution_target when checking validation completeness.
  • Tests: added and updated unit tests that cover primary seeding, hard-failure pinning, blocked switch attempts, allowed helper edits, allowed rerun of same primary, and conservative recovery clearing.

Testing

  • Ran: pytest -q tests/test_state_runtime.py tests/test_state_tooling_mutation_policy.py tests/test_bounded_execution.py and observed all tests passing.
  • Outcome: 64 passed for the executed test subset.

Codex Task

@mmprotest mmprotest merged commit ef04d2c 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