Skip to content

[API-394] Preserve metric output result details in CLI#92

Merged
callumreid merged 1 commit into
mainfrom
callum/cli-metric-output-result-json
Jul 7, 2026
Merged

[API-394] Preserve metric output result details in CLI#92
callumreid merged 1 commit into
mainfrom
callum/cli-metric-output-result-json

Conversation

@callumreid

@callumreid callumreid commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve metric-output metric_version_ulid, explanation, result, runtime_metadata, and subvalue cap metadata in CLI models
  • keep default metric tables compact while exposing full rubric decision-tree payloads in JSON, metric-detail, and agent output
  • add CLI tests for critical/non-critical failure arrays on metric outputs

Validation

  • cargo fmt --check
  • cargo clippy -- -D warnings
  • cargo test --test cli_tests metric
  • live smoke: coval conversations metric-detail 4pFHrsBUtdW7eZukeFvfyw 01KRD3AX13QZY9BXR2RV1SRY0G against Chime API key preserved result.raw_values.critical_failures count 1 and non_critical_failures count 1

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The SimpleMetricOutput struct in the client model was extended with five new optional fields: explanation, subvalues_by_timestamp_truncated, subvalues_by_timestamp_total_count, result, and runtime_metadata, along with an updated serde attribute for metric_version_ulid to skip serialization when None. Corresponding CLI test mocks and assertions in tests/cli_tests.rs were updated across three tests (simulations metrics with subvalues, simulation metric detail by ULID, and conversation metric detail by metric id) to include these new fields in mock responses and to validate them via structured JSON parsing instead of stdout substring checks.

Changes

Cohort / File(s) Summary
Model (src/client/models/simulation.rs) Added explanation, subvalues_by_timestamp_truncated, subvalues_by_timestamp_total_count, result, runtime_metadata optional fields to SimpleMetricOutput; updated metric_version_ulid serde attribute to skip serializing when None.
Tests (tests/cli_tests.rs) Expanded mock payloads for three tests to include new fields and structured result.raw_values/runtime_metadata; switched assertions from stdout substring checks to JSON parsing with exact value assertions.

Suggested reviewers: kdmelon, borgesius

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: preserving metric output details in the CLI.
Description check ✅ Passed The description matches the changeset by describing the added metric fields and updated CLI tests.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@callumreid callumreid force-pushed the callum/cli-metric-output-result-json branch from 84ec34c to d490db5 Compare July 7, 2026 19:18
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown

Greptile Summary

This PR preserves more metric output details in the CLI. The main changes are:

  • Added optional metric version, explanation, result, runtime metadata, and subvalue cap fields to metric output models.
  • Kept compact table output while preserving full data in JSON and agent-style serialization paths.
  • Added CLI tests for critical and non-critical failure arrays in metric outputs.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Reviews (2): Last reviewed commit: "Preserve metric output result details" | Re-trigger Greptile

@callumreid callumreid merged commit f08539e into main Jul 7, 2026
8 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.

2 participants