feat(scoring): add draft-PR awareness to classification and queue health#1189
Merged
Conversation
isDraftPullRequest() now checks pr.isDraft first, matching every other draft-detection site in the codebase (local-branch.ts, engine.ts, commands.ts). GitHub-native draft PRs without a draft title or label were previously misclassified as blocked. buildQueueHealth() gains a draftPullRequests signal and surfaces an inactive_draft_prs finding when any draft PR has not updated in 14+ days, letting maintainers distinguish abandoned drafts from stale reviewable work. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 #1189 +/- ##
=======================================
Coverage 94.68% 94.69%
=======================================
Files 157 157
Lines 19074 19079 +5
Branches 6905 6907 +2
=======================================
+ Hits 18061 18066 +5
Misses 424 424
Partials 589 589 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closed
12 tasks
This was referenced Jul 2, 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
isDraftPullRequest()insrc/scoring/pending-pr-scenarios.tsnow checkspr.isDraftfirst, before falling through to title-pattern and label matching. Every other draft-detection site in the codebase (local-branch.ts:625,engine.ts:3968,commands.ts:1299,agent-sweep.ts:41,processors.ts:837) usespr.isDraftdirectly; this function was the only outlier, silently misclassifying GitHub-native draft PRs asblockedwhen they lacked a draft title or label.buildQueueHealth()gains a newdraftPullRequestssignal (count of open draft PRs) and surfaces aninactive_draft_prsfinding when any draft PR has gone 14+ days without an update — letting maintainers distinguish genuinely abandoned drafts from stale reviewable work without changing the existingstalePullRequestsaccounting.Scope
src/andtest/cf-typegenchanges requiredsite/,CNAME, and**/lovable/**untouchedValidation
npm run test:cifully green (3705 tests pass, 217 test files)git diff --checkcleanSafety
isDraftPullRequest()change is additive — existing title-pattern and label checks are preserved as fallback