Card, URL, and IP recognizers miss candidates or report incomplete spans
Affected module
Ingestion Framework
Describe the bug
The shipped recognizers can miss an embedded credit card number or return evidence whose span does not identify the complete value:
| Column | Sample value | Current recognition result |
|---|---|---|
card_note |
Card 4111111111111111 issued |
No credit-card hit |
customer_card |
4111-1111-1111-1111 |
Card hit, but its offsets omit part of the original value |
service_url |
http://app.internal.local/path |
URL hit only for http://app.int |
user_session_ip |
2001:db8::1 |
IP hit only for 2001:db8:: |
The card wrapper removes separators from the whole input before applying anchored card patterns. This prevents a card embedded in prose from matching and makes offsets refer to the sanitized text. The URL and IPv6 patterns can instead accept a valid prefix of a longer candidate.
Parent epic: #33827.
To Reproduce
At evaluated commit ba688d605830bb3d287ab65e8096b3b4724ce198, run the shipped recognizers through the default TagProcessor with each column and single sampled value above. Use workflow language en. Inspect both the emitted tag and the recognizer result's entity, start and end offsets, and corresponding substring of the original input.
Expected behavior
A supported candidate should be recognized as a complete substring of the original value, with offsets that select exactly that substring. A recognizer should not accept a shorter URL or IP prefix when it is part of a longer candidate it cannot validate.
Proposed change
Extract bounded candidates from the original input, validate each candidate using the existing card checksum or URL/IP validation, and retain offsets into the original string. For URLs and IP addresses, reject partial-prefix matches or select the complete valid candidate. Keep internal-hostname support as an explicit decision; rejecting http://app.int as a false partial match does not itself establish that .local URLs should be supported.
Acceptance criteria
- Recognize the embedded, compact, dashed, and spaced Luhn-valid card controls with exact original-text spans; reject checksum-invalid controls.
- Do not return
http://app.intforhttp://app.internal.local/pathor2001:db8::for2001:db8::1. - Preserve full matches for supported public URLs, IPv4, and compressed and uncompressed IPv6 forms.
- Test adjacent punctuation, longer invalid tokens, and unrelated Luhn-valid numbers to catch new incidental matches.
- Check recognizer evidence and final
TagProcessoroutput separately across the shipped credit-card workflow languages. A corrected span alone should not be claimed as a corrected PII decision.
Source: open-metadata/OpenMetadata