caelum0x 174222bcaa feat: Builder-Track named-user tools, bio + evidence-intelligence platform, Apache-2.0
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).
2026-07-10 16:23:13 +03:00

73 lines
2.8 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client";
import type { MetaAnalysisResult } from "./types";
// Numeric summary of the pooled result: fixed & random estimates, heterogeneity
// (I²/tau²/Q), and the prediction interval — the reproducible numbers behind the
// forest plot. Presentation only; every value comes from the API response.
interface PooledStatsProps {
pooled: MetaAnalysisResult;
}
function Stat({ label, value, hint }: { label: string; value: string; hint?: string }) {
return (
<div className="rounded-md border border-ink/10 bg-white p-3">
<div className="text-xs uppercase tracking-wide text-ink/40">{label}</div>
<div className="mt-1 font-mono text-sm text-ink/80">{value}</div>
{hint ? <div className="mt-0.5 text-xs text-ink/40">{hint}</div> : null}
</div>
);
}
export function PooledStats({ pooled }: PooledStatsProps) {
const { fixed, random, heterogeneity: h, predictionInterval: pi, measure } = pooled;
const ci = (lo: number, hi: number) => `${lo}–${hi}`;
return (
<div className="space-y-4">
<div className="grid grid-cols-2 gap-3 sm:grid-cols-4">
<Stat
label="Random effects"
value={`${measure} ${random.point}`}
hint={`95% CI ${ci(random.ciLower, random.ciUpper)}${random.significant ? " · significant" : " · crosses null"}`}
/>
<Stat
label="Fixed effect"
value={`${measure} ${fixed.point}`}
hint={`95% CI ${ci(fixed.ciLower, fixed.ciUpper)}`}
/>
<Stat label="Studies pooled" value={`k = ${pooled.k}`} />
<Stat
label="Prediction interval"
value={pi ? ci(pi.lower, pi.upper) : "n/a"}
hint={pi ? "95% PI for a new trial" : "needs k ≥ 3"}
/>
</div>
<div className="grid grid-cols-2 gap-3 sm:grid-cols-4">
<Stat label="I²" value={`${h.iSquared}%`} hint="between-study variability" />
<Stat label="τ²" value={`${h.tauSquared}`} hint="between-study variance" />
<Stat label="Cochran's Q" value={`${h.q}`} hint={`df = ${h.df}, p = ${h.pValue}`} />
<Stat label="H²" value={`${h.hSquared}`} hint="Q / df" />
</div>
{pooled.skipped.length > 0 ? (
<div className="rounded-md border border-amber-300 bg-amber-50 p-3">
<div className="text-xs font-semibold uppercase tracking-wide text-amber-700">
{pooled.skipped.length} study{pooled.skipped.length === 1 ? "" : "ies"} skipped
</div>
<ul className="mt-1 space-y-0.5 text-sm text-ink/60">
{pooled.skipped.map((s, i) => (
<li key={`${s.label}-${i}`}>
<span className="font-medium text-ink/70">{s.label || "(unlabeled)"}:</span> {s.reason}
</li>
))}
</ul>
</div>
) : null}
</div>
);
}