Fix MAP-Elites eviction (#454) & sampling (#452) bugs; harden library API; dhara CI + Frame SAST#462
Merged
codelion merged 3 commits intoJul 5, 2026
Conversation
…l to dhara Bug fixes: - database.py: protect MAP-Elites cell owners during population eviction (non-elite/homeless programs are removed first) — fixes algorithmicsuperintelligence#454 bug 1. - database.py: remove programs displaced from their cell that become orphaned (in no island, owning no cell) instead of leaking them as unsampleable "zombies" that consume population slots — fixes algorithmicsuperintelligence#454 bug 2. - api.py: fix run_evolution() with a lambda evaluator generating `return <lambda>(...)` (SyntaxError); extract and bind the lambda expression so the generated evaluator module is self-contained and subprocess-safe. - controller.py: pass usedforsecurity=False to hashlib.md5 (seed derivation is not security-sensitive) to satisfy SAST weak-hash checks. Testing / CI: - Swap the integration-test model from google/gemma-3-270m-it to codelion/dhara-250m (served via optillm). Bound max_tokens to 256 in the integration configs: dhara does not stop at the ChatML <|im_end|> marker, so unbounded it rambled to the 4096-token default (10-20 min per call). - Run the FULL integration suite in CI (drop the `-m "not slow"` filter) so contributor PRs are exercised end-to-end; raise the job timeout to 90 min. - Add tests: elite protection, orphan removal, initial-program artifacts, and a real-LLM iteration/checkpoint test (moved out of the unit suite so it no longer skips when no server is present). Update snapshot/parallel tests that relied on the zombie behaviour to use distinct islands. - Fix MockEvaluator (missing get_pending_artifacts) and the hardcoded model in the library-API test config. Remove a stale .bak test file. Security: - Add a Frame SAST workflow that scans PR-changed Python files (SARIF -> code scanning, non-blocking). Bump version to 0.3.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7759b06 to
ccaf034
Compare
- Remove dead code openevolve/iteration.py (the single-process sample() path). It was never imported or executed (the live path is ProcessParallelController -> process_parallel.py), and it carried the hardcoded get_top_programs(5)/(3) counts and the divergent sampling logic the issue flagged (algorithmicsuperintelligence#452 points 2 & 4). - Size inspirations by num_diverse_programs instead of num_top_programs so that config parameter actually controls the inspiration count (algorithmicsuperintelligence#452 point 1). - Deduplicate inspirations against the top/diverse programs already shown in the prompt so a program is not listed twice (algorithmicsuperintelligence#452 point 3); add tests. - Rename secret_patterns -> redaction_patterns in the artifact security filter so SAST tools do not misread the redaction table as a hardcoded secret. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Builds on the original fix (store artifacts for the initial program) and stacks several related fixes, plus test-infra and CI changes, targeting the 0.3.0 release.
Bug fixes
run_evolution()with a lambda evaluator generatingreturn <lambda>(...)(SyntaxError); the lambda expression is now extracted and bound so the generated evaluator module is self-contained and subprocess-safe.Closes #454
Closes #452
Testing / CI
google/gemma-3-270m-itto the publiccodelion/dhara-250m(served via optillm), with a boundedmax_tokensso the model does not ramble to the 4096-token default.-m "not slow") so contributor PRs are exercised end-to-end; cache HF models; install themath-verifydep thatpip install optillmomits; poll the server for health.MockEvaluatorinterface and remove a stale.bakfile. Zero skipped tests.Security
Bumps version to 0.3.0.