b8a38ba547
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2.6 KiB
2.6 KiB
Scanner rework status
Progress on the approved scanner/OCR rework. See ADR-007/008/009 in DECISIONS.md for the decisions behind these.
Done (implemented, unit-tested, build green)
- OCR eval harness —
src/eval/,npm run eval, gate innpm test. See ocr-eval.md. - C# input/capture sidecar —
native/input-helper/,npm run helper:build. Replaces the PowerShell helper on the same JSON protocol; PowerShell remains a fallback. Verified end-to-end (spawn, runtime, base64 capture). - Layout profiles + OCR preprocessing —
src/lib/layoutProfile.ts(pure geometry, 16:9 detection),src/lib/ocrPreprocess.ts(grayscale + Otsu binarize). main.ts crops via the profile and OCRs an upscaled + binarized copy. - Card-ready gating —
src/lib/cardReadyGate.tsreplaces the fixed 280 ms settle with change+stability polling; robust to animation. - GOOD interop —
src/lib/goodInterop.ts(export + best-effort import for scanned records). - Rescan-merge —
src/lib/artifactMerge.tscollapses leveled re-scan duplicates by a level-independent identity. - Data staleness warning —
src/lib/dataPackageStatus.ts, surfaced in the Scanner Diagnose data-package line. - Lock detection (experimental) —
src/lib/lockDetection.ts, pure heuristic, not yet wired into capture.
Remaining — needs the live environment or a UI pass
These cannot be finished/validated without Genshin running at the user's resolution or without UI work best tested live:
- Calibrate IK-style fixed crop coordinates (ADR-009). The layout module is the structure; the exact per-field fractions still come from a colour-detected/fallback detail rect. A reference 16:9 screenshot of the artifact screen lets us pin exact client-relative crop coordinates.
- Validate/tune OCR preprocessing on real captures — confirm invert + threshold + upscale factor help (not hurt) actual Tesseract reads. The text-level eval harness cannot measure image preprocessing.
- Wire GOOD import — file-picker IPC + merge imported records into the store (the conversion engine is done and tested).
- Wire live lock detection — calibrate crop position/threshold against a
reference screenshot, then populate a
lockedflag during capture.
Grow the eval corpus
Every low-confidence review sample already stores its crops + OCR. Confirm/correct
those via reviewSampleToEvalCase and commit them into src/eval/corpus/ so the
harness keeps measuring real-world accuracy across patches. See
ocr-eval.md.