Builds PaperTrail from the base skeleton into a full evidence-verification platform for the "Built with Claude: Life Sciences" hackathon (Builder Track). New named-user features (Build Beyond the Bench): - Lab Notebook Companion — rough bench notes -> structured, searchable, grounded experiment records (lib/labNotebook, /console/lab-notebook, migration 0059) - Clinical Trial Matcher — de-identified patient notes -> ranked eligible ClinicalTrials.gov trials with per-criterion inclusion/exclusion reasoning (lib/trialMatcher, /console/trial-matcher, migrations 0060) Platform: - Deterministic verification moat (biostats recompute, exact-span grounding) - 11 biomedical evidence engines (FAERS, GWAS, Open Targets, ChEMBL, ClinVar, PharmGKB, PubTator, DDI, repurposing, biomarker, unified verifier) - Evidence Intelligence (KG, dossier, provenance/export, RWE) + enterprise governance (RBAC, /api/v1 gateway, metering, audit chain, retention) - 17 OSS projects assimilated into native TypeScript on our stack (backend/engines retained + credited in NOTICE) - Multi-format upload (PDF/DOCX/XLSX/CSV/MD/TXT), logo, marketing site - Next.js 16 upgrade, benchmark harness (honest smoke-test caveat) Licensing: Apache-2.0 (LICENSE + NOTICE).
77 lines
2.8 KiB
TypeScript
77 lines
2.8 KiB
TypeScript
import { CertaintyBadge } from "../../evidence-report/_components/CertaintyBadge";
|
||
import type { EngineFactsView } from "./types";
|
||
|
||
// The engine-facts panel — every NUMBER in the review, restated from the deterministic
|
||
// pipeline (never Claude). Rendering these next to the prose makes the trust boundary
|
||
// visible: the badge + figures come from the engine; the surrounding prose is grounded
|
||
// against sources. When pooling wasn't possible, we show the honest reason instead.
|
||
|
||
interface FactsPanelProps {
|
||
facts: EngineFactsView;
|
||
}
|
||
|
||
function fmt(n: number | null, suffix = ""): string {
|
||
return n === null ? "—" : `${n}${suffix}`;
|
||
}
|
||
|
||
export function FactsPanel({ facts }: FactsPanelProps) {
|
||
if (!facts.poolable) {
|
||
return (
|
||
<section className="rounded-lg border border-amber-200 bg-amber-50 p-4">
|
||
<h3 className="text-sm font-semibold text-amber-900">
|
||
Insufficient evidence to pool
|
||
</h3>
|
||
<p className="mt-1 text-sm text-amber-900/80">{facts.engineRationale}</p>
|
||
</section>
|
||
);
|
||
}
|
||
|
||
return (
|
||
<section className="rounded-lg border border-ink/15 bg-white p-4">
|
||
<div className="flex items-center justify-between">
|
||
<h3 className="text-sm font-semibold uppercase tracking-wide text-ink/60">
|
||
Engine facts
|
||
</h3>
|
||
{facts.certainty ? <CertaintyBadge certainty={facts.certainty} /> : null}
|
||
</div>
|
||
<dl className="mt-3 grid grid-cols-2 gap-x-6 gap-y-2 text-sm sm:grid-cols-3">
|
||
<div>
|
||
<dt className="text-ink/40">Measure</dt>
|
||
<dd className="font-medium text-ink/80">{facts.measure ?? "—"}</dd>
|
||
</div>
|
||
<div>
|
||
<dt className="text-ink/40">Studies (k)</dt>
|
||
<dd className="font-medium text-ink/80">{fmt(facts.k)}</dd>
|
||
</div>
|
||
<div>
|
||
<dt className="text-ink/40">Pooled estimate</dt>
|
||
<dd className="font-medium tabular-nums text-ink/80">
|
||
{facts.pooledPoint === null
|
||
? "—"
|
||
: `${facts.pooledPoint} (${fmt(facts.pooledCiLower)}–${fmt(facts.pooledCiUpper)})`}
|
||
</dd>
|
||
</div>
|
||
<div>
|
||
<dt className="text-ink/40">Reduction</dt>
|
||
<dd className="font-medium tabular-nums text-ink/80">
|
||
{fmt(facts.pooledReductionPercent, "%")}
|
||
</dd>
|
||
</div>
|
||
<div>
|
||
<dt className="text-ink/40">Heterogeneity I²</dt>
|
||
<dd className="font-medium tabular-nums text-ink/80">{fmt(facts.iSquared, "%")}</dd>
|
||
</div>
|
||
<div>
|
||
<dt className="text-ink/40">Claim vs pool</dt>
|
||
<dd className="font-medium text-ink/80">
|
||
{facts.verdict ? facts.verdict.replace(/_/g, " ") : "—"}
|
||
</dd>
|
||
</div>
|
||
</dl>
|
||
<p className="mt-3 border-t border-ink/10 pt-2 text-xs text-ink/50">
|
||
{facts.engineRationale}
|
||
</p>
|
||
</section>
|
||
);
|
||
}
|