Skip to content

fix(viewer): show scenario run model labels#120

Merged
jakepresent merged 2 commits into
mainfrom
fix/scenario-run-header-models
May 28, 2026
Merged

fix(viewer): show scenario run model labels#120
jakepresent merged 2 commits into
mainfrom
fix/scenario-run-header-models

Conversation

@jakepresent

Copy link
Copy Markdown
Collaborator

Summary

  • Falls back from prompt metrics to scenario metrics when rendering the run header model labels
  • Uses the scenario tester model as the evaluation target label when scenario scores do not carry a separate target field
  • Adds a small Node-backed regression test for scenario metric labels

Validation

  • python -m pytest tests/test_viewer_metrics.py tests/test_viewer_run_page_server.py -q
  • Browser checked the Scenarios tab for the PR science: sync structured systematization output #111 smoke run locally and confirmed: Evaluation target: azure/gpt-5.4-1 · Judge: azure/gpt-5.4-1
  • npm --prefix viewer run check still has the existing unrelated PrimerPagination.svelte and routes/+page.svelte diagnostics

Copilot AI review requested due to automatic review settings May 28, 2026 18:24

Copilot AI 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.

Pull request overview

Updates the viewer’s run header to correctly display model labels for scenario-only runs by falling back to scenario (audit) metrics when prompt metrics don’t provide labels, and ensures scenario metrics provide a usable target label.

Changes:

  • Render run header model labels using prompt metrics when present, otherwise fall back to scenario/audit metrics.
  • In scenario/audit metrics computation, fall back from target to tester_model for the target label.
  • Add a Node-backed regression test covering the scenario/audit target-label fallback behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
viewer/src/routes/suite/[suite_id]/[run_id]/+page.svelte Uses falsy-aware fallbacks so empty-string prompt metrics don’t block scenario label rendering.
viewer/src/lib/server/metrics.ts Sets audit target to fall back to tester_model when target is missing.
tests/test_viewer_metrics.py Adds regression coverage for the audit target-label fallback via a Node TypeScript harness.

Comment thread tests/test_viewer_metrics.py Outdated
Comment on lines +31 to +37
with TemporaryDirectory() as tmp_dir:
harness_dir = Path(tmp_dir)
source = METRICS_SRC.read_text(encoding="utf-8")
source = source.replace("from '$lib/judgment.js';", "from './judgment.js';")
source = source.replace("from './dimensions.js';", "from './dimensions.js';")
(harness_dir / "metrics.ts").write_text(source, encoding="utf-8")
(harness_dir / "judgment.js").write_text(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in the latest push by creating the temporary harness under viewer/, so Node sees the package ESM settings. Re-ran python -m pytest tests/test_viewer_metrics.py tests/test_viewer_run_page_server.py -q and git diff --check.

@AaronAspinwall123

Copy link
Copy Markdown
Collaborator

Do you have a screenshot of what changed??

@jakepresent

Copy link
Copy Markdown
Collaborator Author

Do you have a screenshot of what changed??

Before:
image

After:
image

@jakepresent jakepresent merged commit c625f0e into main May 28, 2026
1 check 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.

4 participants