fix(services): catch the plural "rankings" in remediation-plan's forbidden-word gate - #8913
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…idden-word gate FORBIDDEN_PATTERN matched only the bare singular `ranking` — the trailing `\b` can never sit between "g" and "s", so "rankings" slipped past this secondary public-safety gate. Change `ranking` to `rankings?`, matching the sibling regex fix in input-model.ts (JSONbored#913), and export the pattern so its plural coverage can be asserted directly (the term is unreachable through the public builder because sanitizePublicComment rewrites it before this gate is consulted). Closes JSONbored#8886 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8913 +/- ##
==========================================
- Coverage 93.84% 90.57% -3.28%
==========================================
Files 803 97 -706
Lines 80084 22548 -57536
Branches 24277 3907 -20370
==========================================
- Hits 75157 20422 -54735
+ Misses 3562 1946 -1616
+ Partials 1365 180 -1185
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 13:35:52 UTC
Review summary Nits — 1 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
FORBIDDEN_PATTERNinremediation-plan.tsmatched only the bare singularranking. Because thetrailing
\bcan never sit between "g" and "s", the pattern could never match inside "rankings", sothe plural slipped past this secondary public-safety gate (
FORBIDDEN_PATTERN.test("...the rankings of...")returnedfalse).rankingtorankings?, matching the sibling regex fix already applied ininput-model.ts(Fix public scenario reward/ranking sanitization #913).FORBIDDEN_PATTERNso its forbidden-term coverage can be asserted directly — the term isunreachable through the public builder because
sanitizePublicCommentrewrites it before this gateis consulted, exactly how the issue itself verified the gap.
Test plan
FORBIDDEN_PATTERNmatches bothrankingandrankings, and a benign prefix ("rankboard") still passesrankings?→rankingmakes the plural assertion failnpx vitest run test/unit/remediation-plan.test.ts— 17/17 pass;tsc --noEmitcleanCloses #8886