Skip to content

Align URL scanner contract#27

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

Align URL scanner contract#27
alyldas merged 1 commit into
mainfrom
issue-26-shared-scanner-contract

Conversation

@alyldas

@alyldas alyldas commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Keep the URL scanner contract names as backward-compatible shared-shape adapters.
  • Export UrlScanHints and keep scanner range and sink shapes aligned with the shared range contract style.
  • Replace the local URL masking wrapper 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:url
  • npm pack --dry-run with a temporary npm cache

Benchmark Evidence

Baseline origin/main:

  • check short clean: 0.0015 avg ms
  • check hinted short clean: 0.0009 avg ms
  • check long clean: 0.5148 avg ms
  • check hinted long clean: 0.5073 avg ms
  • censor short clean: 0.0010 avg ms
  • censor long clean: 0.5245 avg ms
  • censor direct URL: 0.0116 avg ms
  • censor late-match URL: 0.6745 avg ms

This branch:

  • check short clean: 0.0012 avg ms
  • check hinted short clean: 0.0011 avg ms
  • check long clean: 0.5248 avg ms
  • check hinted long clean: 0.5228 avg ms
  • censor short clean: 0.0009 avg ms
  • censor long clean: 0.5767 avg ms
  • censor direct URL: 0.0139 avg ms
  • censor late-match URL: 0.6312 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.
  • createUrlFilter(), urlFilter(), filter, createUrlScanner(), scanUrlRanges(), and scanUrlRangeMatches() remain available.
  • Existing UrlScanInput, UrlRangeScanResult, UrlRangeMatch, and UrlRangeMatchSink names remain available.

Closes #26

BEGIN_COMMIT_OVERRIDE
feat: align URL scanner contract
END_COMMIT_OVERRIDE

@alyldas alyldas merged commit 4432cc7 into main Jul 1, 2026
4 checks passed
@alyldas alyldas deleted the issue-26-shared-scanner-contract branch July 1, 2026 14:14
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 URL scanner with shared scanner contract

1 participant