/quality-evolve

Evolution L3 Production medium usage

/quality-evolve

Overview

/quality-evolve is a production command in the Evolution category of the Prismatic Platform. It drives targeted evolution cycles focused on improving specific quality domains, systematically identifying quality deficiencies, generating improvement candidates, validating their effectiveness through automated testing, and promoting successful improvements into the production codebase. Unlike general-purpose evolution commands such as /evolve, which operate across the entire platform, /quality-evolve concentrates its efforts on a single quality domain per execution cycle, enabling deeper analysis and more effective improvements.

This command operates under the L3 authority level and is executed by the evolution-orchestrator agent. It is part of the platform's 216-command slash command registry, built on the AIAD (Autonomous Intelligence Agent Design) standard. The L3 authority level grants the command permission to modify source code, update quality configurations, and trigger compilation and test cycles as part of the evolution process.

The Prismatic Platform tracks quality across 13 domains: Dialyzer, Credo, Compilation, DateTime Precision, Guard Functions, @impl Coverage, Memory Safety, Performance, Regression Prevention, Timing Patterns, TODO Management, Typespec Coverage, and Unsafe Map Access. Each domain has specific metrics, detection rules, and improvement strategies. /quality-evolve encapsulates the domain-specific knowledge needed to improve any of these 13 areas.

The evolutionary approach to quality improvement represents a fundamental shift from manual code review and ad-hoc fixing to systematic, automated, and validated quality enhancement. Each evolution cycle follows a measure-analyze-improve-validate loop that ensures improvements are real (validated by tests), safe (no regressions introduced), and permanent (committed to the codebase with quality DNA updates).

Syntax and Usage

/quality-evolve [options]

The command accepts options for domain selection, iteration control, and strategy configuration.

# Evolve all quality domains (one cycle each)
/quality-evolve

# Evolve specific domain
/quality-evolve --domain dialyzer

# Evolve with specific iteration count
/quality-evolve --domain credo --iterations 5

# Dry run showing proposed improvements
/quality-evolve --domain memory-safety --dry-run

# Evolve with aggressive improvement strategy
/quality-evolve --domain typespec --strategy aggressive

# Evolve specific application only
/quality-evolve --domain compilation --app prismatic_web

# Show current quality scores per domain
/quality-evolve --status

# Evolve with detailed progress reporting
/quality-evolve --domain performance --verbose

# Multi-domain evolution campaign
/quality-evolve --domains dialyzer,credo,typespec --iterations 3

Parameters and Options

OptionTypeDefaultDescription
--domainstringallQuality domain to target
--domainsstringallComma-separated list of domains
--appstringallSpecific umbrella application to evolve
--iterationsinteger3Number of evolution cycles per domain
--strategyenumbalancedEvolution strategy: conservative, balanced, aggressive, targeted
--dry-runflagfalseShow proposed improvements without executing
--statusflagfalseDisplay current quality scores
--verboseflagfalseDetailed progress reporting
--max-changesinteger50Maximum code changes per cycle
--rollback-on-regressionflagtrueRollback if quality score decreases
--commitflagfalseAuto-commit improvements after validation
--reportpathnoneExport evolution report to file
--severitystringallFilter violations by severity: high, medium, low
--checksstringallFilter by specific check categories

The --strategy parameter controls the aggressiveness of the evolution. Conservative mode makes only high-confidence, well-tested improvements with minimal risk of side effects. Balanced mode (default) applies a mix of safe and moderately complex improvements. Aggressive mode attempts more ambitious fixes that may require manual review. Targeted mode focuses on specific violation types identified through prior analysis.

Implementation Architecture

The quality evolution system operates as a feedback loop: measure, analyze, generate improvements, test, and promote.

              /quality-evolve
                    |
           Domain Selector
                    |
           Quality Measurer
                    |
          +--------+--------+
          |        |        |
       Defect   Pattern   Benchmark
       Scanner  Analyzer  Collector
          |        |        |
          +--------+--------+
                    |
          Improvement Generator
                    |
          +--------+--------+
          |        |        |
       Code     Config    Pattern
       Fixer    Tuner     Propagator
          |        |        |
          +--------+--------+
                    |
           Validation Gate
                    |
          +--------+--------+
          |        |        |
       Compile   Test     Quality
       Check     Suite    Score
          |        |        |
          +--------+--------+
                    |
           Promotion Decision

Domain-Specific Strategies

DomainStrategyTypical Improvement Per Cycle
DialyzerType annotation addition, spec correction5-20 violations fixed
CredoCode style normalization, complexity reduction10-50 issues resolved
CompilationWarning elimination, deprecation updates2-10 warnings fixed
Memory SafetyUnsafe access replacement, guard addition3-15 patterns fixed
Typespec Coverage@spec generation from runtime analysis10-30 specs added
PerformanceHot path optimization, query tuning5-15% improvement
Guard FunctionsGuard clause addition for public functions5-20 guards added
@impl CoverageMissing @impl annotation addition10-40 annotations added
Unsafe Map AccessMap.get/Access replacement for bracket access5-25 patterns fixed

Evolution Phases

Phase 1 -- Domain Assessment: The target domain is assessed for current quality score, violation count, and improvement potential. Historical trends are analyzed to identify whether the domain is improving, stable, or degrading.

Phase 2 -- Defect Scanning: Domain-specific scanners identify all current violations, categorize them by severity and fixability, and rank them by expected improvement impact.

Phase 3 -- Improvement Generation: Based on scan results, the improvement generator creates code modifications: automated fixes (deterministic corrections for well-understood patterns), heuristic fixes (best-effort corrections based on pattern analysis), and configuration updates (tuning domain-specific settings for stricter enforcement).

Phase 4 -- Validation: Every proposed improvement passes through a validation gate: compilation check (mix compile --warnings-as-errors must pass), test suite (all existing tests must continue to pass), quality score (domain quality score must not decrease), and cross-domain impact (changes must not introduce violations in other domains).

Phase 5 -- Promotion: Validated improvements are applied to the codebase. If --commit is enabled, changes are automatically committed with conventional commit messages. Quality DNA is updated to reflect the new state.

Examples

Comprehensive Dialyzer Evolution

/quality-evolve --domain dialyzer --iterations 10 --strategy aggressive
# Cycle 1: 15 type annotation fixes applied
# Cycle 2: 8 spec corrections applied
# Cycle 3: 12 return type annotations added
# ... (continues for 10 cycles)
# Total: 67 violations fixed, quality score 100/100

Safe Memory Safety Improvement

/quality-evolve --domain memory-safety --dry-run --verbose
# Proposed improvements:
#   1. Replace map[:key] with Map.get(map, :key) in 12 locations
#   2. Add guard clauses to 5 public functions accepting maps
#   3. Replace unsafe Access.get with safe alternatives in 3 modules
# Estimated quality improvement: +8 points
# Risk assessment: LOW (all changes are structural replacements)

Application-Specific Typespec Evolution

/quality-evolve --domain typespec --app prismatic_api --strategy targeted
# Targets prismatic_api specifically, adding @spec annotations
# to all public functions that currently lack them

Integration with Platform

ComponentIntegration TypeDescription
/quality-gatesEnforcementImprovements validated against quality gates
/quality-unifiedPeerUnified quality assessment feeds into evolution targets
/quality-hbfsPeerHottest-bug-first prioritization guides evolution
/evolveFrameworkPart of broader ecosystem evolution
/regression-checkValidationRegression checks validate improvements
Quality GatesEnforcementGate compliance required for promotion
TelemetryMonitoringEvolution metrics and quality trends
NABLA InfinityEpistemicEvidence-based improvement decisions
Quality DNAState trackingCross-session quality state persistence

Workflow Integration

The /quality-evolve command integrates into the platform's quality management workflow at several levels:

  1. Daily Quality Improvement: Scheduled evolution cycles run with conservative strategy, continuously improving quality scores without risk of regressions. This creates a "quality ratchet" that prevents quality from degrading over time.

  2. Pre-Release Quality Campaigns: Before major releases, aggressive evolution campaigns target remaining quality violations. Multi-domain evolution (--domains dialyzer,credo,typespec) addresses all quality fronts simultaneously.

  3. Post-Incident Quality Response: After quality regressions are detected, targeted evolution cycles address the specific domain that regressed. The rollback-on-regression safeguard prevents further degradation.

  4. New Application Bootstrap: When new umbrella applications are created via /quickstart, quality evolution establishes baseline quality by running all domains against the new application.

  5. Cross-Domain Awareness: Quality domains are interconnected. Improving Dialyzer compliance often requires adding typespecs (affecting the Typespec Coverage domain). Using --domains to evolve related domains together produces better results than treating them independently.

NABLA Compliance

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

  • NO MERCY: Zero tolerance for incomplete execution or quality violations. Improvements that degrade any quality domain are rejected. Every evolution cycle must leave the codebase in a better or equal state -- never worse.
  • NO DOUBTS: Full investigation before action, evidence-based results. Every improvement is validated through compilation, testing, and quality scoring. No speculative improvements are promoted without empirical validation.

NABLA axiom compliance:

AxiomEnforcement
Evidence-BasedEvery improvement validated by compilation, tests, and quality scoring
Provenance MandatoryEach change traceable to specific violation, scanner, and evolution cycle
Signal PluralityMultiple validation signals (compile, test, quality score) required for promotion
Contradiction PreservationCross-domain impacts tracked; improvements that fix one domain but break another are flagged
Time DecayQuality scores timestamped; degradation trends trigger automatic evolution

Performance

MetricTargetTypical
Domain assessment< 30s~10s
Defect scanning< 60s per domain~20s per domain
Improvement generation< 2min per cycle~45s per cycle
Validation (compile + test)< 5min~2min
Single evolution cycle< 10min~4min
Full 13-domain evolution< 2hr~45min
Quality DNA update< 5s~1s

The validation phase dominates execution time, as it requires full compilation and test suite execution. For large umbrella applications, parallel compilation significantly reduces this overhead. The --app parameter limits the scope and proportionally reduces execution time.


Connect & Contribute

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