diff --git a/src/app/api/freshness/route.ts b/src/app/api/freshness/route.ts index b9cd4c4f..5c0c5603 100644 --- a/src/app/api/freshness/route.ts +++ b/src/app/api/freshness/route.ts @@ -64,9 +64,29 @@ const computeFreshness = unstable_cache( for (const [slug, asOf] of entries) { if (asOf != null) freshness[slug] = asOf; } + // Store fallback: the Vercel site has no PROMETHEUS_URL (Prom lives + // on a private VPS), so on prod every probe above fails and this + // map came back EMPTY since launch, blanking the LiveIndicator. + // The materialized blobs carry the worker's lastRunAt per bench, + // minute-grained instead of scrape-grained, which is honest and far + // better than nothing. Prom keeps priority when reachable (local + // dev, worker context). + if (Object.keys(freshness).length === 0) { + try { + const { loadAllBenchmarks } = await import("@/lib/spec"); + const all = await loadAllBenchmarks(); + for (const b of all) { + if (!liveSlugSet.has(b.slug)) continue; + const t = Date.parse(b.lastRunAt ?? ""); + if (Number.isFinite(t)) freshness[b.slug] = t; + } + } catch { + // leave empty; the indicator degrades exactly as before + } + } return { now: Date.now(), freshness }; }, - ["freshness-v2"], + ["freshness-v3"], { revalidate: 30, tags: ["benchmarks", "freshness"] }, ); diff --git a/src/app/compare/[slug]/page.tsx b/src/app/compare/[slug]/page.tsx index a74c8b1d..3626b64f 100644 --- a/src/app/compare/[slug]/page.tsx +++ b/src/app/compare/[slug]/page.tsx @@ -224,12 +224,15 @@ export async function generateMetadata({ const liveSharedCount = sharedSlugsForMeta.filter( (s) => !excluded.has(s) && aLive.has(s) && bLive.has(s), ).length; - // Curated pairs (explicit benchmarks list in COMPARE_PAIRS) are - // hand-picked head-term targets like usdc-vs-usdt and carry editorial - // framing beyond the ledger, so they stay indexable even with a - // single live shared bench. The gate only applies to combinatorial - // ad hoc pairs. - const isCurated = !!pair.benchmarks; + // Curated pairs are hand-picked head-term targets like usdc-vs-usdt + // and carry editorial framing beyond the ledger, so they stay + // indexable even with a single live shared bench. Membership in + // COMPARE_PAIRS is the curation signal; `pair.benchmarks` is only an + // optional editorial override most curated entries do not set (the + // previous check on it noindexed usdc-vs-usdt and + // dydx-vs-hyperliquid in prod). The gate only applies to + // combinatorial ad hoc pairs. + const isCurated = getComparePair(pair.slug) !== undefined; const thin = !isCurated && liveSharedCount < 2; // Meta description: unique per pair via the shared-count + provider