promptdojo_

A gate that can't fail isn't a gate — step 6 of 7

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 gates in order. Each gate has name, metric, threshold; each metric's measured value is in scores.
  • Prints "<name>: pass" when scores[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

full-screen editor opens — close anytime to keep reading.