一键导入
add-fixture
// Add a new OCR regression fixture from an ocr_debug image. Use when a scan misidentified an item and you want to lock in the correct result as a test case.
// Add a new OCR regression fixture from an ocr_debug image. Use when a scan misidentified an item and you want to lock in the correct result as a test case.
Use when user wants to Run the Arc Raiders AutoScrapper validation stack after edits. Use for linting, typing, tests, workflow checks, and broader repo validation.
Use when user wants to Update Metaforge snapshots and bundled default rules
Use when user wants to Validate OCR changes against failure corpus before shipping
Use when user wants to Run full validation, push branch, and open a PR with appropriate context notes
Workflow for safely adding, removing, or renaming persisted config fields in config.py. Use whenever editing dataclass fields in src/autoscrapper/config.py. Covers incrementing CONFIG_VERSION, writing a migration function, and validating the round-trip.
Use when user wants to Find and remove genuine dead code using deadcode + vulture. Filters known false positives (dataclass fields, protocol methods, dunder hooks). Run before a cleanup commit.
| name | add-fixture |
| description | Add a new OCR regression fixture from an ocr_debug image. Use when a scan misidentified an item and you want to lock in the correct result as a test case. |
| disable-model-invocation | true |
When OCR misidentifies an item, capture a regression fixture so the failure can never silently recur.
The ocr_debug/ directory must contain the problem image. Run a dry-run scan if it is empty:
uv run autoscrapper scan --dry-run
uv run python scripts/capture_ocr_fixture.py IMAGE_PATH EXPECTED_NAME
Example:
uv run python scripts/capture_ocr_fixture.py ocr_debug/infobox_3.png "Rusty Gear"
Output:
tests/fixtures/ocr/rusty_gear.png ← copy of the source image tests/fixtures/ocr/rusty_gear.json ← sidecar: expected_name, source, captured_at
If the fixture already exists, the script prompts before overwriting.
uv run pytest tests/autoscrapper/ocr/test_ocr_fixtures.py -v
If it fails, the OCR is still broken - this is now a tracked regression. Fix the OCR logic, then rerun until the fixture passes.
uv run pytest tests/autoscrapper/ocr/ -v
All existing fixtures must still pass after adding the new one.
"Arc Alloy" → arc_alloy.pngocr_debug/ is disposable and is not committed; fixtures in tests/fixtures/ocr/ are committed