fix(signals): catch plural private terms in the public-safe comment backstop#1380
Open
minion1227 wants to merge 1 commit into
Open
fix(signals): catch plural private terms in the public-safe comment backstop#1380minion1227 wants to merge 1 commit into
minion1227 wants to merge 1 commit into
Conversation
…ackstop containsPrivatePublicTerm is the sole public-safe gate for next-step lines and public finding titles/details on the converged PR comment (no scrub partner, unlike the unified-comment bridge). Its denylist wrapped bare-singular terms in word boundaries, so plural forms — "rewards", "payouts", "wallets", "hotkeys", "trust scores", "estimated scores" — passed the boundary and could surface on a public GitHub comment, while every sibling denylist (advisory.ts, queue-intelligence.ts, unified-comment-bridge.ts) already uses the plural-aware `s?` forms. Add `s?` to the pluralizable terms so the backstop matches singular and plural alike. Add a regression test asserting plural private terms are dropped from public finding titles, with a singular control proving no regression.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
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.
Summary
containsPrivatePublicTerm(src/signals/engine.ts) is the fail-safe public-safe backstop that drops a public-comment line if it still names private reward/wallet/trust internals. It is the sole gate at four public-surface call sites —publicSafeNextSteps,publicSafePreflightFindings, the inline next-steps filter inbuildPublicPrIntelligenceComment, andbuildPublicCommentSignalBundle— with no scrub step before it (unlikesrc/review/unified-comment-bridge.ts, whose byte-identicalPRIVATE_DROP_TERMSis safe only becausepublicSafeNitfirst scrubs with the plural-awarePRIVATE_FORBIDDEN_TERMS).rewardmatched butrewardsdid not — likewisepayouts,wallets,hotkeys,trust scores,estimated scores. A finding/step whose text used a plural (e.g. a title"Quarterly rewards summary") therefore passed the backstop and could surface on a public GitHub PR comment.s?plural form to the pluralizable terms, matching the intent already established by every sibling denylist —CHECK_RUN_FORBIDDEN_TERMS(src/rules/advisory.ts),PRIVATE_FORBIDDEN_TERMS(src/review/unified-comment-bridge.ts), andFORBIDDEN_PUBLIC_COMMENT_WORDS(src/queue-intelligence.ts), which all userewards?/wallets?/trust\s+scores?. Purely additive: every input matched before still matches; plurals now match too.linkedIssuePolicyispreferred(not required) andissueDiscoveryPolicyisdiscouraged, so a direct PR with this rationale is the intended path rather than filing a discovery issue.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥97% coverage of the lines AND branches you changed (aim for 98%+ on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
Safety
UI Evidencesection below. (N/A — backend-only, no visible change.)UI Evidence
N/A — backend-only change to a sanitizer regex; no visible UI, frontend, docs, or extension change.
Notes
test/unit/signals-coverage.test.ts): builds the public comment signal bundle with a finding whose title carries each plural private term and asserts none survive intopublicFindingTitles; a singular-form control pins that the fix does not regress the cases already caught. Verified the test fails on the pre-fix regex (the plural leaks) and passes after the fix.