fable-agent/PHASES/phase-09-recovery-handler.md

862 B

Phase 9: Recovery Handler

Purpose: Retry, fallback, and graceful degradation for failed steps. TS Module: src/tier2-primitives/workflows/recovery-handler.ts

What It Does

When a step fails:

  1. Retry with exponential backoff (configurable per step)
  2. If retries exhausted, try fallback step
  3. If no fallback, degrade gracefully (mark step as skipped, continue)
  4. If critical step fails completely, escalate to orchestrator

Recovery Strategies

{
  "maxRetries": 3,
  "fallbackStepId": "step-4-alt",
  "degradeGracefully": true,
  "timeoutOverrideMs": 60000
}

Key Rules

  • Register recovery strategies per step or globally
  • Graceful degradation produces degraded output rather than crashing
  • Every incident is logged to the safety boundary for pattern analysis
  • 3+ failures on the same step → permanent strategy change