Provenance trace
ProLive provenance (Candor's ProvenanceOverlay). Hold Option/Alt, or press Trace, and everything dims except each claim and the evidence it rests on, joined by a connector. Hovering or focusing one claim lights just its own evidence. A claim with no evidence is marked as such instead of being drawn as if it had some.
Preview
Install
With the Candor CLI
First time? Get started sets up the registry and theme. Or with shadcn directly: npx shadcn@latest add @candor/provenance-trace
Usage
"use client"
import type { Claim, RetrievedPassage } from "@/lib/know"
import { ProvenanceTrace } from "@/components/provenance-trace"
const ago = (h: number) => new Date(Date.now() - h * 3_600_000).toISOString()
const evidence: RetrievedPassage[] = [
{ id: "p1", sourceId: "k3", title: "Data model notes, §3.2 Data regions", excerpt: "Customers are routed to a data region by region (us, eu, apac). Partner tier is no longer used for routing.", score: 0.91, cited: true, readAt: ago(24 * 12) },
{ id: "p2", sourceId: "k1", title: "Job: assign_region (Staging)", excerpt: "assign_region reads customers.region; the partner-tier fallback sits behind a flag that is off.", score: 0.84, cited: true, readAt: ago(5) },
{ id: "p3", sourceId: "k2", title: "Job: assign_region (Production)", excerpt: "Version 6 is deployed to Production; the partner-tier fallback is still on there.", score: 0.69, cited: true, readAt: ago(52) },
]
const claims: Claim[] = [
{ id: "c1", text: "Customers are routed to a data region by region, not partner tier.", evidence: ["p1"] },
{ id: "c2", text: "On Staging the assign_region job only uses the region column;", evidence: ["p2"] },
{ id: "c3", text: "Production is a version behind and still falls back to partner tier.", evidence: ["p3"] },
{ id: "c4", text: "Deploying the new version won't move any existing customer's data.", evidence: [] },
]
export default function Example() {
return <ProvenanceTrace className="max-w-3xl" claims={claims} evidence={evidence} />
}<ProvenanceTrace>
| Prop | Type | Default | Description |
|---|---|---|---|
| claimsrequired | Claim[] | — | The answer's claims, each with the ids of the passages it rests on. |
| evidencerequired | RetrievedPassage[] | — | The passages the claims point to. |
| className | string | undefined | — | Extra classes for the outer element. |
Strings
The fixed words, in English by default. Change any of them under provenanceTrace in <LocaleProvider strings={{ … }}>; the table is exported as provenanceTraceStrings.
| Key | English |
|---|---|
| trace | Trace |
| orHold | or hold |
| optionKey | ⌥ Option |
| noEvidence | (no evidence) |
| legend | Dotted underline: a claim the answer makes without citing evidence. |