PythiloLesson 11 of 12 · progress kept in this browser

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)))
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"].