Skip to content

feat: add subvalue by timestamp to CLI#49

Merged
kdmelon merged 1 commit into
mainfrom
dakota/hr-148-add-subvalue-by-timestamp-to-cli
Mar 23, 2026
Merged

feat: add subvalue by timestamp to CLI#49
kdmelon merged 1 commit into
mainfrom
dakota/hr-148-add-subvalue-by-timestamp-to-cli

Conversation

@kdmelon

@kdmelon kdmelon commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • New Features
    • Metrics now support timestamped subvalues, enabling detailed tracking of output values across specific time intervals.
    • Metric output tables display counts of timestamped subvalue entries for improved visibility into simulation results.

@kdmelon kdmelon changed the title [HR-148] add subvalue by timestamp to CLI feat: add subvalue by timestamp to CLI Mar 21, 2026
@coderabbitai

coderabbitai Bot commented Mar 21, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

A new SubvalueByTimestamp struct was introduced to represent timestamped metric subvalues, and the SimpleMetricOutput struct was extended with an optional collection of these subvalues. The tabular display was updated to show the count of subvalues when present.

Changes

Cohort / File(s) Summary
Metric Subvalue Support
src/client/models/simulation.rs
Added new SubvalueByTimestamp struct with temporal and value fields (start/end offsets, output type, float/string values, optional role and message index). Extended SimpleMetricOutput with optional subvalues_by_timestamp field and updated Tabular implementation to display subvalue counts in a new column.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Hop along through time we go,
Subvalues marked from high to low,
With timestamps dancing, hand in hand,
Our metrics now more rich and grand!
✨ A structured gift for data's flow.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add subvalue by timestamp to CLI' directly and clearly describes the main change: adding a subvalue by timestamp feature to the CLI.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dakota/hr-148-add-subvalue-by-timestamp-to-cli

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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/client/models/simulation.rs (1)

173-176: Consider simplifying the count formatting.

Using format!("{}", sv.len()) is slightly verbose. A more idiomatic approach would be sv.len().to_string().

♻️ Suggested simplification
             self.subvalues_by_timestamp
                 .as_ref()
-                .map(|sv| format!("{}", sv.len()))
+                .map(|sv| sv.len().to_string())
                 .unwrap_or_else(|| "-".into()),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/client/models/simulation.rs` around lines 173 - 176, Replace the verbose
formatting in the closure that maps self.subvalues_by_timestamp to a string:
instead of using format!("{}", sv.len()) use sv.len().to_string() to produce the
count; update the closure on self.subvalues_by_timestamp (the map(|sv| ... )
block) so it returns sv.len().to_string() and leave the unwrap_or_else branch
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/client/models/simulation.rs`:
- Around line 173-176: Replace the verbose formatting in the closure that maps
self.subvalues_by_timestamp to a string: instead of using format!("{}",
sv.len()) use sv.len().to_string() to produce the count; update the closure on
self.subvalues_by_timestamp (the map(|sv| ... ) block) so it returns
sv.len().to_string() and leave the unwrap_or_else branch unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8508836b-8c88-4f39-a512-bfeb8b0e979b

📥 Commits

Reviewing files that changed from the base of the PR and between bac5137 and 6b96ec9.

📒 Files selected for processing (1)
  • src/client/models/simulation.rs

@kdmelon kdmelon merged commit c56dc5e into main Mar 23, 2026
7 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