Uh oh!
There was an error while loading. Please reload this page.
feat: Implement Evolution Engine V1 — autonomous code self-repair pipeline - #3
Open
AndrosEt wants to merge 3 commits into
Open
feat: Implement Evolution Engine V1 — autonomous code self-repair pipeline#3AndrosEt wants to merge 3 commits into
AndrosEt wants to merge 3 commits into
Conversation
added 3 commits
April 23, 2026 17:36
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 freeto 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
This PR delivers the complete Evolution Engine V1 implementation: a self-purifying autonomous pipeline that reads an
evolution.ymlconfig, observes live evidence, lets an Actor LLM propose a minimal unified diff, has an independent Judge LLM audit it, and automatically opens a GitHub PR — all via the GitHub REST API, with no localgitorghCLI required.What's Included
Core Pipeline (
src/)observer.pyactor.pyjudge.pyPASS/FAIL,overall_score,confidence,top_risks)router.pyPASS: creates branch, commits patch, opens PR via GitHub REST API; onFAIL: logs and exits cleanlyhard_stops.pyllm.pygithub_client.py_normalize_diff()to rewrite incorrect LLM-generated hunk headersconfig_loader.pyhistory.pyevolution_history.jsonl)cli.pyevolve run / validate / resetcommandsKey Design Decisions
Actor / Judge isolation is a hard requirement. The two LLMs run in completely separate sessions. The Judge receives only: mission, principles, evidence, and the final patch text — never the Actor's reasoning chain. Enforced at runtime.
Patch header normalization. LLMs occasionally emit incorrect or placeholder
@@hunk headers (wrong line counts, literal placeholders)._normalize_diff()recounts source/target lines from the actual diff body and rewrites every header before parsing, making the pipeline robust to LLM output variance.Hard Stops (circuit breaker). State is persisted to
.evolution_state.json. A triggered hard stop blocks all subsequent runs until explicitly reset withevolve reset, preventing runaway API spend or spam PRs.Tests (
tests/)test_v1.py— 45 unit/integration tests covering the full acceptance checklist:evolve resetFAILverdict → no PR createdparse_errortest_prd_11.py— End-to-end real-world scenario: Actor must autonomously infer a rate-limit fix from raw events alone, without any pre-feddiagnosticshints; Judge must pass based on event evidence only.Examples & Docs
examples/evolution.yml— reference config for a rate-limit auto-remediation missionexamples/dashboard/metrics.json— sample evidence file (raw events, no diagnostics scaffolding in the stripped variant)examples/prompts/— Actor and Judge system prompt templatesREADME.md/README.zh.md— full documentation in English and ChineseCONTRACT_metrics_schema.md— schema contract for the metrics evidence formatHow to Test
Checklist
evolve resetcorrectly clears halt state_normalize_diff()covers both placeholder and wrong-count hunk headers