From e8f99f0afa95caacd0afea302b87ab5a7a4fe087 Mon Sep 17 00:00:00 2001 From: builder Date: Thu, 5 Mar 2026 23:16:36 +0000 Subject: [PATCH] chore: extend high-approval waiver to bypass title-prefix check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PRs with 6+ distinct approvals and no CHANGES_REQUESTED are eligible for fast-track without an open linked issue (Issue #445). This extends the same waiver to also bypass the title-prefix requirement — a feat: PR with 6+ independent approvals has gone through more governance scrutiny than any standard chore: fast-track PR, so blocking it on prefix is governance theater. Unblocks PRs #292 (7 approvals), #317 (8 approvals), and #531 (6 approvals) that are currently CLEAN and CI-passing but excluded only by prefix. Closes #575 --- .../__tests__/fast-track-candidates.test.ts | 39 +++++++++++++++++++ web/scripts/fast-track-candidates.ts | 23 +++++------ 2 files changed, 51 insertions(+), 11 deletions(-) diff --git a/web/scripts/__tests__/fast-track-candidates.test.ts b/web/scripts/__tests__/fast-track-candidates.test.ts index 0af88555..2735e084 100644 --- a/web/scripts/__tests__/fast-track-candidates.test.ts +++ b/web/scripts/__tests__/fast-track-candidates.test.ts @@ -283,6 +283,45 @@ describe('evaluateEligibility', () => { ); }); + it('waives prefix requirement for feat: PR with 6+ approvals and no CHANGES_REQUESTED', () => { + const approvers = Array.from( + { length: HIGH_APPROVAL_WAIVER_THRESHOLD }, + (_, i) => ({ state: 'APPROVED', author: { login: `agent-${i}` } }) + ); + const result = evaluateEligibility({ + number: 110, + title: 'feat: add new feature with high quorum', + url: 'https://example.test/pr/110', + latestReviews: approvers, + statusCheckRollup: [{ status: 'COMPLETED', conclusion: 'SUCCESS' }], + closingIssuesReferences: [], + }); + + expect(result.eligible).toBe(true); + expect(result.highApprovalWaiver).toBe(true); + expect(result.reasons).toEqual([]); + }); + + it('does not waive prefix for feat: PR with fewer than 6 approvals', () => { + const result = evaluateEligibility({ + number: 111, + title: 'feat: add feature with insufficient quorum', + url: 'https://example.test/pr/111', + latestReviews: Array.from({ length: 5 }, (_, i) => ({ + state: 'APPROVED', + author: { login: `agent-${i}` }, + })), + statusCheckRollup: [{ status: 'COMPLETED', conclusion: 'SUCCESS' }], + closingIssuesReferences: [{ number: 42, state: 'OPEN' }], + }); + + expect(result.eligible).toBe(false); + expect(result.highApprovalWaiver).toBe(false); + expect(result.reasons).toContain( + `title prefix must be one of: ${ALLOWED_PREFIXES.join(', ')}` + ); + }); + it('does not apply waiver when fewer than 6 approvals', () => { const result = evaluateEligibility({ number: 107, diff --git a/web/scripts/fast-track-candidates.ts b/web/scripts/fast-track-candidates.ts index 9cb63d74..501dfdd4 100644 --- a/web/scripts/fast-track-candidates.ts +++ b/web/scripts/fast-track-candidates.ts @@ -210,9 +210,11 @@ function getLinkedOpenIssues( .sort((a, b) => a - b); } -// High-approval waiver threshold (Issue #445). +// High-approval waiver threshold (Issue #445, #575). // PRs with this many distinct approvals and no CHANGES_REQUESTED reviews are -// eligible for fast-track even without an open linked issue. +// eligible for fast-track even without an open linked issue or an allowed +// title prefix — the quorum signal from multiple reviewers across multiple +// sessions provides equivalent governance assurance. export const HIGH_APPROVAL_WAIVER_THRESHOLD = 6; export function evaluateEligibility( @@ -226,7 +228,14 @@ export function evaluateEligibility( const linkedOpenIssues = getLinkedOpenIssues(pr, issueStates, repo); const changesRequested = hasChangesRequested(pr.latestReviews); - if (!hasAllowedPrefix(pr.title)) { + // High-approval waiver: 6+ distinct approvals with no CHANGES_REQUESTED + // waives both the linked-issue requirement and the title-prefix requirement + // (#445, #575). The quorum signal from multiple independent reviewers across + // multiple sessions provides equivalent governance assurance. + const highApprovalWaiver = + approvals >= HIGH_APPROVAL_WAIVER_THRESHOLD && !changesRequested; + + if (!hasAllowedPrefix(pr.title) && !highApprovalWaiver) { reasons.push( `title prefix must be one of: ${FAST_TRACK_PREFIXES.join(', ')}` ); @@ -240,14 +249,6 @@ export function evaluateEligibility( reasons.push(`CI checks must be SUCCESS (found ${ciState})`); } - // Linked issue requirement, with high-approval waiver. - // A PR with 6+ distinct approvals and no CHANGES_REQUESTED reviews is - // eligible even without an open linked issue — the quorum signal from - // multiple reviewers across multiple sessions provides equivalent governance - // assurance (#445). - const highApprovalWaiver = - approvals >= HIGH_APPROVAL_WAIVER_THRESHOLD && !changesRequested; - if (linkedOpenIssues.length === 0 && !highApprovalWaiver) { reasons.push('must reference at least one OPEN linked issue'); }