From a2ad01eeacf8d60857b14afe0826f8bb7b9f528f Mon Sep 17 00:00:00 2001 From: Florent Tapponnier Date: Mon, 22 Jun 2026 18:30:08 +0200 Subject: [PATCH] hotfix(build): loadBenchmark falls back to safe aggregator + shorter HF Space description Two fixes bundled because both must land for the next prod-deploy to succeed. loadBenchmark fell back to loadAllBenchmarks (strict) when the per-slug cache miss happened. The strict aggregator throws AllBenchmarksDraftError when the quorum guard from #631 trips, which crashes next build during any Prom blackout. Both fallback sites now use loadAllBenchmarksSafe, which substitutes draft placeholders for the same blackout. Behavior at runtime is unchanged when Prom is healthy. HF Space short_description was 86 chars, HF rejects anything > 60. Shortened to 46. --- scripts/hf_space/README.md | 2 +- src/lib/spec.ts | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/hf_space/README.md b/scripts/hf_space/README.md index c862d70a..1af49296 100644 --- a/scripts/hf_space/README.md +++ b/scripts/hf_space/README.md @@ -9,7 +9,7 @@ python_version: "3.11" app_file: app.py license: cc-by-4.0 pinned: false -short_description: Interactive leaderboard for OpenChainBench crypto infra benchmarks +short_description: Live leaderboard for OpenChainBench benchmarks --- # OpenChainBench leaderboard diff --git a/src/lib/spec.ts b/src/lib/spec.ts index b7e9ce97..7f20a8d4 100644 --- a/src/lib/spec.ts +++ b/src/lib/spec.ts @@ -413,7 +413,12 @@ export const loadBenchmark = cache(async function loadBenchmark( } catch { // live spec collapsed with no cached value — placeholder below } - const all = await loadAllBenchmarks(); + // Safe fallback. The strict aggregator throws AllBenchmarksDraftError + // when the quorum guard trips, which would crash `next build` and any + // page that calls getBenchmark during a Prom blackout. The safe + // wrapper catches that throw and substitutes draft placeholders so + // the page still renders. + const all = await loadAllBenchmarksSafe(); return all.find((b) => b.slug === slug); } // The filtered cache throws when a live spec collapses to draft so the @@ -430,7 +435,12 @@ export const loadBenchmark = cache(async function loadBenchmark( const spec = specs.find((s) => s.slug === slug); return spec ? overlayEditorial(result, spec) : result; } catch { - const all = await loadAllBenchmarks(); + // Safe fallback. The strict aggregator throws AllBenchmarksDraftError + // when the quorum guard trips, which would crash `next build` and any + // page that calls getBenchmark during a Prom blackout. The safe + // wrapper catches that throw and substitutes draft placeholders so + // the page still renders. + const all = await loadAllBenchmarksSafe(); return all.find((b) => b.slug === slug); } });