Skip to main content

Module evolution

Module evolution 

Source
Expand description

Self-evolution: agent evaluates its own runs and proposes improvements.

After each task, the agent can analyze telemetry and identify bottlenecks. Improvements are stored as tasks in .tasks/ for the next run.

§Evolution loop

Run task → Collect telemetry → Evaluate → Propose improvements →
→ Pick improvement → Patch code → Test → Commit → Rebuild → Restart →
→ Run task (with improvement) → ...

Structs§

CircuitBreaker
Circuit breaker: stops after N consecutive identical failures.
EvolutionEntry
One entry in evolution.jsonl — records a single self-improvement attempt.
Improvement
A proposed self-improvement.
LoopOptions
Loop configuration (mirrors solo-dev.sh flags).
LoopState
Loop state — tracks progress across iterations.
RunStats
Telemetry from a single agent run.
SessionPattern
Pattern found across multiple sessions.

Enums§

ControlAction
Control commands via file. Compatible with solo-dev.sh. Write “stop”, “pause”, or “skip” to the control file.
LoopMode
SoloSignal
Solo-compatible signals in agent output. <solo:done/> = stage complete, move to next <solo:redo/> = go back to previous stage (e.g. review found issues)

Functions§

analyze_sessions
Analyze recent session logs for recurring issues. Reads last max_sessions JSONL files from agent home dir.
baseline_score
Get the latest score (baseline for comparison).
check_control
Check control file for commands. Reads and deletes (except pause which persists).
evaluate
Analyze run stats and propose improvements.
evolution_log_path
Default evolution log path.
evolution_prompt
Build a prompt that asks the agent to improve itself.
evolution_prompt_with_history
Build an evolution prompt that includes session history analysis.
evolution_summary
Count how many “keep” vs “discard” in history.
format_improvements
Format improvements as a markdown task list for the agent.
load_evolution
Load evolution history.
log_evolution
Append an entry to evolution.jsonl.
parse_signal
Parse solo signals from agent output.
score
Efficiency score: 0.0 (terrible) to 1.0 (perfect). successful_calls / steps weighted by completion.