S9 (a1): slip reader — zero-API OCR

tesseract.js (self-hosted WASM, Apache-2.0) + pure per-book layout
parsers (DK/FD/MGM/Caesars) with per-field confidence and needs_review
honesty — the reader never guesses. POST /api/slips/parse (auth, free
1/day paid 10/day, 4MB cap) + Next proxy. Gated /slip page: upload or
paste, manual-correct UI, per-leg grades through the normal engine
(refusals render honestly), add-all to Parlay Lab, share card. Vision
model upgrade logged post-revenue. 2574 -> 2608 tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kev
2026-07-11 19:32:17 -04:00
parent aaafc3e0f2
commit 4e49ee0990
18 changed files with 1914 additions and 1 deletions
+18
View File
@@ -3,6 +3,24 @@
## Last Updated
2026-07-11
## Session S9 (a1 board, 2026-07-11) — Slip Reader: zero-API OCR ✅
Spec: `specs/a1-s9-slip-reader.md`. +34 tests (24 unit + 10 integration).
- **slipReader service** — tesseract.js (self-hosted WASM, Apache-2.0, zero
API spend) + PURE per-book layout parsers (DraftKings, FanDuel, BetMGM,
Caesars) on OCR-text fixtures. Per-field confidence; below 0.6 → field
null + `needs_review` — the reader never guesses. Stats normalize to the
scan-route vocabulary; names through `playerName`.
- **POST /api/slips/parse** — auth, free 1/day paid 10/day (`slips:{user}:
{day}` Redis + memory mirror), 4MB image cap, text paste path. Next proxy
added. Mounted in app.js.
- **/slip page** (gated) — upload/paste screenshot → manual-correct UI
(amber = uncertain) → per-leg grade via existing /api/scan (honest
refusals) → add-all to Parlay Lab → "VYNDR read my slip" share card.
- **Acceptance: FULL image path** — synthetic DK slip PNG (sharp SVG→PNG)
→ real tesseract.js OCR → parser → 3/3 complete legs. Untested on a real
phone screenshot yet — grab one post-deploy.
- Vision-model upgrade logged post-revenue in specs/vyndr-roadmap.md.
## Session S3 (a1 board, 2026-07-11) — Affiliate + Partnership Plumbing ✅
Zero out-of-pocket; everything config-flip-ready but DISABLED/organic.
2398 → **2439 tests** (209 suites), web build exit 0.