How it works
A clinical document goes in. Records a clinician could defend come out. Each stage either proves what it passes on or holds it back for a person.
The path of one document
Every stage below has exactly one module that owns its rule. When two modules answered the same question, they eventually disagreed, so the second answer was deleted rather than kept in sync.
- Source
A textbook PDF, a journal article or a question bank
A corpus recipe says where a document's bytes live and whether its apparatus pages (bibliography, index) were removed first. Removing them is a new corpus, because every content-addressed id changes with the bytes.
- Page reader
One walk over the pages, three streams
Prose, figures and tables, and navigation apparatus. Fonts, private-use glyphs, columns and page furniture are repaired first, on evidence gathered from the whole document.
- Passages
Cut at sentences, never through a table row
An oversized section is split by topic. The model picks boundaries between numbered sentences and never writes text; a split that does not cover every sentence once, in order, is refused.
- Layer 2 · Link
Mentions become UMLS concepts
Linked against a 792,516-concept clinical subset. Two names for one thing are collapsed first; a true tie goes to a cross-encoder or is quarantined. Abbreviations are expanded only from ranked evidence.
- Layer 2 · Assert
Negated, historical, hypothetical, or someone else's
Each mention is read for negation, time and experiencer. A relative's finding travels on its own field and never reaches the patient's.
- Layer 2 · Decide
Three verdicts, all counted
Admitted, rejected or quarantined. A candidate missing from the totals is a defect.
- Layer 3 · Curate
A unit carries affirmed concepts only
No field of a generation brief can carry a negated, hypothetical or historical concept, so a generator cannot be told one.
- Layer 3 · Generate
Triplets, hard negatives, reasoning items
Hard negatives are written in four clinical failure modes. Reasoning items are cases and questions with cited, step-by-step rationales.
- Layer 3 · Audit
A judge must confirm the flaw
A negative is published only when a judge names what is wrong with it. An unreachable judge quarantines; it never approves.
- Stores
Graph, vectors, datasets, ledgers
Every model call is recorded in append-only ledgers keyed by a fingerprint of model, prompt version and settings. Stage gates decide whether an artifact may be spent on.
Reading the page
PDFs lose text in ways no byte-level rule can see. A broken font map yields printable characters, so the only evidence is whether the result reads as language. Each repair is proved on the whole document and applied span by span, and a span the proof does not cover is left exactly as printed.
The same page-level discipline removes furniture. "Investigations" is a real heading that recurs 301 times in one book and never twice at the same height; a watermark sits at the same coordinate on 151 of 218 pages. A line stamped at one fixed position on most pages is furniture wherever it appears. Before that rule, one book's licence footer rode along in 289 of its 370 passages; after it, none.
Reading the sentence
A negated finding must never become a positive assertion. The two defects below passed every self-authored test and were found only by independently labelled clinical notes.
POSTOPERATIVE DIAGNOSIS: 1) Colitis
Deciding
Every candidate ends in one of three verdicts. The rule separating them is whether more information would change the answer, and each reason in the code declares its own verdict, so a new gate cannot pick one by how the failure feels.
Cleared every gate: a real concept in the clinical subset, an in-scope semantic type taken from the ontology, a clear assertion.
Wrong by definition, so a reviewer adds nothing. A code that matches the format but names nothing (C9999999), an out-of-scope type, dosing notation, a superseded span, a confidently low score. Counted, never queued.
The engine could not decide and a person could. Two concepts tied for one name, an abbreviation with several readings at the same rank of evidence, a relative's finding on a path that has no family field. Kept in full and queued for review.
A reviewer's answer re-enters admission as a proposal, so it cannot overrule the ontology. How far the answer travels comes from the reason, never from the reviewer.
Writing hard negatives
A retrieval model learns what a good passage is partly from passages that look right and are clinically wrong. Each hard negative is a rewrite of a real passage into one of four ways medicine goes wrong. A judge must name the flaw before the negative is published; if the rewrite turns out to be accurate, it is discarded.
Contraindication trap
Advises something the patient's situation rules out, or drops the exception. One generated example told clinicians no adjustment was needed in a patient on therapeutic warfarin.
Outdated practice
States what used to be standard care and no longer is.
Near-miss entity
Swaps in a closely related drug, test or condition that makes the statement wrong.
Unwarranted specificity
Asserts a precise value, subtype or diagnosis the evidence does not support. A swapped number is judged the same way.
Questions from published banks carry their own wrong options. Those are used as the author wrote them, with no failure mode assigned, because the source never said how each option is wrong.
Reasoning items and what their refusals are worth
A reasoning item is a case or a question whose rationale cites passages step by step. It is generated from a whole concept subtree of a book rather than one passage, and it must pass three layers in order. Each refusal records which layer refused it.
So each refusal becomes the rejected half of a preference pair whose chosen half is an accepted item on the same concept and item kind. A quarantined item takes no side, because an outage is not a clinical flaw. A rejected item enters at most one pair: six accepted items against 23 refused would otherwise cross-multiply into 138 rows, of which 23 carry information. An item judged both ways across re-runs is refused rather than arbitrated.
Where it ends up
A store cannot forbid a careless query, so the safety lives in the names. In the graph, an assertion is the edge type rather than a property, so no query returns a denial without naming one. In the vector collection, three fields answer three different questions.
| Field | Holds | Safe to rest an affirmation on |
|---|---|---|
asserted_cuis | Concepts the passage affirms about the patient | Yes |
mentioned_cuis | Every concept the passage is about, including negated ones | No |
family_history_cuis | Findings about relatives | No |
Material whose licence forbids redistribution raises an error in both stores rather than relying on a filter someone might forget. Material whose terms nobody has checked is treated the same way until someone checks.