2026-03-26-degradation-ladder

Degradation Ladder

Date: 2026-03-26 Phase: 086-degradation-ladder Systems: intelligence engine, guardian, completions

What

Automatic degradation state machine with 5 levels (0-4) that BR enters based on budget pressure and provider health. Surfaces current level via X-BR-Degradation-Level header and GET /v1/intelligence/degradation status endpoint.

Levels

LevelNameTriggerBehavior
0NormalBudget <70%, providers healthyFull routing
1ConservativeBudget 70-85% or 1+ degradedAggressive caching
2Mid-tierBudget 85-95% or 2+ degradedForce mid-tier models
3EconomyBudget 95-99% or majority downCheapest viable only
4Cache-onlyBudget exhausted or all downCache-only, 503 for uncached

Implementation

  • src/router/intelligence/degradation-ladder.ts — State machine with hysteresis (30s up, 60s down)
  • src/api/routes/degradation.tsGET /v1/intelligence/degradation status endpoint
  • Designed for <1ms evaluation overhead (number comparisons only)

Lockstep Checklist

  • [x] API: Degradation evaluator + status endpoint
  • [x] Tests: 12 tests — level transitions, hysteresis, provider health, de-escalation, flapping prevention
  • [x] Docs: This ship log
  • [x] SDK-TS: N/A (headers automatic, simple GET endpoint)
  • [x] SDK-PY: N/A
  • [x] MCP: N/A
  • [x] CLI: N/A
  • [x] GTM: N/A
  • [x] Dashboard: N/A