When a task is tried several times, two questions have different answers:
- pass@k: the chance that at least one of k tries succeeds. Right for a coding helper, where a developer can pick the working suggestion.
- pass^k (pass hat k): the chance that all k tries succeed. Right for an agent that acts on customers' money, where every run must be right.
From c successes in n trials: pass@k = 1 − C(n−c, k) / C(n, k), and pass^k = C(c, k) / C(n, k).
A high average can still hide a case that must never fail. Gates need hard fails: any failure on a case marked severity "hard" blocks the release, whatever the pass rate.
Your task
- Implement both metrics in
metrics.py. - Choose which metric fits each product.
- Change
gate.pyso a failed hard case blocks the release even when the pass rate is above 90%.