Skip to content

Give rubric_based_* metrics a public rubric path (#132) - #229

Merged
krisztianfekete merged 7 commits into
agentevals-dev:mainfrom
erauner12:rubrics-public-path
Oct 13, 2026
Merged

krisztianfekete merged 7 commits into
agentevals-dev:mainfrom
erauner12:rubrics-public-path

Conversation

@erauner12

@erauner12 erauner12 commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Rubric-based response quality can now be configured through the public evaluation path, with identifiable property results. The shared plumbing also supports the existing tool-use rubric metric. Closes #132.

Rebased onto current main, including the conversation model, case matching and tool-declaration enrichment from #234.

Behavior

  • Config accepts named {id, text} properties or strings with positional IDs. It has no rubric type field, and supplied properties survive judge/threshold overrides.
  • The matched EvalCase supplies case and invocation rubrics. Their explicit ADK types are preserved: case properties apply to every invocation, while invocation properties apply to that invocation. Untyped inputs are reported by ID and location without assigning a type.
  • Missing applicable properties and conflicting effective IDs are reported before calling the judge.
  • Serialized details preserve property IDs, scores, explanations and actual invocation identity. Valid negative scores remain distinct from ungraded results.
  • Unset rubrics are omitted from MCP evaluator overrides. API metadata enables the two supported rubric metrics and leaves the conversation rubric evaluator unavailable.

This retains ADK scoring semantics. Whole-conversation rubric support and new turn-aware expectations are follow-up work. The docs explain why completion requirements belong on the intended invocation and why the last observed response may correctly be a clarification question.

Validation

At a5e39b9: 1,674 model-free tests passed, 8 skipped and 18 e2e tests deselected; Ruff check and formatting passed. Regression tests cover config, matched-case and invocation inputs, both existing rubric metrics, overrides, typed/untyped/mixed properties, unusable inputs, and serialized property results. No live model calls were made.

Non-trivial AI assistance was used for implementation and test drafting.

@erauner12 erauner12 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this draft on a few real multi-turn traces and left three notes on behavior that seems worth deciding before the design is finalized. The rubric input path itself works but the main open questions are how case-level rubrics should apply across invocations, and whether tool declarations should be handled here or in a separate follow-up.

My preference is final-invocation-only behavior or an explicit applies_to option, but I’m happy to follow the maintainers’ direction. The per-rubric result shape stays the same either way, so downstream consumers are not blocked on that decision.

Comment thread src/agentevals/builtin_metrics.py Outdated
Comment thread src/agentevals/builtin_metrics.py Outdated
Comment thread docs/eval-set-format.md Outdated

@krisztianfekete krisztianfekete left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, and for testing it on real multi-turn traces, that was really useful!

The approach is what I had in mind around this use-case, so let's get it in. A few things before merge:

  1. Tool declarations: already fixed on main by #234. Every builtin metric now goes through _enrich_app_details, so a rebase picks it up and no follow-up is needed.
  2. CI: test_evaluate_sessions_posts_builtin_evaluator_overrides now sees 'rubrics': None in the payload. Either updating the expectation or not sending the unset field is fine.
  3. Rubric types: ADK drops case and invocation rubrics with no type, but this PR gives them the metric's type. Let's match ADK, and have your pre-check list any untyped rubrics that would be dropped.
  4. type on RubricDef: ADK never filters criterion rubrics by type, so this field has no effect. Let's drop it, which also keeps ADK enum values out of the config.
  5. applies_to: let's go with option 1 for now (ADK parity plus your doc note). I'm working on a turn-aware expectations format where "final turn only" will be first-class, and I'd love your input on it when it's up.

@erauner12 erauner12 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback @krisztianfekete! I’ll rebase onto current main, address the config and CI issues, and retain ADK parity. I’ll add regression coverage for the public rubric path, including stable property IDs, per-invocation scores and explanations, and clear handling of unusable rubric inputs.

I’d also like to contribute synthetic clarification, completion, and correction examples to the turn-aware expectations work, including cases that intentionally end at a clarification request. Please tag me on that issue/PR when you have it ready :)

Comment thread src/agentevals/runner.py
Comment thread src/agentevals/custom_evaluators.py
Comment thread src/agentevals/builtin_metrics.py
Comment thread src/agentevals/config.py
Comment thread docs/eval-set-format.md
Comment thread tests/test_rubrics.py
The rubric-based metrics have been reachable only through the internal
build_eval_metric(..., rubrics=...) call: the metric builder accepted
rubrics, the eval-set format documented them on cases and invocations,
and nothing on the config, CLI or API path passed any of them through,
so the metrics were listed as not working.

Rubrics can now be declared on a builtin evaluator in the eval config,
as {id, text} mappings or plain strings with positional ids, with
duplicate ids refused. At run time the runner matches the eval case,
not only its conversation, and the matched case's rubrics and each
expected invocation's rubrics are attached to the actual invocations
the way ADK's own eval service attaches them, with the metric's rubric
type given to rubrics that have none, since ADK applies invocation
rubrics by type. A rubric metric with no rubric from the config, the
case or an invocation reports an error before any judge call rather
than an empty evaluation. Its result carries per-rubric scores per
invocation and overall in details. The API lists the rubric metrics as
working.
@erauner12
erauner12 force-pushed the rubrics-public-path branch from a123284 to ff6e970 Compare October 12, 2026 17:24
@erauner12
erauner12 marked this pull request as ready for review October 12, 2026 17:32

@krisztianfekete krisztianfekete left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, one small thing before merge:

  • could you please replace METRICS_NEEDING_RUBRICS with a single RUBRIC_METRIC_TYPES dict in config.py and use it everywhere?

The two metric names are repeated in mltipleplaces right now. It also lets BuiltinMetricDef reject rubrics on other metrics, which currently accept them and quietly ignore them.

I'll add rubrics to the gRPC contract in #251 once this is in.

@krisztianfekete

Copy link
Copy Markdown
Contributor

Merged #251 and pushed the conflict fix plus the RUBRIC_METRIC_TYPES change to your branch, along with the rubrics field on the gRPC contract. Thanks for your patience, merging once CI is green!

@krisztianfekete
krisztianfekete merged commit 0e639bc into agentevals-dev:main Oct 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify supported rubric input path for rubric_based_* metrics

2 participants