Lesson 3: Continuous Evolution Workflow
The Evolution Loop
From v0.42.0, Sruja provides an evolutionary workflow that continuously monitors and improves architecture:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Instrumentation│ → │ Context Hints│ → │Infra Discovery│
└─────────────┘ └─────────────┘ └─────────────┘
↓ ↓ ↓
Measure health Suggest improvements Auto-optimize
Maturation Phases
Phase 1: Instrumentation
Start by measuring what you have:
sruja discover -r . --context
This builds the initial architecture graph.
Phase 2: Context Hints
Add human knowledge to guide evolution:
sruja intent propose -r . --from-diff
Phase 3: Infrastructure Discovery
Let Sruja find infrastructure patterns:
sruja scan -r . --infra
The Evolution Command
# Run evolution analysis
sruja evolution -r .
# Show recommended changes
sruja evolution -r . --propose
# Apply recommended changes
sruja evolution -r . --fix
Drift Detection and Resolution
# Detect drift
sruja drift -r .
# Auto-fix where possible
sruja drift -r . --fix
# Show blast radius of changes
sruja impact <component> -r . --depth 3
Agentic Memory (v0.37.0)
From v0.37.0, Sruja includes agentic memory—autonomous optimization that learns from past decisions:
# Enable autonomous mode
sruja agent run -r . --autonomous
# Review agent suggestions
sruja agent review -r .
The agent:
- Remembers past architectural decisions
- Learns from team preferences
- Proposes optimizations based on patterns
- Evaluates fitness of changes before applying
Integrating into CI/CD
# .github/workflows/evolution.yml
- name: Check Architecture Health
run: |
sruja health -r . --format json > health.json
sruja drift -r . --fail-on-drift
- name: Evolution Check (daily)
if: github.event_name == 'schedule'
run: sruja evolution -r . --propose
Summary
The continuous evolution workflow:
- Instrument: Build architecture graph
- Measure: Run health checks
- Detect: Find drift with
sruja drift - Propose: Get evolution suggestions
- Apply: Use
sruja evolution --fix - Learn: Agentic memory improves over time
Module Complete!
You've completed the Evolutionary Architecture module. You now understand:
- ✅ Fitness functions and how to define them
- ✅ Health scoring and community detection
- ✅ Continuous evolution workflow with maturation phases