spb/autoscholar
Public
1import { disciplineCounts, listTopics, searchPapers } from "@autoscholar/core";2import { PublicSearchQuery } from "@autoscholar/schemas";3import Link from "next/link";4import { DisciplineExplorer } from "@/components/DisciplineExplorer";5import { Disclosure } from "@/components/Disclosure";6import { EmptyResearchState } from "@/components/EmptyState";7import { IconArrow } from "@/components/Icons";8import { ClusterMotif, MacLustrInfrastructure } from "@/components/MacLustrInfrastructure";9import { PaperCard } from "@/components/PaperCard";10import { PipelineStrip } from "@/components/ResearchPipeline";11import { SectionHeading } from "@/components/SectionHeading";12import { db } from "@/lib/server/db";1314export const dynamic = "force-dynamic";1516/** Editorial hero motif: a vector "evidence ledger" — abstract, built from no data. */17function HeroMotif() {18 const rows = Array.from({ length: 8 }, (_, i) => i);19 return (20 <svg21 viewBox="0 0 360 300"22 className="h-auto w-full"23 role="img"24 aria-label="Abstract illustration of a verified research ledger"25 >26 <defs>27 <linearGradient id="hg" x1="0" x2="1">28 <stop offset="0" stopColor="var(--sci)" />29 <stop offset="1" stopColor="var(--accent)" />30 </linearGradient>31 </defs>32 <rect x="18" y="14" width="324" height="272" rx="14" fill="var(--bg-elev)" stroke="var(--line)" />33 <rect x="18" y="14" width="324" height="40" rx="14" fill="var(--bg-muted)" />34 <text x="36" y="39" fontFamily="var(--font-mono)" fontSize="11" fill="var(--fg-subtle)">35 AS-WP-2026-····36 </text>37 <circle cx="318" cy="34" r="5" fill="url(#hg)" />38 {rows.map((i) => {39 const y = 74 + i * 22;40 const w = [180, 230, 140, 210, 170, 240, 120, 200][i] ?? 160;41 const ok = i !== 6;42 return (43 <g key={i}>44 <text x="36" y={y + 4} fontFamily="var(--font-mono)" fontSize="9" fill="var(--fg-subtle)">45 {String(i).padStart(2, "0")}46 </text>47 <rect48 x="60"49 y={y - 5}50 width={w}51 height="10"52 rx="5"53 fill={i % 3 === 0 ? "var(--sci-soft)" : "var(--bg-muted)"}54 />55 <rect56 x="60"57 y={y - 5}58 width={Math.round(w * 0.55)}59 height="10"60 rx="5"61 fill={i % 3 === 0 ? "var(--sci)" : "var(--line-strong)"}62 opacity={i % 3 === 0 ? 0.55 : 0.9}63 />64 <path65 d={ok ? `M304 ${y - 2} l4 4 7-8` : `M304 ${y - 4} l8 8 m0 -8 l-8 8`}66 stroke={ok ? "var(--color-ok-500)" : "var(--color-danger-500)"}67 strokeWidth="1.6"68 fill="none"69 strokeLinecap="round"70 />71 </g>72 );73 })}74 <path d="M36 270 H324" stroke="var(--line)" />75 <text x="36" y="262" fontFamily="var(--font-mono)" fontSize="9" fill="var(--fg-subtle)">76 sha256 · verified · gates 16/1677 </text>78 </svg>79 );80}8182export default async function Home() {83 const d = db();84 const latest = await searchPapers(d, PublicSearchQuery.parse({ pageSize: "7" }));85 const [featured, ...recent] = latest.items;86 const counts = await disciplineCounts(d);87 const topics = await listTopics(d);88 const total = counts.reduce((n, c) => n + c.n, 0);8990 return (91 <div>92 {/* Hero */}93 <section className="container-x section-tight relative">94 <div className="grid items-center gap-10 lg:grid-cols-12 lg:gap-12">95 <div className="reveal lg:col-span-7">96 <p className="eyebrow">Autonomous Research Foundry</p>97 <h1 className="display mt-4 max-w-[13ch]">Research you can check, not just read.</h1>98 <p className="lede mt-5">99 AutoScholar is a library of original working papers produced by an autonomous, auditable100 research pipeline. Every release ships its sources, code, data and build evidence.101 </p>102 <div className="mt-7 flex flex-wrap gap-3">103 <Link href="/research" className="btn btn-primary">104 Browse the library <IconArrow size={16} />105 </Link>106 <Link href="/methodology" className="btn">107 How papers are produced108 </Link>109 </div>110 <dl className="mt-8 grid max-w-md grid-cols-3 gap-4 border-t pt-5 hairline">111 <div>112 <dt className="label">Papers</dt>113 <dd className="serif mt-1 text-2xl">{total}</dd>114 </div>115 <div>116 <dt className="label">Hard gates</dt>117 <dd className="serif mt-1 text-2xl">16</dd>118 </div>119 <div>120 <dt className="label">Stages</dt>121 <dd className="serif mt-1 text-2xl">11</dd>122 </div>123 </dl>124 </div>125 <div className="reveal reveal-2 lg:col-span-5">126 <HeroMotif />127 </div>128 </div>129 <div className="mt-8">130 <Disclosure compact />131 </div>132 </section>133134 {/* Featured + latest */}135 <section className="container-x section-tight" aria-labelledby="latest">136 <SectionHeading137 eyebrow="Library"138 title="Latest working papers"139 id="latest"140 more={{ href: "/research", label: "All papers" }}141 >142 Newest releases first. Each paper lists its verified references, artifacts and provenance.143 </SectionHeading>144 <div className="mt-8">145 {!featured ? (146 <EmptyResearchState />147 ) : (148 <div className="space-y-6">149 <PaperCard p={featured} featured />150 {recent.length > 0 && (151 <ul className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">152 {recent.slice(0, 6).map((p, i) => (153 <li key={p.publicId}>154 <PaperCard p={p} index={i} />155 </li>156 ))}157 </ul>158 )}159 </div>160 )}161 </div>162 </section>163164 {/* Disciplines */}165 <section className="container-x section-tight" aria-labelledby="subjects">166 <SectionHeading167 eyebrow="Subject explorer"168 title="Disciplines"169 id="subjects"170 tone="sci"171 more={{ href: "/topics", label: "All topics" }}172 >173 Every legitimate academic discipline is in scope. Methodology follows the question.174 </SectionHeading>175 <div className="mt-8">176 <DisciplineExplorer counts={counts} topics={topics} />177 </div>178 </section>179180 {/* Process */}181 <section className="section-tight" aria-labelledby="process" style={{ background: "var(--bg-muted)" }}>182 <div className="container-x">183 <SectionHeading184 eyebrow="Process"185 title="Eleven stages, two independent halves"186 id="process"187 more={{ href: "/methodology", label: "Full methodology" }}188 >189 Research runs on an isolated MacLustr worker; verification and publication run on the control190 plane, where deterministic gates decide — never the model.191 </SectionHeading>192 <div className="mt-8">193 <PipelineStrip />194 </div>195 <ul className="mt-8 grid gap-6 md:grid-cols-3">196 {[197 [198 "Integrity before throughput",199 "No paper is released unless its central claims trace to verified sources or executed artifacts and its PDF rebuilds from the released LaTeX.",200 ],201 [202 "Evidence travels with the paper",203 "Manuscript source, verified bibliography, code and data when part of the study, reproducibility notes and a redacted provenance record.",204 ],205 [206 "Honest about what this is",207 "AI-generated working papers, not peer-reviewed articles. Automated review is critique, not validation. Corrections and retractions are public and permanent.",208 ],209 ].map(([h, p]) => (210 <li key={h} className="border-t pt-4 hairline">211 <h3 className="title-3">{h}</h3>212 <p className="muted mt-2 text-sm leading-relaxed">{p}</p>213 </li>214 ))}215 </ul>216 </div>217 </section>218219 {/* Infrastructure */}220 <section className="container-x section-tight">221 <MacLustrInfrastructure />222 <div className="sr-only">223 <ClusterMotif />224 </div>225 </section>226 </div>227 );228}229