# Sprint Health Algorithm

Implemented in `SprintHealthEngineService`.

## Inputs

- Capacity utilization (% from team allocations or sprint capacity MD)
- Blocked work items (kanban column / status name)
- Overdue work items (past due, not completed)
- Sprint progress (% completed MD / committed MD)
- Velocity trend (from `VelocityService`, values: `up`, `down`, `flat`, `unknown`)
- Sprint overdue flag

## Score (0–100)

Starting at 100, penalties applied:

- Over-utilization: up to −40
- Blocked items: −8 each (max −25)
- Overdue items: −6 each (max −25)
- Sprint overdue: −20
- Declining velocity (`down` trend): −10

## Status mapping

| Score | Status |
|-------|--------|
| ≥ 80 | `good` |
| ≥ 60 | `warning` |
| ≥ 40 | `at_risk` |
| < 40 | `critical` |

## Output

API returns blocked/overdue counts, utilization %, recommendation text, and summary MD figures. Surfaced on sprint cards (`executive_health`) and sprint detail (`health_summary`).
