feat(evaluator): Update publish_to_intake to record latency + tokens - #1207
Merged
Conversation
Signed-off-by: shanaiabuggy <59746633+shanaiabuggy@users.noreply.github.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughTrial publishing now maps token measurements to ATIF final metrics and runtime measurements to invocation end timestamps. The ingestion mapping preserves existing output when no runtime is recorded. Tests cover populated and empty measurements. ChangesTrial ATIF telemetry
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Contributor
|
Contributor
Author
|
@coderabbitai full review |
Contributor
✅ Action performedFull review finished. |
SandyChapman
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
publish_to_intakepreviously emitted a stub single-step trajectory with no telemetry, so evaluations published from nemo-evaluator showed no token counts and a0mslatency. This wires each trial's recorded token usage and runtime into the ATIF payload so Intake's rollup captures them:final_metrics, which Intake promotes onto the trajectory's root span (attributes_number) — exactly what the evaluation rollup sums intotokens.started_at → started_at + runtime_sec) on the step, so the root span'send − startis the trial's runtime instead of0.Metrics are emitted only when the harness actually recorded them — a trial with no usage/runtime yields no
final_metricsand no window, so latency reads as unmeasured rather than a misleading0ms. Cost is still not captured (there is no per-trial cost source in the trial measurements yet).Related Issue
Follow-up to the evaluator → Intake publish path: closes the token/latency capture gap the initial stub deferred. (No Linear issue linked; add one if applicable.)
Changes
intake/publish.py— project each trial'sTrialMeasurements(fromtrial.metadata) once: build ATIFfinal_metricsfrom its token fields (_token_final_metrics), and deriveended_at = started_at + runtime_secwhen a runtime was recorded; pass both totrial_to_atif_ingest.intake/mapping.py—trial_to_atif_ingestgains an optionalended_at; when set, it attaches a NAT invocation window (extra["invocation"]with epoch-secondstart_timestamp/end_timestamp) to the step. Purely additive — no change whenended_atis absent.started_atstays the window start andruntime_secis a stable recorded value, so the root span's id andstart_timedon't change on re-publish.test_publish.py) and invocation-window presence/absence (test_mapping.py).No API or schema change:
AtifFinalMetricsParamand the stepextrafield already exist in the SDK types, so no OpenAPI/SDK regen.Type of Change
Quality Gates
Verification
Signed-off-by:traileruv run pre-commit run -apasses, or any blocked checks are identified belowTargeted validation (targeted checks run locally, not the full pre-commit sweep):
uv run --frozen pytest plugins/nemo-evaluator/tests/intake/test_publish.py plugins/nemo-evaluator/tests/intake/test_mapping.py→ 35 passeduv run --frozen ty check plugins/nemo-evaluator/src/nemo_evaluator/intake/{publish,mapping}.py→ cleanuv run ruff check→ clean🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests