# Prompt 3: Check every quotation

Use this to have an agent write and run a quotation checker over your notes. Run it after every revision.

---

Write a script that checks every quotation in my article against the source file its note names, and run it.

Inputs: the article (Markdown, numbered footnotes, quotations in « » or quotation marks), and a table mapping each note number to one or more source files.

For each quoted run, the script should:
1. Load the named source file(s).
   - Strip XML or HTML tags.
   - Rejoin words split by a hyphen at a line end.
   - Collapse whitespace.
   - Normalise Unicode (NFC).
2. Report EXACT if the run occurs verbatim.
3. Otherwise report LOOSE if it occurs after folding case, accents and breathings, u/v, i/j and ae/oe, and dropping punctuation. LOOSE is acceptable for OCR sources and must be disclosed in the note. For clean texts, re-copy the quotation.
4. Otherwise report MISSING. A MISSING quotation must not be published.
5. Reject any run longer than a few hundred words: a run that long is a sign that a whole file was pasted, not quoted.
6. Also check that:
   - every note marker in the text has a definition, and every definition is anchored;
   - no marker is used twice;
   - notes are numbered in order of first appearance.

Print counts by verdict and list every failure. Then fix the failures by re-copying from the source, never by editing the script to accept them.

Caution: in two-column OCR, a script cannot see the column gutter if the OCR marks it with ordinary spaces. Check by hand that every run from such a source stays in one column, and say so in the note.
