You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guide for AI agents working on the CodeEvolve codebase.
4
+
5
+
## Project Overview
6
+
7
+
CodeEvolve is an LLM-driven evolutionary algorithm framework that discovers and optimizes code solutions. Programs evolve across distributed islands via LLM-generated SEARCH/REPLACE diffs, evaluated in sandboxed environments.
8
+
9
+
## Repository Layout
10
+
11
+
```
12
+
src/codeevolve/
13
+
cli.py # CLI entry point, arg parsing, island spawning
14
+
runner.py # Process management, signal handling, log daemon
15
+
evolution.py # Main evolutionary loop and component setup
16
+
database.py # Program dataclass, ProgramDatabase, MAP-Elites
17
+
evaluator.py # Sandboxed execution with time/memory limits
Task templates live in `template.py` as composable sections (`_CORE_RULES`, `_MODIFICATION_FORMAT`, etc.) assembled by `get_*_task_template()` factory functions.
64
+
65
+
### Evaluator (`evaluator.py`)
66
+
67
+
The `Evaluator` class runs programs via subprocess with timeout and optional memory monitoring. The `execute()` method takes a `Program` and returns `(returncode, output, warning, error, eval_metrics)`.
68
+
69
+
### Mock Models
70
+
71
+
Set `model_name` to `"MOCK"` in config to use `MockOpenAILM` for testing without API calls. The mock returns identity SEARCH/REPLACE diffs.
72
+
73
+
## Testing Guidelines
74
+
75
+
- Mirror the module structure: `test_<module>.py`
76
+
- Use class-based test organization (`class TestFeatureName`)
77
+
- Prefix helpers with `_make_*` for fixture-like factory methods
0 commit comments