llmwiki lint validates every citation on every run, and llmwiki eval measures how thoroughly and accurately your pages are cited.
Paragraph-Level Citations
The most common citation form is a paragraph-level source marker. At the end of a prose paragraph, llmwiki appends^[filename.md] to indicate which source file contributed that paragraph’s content:
^[...] is relative to the sources/ directory. You do not include the sources/ prefix - just the bare filename as it appears in the sources frontmatter field.
Claim-Level Citations
For claims that require tighter verification - specific numbers, precise technical assertions, direct quotations - you can pin a citation to a line range within the source file. llmwiki supports two equivalent syntaxes:architecture-notes.md in the sources/ directory. Use whichever form your team prefers - llmwiki’s linter and eval harness treat them identically.
How llmwiki lint Validates Citations
llmwiki lint validates every citation marker in every compiled page. It checks for four categories of problems:
Missing source file
The filename inside
^[...] does not exist in sources/. This happens when a source is deleted after compilation or when the LLM hallucinated a filename. Treated as an error.Malformed citation
The citation syntax is not parseable - for example,
^[file.md:abc] where the range is not a pair of integers. Treated as an error.Impossible range
A line range where the start line is
0 (lines are 1-indexed), or where the end line is less than the start line (e.g. ^[file.md:8-3]). Treated as an error.Out-of-bounds range
A line range that extends past the end of the source file (e.g. citing lines
900-950 in a 200-line file). Treated as a warning, since the source may have been truncated on ingest.llmwiki eval and are listed individually in lint output. Broken citations also trigger the provenance-violating review policy hold mode, so pages with bad citations can be automatically queued for human review rather than written to wiki/.
What Happens During Source Merge
When multiple sources contribute to the same concept slug, llmwiki merges them into a single page. Epistemic metadata is reconciled across all contributing sources:
Citation markers in the merged page body continue to point to the specific source file each paragraph came from. A merged page may therefore carry citations to multiple different files in
sources/:
A Full Example Compiled Page
Here is a complete example showing frontmatter and body with both paragraph and claim-level citation markers:Citation Coverage and Eval
llmwiki eval measures citation quality across the entire wiki as part of its health score:
- Citation coverage - the fraction of prose paragraphs in
wiki/concepts/that carry at least one^[...]marker. Low coverage means paragraphs are floating without provenance. - Citation precision - the fraction of
^[...]markers that point to a source file that actually exists insources/. A precision below 100% indicates hallucinated or deleted source references. - Citation support (
--suite full) - samples up to N(claim, source span)pairs and asks a judge model to score each 0–2 (unsupported → fully supported). Results are cached in.llmwiki/eval/citation-cache.jsonlso re-runs only judge new pairs. - Claim-level citation rate - the fraction of all citations that use a line-range form rather than a bare filename.
.llmwiki/eval/thresholds.yaml to gate CI pipelines on citation quality.
For details on running lint and eval, see llmwiki lint and eval.