Skip to content

Align live validation refresh, recovery context, and primary target contract seeding#291

Merged
mmprotest merged 1 commit into
mmprotest/implement-shell-normalization-for-command-executionfrom
mmprotest/implement-enhancements-for-runner-capability
Apr 11, 2026
Merged

Align live validation refresh, recovery context, and primary target contract seeding#291
mmprotest merged 1 commit into
mmprotest/implement-shell-normalization-for-command-executionfrom
mmprotest/implement-enhancements-for-runner-capability

Conversation

@mmprotest

Copy link
Copy Markdown
Owner

Motivation

  • Prevent validation state from remaining stuck at startup fallbacks after the repo or live runs produce stronger evidence.
  • Make the model explicitly aware when the runner is in recovery on a pinned primary execution contract so it repairs rather than drifts.
  • Ensure primary execution target tracking is a minimal (target, cwd) contract that is seeded by evidence and replaceable only by strictly stronger evidence.

Description

  • Add augment_validation_config_with_live_commands(...) in villani_code/project_memory.py to persist compact live-observed validation/run commands into .villani/validation.json.
  • Extend villani_code/state_runtime.py with _suggest_live_validation_commands(...), accept observed_commands in refresh_live_validation_candidates(...), and call the refresh/augment path from both run_verification(...) (successful verification artifacts) and the Bash direct-run branch so observed direct runs seed live validation augmentation.
  • Tighten villani_code/state_tooling.py so write/patch handling only seeds _current_verification_targets with validation-capable candidate file types and call refresh_live_validation_candidates(...) with those candidates instead of every touched file.
  • Keep and use the (target, cwd) primary execution contract and evidence ordering (write_only < indirect_validation < direct_validation < direct_run) in _seed_primary_execution_target(...) while allowing strictly stronger evidence to replace earlier seeds.
  • Inject a compact recovery block into the model context packet in villani_code/context_projection.py only when recovery is active, including primary_execution_target, primary_execution_cwd, primary_execution_evidence, recovery_mode, failing_target_summary, primary_target_minimally_valid, and switch_blocked, and render it as a compact single-line contract for model prompts.
  • Add and update focused tests to exercise: live validation augmentation from observed commands, recovery block suppression/injection and inclusion of both target and cwd, and an integration flow for scaffold write → direct run → stronger evidence replacement → recovery context → validation augmentation.

Testing

  • Ran targeted tests: pytest -q tests/test_state_runtime.py::test_model_context_packet_omits_recovery_block_when_not_recovering tests/test_state_runtime.py::test_model_context_packet_includes_compact_live_recovery_contract tests/test_state_runtime.py::test_live_validation_candidates_refresh_after_material_changes tests/test_state_runtime.py::test_single_file_write_seed_is_replaceable_by_stronger_direct_signal tests/test_state_runtime.py::test_primary_target_contract_distinguishes_same_file_different_cwd tests/test_state_runtime.py::test_hard_failure_activation_requires_same_primary_contract tests/test_state_tooling_mutation_policy.py::test_integration_scaffold_then_direct_run_reseeds_primary_and_live_validation and all passed (7 passed).
  • Ran broader suites including tests/test_state_runtime.py, tests/test_state_tooling_mutation_policy.py, and tests/test_mission_state_runtime.py and observed 83 passed for the invoked scope; all automated tests in the exercised suites passed.
  • The changes are covered by unit and an integration-style regression test added/updated in tests/test_state_runtime.py and tests/test_state_tooling_mutation_policy.py, and no unrelated pre-existing failures were introduced.

Codex Task

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