fix(review): count owner reopen-then-merge as a real reversal signal - #8074
Merged
Conversation
Closes #7985. A bare owner reopen of a bot-closed PR stayed excluded from reversalRate (still ambiguous — could be an administrative re-queue), but an owner reopen followed by an approve/merge within 6h is unambiguous: the owner looked again and decided the bot was wrong. Every one of the 2026-07-21/22 metagraphed false-positive incidents (#7469/#7589/#7591/#7594) was exactly this pattern, and the old unconditional owner-reopen exclusion recorded nothing for any of them — part of why the accuracy metric stayed misleadingly high that day. Record a time-bounded owner_reopen_pending_reversal marker on reopen, then promote it to a real reversal_reopened event if a merge follows within OWNER_REOPEN_MERGE_WINDOW_MS. A bot reopening itself still never counts.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (78.94%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #8074 +/- ##
==========================================
- Coverage 91.83% 89.67% -2.16%
==========================================
Files 734 1 -733
Lines 75086 184 -74902
Branches 23068 50 -23018
==========================================
- Hits 68952 165 -68787
+ Misses 5034 12 -5022
+ Partials 1100 7 -1093
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.
Closes #7985.
Summary
recordReversalSignalspreviously excluded EVERY repo-owner reopen of a bot-closed PR from the reversal signal (treated as "administrative re-queue, not a dispute"). That blanket exclusion is right for a bare reopen — genuinely ambiguous on its own — but wrong once the owner actually merges the PR afterward: that's an unambiguous "the bot's close was wrong" correction, not routine administration.owner_reopen_pending_reversalmarker (viarecordAuditEvent) instead of being silently dropped. If a merge for that same PR follows withinOWNER_REOPEN_MERGE_WINDOW_MS(6h), it's promoted to a realreversal_reopenedevent in bothreview_audit(whatreversalRate/calibration read) andaudit_events. A bare reopen with no follow-up merge, or a merge outside the window, still records nothing extra — same "genuine correction, not noise" bar a contributor reopen already has to clear. A bot reopening itself is still never a human-disagreement signal.Test plan
npm run typechecktest/unit/outcomes-wire.test.ts(describe("owner reopen + merge within the window (#7985)")): promotes reopen+merge to a real reversal; a plain merge with no marker records nothing; a stale marker outside the window records nothing; an owner reopen when the last bot action wasn't a close writes no markernpm run test:coverage: 1088/1088 files, 20312 tests, 0 failures