What is a Capsule?
A Capsule is a proven solution created after a successful Gene application. Capsules encode:- Trigger Signals that activated the solution
- Gene Used to generate the solution
- Blast Radius (actual files/lines changed)
- Outcome (status, score, success streak)
- Environment Fingerprint for reproducibility
Capsule Structure
Must be
"Capsule"Current:
"1.5.0"Unique identifier (e.g.,
capsule_1770477654236)Signals that triggered this Capsule’s creation
ID of the Gene used (e.g.,
gene_gep_repair_from_errors)Human-readable summary of the change
Confidence score (0.0-1.0)
Actual impact:
{ files: number, lines: number }Result:
{ status: "success" | "failed", score: number }Consecutive successful applications (for reuse scoring)
Environment metadata (node version, platform, OS, evolver version, cwd, captured_at)
Agent-to-agent metadata:
{ eligible_to_broadcast: boolean, status?: string, source?: string }Content hash (SHA-256) for deduplication and verification
Real Capsule Examples
Example 1: Minimal Repair (2 lines)
This Capsule fixed a shell compatibility error with minimal changes:Why This Capsule Matters
Why This Capsule Matters
Minimal Blast Radius: Only 1 file, 2 lines changedHigh Confidence: 0.85 score indicates strong validationSpecific Error Match: The
errsig in triggers allows matching similar shell errorsNot Broadcast Eligible: Too new (streak=1), not yet proven enoughExample 2: Larger Repair (44 lines)
This Capsule fixed a similar error with broader changes:Comparison with Example 1
Comparison with Example 1
Same Gene: Both used
gene_gep_repair_from_errorsSame Error Signature: Matching errsig in triggersDifferent Blast Radius: 2 files / 44 lines vs. 1 file / 2 linesSame Confidence: Both scored 0.85 (validation passed)Evolution Tree: These are sibling events, both children of evt_1770477201173Trigger Patterns
Signal Types in Triggers
Capsule triggers include:- Error Signals:
log_error,exception,crash - Error Signatures:
errsig:**TOOLRESULT**: {...}(normalized for matching) - Platform Signals:
windows_shell_incompatible,linux_path_issue - Performance Signals:
perf_bottleneck,timeout - User Signals:
user_missing,user_feature_request
Error Signature Matching
Error signatures are normalized for fuzzy matching:Confidence and Success Streaks
Confidence Scores
Confidence is computed based on:- Validation Results: All validation commands passed (0.8 base)
- Blast Radius: Smaller changes = higher confidence
- Signal Match Quality: Exact trigger match vs. partial match
Success Streaks
Capsulesuccess_streak is computed from EvolutionEvent history:
success_streak: 1= First success, not yet provensuccess_streak: 2= Two consecutive successes (broadcast eligible)success_streak: 5= Highly proven (capped for scoring)
Blast Radius Tracking
Why Blast Radius Matters
Blast radius measures the impact of a change:- Small: 1-3 files, < 50 lines (safe to broadcast)
- Medium: 4-10 files, 50-200 lines (review recommended)
- Large: > 10 files or > 200 lines (not eligible for broadcast)
Calculation Method
Blast radius is computed from git diff:Outcome Tracking
Outcome Status
success: All validation passed, changes committedfailed: Validation failed, changes rolled back
Numeric quality score (0.0-1.0) based on validation results and impact
Failed Capsules
When validation fails, a failed Capsule is still recorded:assets/gep/failed_capsules.json) to prevent reuse.
Environment Fingerprint
Every Capsule includes environment metadata for reproducibility:A2A Broadcast Eligibility
Capsules meeting strict criteria can be broadcast via A2A protocol:Eligibility Criteria
External Capsule Reception
When receiving a Capsule from another agent:Reuse Scoring
When selecting a Capsule for reuse, score is computed as:>= 0.72: Reuse as reference (inject into prompt)>= 0.85: Direct reuse (skip local reasoning)
Capsule Lifecycle
Next Steps
Events
Track evolution history through EvolutionEvent trees
A2A Protocol
Share Capsules with other agents via agent-to-agent protocol