feat: CrossoverMutator — multi-parent synthesis via LLM (#154)#419
Open
feat: CrossoverMutator — multi-parent synthesis via LLM (#154)#419
Conversation
Adds CrossoverMutator and supporting types to evolver.zig: - Organism struct: code-patch candidate with id, parent lineage (single parent_id + multi-parent parent_ids), generation, diff, fitness - FailureCase struct: test_name + snippet - buildCrossoverPrompt(): constructs bounded prompt showing top-K parents with their fitness, explanations, diffs, and optional history - parseMutationResponse(): extracts EXPLANATION + DIFF from LLM output, strips code fences, returns null on malformed - CrossoverMutator.crossover(): caps at k parents, tracks multi-parent lineage; placeholder for LLM call pending API integration 6 new tests covering prompt construction (all parents present, history inclusion), response parsing (valid + garbage), crossover child creation (parent IDs, generation), and k-capping behavior. All 24 evolver tests pass. Made-with: Cursor
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.
Summary
Organismstruct withparent_ids: ?[]const u64for multi-parent lineage trackingFailureCasestruct: test_name + snippetbuildCrossoverPrompt(): Constructs bounded prompt showing top-K parents with fitness scores, explanations (400 chars), diffs (2000 chars), and optional learning historyparseMutationResponse(): Extracts EXPLANATION + DIFF sections, strips ```diff fencesCrossoverMutator.crossover(): Caps at k parents, builds multi-parent child with lineage tracking; placeholder for LLM callTest plan
zig test src/evolver.zig— 24/24 tests passCloses #154
Made with Cursor