Strategic Improvement
** Current retry logic is simple (fixed count). Build a pattern-recognition system that analyzes failure types (API timeout, test flake, merge conflict, context exhaustion) and applies failure-specific retry strategies: exponential backoff for rate limits, immediate retry for flakes, model escalation for context issues, human escalation for persistent failures. Learns optimal retry counts per pattern from historical data.
Acceptance Criteria
- Failure classifier categorizes errors into 8+ types (timeout, flake, conflict, quota, etc.)
- Retry strategy router applies type-specific logic (backoff, model switch, skip stage, escalate)
- Historical success rate per (failure_type, retry_strategy) tracked in database
- Adaptive retry count based on historical P(success | failure_type, retry_n)
- Cost savings metric: wasted retries avoided vs successful recoveries
- Integration test showing 3 failure types handled with different strategies
- Documentation update in CLAUDE.md with retry decision flowchart
Context
- Priority: ** P0
- Complexity: ** standard
- Generated by: Strategic Intelligence Agent
- Strategy alignment: ** P0: Reliability & Success Rate - "Smarter retry strategies based on failure patterns"
Strategic Improvement
** Current retry logic is simple (fixed count). Build a pattern-recognition system that analyzes failure types (API timeout, test flake, merge conflict, context exhaustion) and applies failure-specific retry strategies: exponential backoff for rate limits, immediate retry for flakes, model escalation for context issues, human escalation for persistent failures. Learns optimal retry counts per pattern from historical data.
Acceptance Criteria
Context