Use ExecutionMemento as regular-runner carry-forward state#304
Open
mmprotest wants to merge 1 commit into
Open
Use ExecutionMemento as regular-runner carry-forward state#304mmprotest 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
villani_code/execution_memento.pyimplementingExecutionMementodataclass and helpers:build_execution_memento,save_execution_memento,load_execution_memento,render_execution_memento_for_model, andbuild_local_evidence_blockand persisted artifacts to.villani_code/missions/<mission_id>/execution_memento.json(/optional.md).MissionStatewithlast_memento_path: strandlast_memento_turn_index: intand updated serialization/roundtrip invillani_code/mission_state.py._refresh_execution_memento()and invoking it fromRunner._update_mission_statewhen key fields change and from validation/result code paths instate_runtime.py._inject_projected_contextnow prefers the renderedEXECUTION STATE+ tinyLOCAL EVIDENCEblock and falls back to the legacyMission context packet:when required memento fields are missing;prepare_messages_for_modeltrims long history aggressively for regular (non-small, non-autonomous) runners and preserves tool_use/tool_result adjacency when keeping a short tail.Testing
pytest -q tests/test_mission_state_runtime.py tests/test_state_runtime.py tests/test_session_compaction.pyand all tests passed (57 passed).tests/test_mission_state_runtime.py,tests/test_state_runtime.py,tests/test_session_compaction.py).Codex Task