Skip to content

feat: upload eval-results.json to Braintrust (AI-921) - #89

Closed
Rodriguespn wants to merge 3 commits into
mainfrom
pedrorodrigues/ai-921-store-eval-results-in-braintrust
Closed

feat: upload eval-results.json to Braintrust (AI-921)#89
Rodriguespn wants to merge 3 commits into
mainfrom
pedrorodrigues/ai-921-store-eval-results-in-braintrust

Conversation

@Rodriguespn

@Rodriguespn Rodriguespn commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Adds pnpm upload:braintrust, a script that reads the existing eval-results.json snapshot and mirrors it into Braintrust experiments so we can trial their built-in comparison/leaderboard UI. No eval runs, no schema changes — just the upload.

Mapping (one Braintrust experiment per result-file experiment / Configuration, one event per eval):

  • id ← eval id (stable, so --update re-logs the same row)
  • input{ eval, prompt }
  • output{ passed, checks }
  • scores{ passed: 0|1, checkPassRate: 0..1 } (numeric + comparable across evals)
  • metadata ← everything else, with experimentDisplay flattened to top-level keys (agent, modelProvider, modelId, reasoningEffort) so they're usable as Braintrust grouping axes
  • tags ← product + topic + interface + experimentSuite

The eval-refresh workflow gains a best-effort Upload results to Braintrust step. It:

  • runs only on manual workflow_dispatch refreshes (so label-triggered PR runs don't push preview data into the shared project),
  • is skipped unless the BRAINTRUST_API_KEY secret is configured,
  • is continue-on-error: true, so the existing JSON-commit path stays authoritative.

New commands

pnpm upload:braintrust             # upload default snapshot
pnpm upload:braintrust -- --dry    # map + print, no network (no key needed)
pnpm upload:braintrust -- --update # append to existing named experiments

Follow-up: add the BRAINTRUST_API_KEY repo secret to actually enable the CI step.

Closes AI-921.

Adds a pnpm upload:braintrust command that mirrors the exported
eval-results.json snapshot into Braintrust experiments (one experiment per
Configuration, one event per eval; passed/checkPassRate as scores, everything
else as metadata/tags) to trial Braintrust's comparison UI.

Wires a best-effort, secret-gated upload into the eval-refresh workflow,
limited to manual workflow_dispatch refreshes so the committed JSON stays
authoritative and PR-preview runs don't pollute the shared project.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jul 14, 2026

Copy link
Copy Markdown
AI-921 Store eval results in Braintrust instead of eval-results.json

Leverage Braintrust Experiments to store our eval results instead of the committed apps/web/src/data/eval-results.json file.

This changes how we run CI today: the eval-refresh workflow currently exports and commits eval-results.json — that step would upload runs to Braintrust instead of (or in addition to) committing the JSON.

First step: upload the existing eval-results.json to Braintrust as-is (the current schema maps cleanly onto experiments/scores/metadata).

Review in Linear

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
evals Ignored Ignored Preview Jul 14, 2026 5:10pm

Request Review

@Rodriguespn
Rodriguespn marked this pull request as draft July 14, 2026 16:40
Rodriguespn and others added 2 commits July 14, 2026 18:10
Extract the pure snapshot→Braintrust mapping (scoresFor, tagsFor, metadataFor,
experimentMetadata, groupByExperiment, isResultRow) into lib/braintrust-mapping.ts
and cover it with vitest. Runs credential-free as part of `pnpm check`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Rodriguespn

Copy link
Copy Markdown
Contributor Author

Closing this in favor of #101

@raulb
raulb deleted the pedrorodrigues/ai-921-store-eval-results-in-braintrust branch July 29, 2026 11:10
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