Context
Each @evaluator returns a dataclass whose fields are tagged Verdict / Metric / Reason. If two evaluators attached to the same EvalCase expose a field with the same name (e.g. both declare ok: Annotated[bool, Verdict]), their scores collide. The current workaround is a bespoke dataclass per evaluator with globally-unique field names (count_ok/count_detail, alert_ok/alert_detail, shared_key_ok/shared_key_detail, …).
Impact
- You discover the rule only by hitting a collision, not from the API.
- It forces verbose, prefix-namespaced field names everywhere, which leaks the evaluator's identity into its result schema (every evaluator reinvents
<name>_ok / <name>_detail).
Suggestion
Namespace scores by the evaluator's name automatically (e.g. count_matching.ok, alert_emitted.ok), so two evaluators can both use plain ok / detail. Failing that, raise an explicit error at registration/run time when two evaluators on the same case declare the same score name.
Note
If the constraint is intended, a loud error at collision time (instead of a silent overwrite) would already remove the papercut — the dangerous case is two evaluators silently clobbering each other's verdict.
Context
Each
@evaluatorreturns a dataclass whose fields are taggedVerdict/Metric/Reason. If two evaluators attached to the sameEvalCaseexpose a field with the same name (e.g. both declareok: Annotated[bool, Verdict]), their scores collide. The current workaround is a bespoke dataclass per evaluator with globally-unique field names (count_ok/count_detail,alert_ok/alert_detail,shared_key_ok/shared_key_detail, …).Impact
<name>_ok/<name>_detail).Suggestion
Namespace scores by the evaluator's name automatically (e.g.
count_matching.ok,alert_emitted.ok), so two evaluators can both use plainok/detail. Failing that, raise an explicit error at registration/run time when two evaluators on the same case declare the same score name.Note
If the constraint is intended, a loud error at collision time (instead of a silent overwrite) would already remove the papercut — the dangerous case is two evaluators silently clobbering each other's verdict.