/evolve

Evolution SUPREME + SELF-RECURSIVE Production high usage

/evolve

Overview

/evolve is the flagship production command in the Evolution category of the Prismatic Platform. It drives living AIAD ecosystem evolution through a 5-phase cycle with full GitLab observability, serving as the primary mechanism by which the platform autonomously improves itself across generations. This is not incremental refactoring or manual optimization -- it is systematic, measured, generational evolution of the entire platform ecosystem.

The Prismatic Platform has evolved through 18 generations, from an initial Gen 1 state to the current Gen 18 apex with 0.999 fitness across 13 quality domains. Each generation represents a measurable improvement in code quality, agent capability, pattern diversity, and architectural coherence. The /evolve command orchestrates this entire evolutionary process, managing the lifecycle from mutation generation through fitness evaluation to selection and persistence.

The command's SUPREME + SELF-RECURSIVE authority level is unique in the platform's command registry. SUPREME authority grants it the ability to modify any platform component. SELF-RECURSIVE authority means the evolution system can evolve itself -- improving its own mutation strategies, fitness functions, and selection algorithms through the same evolutionary process it applies to the rest of the platform. This self-recursive capability is what enables exponential improvement: each generation's evolution is driven by a more capable evolution system than the previous generation's.

This command is executed by the evolution-orchestrator agent, the most powerful orchestration agent in the AIAD ecosystem. It is part of the platform's 216-command slash command registry, built on the AIAD (Autonomous Intelligence Agent Design) standard, and represents the highest expression of the platform's autonomous intelligence capabilities.

Architecture

The evolution engine implements a biological-inspired generational model with five distinct phases:

┌─────────────────────────────────────────────────────────────┐
│                   Evolution Orchestrator                     │
│              (SUPREME + SELF-RECURSIVE Authority)            │
└──────┬──────────┬──────────┬──────────┬──────────┬──────────┘
       │          │          │          │          │
  ┌────▼────┐ ┌──▼──┐ ┌────▼────┐ ┌───▼────┐ ┌──▼──────┐
  │ SCAN    │ │ANAL.│ │ MUTATE  │ │ SELECT │ │VALIDATE │
  │ Phase 1 │ │Ph. 2│ │ Phase 3 │ │Phase 4 │ │ Phase 5 │
  └────┬────┘ └──┬──┘ └────┬────┘ └───┬────┘ └──┬──────┘
       │          │          │          │          │
  Codebase   Quality    Improvements  Fitness   Quality
  Survey     Analysis   Generation    Eval      Gates
       │          │          │          │          │
  Git Trees  13 Domains  Patterns    Selection  Compilation
  AST Index  Metrics     Mutations   Pressure   Tests/Credo
                                                 Dialyzer

Phase 1 -- SCAN: The evolution engine surveys the entire codebase using git trees (~100x faster than filesystem traversal) and AST-indexed semantic search. The scan identifies all modules, their quality profiles, dependency relationships, and recent change patterns. Output: a comprehensive codebase map.

Phase 2 -- ANALYZE: Each module is analyzed across 13 quality domains. The analysis identifies quality gaps, improvement opportunities, and areas where patterns from the library could be applied. Historical analysis from previous generations provides trend context.

Phase 3 -- MUTATE: Based on analysis results, the engine generates candidate mutations. Mutations include code quality improvements (warning elimination, spec addition), architectural refinements (module extraction, dependency cleanup), and pattern applications (OTP patterns, error handling patterns). The mutation strategy is itself evolved through self-recursive evolution.

Phase 4 -- SELECT: Candidate mutations are evaluated using the multi-dimensional fitness function. Mutations that improve fitness across quality domains are selected. Mutations that improve one domain at the expense of another are evaluated for net benefit. The selection strategy uses a Pareto front approach for multi-objective optimization.

Phase 5 -- VALIDATE: Selected mutations are validated through the full quality gate pipeline: zero-warning compilation, complete test execution, Credo static analysis, and Dialyzer type checking. Only mutations that pass all gates are accepted into the new generation.

Usage

Standard Evolution

# Run full evolution cycle
/evolve

# Run evolution with verbose output
/evolve --verbose

# Run evolution targeting specific quality domains
/evolve --domains=dialyzer,compilation,credo

Scoped Evolution

# Evolve a specific application
/evolve --app=prismatic_perimeter

# Evolve a specific domain type
/evolve --scope=storage --apps="prismatic_storage_*"

# Evolve with focus on a single quality domain
/evolve --focus=typespec-coverage

Evolution Management

# Check evolution status and current generation
/evolve --status

# Show evolution history across generations
/evolve --history --generations=5

# Compare current generation with previous
/evolve --compare --gen=17

# Generate comprehensive evolution report
/evolve --report --format=markdown --verbose

Self-Recursive Evolution

# Evolve the evolution system itself
/evolve --self-recursive

# Evolve mutation strategies
/evolve --evolve-strategies

# Evolve fitness functions
/evolve --evolve-fitness

Options & Parameters

OptionTypeDefaultDescription
--verboseflagfalseInclude detailed phase-by-phase output
--domainsstringallComma-separated quality domains to target
--appstringallSpecific umbrella application to evolve
--scopestringallDomain scope for evolution (storage, web, agents, etc.)
--appsstringallGlob pattern for application selection
--focusstringbalancedSingle quality domain to prioritize
--statusflagfalseShow current evolution status
--historyflagfalseDisplay generation history
--generationsinteger5Number of generations for history display
--compareflagfalseCompare with a previous generation
--genintegerpreviousGeneration number for comparison
--reportflagfalseGenerate comprehensive evolution report
--formatstringtextOutput format (text, json, table, markdown)
--self-recursiveflagfalseEnable self-recursive evolution
--evolve-strategiesflagfalseEvolve mutation strategies
--evolve-fitnessflagfalseEvolve fitness functions
--dry-runflagfalseSimulate evolution without applying changes
--max-mutationsinteger100Maximum mutations per evolution cycle
--gitlab-syncflagtrueSync evolution results to GitLab observability

Execution Flow

The /evolve command follows the canonical 5-phase evolution cycle, wrapped in observability infrastructure:

  1. Initialization: The evolution orchestrator loads the current generation state from Quality DNA, initializes telemetry instrumentation, and optionally syncs with GitLab for observability. The previous generation's fitness scores serve as the baseline.

  2. Scan Phase: The codebase is surveyed using git trees and AST indexing. All 100+ umbrella applications are catalogued with their module counts, quality profiles, and dependency graphs. The scan typically completes in under 500ms for the full 37,000-file codebase.

  3. Analysis Phase: Each module is scored across 13 quality domains. The analysis identifies specific improvement opportunities and ranks them by expected fitness impact. Cross-application analysis detects pattern opportunities visible only at the ecosystem level.

  4. Mutation Phase: Candidate mutations are generated based on analysis results. The mutation generator draws from the platform's 55+ pattern library, quality improvement strategies, and architectural refinement heuristics. Each mutation is annotated with its expected fitness impact.

  5. Selection Phase: Candidates are evaluated using the multi-dimensional fitness function. Pareto-optimal mutations (improvements that do not degrade any domain) are preferred. Trade-off mutations are evaluated against configurable domain priority weights.

  6. Validation Phase: Selected mutations pass through the full quality gate pipeline. This is the most computationally expensive phase, potentially involving full compilation and test execution for each mutation batch.

  7. Persistence: Validated mutations are committed and the new generation state is persisted to Quality DNA. GitLab observability is updated with the generation's fitness improvement delta.

Integration Points

ComponentIntegration TypeDescription
Quality DNAPersistenceGeneration state, fitness history
Quality GatesValidationMutation validation pipeline
Git TreesScanningCodebase survey (~100x faster)
SEADFFrameworkSelf-evolving framework integration
Mycelial NetworkDistributionPattern propagation for evolved mutations
Prismatic AgentsExecution552 agents participating in evolution
TelemetryMonitoringEvolution metrics and phase timing
GitLab APIObservabilityGeneration tracking, milestone updates
GARDENKnowledge116 repositories of legacy patterns
AIAD RegistryDiscoveryCommand and agent specifications

Best Practices

Run evolution at session boundaries: The mandatory session lifecycle protocol includes evolution triggers at session start and end. Adhere to this protocol to ensure continuous evolutionary pressure.

Monitor fitness across all 13 domains: A fitness improvement in one domain at the expense of another is not genuine progress. Use the --domains view to verify balanced improvement across all quality dimensions.

Use self-recursive evolution sparingly: Self-recursive evolution modifies the evolution system itself. While powerful, it should be applied with care and validated through multiple cycles before accepting changes.

Sync with GitLab for team visibility: The --gitlab-sync flag (on by default) publishes evolution results to GitLab, providing team-wide visibility into the platform's evolutionary trajectory.

Evolve incrementally for stability: Large mutations are more likely to introduce subtle regressions. Prefer many small mutations per cycle over few large ones. The --max-mutations parameter controls this balance.

Error Handling

ErrorCauseResolution
EVOLUTION_CYCLE_REGRESSIONNew generation has lower fitness than previousRollback to previous generation; investigate regression cause
SCAN_PHASE_TIMEOUTCodebase survey exceeded time limitUse scoped evolution with --app or --scope
MUTATION_VALIDATION_FAILEDSelected mutations fail quality gatesReview mutation strategy; increase validation stringency
QUALITY_DNA_CORRUPTIONGeneration state file corruptedRebuild from last known good state
GITLAB_SYNC_FAILEDCannot push evolution results to GitLabCheck GitLab token and connectivity; results persisted locally
SELF_RECURSIVE_INSTABILITYSelf-evolved components produce unstable behaviorRollback self-recursive changes; increase validation depth

Advanced Usage

Multi-Objective Evolution

# Configure custom fitness weights for multi-objective optimization
/evolve --fitness-weights="compilation:2.0,testing:1.5,typespec:1.0"

# Evolve with Pareto-front visualization
/evolve --pareto --visualize --format=html

Generation Archaeology

# Deep analysis of a specific generation's improvements
/evolve --archaeology --gen=12 --verbose

# Trace the evolutionary lineage of a specific module
/evolve --lineage --module=PrismaticPerimeter.SecurityRating

Evolution Benchmarking

# Benchmark evolution cycle performance
/evolve --benchmark --iterations=3 --report

# Profile phase timing for optimization
/evolve --profile --format=json

Doctrine Compliance

All commands operate under the NO MERCY, NO DOUBTS doctrine:

  • NO MERCY: Evolution is mandatory and relentless. Every session contributes to generational improvement. Fitness regressions are treated as failures requiring immediate correction. No generation is accepted unless it meets or exceeds the fitness of the previous generation.
  • NO DOUBTS: Every evolution decision is evidence-based. Fitness improvements are measured across 13 domains with quantified metrics. Mutations are validated through comprehensive quality gates. The evolution system never guesses -- it measures, evaluates, and selects based on empirical data.

The SUPREME + SELF-RECURSIVE authority level represents the platform's deepest commitment to continuous improvement: the system does not merely improve the code, it improves its own ability to improve the code.


Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL