"Sometimes the file on disk is the writing. Sometimes the writing is trapped inside the file, and you have to let it out first."
Two Kinds of Ground Truth
Not all sources are equal. A markdown essay is its file — the bytes on disk are exactly the writing. But a PDF, a Word document, or a web page buried in HTML tags is different: the writing is inside the file, wrapped in a format you have to convert away before you can index it cleanly. Lantern names this split with two corpus classes: referenced and captured.
Referenced: The File Is the Document
A referenced corpus points at text files whose bytes are the ground truth. Markdown, plain text — read them, chunk them, index them, done. The doc_sha256 is the hash of the file itself. If the file is ever lost, it's lost; Lantern never claimed to preserve it, only to index it. The originals are authoritative and they stay put. This is the simple, common case.
Captured: The Conversion Is the Document
A captured corpus declares an adapter — a converter that turns a source into clean text. A PDF or DOCX goes through a document-to-markdown converter; HTML-polluted content goes through a prose extractor that strips tags. The converted text is what gets chunked and indexed, and — crucially — it's preserved in a snapshot store. Here the doc_sha256 is the hash of the snapshot (so offsets refer to the converted text), while a separate source_sha256 records the original bytes, so the engine can skip re-converting a source that hasn't changed.
Same Index, Different Truth
Downstream, the two classes look identical: both produce chunks, both are searchable, both return citable results with the same provenance shape. They differ only in what counts as ground truth — the file, or the snapshot of the conversion. That single decision determines whether a vanished source takes its content to the grave or leaves a preserved copy behind.