Repository navigation
feat(scrub): match national phone numbers; 00 prefix only at a token start - #4
Merged
Merged
Conversation
…start - NATIONAL_PHONE_PATTERN: German/Austrian trunk-prefix numbers with a separator after the area code (030 1234567, 0221/123456, (0221) 123 456) - PHONE_PATTERN: the 00 international prefix no longer matches inside digit runs (ids, timestamps, order numbers) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014BM517C36Je3UT1YZegY7m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scrub(and the catch-all pass in schema-aware mode) found config-analytics-api had to work around two gaps, see itstransform/redact.tsTODO:PHONE_PATTERNonly knows+/00prefixes, so030 1234567or0221/123456, the usual way German configs write a hotline, pass through. NewNATIONAL_PHONE_PATTERNmatches trunk-prefix numbers with a separator after the area code:030 1234567,0221/123456,0170-1234567,(0221) 123 456,089 123 456 78.0301234567written as one run is not caught (documented in the README).0[1-9], so the+00 000 …pseudonyms don't re-match, andscrubstays idempotent.00prefix matched inside digit runs.17297001234567890became17297+00 000 …andA-2007891234567becameA-2+00 000 …. The00form now only matches at a token start;+is unchanged.Test plan
npm test: 33 pass. The 2 new tests fail onmain: national numbers are not scrubbed, and ids/timestamps get mangled.npm run lintGenerated by Claude Code