
Problem: Many APIs are specified only as documents. Developers transcribe them by hand, and document defects flow straight into code. The official 194-page UniFi Access API PDF defines “visit_reason” as an enum on page 52, yet its own samples on page 56 and 63 send “Interviemw”. Solution: SpecProof has an AI extract each spec section into a contract where every field cites a page and a verbatim quote. Deterministic code, never a model, then verifies every claim: the quote must exist on the cited page, table rows must match their required flags and types, and the document’s own samples must be copied verbatim and validate. Failures get machine-generated feedback and at most three attempts; what still fails is quarantined. Conflicts between two grounded parts of the document are reported as spec defects. The verified contract is then compared with a community OpenAPI conversion and used to test the py-unifi-access client. Result: 108/108 endpoint sections extracted; 1406/1406 citations found verbatim on their pages; 97 – 115 of 116 sections verified by the self-correction loop (1 quarantined); a blind audit of 40 random items was 40/40 correct (95% CI91-100%). A human reviewed all 63 candidate findings: 19 confirmed spec defects, 8 community-spec differences, and 1 client bug. By hand, one section took 8.5 minutes with 2 of the 10 rows wrong; SpecProof re-verifies the whole spec in 4.8 seconds
27 Sep 2026