Skip to content

Warn about group labels differing only in case or spacing - #1035

Merged
yakew7 merged 1 commit into
yakew7:mainfrom
prami25r:fix/group-label-collisions-1009
Oct 17, 2026
Merged

yakew7 merged 1 commit into
yakew7:mainfrom
prami25r:fix/group-label-collisions-1009

Conversation

@prami25r

Copy link
Copy Markdown
Contributor

Summary

Adds a warning when distinct labels within a dimension match after trimming and full Unicode case-folding. For example, M and m remain separate groups with their original counts, but now raise sex: 'M' and 'm' differ only in case or spacing.

  • Python and JavaScript produce the same warnings, surfaced through the existing terminal, browser, HTML, and CSV reports.
  • Reuses the Unicode trim set and JS case-folding helper without applying numeric or NFKC normalization.
  • Updates SPEC section 3 and adds 65 regression cases covering preserved metrics, Unicode, missing values, property-named labels, dimension scoping, and report parity.

Type

  • Bug fix

Validation

  • Final fast suite: 903 passed, 2 skipped, 27 deselected (slow tests and four pre-existing Windows failures deselected).
  • Full suite also run. Seven unrelated Windows path/regex/error-message failures were reproduced on unchanged upstream aa98442. A SPEC wording failure found during that run was corrected; its checks and the final fast suite pass.
  • Ruff, em-dash lint, internal-link checks, and Unicode case-fold parity check pass.
  • The issue reproducer adds exactly one collision warning; all other structured fields match the original implementation.

Linked issue

Closes #1009

@vercel

vercel Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the yashkewlani2020-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Hey @prami25r, your first PR on Fair Code, that's awesome, thank you.

This project is about making AI more accountable, and contributions like yours are what keep that work going. We'll review your changes shortly.

If you haven't already, give the contributing guide a quick read: it covers how audits are structured and what we look for in a review.

And if you're finding Fair Code useful or interesting, a star on the repo genuinely helps more people find it - no pressure, just appreciated.

@github-actions

Copy link
Copy Markdown

@yakew7 @ahmdkaml - new PR touching a path you own, please review.

@yakew7
yakew7 merged commit a951cf6 into yakew7:main Oct 17, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Group labels that differ only in case or surrounding spaces are counted as separate groups with no warning

2 participants