Self adaptive systems

From curiositech/windags-skills · View interactive version

Self adaptive systems is an AI agent skill from the GitHub repository curiositech/windags-skills. Engineering methodology for building software systems that autonomously manage themselves through explicit architectural separation and formal guarantees

How to use this skill

Skill file

Self-Adaptive Systems Engineering

Engineering methodology for building software systems that autonomously manage themselves through explicit architectural separation and formal guarantees.

Decision Points

System Property Assessment → Adaptation Strategy Selection

| System Property | Choose Strategy | Implementation |

|-----------------|----------------|----------------|

| Single goal, predictable dynamics | Simple feedback control (PID-style) | Monitor → Calculate error → Proportional/Integral/Derivative response |

| Multiple conflicting goals | Formal goal specifications with utility functions | Define weighted objectives → Multi-objective optimization → Synthesize controller |

| >10 interacting components | Hierarchical feedback loops | Reactive (ms-s) → Deliberative (min-hr) → Reflective (days) layers |

| High environmental uncertainty | Probabilistic models + runtime updates | Maintain confidence intervals → Detect model drift → Trigger re-identification |

| Millisecond adaptation required | Pre-computed policy tables | Offline synthesis → Lookup-based execution → Background policy updates |

Uncertainty Type → Model Selection

IF confidence > 90% AND drift < threshold
  THEN incremental model update (recursive least squares)
ELSE IF abrupt change detected OR confidence < 50%  
  THEN trigger re-identification experiments
ELSE IF formal guarantees required
  THEN use model checking on policies before deployment
ELSE
  THEN fallback to conservative policy + alert operators

Architecture Decision Tree

Does current system have scattered adaptation logic?
├─ YES → Extract to explicit managing/managed separation
│   └─ Can you draw clear boundary between domain logic and adaptation logic?
│       ├─ NO → Refactor with MAPE-K pattern first
│       └─ YES → Proceed with formal goal specification
└─ NO → Is this new system design?
    └─ YES → Start with single feedback layer
        └─ Expected to grow beyond 10 components?
            ├─ YES → Design hierarchical from start
            └─ NO → Single layer, plan evolution path

Failure Modes

1. Oscillation Death Spiral

Detection Rule: If system alternates between opposing states (scale up → scale down → scale up) with increasing frequency

Symptom: Thrashing behavior, degrading performance despite "working" adaptation

Root Cause: Controller gain too aggressive OR conflicting timescales in single layer

Fix: Reduce proportional gain by 50%, add derivative term to dampen, OR separate into reactive/deliberative layers

2. Uncertainty Blindness

Detection Rule: If adaptation confidence remains constant despite changing conditions OR no confidence tracking exists

Symptom: Mysterious failures in production, adaptation working in test but not reality

Root Cause: Models assume certainty, no drift detection, point estimates treated as truth

Fix: Add probabilistic models with confidence intervals → Track model prediction accuracy → Trigger re-learning when confidence drops below threshold

3. Goal Ambiguity Paralysis

Detection Rule: If team debates "is the adaptation working?" OR cannot define success criteria OR has conflicting informal goals

Symptom: Endless tuning, stakeholder disagreements, no objective success metrics

Root Cause: Informal goals ("fast and reliable") cannot drive automated decisions

Fix: Formalize as executable specifications: P≥0.95[responseTime ≤ 200ms] AND cost ≤ $X/hour → Verify policies against formal goals before deployment

4. Single-Layer Complexity Explosion

Detection Rule: If adaptation component has >1000 lines OR >20 configuration parameters OR debugging requires system-wide tracing

Symptom: Adding adaptation features breaks existing ones, emergent behaviors, impossible to predict changes

Root Cause: Forcing different timescales into single control loop

Fix: Decompose into hierarchical layers: Reactive handles immediate responses, Deliberative optimizes patterns, Reflective evolves strategy

5. Verification Avoidance

Detection Rule: If adaptation policies deployed based on intuition OR testing only happy path scenarios OR discovering issues only in production

Symptom: "It worked in staging but failed in production", unpredictable behavior under load

Root Cause: Adaptation space is exponential, manual testing insufficient

Fix: Model check policies before deployment → Use statistical verification for probabilistic properties → Runtime monitoring of guarantee violations

Worked Examples

Example: E-commerce Platform Auto-scaling

Scenario: Online retailer needs adaptive resource management balancing response time (<200ms for 95% requests), availability (99.9% uptime), and cost (<$500/hour infrastructure).

Step 1: Architecture Decision

Step 2: Formal Goal Specification

Primary: P≥0.95[responseTime ≤ 200ms]
Secondary: availability ≥ 99.9% 
Constraint: cost ≤ $500/hour

Step 3: Hierarchical Design

Step 4: Controller Synthesis

Deliberative layer models relationship: responseTime = f(activeServers, requestRate, cpuUtilization)

From experimental data: responseTime ≈ 50 + (requestRate/activeServers) * 0.8 + cpuNoise

Synthesize controller: targetServers = requestRate/targetThroughputPerServer + safetyMargin

Expert vs Novice Differences:

Result: System maintains goals under 3x traffic spikes, reduces cost 40% during low-traffic periods, provides formal guarantees on response time distribution.

Quality Gates

Task complete when all conditions verified:

NOT-FOR Boundaries

Do NOT use this skill for:

Delegate to other skills:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.