import { Fragment } from "react" import Link from "next/link" import { ArrowRight } from "lucide-react" import { Navigation } from "@/components/navigation" import { CorpusSignalsStrip } from "@/components/signals/corpus-signals-strip" import { getDeveloperList, getEvalList } from "@/lib/data-backend" import { fetchBackendManifest, fetchCorpusAggregates, fetchEvalHierarchy, } from "@/lib/hf-data" function formatGeneratedAt(value: string | null | undefined) { if (!value) return null try { const date = new Date(value) if (Number.isNaN(date.getTime())) return value return date.toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", }) } catch { return value } } function formatNumber(value: number | undefined | null): string { if (value == null || !Number.isFinite(value)) return "—" return value.toLocaleString("en-US") } const FAMILY_KIND_LABELS: Record = { General: "General capability", Reasoning: "Reasoning", Agentic: "Agentic", Safety: "Safety", Code: "Code", Math: "Math", Multilingual: "Multilingual", } export default async function HomePage() { const [aggregates, manifest, hierarchy, developers, evals] = await Promise.all([ fetchCorpusAggregates(), fetchBackendManifest(), fetchEvalHierarchy(), getDeveloperList().catch(() => []), getEvalList().catch(() => [] as Awaited>), ]) const stats = hierarchy.stats const familyCount = stats?.family_count ?? hierarchy.families.length const compositeCount = stats?.composite_count ?? 0 // v3 hierarchy ships `benchmark_count` directly. The legacy // `single_benchmark_count` / `standalone_benchmark_count` synthesis // is gone with the adapter (Step 4b); v3's `benchmark_count` is the // distinct (composite, benchmark) row count from the dim. const benchmarkLeafCount = stats?.benchmark_count ?? 0 const sliceCount = stats?.slice_count ?? 0 const metricCount = stats?.metric_count ?? 0 const tripleCount = stats?.metric_rows_scanned ?? 0 const modelCount = manifest?.model_count ?? 0 const developerCount = developers.length // Distinct eval-provider organizations across the corpus. Sourced from // `headline.reporting_org_count` (precomputed in the producer's // sidecars.py) so the page doesn't have to scan parquet at request // time. The producer derives this from `eval_results_view.reporting_orgs` // which carries the de-aliased identity per fact row — canonical // display_name when the registry has the org (folds Ai2 ≡ Allen // Institute for AI), raw upstream string otherwise. Falls back to // evals.length only if a pre-sidecar snapshot is loaded. const evaluatorCount = aggregates?.reporting_org_count ?? evals.length const generatedAt = formatGeneratedAt(manifest?.generated_at) // Featured family cards — pick the first six families with summaries. // Curated multi-benchmark families (BFCL, MMLU, JudgeBench, …) put // their benchmarks under composites[].benchmarks[] after the adapter; // singletons land in standalone_benchmarks[] or benchmarks[]. Pull // from all four shapes so the count reflects the union (matches // family-table.tsx:313's logic). const featuredFamilies = hierarchy.families.slice(0, 6).map((family) => { // v3 family layouts: exactly one of standalone_benchmarks / benchmarks / // composites is present per family. Walk all three to count benchmarks. const benches: unknown[] = [ ...(family.standalone_benchmarks ?? []), ...(family.benchmarks ?? []), ...((family.composites ?? []).flatMap((c) => c.benchmarks ?? [])), ] let slices = 0 for (const b of benches) { const benchSlices = (b as { slices?: unknown[] }).slices if (Array.isArray(benchSlices)) slices += benchSlices.length } return { key: family.key, name: family.display_name, kind: FAMILY_KIND_LABELS[family.category] ?? family.category ?? "Benchmark family", benchCount: benches.length, sliceCount: slices, } }) return (
{/* HERO ----------------------------------------------------------- */}
{aggregates ? `Signals v${aggregates.signal_version}` : "Eval Cards · Beta"}

A reporting layer
over evaluation
infrastructure.

Eval Cards is a registry of reported model–benchmark results, organised under a five-level rollout hierarchy and four interpretive signals computed over the joined record.

Browse models Browse evaluations About
Corpus snapshot{generatedAt ? ` · ${generatedAt}` : ""}
{/* FIVE-LEVEL HIERARCHY STRIP -------------------------------------- */}
Five-level rollout hierarchy
{[ { name: "Family", count: formatNumber(familyCount), ex: "SWE-bench family, MMLU family", }, { name: "Composite", count: formatNumber(compositeCount), ex: "Open LLM Leaderboard v2, HELM Instruct", }, { name: "Single benchmark", count: formatNumber(benchmarkLeafCount), ex: "GSM8K, IFEval, MMLU-Pro", }, { name: "Slice", count: formatNumber(sliceCount), ex: "algebra (within MATH), level-5, multi-turn", }, { name: "Metric", count: formatNumber(metricCount), ex: "pass@1, accuracy, F1", }, ].map((node, i, arr) => (
{String(i + 1).padStart(2, "0")}
{node.name}
{node.count}
{node.ex}
{i < arr.length - 1 && (
)}
))}

Every score resolves to an explicit path through this hierarchy, so aggregate claims drill down to the evidence supporting them.

{/* FOUR INTERPRETIVE SIGNALS -------------------------------------- */}
Interpretive signals

Reproducibility · Completeness ·
Provenance & risk · Comparability

Four signals computed over each (model, benchmark, metric-path) record and aggregated to the corpus level. Per-record instances appear on every model and benchmark page.

{aggregates ? ( ) : (

Corpus aggregates unavailable

The current backend snapshot does not include{" "} headline.json . When it does, this section will render the four corpus-level rollups.

)}
{/* FEATURED BENCHMARK FAMILIES ------------------------------------ */} {featuredFamilies.length > 0 && (

Benchmark families

All {formatNumber(familyCount)} →
{featuredFamilies.map((fam) => (
{fam.kind}
{fam.benchCount} bench · {fam.sliceCount} slices

{fam.name}

{fam.benchCount > 0 ? `${fam.benchCount} reported benchmark${fam.benchCount === 1 ? "" : "s"} across this family.` : "No reported results yet for this family."}

))}
)}
) } function CorpusStat({ label, value, detail, }: { label: string value: string detail: string }) { return (
{value}
{label}
{detail}
) }