Add native IK-style capture processing, Artifact Inventory, explicit promotion and single-result review. Confirm the three live OCR corrections in the eval corpus and preserve extraction/value separation.
Adds the accuracy check yas / Genshin Optimizer use: a substat value is only
legitimate if it equals round(sum of 1..6 rolls) from that stat's roll table.
Values that fit no combination at either rarity are guaranteed OCR misreads.
- src/lib/substatRolls.ts: 5-star roll tables (+ 4-star %/crit tables to tell
rarities apart), pure isPlausibleSubstat/implausibleSubstats, and inferRarity
(level > 16 or roll-table fit; conservative, defaults to 5). Validates against
the union of rarities so valid 4-star pieces are not false-flagged.
- Wired in: shouldFlagArtifactForReview routes implausible substats to review;
the parser adds an explanatory note; goodInterop export replaces the hardcoded
rarity:5 with inferRarity (fixes wrong 4-star exports to GO/IK).
- 10 new unit tests; 131 total green; eval still 100%.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Task #5 building blocks, each a pure + unit-tested module:
- goodInterop.ts: GOOD (Genshin Optimizer / Inventory Kamera / Akasha) import and
export for scanned StoredArtifactRecords - slot/stat/set key maps both ways,
substat string <-> { key, value }, main-value reconstruction on import
(ADR-003). Export is lossless; import is best-effort (GOOD lacks piece names).
- artifactMerge.ts: rescan-merge (ADR-006 follow-up). Level-independent identity
(set + slot + main + substat NAME set) collapses leveled re-scan duplicates,
keeping the higher-level/stronger record and summing timesSeen. Conservative:
differing substat lineups never merge.
- dataPackageStatus.ts: warns when the genshin-db package is older than ~45 days
(a patch cycle) so new sets/characters aren't silently missed; surfaced in the
Scanner Diagnose data-package line. Adds dataGeneratedAt to genshinData.
- lockDetection.ts: EXPERIMENTAL read-only lock-status heuristic (gold-pixel
ratio in a top-right icon crop). Pure + tested but not wired into capture; crop
position and threshold need calibration against a reference 16:9 screenshot.
120 tests + build green. Remaining wiring (needs UI / live calibration): GOOD
import/export buttons and live lock detection.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>