Python: assert_dimension_score_at_least passes vacuously when evaluator/dimension filter matches nothing or results are empty
Observed Behavior
assert_dimension_score_at_least and assert_score_at_least in python/packages/core/agent_framework/_evaluation.py pass vacuously when the filter matches nothing: an unknown evaluator name or dimension_id, or an empty EvalResults (zero items), leaves the assertion a no-op instead of failing the run.
evaluator="typo"on an empty result set: the empty-missing_itemspath underrequire_applicable=Trueskips both the not-applicable report and the no-scores check.evaluatorfilter that matches no scores on a non-empty result set:matching_scores_count == 0only raises whenevaluator is not None— but the dimension-only form (dimension_idthat matches no scores) raises nothing.- Zero-item
EvalResultswith no evaluator:dimension_seenis never set, and the same empty-missing_itemspath bypasses the check.
Expected Behavior
A filter (evaluator or dimension) that matches no scores should fail the assertion — mirroring what #10180 established for assert_score_at_least's evaluator filter — and an empty result set should not silently satisfy assert_dimension_score_at_least under require_applicable=True.
Minimal Reproduction
from agent_framework import EvalResults
# no exception on current main:
assert_dimension_score_at_least(EvalResults(items=[]), dimension_id="accuracy", score=0.5)
Additional Context
An implementation with red-green tests was previously posted in #10199 (closed for arriving without an agreed issue — resubmitting a fresh PR once this one is agreed).
Hi! I'd like to contribute to this issue.
I understand that PR #10199 was closed because the implementation was submitted before the issue was agreed upon. I'd like to make sure I follow the project's contribution process.
Would it be okay for me to work on this issue and submit a fresh PR with regression tests covering:
- Unknown evaluator names
- Unmatched dimension IDs
- Empty evaluation results
I'm comfortable working with Python and would be happy to take this up once the proposed approach is approved. Thank you!