Catching Hallucinated Citations Locally: ISO 2108 ISBN, ISO 3297 ISSN Check-Digit Math and BibTeX Forensics in Zero-Upload Python and WebCrypto

Completing our 12-part engineering monograph series: exact EAN-13 Mod-10, prime Z_11 Mod-11 (ISBN-10 / ISSN), ISO 26324 DOI registrant screening, arXiv YYMM calendar invariants, and escape-aware BibTeX verification running 100% locally in browser RAM (25,001 B) and MIT Python stdlib MCP/CLI.
Catching Hallucinated Citations Locally: ISO 2108 ISBN, ISO 3297 ISSN Check-Digit Math and BibTeX Forensics in Zero-Upload Python and WebCrypto

Catching Hallucinated Citations Locally: ISO 2108 ISBN, ISO 3297 ISSN Check-Digit Math and BibTeX Forensics in Zero-Upload Python and WebCrypto

Peer-review confidentiality rules such as NIH Notice NOT-OD-23-149 prohibit pasting embargoed manuscripts into hosted third-party services, yet ungrounded language models continue to emit plausible bibliographies with fabricated identifiers. Because autoregressive next-token sampling splits 10- and 13-digit book codes across variable subword boundaries without computing modular inner products, structural checksum math eliminates fabricated citations deterministically on your own hardware (0 bytes uploaded).

This 12th and final monograph in our engineering series documents the shared verification logic behind our browser Citation & Hallucinated Reference Verifier (25,001 B pure client-side JS, 0 fetch/XHR calls) and the MIT-licensed verify_citation_identifiers MCP tool & ./cli/destiny-verify.sh cite CLI in karany97/destiny.


1. ISO 2108 ISBN-13 (EAN-13 1/3 Modulo-10) & Algebraic Blind Spots

Every modern Bookland identifier starts with GS1 prefix 978 or 979 and appends terminal check digit d_13:

S_12 = sum_{i=1}^{12} w_i * d_i,   w_i = 1 (odd i) or 3 (even i)
d_13 = (10 - (S_12 mod 10)) mod 10

For Kernighan & Ritchie (The C Programming Language, 2nd ed., 978-0-13-110362-7), S_12 = 73, requiring d_13 = (10 - 3) mod 10 = 7. Altering 7 -> 9 yields residue 82 != 0 (mod 10), rejecting 90% of uniformly random 13-digit fabrications offline. Because gcd(3 - 1, 10) = 2, EAN-13 catches 100% of single-digit errors and all adjacent transpositions except pairs differing by |d_i - d_{i+1}| = 5.


2. Prime Field Z_11 Protection in ISBN-10 & ISO 3297 ISSN

Because 11 is prime, every nonzero residue difference has a multiplicative inverse modulo 11. Both ISO 2108 ISBN-10 (weights 10..1, terminal 'X' = 10) and ISO 3297 ISSN (8-character XXXX-YYYX, weights 8..1) guarantee 100% detection of every single-digit alteration and every transposition between any two distinct positions:

  • ISBN-10 check (0-201-61622-X): sum_{i=1}^{9} (11 - i)*d_i = 100, giving (11 - (100 mod 11)) mod 11 = 10 -> 'X'. Substituting '7' emits deterministic failure (expected X, found 7).
  • ISO 3297 ISSN check (Nature 0028-0836): 8*0 + 7*0 + 6*2 + 5*8 + 4*0 + 3*8 + 2*3 + 1*6 = 88 == 0 (mod 11).

3. ANSI/NISO Z39.84 DOI Grammar, arXiv Calendar Bounds & BibTeX Forensics

  1. DOI Screening (ISO 26324): Normalizes doi: / doi.org/ prefixes, strips trailing sentence punctuation (.,;)]}), ignores path segments inside unrelated https:// URLs, and rejects synthetic registrant prefixes (10.0000, 10.1234, 10.9999).
  2. arXiv Calendar & Era Invariants: Post-April 2007 YYMM.NNNN(N) identifiers require 01 <= MM <= 12, reject modern prefixes earlier than 0704, enforce 4 digits for 2007–2014 and 5 digits for 2015+ (2309.06180 passes; 2309.6180 fails; 2315.06180 fails), verify pre-April 2007 archive/YYMMNNN (1991-08..2007-03), and flag cited-year splices (|arXiv_year - year| > 2).
  3. Escape-Aware BibTeX & Local MIT Tooling: Tracks `-escaped quotes and {}depth per@entry{key, …}, checks mandatory fields per entry type (@article, @book, @inproceedings, @phdthesis), flags duplicate cite keys, and audits local .bib files under strict path-traversal (..) and size guards inside both browser RAM and Python >=3.10 stdlib (0` pip deps).

Live Zero-Upload Tools, Mathematical Guide & Archival References


Write a comment