fix(gate): live-fetch the linked-issue author when the cache misses - #1238
Merged
Conversation
resolveLinkedIssueAuthorLogins read the linked issue's author from the local DB only, so a cache miss (issue not yet synced) silently voided the self_authored_linked_issue anti-farming detection — fail-open. On a cache miss it now falls back to a live GitHub fetch (fetchLinkedIssueFacts now returns the author). The fallback is gated on the self-authored gate being in block mode and the token is minted lazily, so quiet/advisory paths add no API calls and the fetch is paid only where a cache miss could otherwise void a hard block. Per-issue fail-safe throughout. Note: the first-time-contributor-grace cache-freshness concern (audit 3.12) is left as-is — there is no local signal that distinguishes a genuine newcomer from an unsynced cache, grace yields a neutral (held, not merged) verdict, the feature is off by default, and CI / conflict / hard-rule closes fire independently; coupling grace to confirmedContributor would violate the gate's score/merge separation. Documented rather than fixed speculatively.
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 #1238 +/- ##
=======================================
Coverage 94.96% 94.96%
=======================================
Files 177 177
Lines 19779 19786 +7
Branches 7115 7117 +2
=======================================
+ Hits 18783 18790 +7
Misses 397 397
Partials 599 599
🚀 New features to boost your workflow:
|
This was referenced Jun 24, 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.
Summary
Closes audit finding 3.11.
resolveLinkedIssueAuthorLoginsread the linked issue's author from the local DB only, so a cache miss (issue not yet synced) silently voided theself_authored_linked_issueanti-farming detection (self-filed → self-solved) — fail-open. On a cache miss it now falls back to a live GitHub fetch (fetchLinkedIssueFactsnow also returns the author). The fallback is:selfAuthoredLinkedIssueGateMode === "block", so quiet/advisory paths add zero API calls;null.On 3.12 (first-time-grace cache freshness)
Left as-is by design, not overlooked: there is no local signal that distinguishes a genuine newcomer from an unsynced cache; the grace yields a neutral (held, not merged) verdict; the feature is off by default; CI / conflict / hard-rule closes fire independently; and coupling grace to
confirmedContributorwould violate the gate's documented score/merge separation. Documented rather than fixed speculatively.Scope
src/queue/processors.ts,src/github/backfill.ts); no schema change; no migrationValidation
npm run test:ci— full gate greennpm audit --audit-level=moderate— 0 vulnerabilitiesSafety
site//CNAME/lovable