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

75 lines
2.7 KiB
TypeScript

// Header for a drafted section: shows the ENGINE's verified ground-truth (the pooled
// number every efficacy sentence was reconciled against) plus roll-up badges. This is
// the "proves it" frame — before reading the prose, the reader sees exactly what the
// deterministic engine established.
import type { DraftAssistResult } from "./types";
interface EvidenceHeaderProps {
evidence: DraftAssistResult["evidence"];
summary: DraftAssistResult["summary"];
section: string;
}
function Badge({ label, value, tone }: { label: string; value: string | number; tone: string }) {
return (
<div className={`rounded-lg border px-3 py-2 ${tone}`}>
<div className="text-[11px] uppercase tracking-wide opacity-60">{label}</div>
<div className="text-sm font-semibold">{value}</div>
</div>
);
}
export function EvidenceHeader({ evidence, summary, section }: EvidenceHeaderProps) {
return (
<div className="rounded-lg border border-ink/10 bg-white p-4">
<div className="flex flex-wrap items-center gap-2">
<span className="rounded-full bg-ink/5 px-2.5 py-0.5 text-xs font-medium capitalize text-ink/70">
{section}
</span>
{evidence.sufficient ? (
<span className="rounded-full bg-emerald-50 px-2.5 py-0.5 text-xs font-medium text-emerald-700">
Evidence pooled
</span>
) : (
<span className="rounded-full bg-amber-50 px-2.5 py-0.5 text-xs font-medium text-amber-700">
Insufficient evidence — hedged
</span>
)}
</div>
<div className="mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4">
<Badge
label="Pooled reduction"
value={
evidence.pooledReductionPercent !== null
? `${evidence.pooledReductionPercent}%`
: "—"
}
tone="border-ink/10 text-ink/80"
/>
<Badge label="Measure" value={evidence.measure ?? "—"} tone="border-ink/10 text-ink/80" />
<Badge
label="GRADE certainty"
value={evidence.certainty ?? "—"}
tone="border-ink/10 text-ink/80"
/>
<Badge
label="Grounded"
value={`${summary.grounded}/${summary.totalSentences}`}
tone="border-emerald-100 text-emerald-700"
/>
</div>
{summary.corrected > 0 ? (
<p className="mt-3 rounded-lg bg-amber-50 px-3 py-2 text-xs text-amber-800">
{summary.corrected} sentence{summary.corrected === 1 ? "" : "s"} auto-corrected against
the engine&apos;s verified number.
</p>
) : null}
<p className="mt-3 text-xs leading-relaxed text-ink/50">{evidence.rationale}</p>
</div>
);
}