Align live target/recovery control path with evidence-based execution contracts#290
Merged
mmprotest merged 1 commit intoApr 11, 2026
Conversation
d3272e1
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
cmdmissed many embedded Unix compound fragments and detached-launch assumptions that leak unsafe behavior into execution.Description
_TARGET_EVIDENCE_ORDERand updated_seed_primary_execution_targetso a new seed replaces the current only when it has strictly stronger evidence (e.g.,write_only<indirect_validation<direct_validation<direct_run).(target, cwd)with helpers_target_contract,_primary_execution_contract,_same_target_contract, and preserved the contract through mission sync and state fields (including_primary_execution_target_cwdand_primary_execution_target_evidence).activate_live_recovery_on_primary_failureonly arms recovery when a hard failure occurs on the current primary contract and updates the same live state the control path reads (sets_recovery_mode,_failing_file,_failing_target_contract_summary,_primary_target_minimally_validetc.).small_model_tool_guardto block sideways target-switch and new-wrapper thrash during recovery when the primary target is not yet minimally valid, while still allowing reads, helper edits, and reruns of the same contract.refresh_live_validation_candidatesand called it from tooling flows so the validation set is not stuck on startup-only defaults.cmdshell checks inclassify_and_rewrite_commandand_detect_invalid_cmd_detached_launchto block embeddedtail/wcfragments and more&-based detached-launch assumptions using conservative pattern checks (no full shell parser).build_model_context_packetso the model can see the pinned primary contract,recovery_mode, a short failing summary, minimal-valid flag, and whether switching is blocked.Testing
cmdpatterns, validation-candidate refresh, and an e2e-style regression for scaffold→real-target failure drift.pytest -q tests/test_state_runtime.py tests/test_state_tooling_mutation_policy.py tests/test_shell_command_guard.pyand observed all tests passing:83 passed.Codex Task