Skip to content

Render metric lists as bulleted sections; ignore .worktrees/#32

Merged
joalves merged 3 commits into
mainfrom
improve/experiment-summary-metric-rendering
May 11, 2026
Merged

Render metric lists as bulleted sections; ignore .worktrees/#32
joalves merged 3 commits into
mainfrom
improve/experiment-summary-metric-rendering

Conversation

@joalves
Copy link
Copy Markdown
Collaborator

@joalves joalves commented May 11, 2026

Summary

  • Restructure experiments get -o rendered so secondary_metrics, guardrail_metrics, and exploratory_metrics are emitted as their own ## sections with one bullet per metric instead of being squashed into a comma-separated table cell.
  • Add .worktrees/ to .gitignore.

Test plan

  • node dist/index.js experiments get <id-with-metrics> -o rendered — verify the metrics sections render as bullets and the key/value table no longer contains those rows.
  • node dist/index.js experiments get <id-without-metrics> -o rendered — verify no empty metric sections appear.

Summary by CodeRabbit

Release Notes

  • Improvements
    • Experiment summary tables now display metrics in dedicated sections below the table for improved readability and clarity.

Review Change Stack

joalves added 3 commits April 29, 2026 21:48
…o rendered`

Pull secondary_metrics, guardrail_metrics, and exploratory_metrics out of the
key/value table and emit each as its own `##` section with one bullet per
metric, so the metric names stay readable instead of being squeezed into a
single comma-separated table cell.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Walkthrough

The experiment summary table construction in the get command now separates the handling of metric-list fields (secondary_metrics, guardrail_metrics, exploratory_metrics) from regular fields. During table iteration, metric values are collected into a deferred accumulator. After the table is rendered, these deferred metric fields are each output as a separate markdown section with a titled heading and bullet-point list of individual metrics split from the comma-separated values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A table once cluttered with metrics so long,
Now defers to the fields where they truly belong—
Sectioned, titled, and bulleted with care,
Experiments rendered with elegance rare! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main changes: restructuring metric list rendering as bulleted sections and adding .worktrees/ to .gitignore.
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.

✏️ 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 improve/experiment-summary-metric-rendering

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/commands/experiments/get.ts`:
- Around line 107-112: The metric-splitting logic in the deferredMetrics loop
(variables key, val, label, lines) uses val.split(', ') which fails for
different spacing and leaves empty items for trailing commas; replace that with
splitting on a regex that trims spaces around commas (e.g.
val.split(/\s*,\s*/)), then map each item to .trim() and filter out empty
strings (e.g. .filter(Boolean)) before pushing bullets so inputs like "a,b", "a,
b", or "a," produce correct non-empty metric lines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a50cf011-0bc4-45ec-a140-c535112a4c5b

📥 Commits

Reviewing files that changed from the base of the PR and between 647f911 and 64a9e4a.

📒 Files selected for processing (1)
  • src/commands/experiments/get.ts

Comment on lines +107 to +112
for (const { key, val } of deferredMetrics) {
const label = key.replace(/_/g, ' ');
lines.push(`## ${label.charAt(0).toUpperCase() + label.slice(1)}`);
for (const metric of val.split(', ')) {
lines.push(`- ${metric}`);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Make metric splitting resilient to spacing/trailing separators.

At Line 110, split(', ') only handles a comma followed by exactly one space. Values like a,b or a, b won’t split correctly, and trailing commas can generate empty bullets.

Proposed fix
 for (const { key, val } of deferredMetrics) {
   const label = key.replace(/_/g, ' ');
   lines.push(`## ${label.charAt(0).toUpperCase() + label.slice(1)}`);
-  for (const metric of val.split(', ')) {
+  for (const metric of val.split(/\s*,\s*/).map((m) => m.trim()).filter(Boolean)) {
     lines.push(`- ${metric}`);
   }
   lines.push('');
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for (const { key, val } of deferredMetrics) {
const label = key.replace(/_/g, ' ');
lines.push(`## ${label.charAt(0).toUpperCase() + label.slice(1)}`);
for (const metric of val.split(', ')) {
lines.push(`- ${metric}`);
}
for (const { key, val } of deferredMetrics) {
const label = key.replace(/_/g, ' ');
lines.push(`## ${label.charAt(0).toUpperCase() + label.slice(1)}`);
for (const metric of val.split(/\s*,\s*/).map((m) => m.trim()).filter(Boolean)) {
lines.push(`- ${metric}`);
}
🤖 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 `@src/commands/experiments/get.ts` around lines 107 - 112, The metric-splitting
logic in the deferredMetrics loop (variables key, val, label, lines) uses
val.split(', ') which fails for different spacing and leaves empty items for
trailing commas; replace that with splitting on a regex that trims spaces around
commas (e.g. val.split(/\s*,\s*/)), then map each item to .trim() and filter out
empty strings (e.g. .filter(Boolean)) before pushing bullets so inputs like
"a,b", "a,  b", or "a," produce correct non-empty metric lines.

@joalves joalves added this pull request to the merge queue May 11, 2026
Merged via the queue into main with commit 957789b May 11, 2026
5 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.

1 participant