feat(dispatch): Compact Instructions block for lineage forks (closes #27) - #93
Open
Srinivasan8888 wants to merge 1 commit into
Open
Srinivasan8888 wants to merge 1 commit into
Srinivasan8888 wants to merge 1 commit into
Conversation
…ge forks A lineage fork inherits the parent experiment's session, so the worker protocol reaches the child only through the cached transcript. On long ancestor chains Claude Code auto-compacts the older portion and can summarize the protocol away; the existing lineage prompt only *hints* that the child should re-read it. Add a '# Compact Instructions' block to the lineage execute prompt that marks the load-bearing context (exp_id/hypothesis/parent_commit, the worker protocol, that 'evo run' is terminal, gate semantics) as preserve-on-summary, so compaction keeps it. Injected only into lineage forks -- fresh explorers get the protocol in-turn and are unaffected. Closes evo-hq#27.
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.
Problem
A lineage fork (
evo dispatchforking from a committed parent experiment's own session) inherits the parent's transcript. The worker protocol therefore reaches the child only through that cached context. On long ancestor chains, Claude Code auto-compacts the older portion of the transcript and can summarize the protocol away.The existing
LINEAGE_EXECUTE_USER_PROMPT_TEMPLATEonly hints at this — "re-read the protocol from<path>if you can no longer see it." As #27 notes, that's a hint, not a guarantee.Fix
Add a
# Compact Instructionsblock to the lineage execute prompt that marks the load-bearing context as preserve-on-summary, exactly as proposed in #27:The block is injected only into lineage forks (
render_execute_prompt(..., lineage=True)). Fresh explorer children receive the protocol in the current turn and don't inherit a long transcript, so they intentionally do not carry the block.Tests
Added
tests/unit/test_compact_instructions.py(TDD — written failing first):Compact Instructionsheader +Preserve when summarizingevo runis terminal, gate)tests/unit(excluding the three Rust-evo-hook-drain-binary tests, which are environmental on a machine without a Rust toolchain): 801 passed, 4 skipped. All existingtest_dispatch.pytests pass unchanged.