TS verdict metrics credit out-of-vocabulary verdicts as passing (prompt-alignment, role-violation)
Author: kittimzheCreated Sep 29, 2026Updated Sep 29, 2026
Spun out of the review on #3359 (found by @shaurya416 there), where it's out of scope because it's a different seam: not how many items were judged, but which verdicts count as passing.
In the TypeScript metrics, verdict schemas are z.string() and the passing test is string inequality:
prompt-alignment: a verdict passes when it is!== "no", so"n/a"(or any out-of-vocabulary string) counts as a pass.role-violation: a verdict fails only when it is=== "yes", so"n/a"also counts as a pass.
Python's score_qag_verdicts only credits verdicts that normalize into the passing set; anything out of vocabulary contributes nothing. So the same judge response can score differently across the two SDKs.
Two candidate directions (not mutually exclusive):
- Tighten the schemas to enums (e.g.
z.enum(["yes", "no"])or per-metric variants) so out-of-vocabulary verdicts fail schema validation and surface as errors rather than silent passes. - Keep
z.string()but normalize verdicts through a shared helper before scoring, mirroring Python, so OOV strings contribute nothing.
Option 1 changes failure behavior (loud vs silent); option 2 keeps it silent but consistent. Happy to prototype either once there's a preference.
Source: confident-ai/deepeval