← Back to Pull requests

fix(label-content-name-mismatch): ignore symbols that NFKD turns into letters #5578

Open
WilcoFiers opened this pull request with 58 lines diff across 4 files
View on GitHub
WilcoFiers WilcoFiers commented on Nov 25, 2026 12:14 UTC
Author

🤖 Remove symbol characters (\p{S}) before case folding in curateTokens(). NFKD (inside caseFoldUnicode()) turns some symbols into letters or digits, which were then compared as words, so a visible label like Acme Widget™ with the name Acme Widget failed. The same went for ℠ → SM, № → No, ℡ → TEL, ℃ → °C, ⓐ → a and ₨ → Rs. Before 4.14, removeUnicode({ nonBmp: true }) removed these.

Full-width letters, digits and parentheses aren't symbols, so they still normalize to ASCII as before (#5419). Characters that decompose to parenthesised content (⑴, ㈱) are still removed.

Tests: 9 new check tests (™, ℠, ℡, №, ℃, ⓐ, ₨, ™ in an aria-hidden superscript, Order №5). All of them fail without the fix. The rule's check, integration and commons/text tests pass.

Note: axe.min.js grows by about 2.7 KB, because Babel compiles \p{S} into explicit ranges for older browsers.

Closes: #5577

Diff: 58 lines (+52 / -6) across 4 files Reviewer: straker Review duration: 11823m
All Vouch review confidence checks passed
Residual risk 0.06 = Change Risk (0.32) × (1 − Review Confidence (0.82)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.32 · 58 lines diff across 4 files
0.32
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.72 · 2 substantive comment(s)
0.72
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
82%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.244
Real PR Conversation Timeline
2 comments
lib/checks/label/label-content-name-mismatch-evaluate.js
"I think we can avoid having to add the 2.5KB to the min file size by not using the Symbol unicode and instead using `removeUnicode({ nonBmp })` here. If we also remove emoji at this step instead of later, the only test that fails is the `keeps numbers that are outside the basic digits` test which we talked about should pass, so we can update the test to `isTrue` rather than `isFalse`. ```suggestion let text = removeUnicode(str, { nonBmp: true, emoji: true, replaceWith: ' ' }); ```"
test weight: 0.55
lib/checks/label/label-content-name-mismatch-evaluate.js
"Good call, done in 44f0d3c. I flipped the ⓫ test and added `①`, `❶` and `1️⃣` cases (`<div role="link" aria-label="1 notification">① notification</div>` passes). What this gives up: symbols outside the `nonBmp` ranges still go through NFKD, so `5㎏` still becomes `5 kg`. 4.13 didn't strip it either, so it's not a regression, and I'm fine leaving it until someone runs into it. _🤖 AI-generated, reviewed by me._"
test weight: 0.55
Reviewers
Assignees
WilcoFiers WilcoFiers
Labels
risk: low confidence: 82.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 31.8% (LOW) · Higher = larger blast radius
31.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 82.5% · Lower = rushed or shallow review
82.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 5.6% · Safe to merge
5.6%