The deploy pipeline runs every gate and prints a receipt for each — not just the final verdict, because "BLOCK" with no named culprit starts an hour of archaeology.
Write run_gates(gates, scores) that:
- Loops over
gatesin order. Each gate hasname,metric,threshold; each metric's measured value is inscores. - Prints
"<name>: pass"whenscores[metric] >= threshold. - Prints
"<name>: FAIL (<score> < <threshold>)"otherwise. - Returns
"SHIP"if every gate passed, else"BLOCK".
Expected output:
accuracy-floor: pass
schema-valid: pass
helpfulness: FAIL (0.84 < 0.9)
BLOCK