fix(queue-intelligence): move bare reward/rewards to the always-forbidden tier and correct the contract doc - #9884
Conversation
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-29 19:02:51 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. Decision record
🟩 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.
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…orbidden tier and correct the contract doc (JSONbored#9702) sanitizePublicComment's JSDoc claimed "reward" is NEVER skippable and that only the bare "score" check is ever relaxed by allowBareScoreTerm -- both false. The flag swaps FORBIDDEN_PUBLIC_COMMENT_WORDS for ALWAYS_FORBIDDEN_PUBLIC_COMMENT_WORDS, relaxing the ENTIRE AMBIGUOUS tier; "reward"/"rewards" lived in that ambiguous tier, so an allowlisted repo (LOOPOVER_PUBLIC_SCORE_TERMS_ALLOWED_REPOS) let a bare "reward" through verbatim. Resolving in favour of the doc's safety intent: move "reward"/"rewards" from AMBIGUOUS_PUBLIC_COMMENT_WORDS to ALWAYS_FORBIDDEN_PUBLIC_COMMENT_WORDS so a bare "reward" is rejected on every repo. The JSDoc is rewritten to describe the code as written (swap-to- ALWAYS_FORBIDDEN, relax the whole ambiguous tier), dropping the false "never skippable" / "only bare-word relaxed" claims and the totalScore/baseTotalScore/credibility example the bare pattern never actually matches. BARE_SCORE_TERM_PATTERN, isPublicScoreTermSafeForRepo, and the allowlist env var are unchanged. Tests: reward rejected with the flag on and off, bare "score" still passes with the flag on, and an invariant pinning "reward"/"rewards" to the always-forbidden tier so doc and constants can't drift again. Closes JSONbored#9702 Co-Authored-By: Claude Opus 4.8 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9884 +/- ##
===========================================
- Coverage 91.75% 79.28% -12.47%
===========================================
Files 919 282 -637
Lines 112987 58536 -54451
Branches 27193 8611 -18582
===========================================
- Hits 103667 46413 -57254
- Misses 8034 11840 +3806
+ Partials 1286 283 -1003
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Closes #9702
What
sanitizePublicComment's JSDoc (src/queue-intelligence.ts) claimed that"reward"is never skippable and thatallowBareScoreTermonly ever relaxes the bare\bscore\w*\bcheck — both false. The flag swapsFORBIDDEN_PUBLIC_COMMENT_WORDSforALWAYS_FORBIDDEN_PUBLIC_COMMENT_WORDS, which relaxes the entireAMBIGUOUS_PUBLIC_COMMENT_WORDStier — and"reward"/"rewards"lived in that tier. SosanitizePublicComment("12 TAO reward for this", { allowBareScoreTerm: true })(live for any repo inLOOPOVER_PUBLIC_SCORE_TERMS_ALLOWED_REPOS) returned the string unchanged, contradicting the safety claim.Resolved in favour of the doc's safety intent:
"reward"/"rewards"fromAMBIGUOUS_PUBLIC_COMMENT_WORDStoALWAYS_FORBIDDEN_PUBLIC_COMMENT_WORDS, so a barerewardis rejected on every repo including allowlisted ones. Qualified forms already in the always-forbidden tier (reward estimate, …) are unaffected.ALWAYS_FORBIDDEN_PUBLIC_COMMENT_WORDSand relaxes the whole ambiguous tier. Removed the false "reward … NEVER skippable" and "only the over-broad bare-word check is ever relaxed" claims, and thetotalScore/baseTotalScore/credibilityexample (the\bscore\w*\bpattern doesn't match those camelCase identifiers). Also fixed the two adjacent tier-constant doc comments that still cited barerewardas ambiguous.BARE_SCORE_TERM_PATTERN,isPublicScoreTermSafeForRepo, and the allowlist env var are unchanged.Tests
New
#9702block: a barerewardthrows with the flag on (the installation-token / allowlisted-repo gap) and off; a barescorestill passes with the flag on (intended relaxation preserved); and an invariant pinningreward/rewardsto the always-forbidden tier (never the ambiguous tier) so the doc and constants can't drift again. The existing parameterized SECURITY/INVARIANT suites now also exerciserewardin the always-forbidden tier. Verified locally: 55/55 inqueue-intelligence.test.ts,tsc --noEmitclean,git diff --checkclean. (Both arms of theallowBareScoreTermternary are exercised against areward-bearing and a bare-scorestring.)