feat(spec+snapshot): MS_PER_MINUTE + Zod-strict snapshot schemas (cherry-pick E)#739
Merged
Merged
Conversation
…emas (PR E) PR E in dev → main reconciliation. Minimal-change strategy: main was already ahead on spec.ts (chain-aliases reconciliation, expectedN overlay, quorum guard all already cherry-picked). Dev only brings 2 real additions: spec.ts changes (cosmetic): - Import MS_PER_MINUTE from @/lib/time-constants - Replace 30 * 60_000 → 30 * MS_PER_MINUTE (line 50) - Replace / 60000 → / MS_PER_MINUTE in log fmt (line 61) - Cache keys bumped bench-unfiltered v14 → v15, all-benchmarks v18 → v19 (regenerate stored snapshots through the new shape v5 below) - Everything else preserved: chain-aliases import, bestForChain re-export, overlayEditorial canonical-slug reconciliation, expectedN passthrough, AllBenchmarksDraftError, quorum guard. snapshot.ts changes (real upgrade): - Replace full file with dev's 441-line version - Was: 323 lines with z.any() loose validation - Now: strict Zod schemas for ProviderResult / ResultExtras / MetricPanel / CellRankEntry / StalenessMeta / RegionPoint - Adds AssertEqual compile-time guards (4 const checks) that fail the build if @/types/benchmark drifts from the Zod schemas - SnapshotPayload adopts expectedN + dataConfidence (completes PR #732 sample-health on the persistence side — sample-health fields now survive KV roundtrip) - snapshotFromBenchmark writes the new fields too - SCHEMA_VERSION bumped 3 → 5 (covers both branches' versions) Old v3 blobs in Upstash KV will safeParse → null → live Prom path takes over and rewrites under v5. Graceful degradation intact (verified in readSnapshot at line 373). - Removes 'as ProviderResult[]' casts (Zod now guarantees shape) Risk: LOW (per second-pass review by reviewer agent). - No external callers of snapshot.ts (only spec.ts imports it). - No external constructors of SnapshotPayload (only snapshotFromBenchmark builds it). - One-time cold render per (slug, variant) on first reader after deploy. With READ_FROM_STORE=1 the worker snapshots absorb it; without, it's a single Prom fan-out per bench. - No caller signature changes.
Flotapponnier
added a commit
that referenced
this pull request
Jun 26, 2026
Dev was force-pushed after PR #730 and the venue support in BenchmarkFilters (materialize/filters.ts) was lost in the spec/snapshot refactor PR #739. The worker still references f.venue and dims.venue, so typecheck failed. Re-add venue across: - BenchmarkFilters union (load.ts) - parseFilterSig allowlist - Spec.dimensions schema (spec-schema.ts) so YAML venue dim parses
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.
PR E — the riskiest of the dev → main reconciliation series. Reviewer-validated SAFE TO MERGE.
Strategy: minimal-change
Main was already AHEAD of dev on spec.ts (chain-aliases #708/#711/#724, expectedN #732, quorum guard #631 all already cherry-picked). Dev's only real additions are:
spec.ts (cosmetic)
snapshot.ts (real upgrade)
z.any()for ProviderResult / ResultExtras / MetricPanel / CellRankEntry / StalenessMeta / RegionPointas ProviderResult[]castsReviewer agent verdict
Risk