feat: add external eval result storage#204
Merged
Merged
Conversation
85192ed to
3db10dc
Compare
Contributor
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Three blockers surfaced during merge-readiness review: 1. Inconsistent redactStoredResponses defaults between the eval runner and the reporter. The runner store path used `redactStoredResponses ?? omitResponsesFromBaseline` (effective default true via fallback), while MCPReporter passed the option through unset, producing falsy-undefined behavior (effective default false). Users with both write paths configured received a mix of redacted and non-redacted artifacts depending on which code path wrote them — silent data inconsistency. Both sites now default to true with explicit `?? true` and the intent is documented inline. To opt into stored responses, pass `redactStoredResponses: false` on the matching site. 2. loadStoredEvalRunnerResult returned `Promise<EvalRunnerResult>` but the documented usage accessed `loaded.metadata?.toolOverrideVariantId` — a field that lives on the storage envelope, not on the runtime result. The optional-chain hid the type error at compile time and the test relied on `metadata` happening to be present on the runner result, which is not where the production save path puts it. Changed the return type to `Promise<StoredEvalArtifact<EvalRunnerResult>>`. Callers now access the runtime data via `loaded.data` and storage metadata (run id, timestamp, package version, tool-override variant id, git hash, etc.) via `loaded.metadata`. Snippet, docs, and test updated to match. 3. GCSEvalResultStore had only two tests (saveArtifact and loadLatestArtifact). The immutable load path (loadArtifact by id) and the listArtifacts pagination/limit path were untested. Both are now covered with nock-mocked HTTP fixtures, including assertions that listArtifacts excludes latest.json from the listing and excludes non-JSON files (partial uploads, etc.). The missing-package error path is left for a follow-up — testing it properly requires either refactoring GCSEvalResultStore.getBucket to accept an injectable importer, or scoped vi.doMock that doesn't contaminate sibling tests. Both are non-trivial enough to defer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
aditya-scio
reviewed
Jun 15, 2026
There was a problem hiding this comment.
Really like this separation. Making result storage a first-class interface, while preserving the old file-path workflows, is the right compatibility story. One small follow-up I’d make sure lands is the redactStoredResponses doc/default cleanup so the docs match runtime behavior.
Resolve additive type re-export conflicts in src/index.ts and src/types/index.ts by keeping both the result-store exports (SaveEvalRunComparisonOptions, StoredEvalRunRef) and main's variantExperiment exports. Also fix redactStoredResponses JSDoc default (false -> true) in src/types/reporter.ts to match MCPReporter runtime behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds external result storage for MCP eval runs, with a first-party GCS-backed implementation and a local file implementation behind the same
EvalResultStoreinterface.This makes eval outputs durable and reusable across local runs, CI, reporter history, baseline regression checks, tool override experiments, and server comparisons.
What Changed
EvalResultStore,FileEvalResultStore,GCSEvalResultStore, stored artifact envelopes, and a result-store factory.runEvalDatasetsosaveResultsToandbaselineResultsFromsupport store-backed refs while preserving existing file-path behavior.compareEvalRuns()and persist eval-run comparison artifacts.runServerComparison()output.MCPEvalRunDataexternally and load stored reporter history for trend charts.Developer Impact
GOOGLE_APPLICATION_CREDENTIALS; inline credentials are intentionally not supported.@google-cloud/storageis optional and dynamically loaded, so non-GCS users do not need cloud configuration at runtime.Validation
npm run format:checknpm run docs:checknpm run typechecknpm run lintnpm testnpm run build