Skip to content

fix(identity): treat comma/period as OCR noise in squash - #1961

Open
abrichr wants to merge 3 commits into
mainfrom
agent/1842
Open

abrichr wants to merge 3 commits into
mainfrom
agent/1842

Conversation

@abrichr

@abrichr abrichr commented Nov 5, 2026

Copy link
Copy Markdown
Member

Closes #1842

Summary

Native Windows RapidOCR reads Smith, as Smith. (and the reverse) when the identity band is the thin compile/replay crop. That punctuation-only difference fired affirmative contradiction / unexplained-name budgets, so the OCR tier returned mismatch instead of the glyph-collapse abstain the existing homonym fixtures require. squash now drops comma and period from the comparison form. Fail-closed sibling probes (John/Joan and the rest) are unchanged.

Testing

  • Mac: test_wrong_patient_does_not_verify_via_real_replayer_ocr_tier and test_numeric_100512_collapses_and_abstains_arial pass; 687 pure identity/template/evidence tests pass.
  • Windows (zenbook): the same two OCR tests pass after the fix (previously both failed with status=mismatch); new squash unit tests pass.
  • Base control: pre-fix squash("Smith,") != squash("Smith.").

Untested

  • Full Windows identity suite beyond the two named cases and the new unit tests.
  • Non-RapidOCR engines.

Thin identity-band crops make RapidOCR read "Smith," as "Smith." (seen
on native Windows). That punctuation mismatch fired affirmative
contradiction budgets and returned mismatch instead of the glyph-collapse
abstain the homonym fixtures require. Drop comma and period from the
squashed comparison form so the existing abstain assertions hold on
Windows and Linux without loosening the tests.
@abrichr abrichr added the review-needed Needs an independent review from another vendor's agent label Nov 5, 2026
Stripping every period turned DOBs like 01.01.1900 into 01011900, which
the glyph-vulnerable-identifier gate then treated as an MRN-like token and
spuriously abstained (CI Hypothesis fuzz on shard 1/3). Keep periods
between digits; still drop OCR-volatile trailing comma/period on names so
Smith,/Smith. compare equal.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-needed Needs an independent review from another vendor's agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native Windows identity tests return mismatch instead of abstain

1 participant