| name | ocr-corpus-replay |
| description | Use when user wants to Validate OCR changes against failure corpus before shipping |
| disable-model-invocation | true |
| context | fork |
| agent | code |
OCR Corpus Replay Skill
Replay recorded OCR failures to validate vision/preprocessing changes don't cause regressions.
When to Use
- After modifying
src/autoscrapper/ocr/inventory_vision.py
- After changing threshold/score_cutoff values in fuzzy matching
- Before shipping OCR-related changes
- When investigating OCR accuracy issues
Usage
/ocr-corpus-replay
/ocr-corpus-replay --check-only
/ocr-corpus-replay --verbose
What It Does
- Loads recorded OCR failure cases from the corpus
- Re-extracts text/boxes using current implementation
- Compares output against baseline
- Reports: match count, deviation count, coordinate shifts, threshold impact
- Returns exit code 0 (pass) or 1 (fail) for CI integration
Behind the Scenes
Runs: uv run python scripts/replay_ocr_failure_corpus.py [args]
Validates:
- Text extraction accuracy (fuzzy match threshold T001)
- Bounding box coordinate stability
- Upscale artifact handling
- Preprocessing pipeline consistency
Critical Note
Never ship OCR changes without corpus replay validation. The corpus captures real-world cases that point detection or preprocessing changes can subtly break.
Invoke with /ocr-corpus-replay after OCR edits.