feat(enrichment): add non-inclusive terminology analyzer - #3268
Merged
JSONbored merged 1 commit intoJul 5, 2026
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Contributor
|
Important 🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪 🔍 Gittensory is reviewing…AI analysis is in progress. This comment will update when the review is complete. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3268 +/- ##
=======================================
Coverage 94.12% 94.12%
=======================================
Files 276 276
Lines 30202 30202
Branches 11011 11011
=======================================
Hits 28429 28429
Misses 1127 1127
Partials 646 646
🚀 New features to boost your workflow:
|
JSONbored
approved these changes
Jul 5, 2026
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.
Closes #2031
What
A new local REES analyzer,
terminology, that flags non-inclusive terms a PR adds in identifiers or comments (whitelist/blacklist,master/slave) and suggests the neutral replacement — a config-driven house-style signal. Pure compute over added lines, no network.Detection (stateless, precision-first)
snake_case, and any non-alphanumeric run, then each lowercased token is matched against a bounded term→suggestion table. A non-inclusive term is flagged wherever it appears as a whole token — including as a camelCase/snake_case compound component, which is the point of scanning identifiers:slaveNodes→[slave, nodes],masterNodes→[master, nodes],blacklistIDs→[blacklist, ids], andmaster_keyare all flagged. What is never flagged is a different word that merely contains the letters:masterclass,postmaster,mastermind,slavery, andenslavedeach tokenize to a single distinct token, so there is no substring false positive (the issue's explicit precision requirement).http://host/master/x) cannot trip a finding.whitelist(+ed/+ing/+s) → allowlist…,blacklist(+ed/+ing/+s) → denylist…,master → main or primary,slave(+s) → replica or secondary. Inflections we want are listed explicitly rather than fuzzy-stemmed, so an unlisted form likemastered/slavery— a genuinely different word — is out of scope.\ No newlineline-counter fix. Terms de-duplicated per line; findings capped (maxFindings: 25) per file and globally.Registration
Registered as a local descriptor (category
quality, costlocal, requires["files"]) with an inlinerender(), following thelooseRangedescriptor shape. All wiring updated:types.ts(TerminologyFinding+terminology?key),render.ts,analyzer-registry.test.ts, rootsrc/review/enrichment-analyzer-names.ts, roottest/unit/enrichment-wire.test.ts, and the generatedanalyzer-metadata.json/rees-analyzers.ts/.env.examplevianode scripts/generate-analyzer-metadata.mjs.Tests
review-enrichment/test/terminology.test.ts(14 tests) covers: tokenization across camelCase/snake_case/non-alphanumeric with URL blanking, each term flagged with its suggestion, camelCase/acronym plural compounds intentionally matched on their non-inclusive component (slaveNodes→slave,masterNodes→master,blacklistIDs→blacklist — the documented-and-tested behavior the gate asked to pin down), token-based no-substring-false-positive cases (masterclass/postmaster/mastermind/slavery/enslaved), per-line de-duplication, URL suppression, case-insensitive matching, added-line scanning with exact locations, a single line with two distinct terms emitting two findings and filling amaxFindings:1budget with just the first, added-lines-only with line-number accuracy across mixed hunks, the per-file cap +maxFindings: 0, the entrypoint's global cap across files, the no-files case, and the rendered brief section. Analyzer metadata is regenerated and committed.