Skip to content

Align phone scanner contract#27

Merged
alyldas merged 2 commits into
mainfrom
issue-26-shared-scanner-contract
Jul 1, 2026
Merged

Align phone scanner contract#27
alyldas merged 2 commits into
mainfrom
issue-26-shared-scanner-contract

Conversation

@alyldas

@alyldas alyldas commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Keep the phone scanner contract names as backward-compatible shared-shape adapters.
  • Export PhoneScanHints and keep scanner range and sink shapes aligned with the shared range contract style.
  • Replace the local phone masking call with the shared core censorCodePointRanges() helper.
  • Add regression coverage for scanner contract typing and public censor wrapper alignment with scanner ranges.

Validation

  • npm ci with a temporary npm cache because registry access is unavailable inside the sandbox
  • npm run check with a temporary npm cache
  • npm run benchmark:phone
  • npm pack --dry-run with a temporary npm cache

Benchmark Evidence

Baseline origin/main:

  • check short clean: 0.0025 avg ms
  • check hinted short clean: 0.0005 avg ms
  • check low digit text: 0.0033 avg ms
  • check hinted low digit text: 0.0008 avg ms
  • check direct phone: 0.0111 avg ms
  • check late-match phone: 0.7767 avg ms
  • censor short clean: 0.0012 avg ms
  • censor long clean: 0.3402 avg ms
  • censor direct phone: 0.0246 avg ms
  • censor late-match phone: 0.6706 avg ms

This branch:

  • check short clean: 0.0026 avg ms
  • check hinted short clean: 0.0005 avg ms
  • check low digit text: 0.0030 avg ms
  • check hinted low digit text: 0.0008 avg ms
  • check direct phone: 0.0087 avg ms
  • check late-match phone: 0.5752 avg ms
  • censor short clean: 0.0012 avg ms
  • censor long clean: 0.2329 avg ms
  • censor direct phone: 0.0081 avg ms
  • censor late-match phone: 0.5997 avg ms

The runtime change delegates masking to the existing core helper; scanner matching behavior is unchanged.

Compatibility Notes

  • Existing public API remains backward compatible.
  • createPhoneFilter(), phoneFilter, filter, createPhoneScanner(), scanPhoneRanges(), and scanPhoneRangeMatches() remain available.
  • Existing PhoneScanInput, PhoneRangeScanResult, PhoneRangeMatch, and PhoneRangeMatchSink names remain available.

Closes #26

BEGIN_COMMIT_OVERRIDE
feat: align phone scanner contract
END_COMMIT_OVERRIDE

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eda42e425b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/index.ts Outdated
@alyldas alyldas merged commit 99c95d6 into main Jul 1, 2026
4 checks passed
@alyldas alyldas deleted the issue-26-shared-scanner-contract branch July 1, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Align phone scanner with shared scanner contract

1 participant