fix(reputation): never cadence-downgrade a trusted submitter, and never claim a review was skipped when it ran - #9800
Merged
Conversation
…er claim a review was skipped when it ran Two defects found live on the ORB, both surfaced by the maintainer's own PRs: 1. The machine-paced cadence leg of shouldSkipAiForReputation downgraded the repo OWNER to deterministic-only on every PR: 50 submissions in 24h at a 7.2-minute median gap trips isMachinePacedCadence (>=5 in 24h, median gap under 10 minutes), regardless of a 145-merge success record. The cadence check is a spend control against UNPROVEN accounts; "trusted" is this same module's own definition of proven (5+ recent merged successes at a low fail rate). A trusted submitter now short-circuits the cadence read entirely. The exemption cannot mask genuine abuse: any prompt-injection row in the window hard-locks the signal to "low" before success counting, pinned by an invariant test. 2. maybeAddReputationSkipHold pushed the "Required AI review was skipped by a submitter-reputation downgrade" finding whenever the skip WOULD fire -- without checking that aiReviewAllAuthors or a forced re-run bypassed it, in which case the review genuinely ran. The published panel then asserted the review was skipped directly above that review's own summary, and held the gate for a review that succeeded (observed on #9764). The hold now describes what happened, not what the heuristic wanted. Operationally: LOOPOVER_REVIEW_REPUTATION is commented out on the ORB until this ships in an image; re-enabling is a one-line uncomment.
Contributor
|
Important 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏳ LoopOver is waiting…LoopOver has seen this pull request and is waiting on CI checks to finish before reviewing it. This comment will update once the review runs. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟨 Waiting |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9800 +/- ##
==========================================
- Coverage 90.33% 89.52% -0.82%
==========================================
Files 918 918
Lines 113936 113938 +2
Branches 26975 26977 +2
==========================================
- Hits 102926 101998 -928
- Misses 9681 10850 +1169
+ Partials 1329 1090 -239
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
What happened
The repo owner's own PRs started showing:
…and on #9764, that bullet rendered directly above a successful AI review summary, holding the gate for a review that had already run.
Root causes (both verified live)
1. The cadence leg has no notion of an earned record.
shouldSkipAiForReputationhas two legs: the quality/burst signal, andisMachinePacedCadence(≥5 submissions in 24h with a median gap under 10 minutes). The maintainer's remediation campaign measured 50 submissions / 7.2-minute median gap — machine-paced by definition — so every PR was downgraded, even though the same module's quality signal rates them trusted (145 recent merges classifiedsuccess; verified by running the production query against the live ledger).The cadence check is a spend control against unproven accounts. A trusted submitter — the module's own definition of proven: 5+ recent merged successes at a low fail rate, recency-windowed — now short-circuits it. The exemption can't be farmed into a loophole: reaching "trusted" requires real merged PRs on that repo inside the window, and a single prompt-injection row hard-locks the signal to
lowbefore success counting — pinned by an invariant test.2. The hold finding described the heuristic, not reality.
forceAiReview(the panel checkbox /@loopover review) andaiReviewAllAuthorsboth bypass the reputation skip inshouldStartAiReviewForAdvisory— butmaybeAddReputationSkipHoldpushed the "was skipped" finding onreputationSkippedalone. So a forced re-run produced a real review and a bullet claiming it was skipped, and held the gate anyway. The hold now returns early on either bypass.Operational note
LOOPOVER_REVIEW_REPUTATIONis commented out on the ORB (with a dated note) until this ships in an image — the owner shouldn't be rate-limited by their own anti-abuse system in the meantime. Re-enabling is a one-line uncomment.Tests
4 new: the trusted-exemption regression (6 merges + 8 PRs at 4-minute pace → no downgrade), the prompt-injection invariant (banked merges + one injection → still downgraded), and one regression per bypass for the hold (forced re-run,
aiReviewAllAuthors). 39 + 15 pass in the touched files;tscclean.