fix(evaluator-sdk): persist metric diagnostics on the success path#791
fix(evaluator-sdk): persist metric diagnostics on the success path#791SandyChapman wants to merge 1 commit into
Conversation
_score_metric built the completed AgentEvalTaskScore without diagnostics, so a metric's own diagnostics (e.g. per-criterion LLM-judge verdicts) were dropped on success while the failure path recorded them. Convert MetricResult.diagnostics to AgentEvalDiagnostic(severity=info, source=metric) on the success path too. Includes the re-vendored SDK mirror and a test. Signed-off-by: Sandy Chapman <schapman@nvidia.com>
📝 WalkthroughWalkthroughSuccessful metric diagnostics are now converted into ChangesMetric diagnostics persistence
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/nemo_evaluator_sdk/tests/agent_eval/test_evaluator.py (1)
454-468: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winExercise the
scores.jsonlpersistence path.This test only inspects
result.scores; it never configuresoutput_diror readsscores.jsonl. Add a temporary output directory and assert the serialized diagnostic fields so a JSONL persistence regression cannot pass unnoticed.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/nemo_evaluator_sdk/tests/agent_eval/test_evaluator.py` around lines 454 - 468, Add an output directory to test_success_metric_diagnostics_are_persisted using the test’s temporary-directory fixture, then read the generated scores.jsonl and assert the persisted diagnostic’s severity, message, source, and details fields. Keep the existing in-memory score assertions while ensuring the test exercises the JSONL serialization path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/nemo_evaluator_sdk/tests/agent_eval/test_evaluator.py`:
- Around line 454-468: Add an output directory to
test_success_metric_diagnostics_are_persisted using the test’s
temporary-directory fixture, then read the generated scores.jsonl and assert the
persisted diagnostic’s severity, message, source, and details fields. Keep the
existing in-memory score assertions while ensuring the test exercises the JSONL
serialization path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c71f9196-94f8-48c9-8b8e-9a4c6c4b03e6
⛔ Files ignored due to path filters (1)
sdk/python/nemo-platform/src/nemo_platform/beta/evaluator/agent_eval/evaluator.pyis excluded by!sdk/**
📒 Files selected for processing (2)
packages/nemo_evaluator_sdk/src/nemo_evaluator_sdk/agent_eval/evaluator.pypackages/nemo_evaluator_sdk/tests/agent_eval/test_evaluator.py
|
What
The evaluator's success path (
_score_metric) built the completedAgentEvalTaskScorewithoutputs=...but omitteddiagnostics, so a metric's own diagnostics were silently dropped on success — while the failure path (_failed_metric_score) recorded them. This convertsMetricResult.diagnostics→AgentEvalDiagnostic(severity=info, source=metric_type)on the success path too, so they persist toscores.jsonl.Why
Metrics that surface component-level detail (e.g. per-criterion LLM-judge verdicts + reasoning) had that signal computed and then discarded on success. This is the mechanism for surfacing it.
Tests
New
test_success_metric_diagnostics_are_persisted; the existingdiagnostics == []assertion for a no-diagnostics metric still holds. Includes the re-vendored SDK mirror (sdk/python/nemo-platform/...).Summary by CodeRabbit