Gate AI changes on a versioned evaluation suite
A prompt or model change can improve an average while breaking one critical safety or business contract. Keep case identities stable and compare candidate results against the required suite, not merely against the cases the candidate happened to produce.
This exercise requires every named case to pass and separately checks token and latency budgets. It treats missing cases as failures and retains reasons for review. A deterministic gate is not a substitute for representative test cases, adversarial evaluation or human judgment. Do not tune repeatedly on the only evaluation set and then report it as untouched evidence.
required={"retrieval","authorization"}
results={"retrieval":True}
print(sorted(required-set(results)))Review the design
The gate enforces an explicit suite and operational budgets. Its coverage depends on the case set and evidence quality; real model behavior still needs provider-backed evaluation and regression monitoring.
Your task
Implement ai_release_reasons(required,results,tokens,latency,max_tokens,max_latency). Return sorted "case:key" for missing or non-True required results, then tokens and latency when over budget. Negative or nonfinite usage gives ["invalid usage"].
The explanation opens here once every check passes.