Commit graph

3 commits

Author SHA1 Message Date
Randall Stillwell
04504903bf perf(scanner): three high-impact speed optimizations
Some checks are pending
CI / Lint (pull_request) Waiting to run
CI / Schema map up to date (pull_request) Waiting to run
CI / Forbidden patterns (9 checks) (pull_request) Waiting to run
CI / Migrations apply (node-pg-migrate) (pull_request) Waiting to run
CI / Unit tests (vitest) (pull_request) Waiting to run
Convoy metrics gate / Require role-event telemetry on convoy PRs (pull_request) Waiting to run
PR Health rollup / Aggregate gate status (pull_request) Waiting to run
Preview smoke / Should run? (pull_request) Waiting to run
Preview smoke / Playwright smoke (pull_request) Blocked by required conditions
1. Non-blocking scan capture upload (emitScannedCard)
   - Card result shows immediately; upload fires in background
   - Removes ~500ms blocking S3/MinIO roundtrip from the result path

2. Parallel OCR workers for name + number strips (ocr-worker)
   - Two independent Tesseract workers run simultaneously
   - Cuts Layer 1 OCR time ~50% on mobile (name + number in parallel)
   - terminateOcrWorker cleans up both workers on teardown

3. Faster pre-verification timing (scanner-card-detection)
   - VERIFICATION_INTERVAL_MS: 1000 → 500ms
   - MIN_FIRST_SEEN_MS_FOR_VERIFY: 800 → 500ms
   - Net ~300ms faster from first detection to verification start

All 58 scanner tests pass (2.20s).
2026-09-01 17:17:20 -05:00
varutasu
0b4f419f49
Scanner identify upgrade — Phase 1 hot path (#156)
* docs(convoy): seed scanner identify upgrade epic and sub-convoys

Baseline scan_attempts telemetry and three-phase plan for faster, more
accurate card identification without touching scanner chrome.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(scanner): tighten Layer-1 identify hot path (Phase 1)

Cut verify hold-still gates, OCR collector numbers on Layer 1, request
structured Gemini JSON, and skip automatic L2 refine when L1 opens the
printing picker. Includes convoy UX/architecture briefs and unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-14 20:21:20 -05:00
varutasu
d798e284c3
feat(scanner): AI Gateway vision + Layer-1 Tesseract/pg_trgm OCR (#38)
Route Layer-2 identification through Vercel AI Gateway (AI_GATEWAY_API_KEY,
default google/gemini-2.5-flash-lite). Add Layer-1 browser Tesseract name-strip
OCR with pg_trgm fuzzy catalog match via /api/cards/identify-by-text before
escalating to vision.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-27 12:59:59 -05:00