Skip to content

How Claims Are Checked

m4bwav edited this page Nov 3, 2026 · 9 revisions

historywright's central rule: a claim counts only when a page this run fetched and read supports it, in words hw.py verify can find on that page. This page states how each check decides, from the code of 0.5.0 (commit 3239fbf), with real output.

URLs: live, dead, likely hallucinated or unknown

verify url tries a HEAD request, then a GET when the server refuses HEAD or errs, then asks the Wayback Machine for an archived copy. The label follows from what came back:

Label When
live the page answered 2xx or a redirect
unknown 401, 403 or 429: blocked or rate-limited, which is not proof that the page is missing; also when the Wayback check itself failed
dead the page did not answer, and the Wayback Machine has a copy (archived gives its address and archived_at its date)
likely_hallucinated 404 or no answer at all, and no archived copy

An invented page on a real site:

python hw.py verify url "https://en.wikipedia.org/wiki/Julius_Caesar" "https://en.wikipedia.org/wiki/The_Fourth_Gallic_Diary_of_Caesar"
{
 "ok": false,
 "results": [
  {
   "url": "https://en.wikipedia.org/wiki/Julius_Caesar",
   "label": "live",
   "status": 200
  },
  {
   "url": "https://en.wikipedia.org/wiki/The_Fourth_Gallic_Diary_of_Caesar",
   "label": "likely_hallucinated",
   "status": 404,
   "why": "no live page and no archived copy"
  }
 ]
}

The second page answered 404 and the Wayback Machine has no copy of it, so the label is likely_hallucinated, and the command exits 1 because one URL failed. Had the Wayback Machine answered 429 (too many requests), the label would be unknown: a rate limit is never read as absence. In the first wiki runs it did answer 429, at a pace of one request every half second. Since 0.1.0 hw.py waits 4 seconds between requests to the Internet Archive, and the runs against 0.1.0, 0.2.0, 0.3.0, 0.4.0 and 0.5.0 got an answer, and so did 0.5.1 when run again later that day, and 0.6.0 and 0.6.1 on 2026-11-02.

Quotes: is it a span of the page?

verify quote fetches the page (or reads the copy stored earlier in the run), turns HTML into text and looks for the quote: first exactly, then normalised (case, curly quotes, dashes and spaces evened out). A ... splits the quote into parts that must appear in order. The match field says which test passed: exact, normalised or normalised, in parts, and since 0.5.0 normalised, long s read as f (pre-1800 print).

python hw.py verify quote --url "https://penelope.uchicago.edu/Thayer/E/Roman/Texts/Suetonius/12Caesars/Julius*.html" --quote "He died in the fifty-sixth year of his age"
{
 "found": true,
 "match": "exact",
 "ok": true,
 "url": "https://penelope.uchicago.edu/Thayer/E/Roman/Texts/Suetonius/12Caesars/Julius*.html",
 "source_text": "fetched now"
}

The page is stored under the home folder, so a later verify sources or a research pack reads the same text. --refetch fetches it again.

Since 0.5.0, when the normalised match fails, every s inside a word is read as f, in the quote and on the page, and the match is tried again. Books printed before about 1800 use the long s, which OCR reads as f: the Internet Archive's text of Oliver Evans's Young Mill-wright and Miller's Guide (1795) has "a fufficient guide to fave thoufands". The stream URL of the same text serves a viewer page; since 0.5.1 verify quote and fetch read the download URL in its place and say so in source_text.

python hw.py verify quote --url "https://archive.org/download/youngmillwrightm00evan/youngmillwrightm00evan_djvu.txt" --quote "a sufficient guide to save thousands"
{
 "found": true,
 "match": "normalised, long s read as f (pre-1800 print)",
 "ok": true,
 "url": "https://archive.org/download/youngmillwrightm00evan/youngmillwrightm00evan_djvu.txt",
 "source_text": "fetched now"
}

Since 0.2.0 a PDF is read as a PDF, not as a web page. OpenAlex often links only the PDF of a work, and in 0.1.0 a real quote in one came back found: false. The text comes from pdftotext when it is on the PATH, else from a built-in reader. A word broken by a hyphen at a line end matches joined or not. As a last step, a quote of 20 or more letters may match with spacing ignored, because drop caps and small caps split words. A PDF with no readable text, such as a scan, answers found: null with the reason, so verify sources warns instead of failing; a miss from the built-in reader carries a note. doctor reports whether pdftotext is installed. This paragraph is described from the code and its tests: no PDF was checked for this wiki.

References

A book or article enters an answer only when its title, author and year all match one record. doi asks Crossref, then OpenAlex, and compares each detail given. A real DOI with the wrong title is the usual shape of a blended reference, one that joins the details of two real works:

python hw.py doi 10.20381/ruor-23791 --title "The Gallic War and the Roman Army" --author Ficocelli --year 2019
{
 "ok": true,
 "exists": true,
 "record": {
  "source": "openalex",
  "doi": "10.20381/ruor-23791",
  "title": "‘Portfolios of Power’: Julius Caesar in the Late Roman Republic",
  "authors": [
   "Giuseppe L. Ficocelli"
  ],
  "year": 2019,
  "container": "uO Research (University of Ottawa)",
  "type": "dissertation",
  "url": "https://doi.org/10.20381/ruor-23791"
 },
 "match": {
  "title": false,
  "author": true,
  "year": true
 },
 "all_match": false,
 "warning": "the DOI exists but does not match every detail given: a blended or wrong reference"
}

With the work's real title the same call gives "all_match": true (Commands).

When the title and author match and only the year differs, the warning says so. Registry records sometimes carry a wrong year, so read the year printed on the work before calling the reference wrong. The same DOI with 2018 for 2019:

python hw.py doi 10.20381/ruor-23791 --title "Portfolios of Power: Julius Caesar in the Late Roman Republic" --author Ficocelli --year 2018
{
 "ok": true,
 "exists": true,
 "record": {
  "source": "openalex",
  "doi": "10.20381/ruor-23791",
  "title": "‘Portfolios of Power’: Julius Caesar in the Late Roman Republic",
  "authors": [
   "Giuseppe L. Ficocelli"
  ],
  "year": 2019,
  "container": "uO Research (University of Ottawa)",
  "type": "dissertation",
  "url": "https://doi.org/10.20381/ruor-23791"
 },
 "match": {
  "title": true,
  "author": true,
  "year": false
 },
 "all_match": false,
 "warning": "only the year differs: registry records sometimes carry a wrong year; check the year printed on the work itself (masthead, title page) before calling it a wrong reference"
}

This warning is new in 0.2.0; 0.1.0 gave the blended-reference warning above for a year-only mismatch too.

Sources: fetched, quoted, independent

verify sources FILE reads a pack's sources.json (or any file in that shape) and checks, for each source:

  • that its URL was fetched by this home folder, from the fetch log. A source the run never fetched cannot be cited. --any-url lifts this for a pack built on another machine.
  • that it has a title, URL, retrieval date, kind and tier;
  • that a Wikipedia page or a known mirror of Wikipedia is marked tertiary, so it never counts as corroboration;
  • that every claim's quote is on its page (skipped with --offline);
  • since 0.5.0, that a claim read off a measured drawing carries measured (scale and how) and a locator naming the sheet in place of a quote. No quote is checked for it and it is reported as measured, so an answer says the value was measured, not stated.

It then counts independent sources: not tertiary, not a mirror, and not derived from another chosen source (derived_from). A claim is corroborated with at least two independent sources, at least one of them tier 1 or primary or secondary.

The test pack's sources are on example.org, which this home folder never fetched, so the plain offline check fails:

python hw.py verify sources pack-good/sources.json --offline
{
 "ok": false,
 "problems": [
  "s1: https://example.org/caesar-source was not fetched in this run (fetch-log); cite only what was read",
  "s2: https://example.org/badian was not fetched in this run (fetch-log); cite only what was read"
 ],
 "warnings": [],
 "quote_checks": [],
 "independent_sources": [
  "s1",
  "s2"
 ],
 "corroborated": true
}

With --any-url, as for a pack made elsewhere, the structure passes and both sources count as independent:

python hw.py verify sources pack-good/sources.json --offline --any-url
{
 "ok": true,
 "problems": [],
 "warnings": [],
 "quote_checks": [],
 "independent_sources": [
  "s1",
  "s2"
 ],
 "corroborated": true
}

A measured claim, added to a copy of the test pack's first source as {"claim": "the wheel was 14 ft across", "locator": "Sheet 3 of 7", "measured": {"scale": "1:24 (scale bar)", "how": "ruler on the scan, rim to rim"}}:

python hw.py verify sources pack-measured/sources.json --offline --any-url
{
 "ok": true,
 "problems": [],
 "warnings": [],
 "quote_checks": [
  {
   "source": "s1",
   "claim": "the wheel was 14 ft across",
   "found": null,
   "match": "measured",
   "locator": "Sheet 3 of 7"
  }
 ],
 "independent_sources": [
  "s1",
  "s2"
 ],
 "corroborated": true
}

At 0.4.0 the same file failed with s1: claim 'the wheel was 14 ft across' has no supporting quote.

Wikidata: every statement, never the truthy one alone

A plain Wikidata query (wdt:P569) returns only the best-ranked value. For Caesar that hides three of four statements, among them Mommsen's 102 BC. A SPARQL query of the same value prints -0099-07-11 for 12 July 100 BC Julian, because it counts a year 0 and converts to the Gregorian calendar. wd claims reads every statement with its rank, calendar, precision, qualifiers and references, and adds notes when a property has several statements or a disputed flag (Commands). wd sparql warns when a query reads a time property through wdt:.

Clone this wiki locally