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
| Level | Name | Trigger | Behavior |
|---|---|---|---|
| 0 | Normal | Budget <70%, providers healthy | Full routing |
| 1 | Conservative | Budget 70-85% or 1+ degraded | Aggressive caching |
| 2 | Mid-tier | Budget 85-95% or 2+ degraded | Force mid-tier models |
| 3 | Economy | Budget 95-99% or majority down | Cheapest viable only |
| 4 | Cache-only | Budget exhausted or all down | Cache-only, 503 for uncached |
Implementation
src/router/intelligence/degradation-ladder.ts— State machine with hysteresis (30s up, 60s down)src/api/routes/degradation.ts—GET /v1/intelligence/degradationstatus 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