Skip to content

fix(scoring): anchor the draft title pattern to genuine markers#1529

Open
Dexterity104 wants to merge 1 commit into
JSONbored:mainfrom
Dexterity104:fix/anchor-draft-title-pattern
Open

fix(scoring): anchor the draft title pattern to genuine markers#1529
Dexterity104 wants to merge 1 commit into
JSONbored:mainfrom
Dexterity104:fix/anchor-draft-title-pattern

Conversation

@Dexterity104

Copy link
Copy Markdown
Contributor

Summary

  • The open PR draft check in classifyOpenPullRequest matched any title beginning with the letters "draft", so real work such as "Drafting a new feature", "Draftsman tool", and "draft-js upgrade" was classified as a draft.
  • Draft titles are excluded from the merge_ready and stale_likely_close buckets, so pendingMergedPrCount and pendingClosedPrCount in detectPendingPrScenario came out lower than reality whenever one of those PRs was otherwise countable.
  • The same over-broad expression was reused in normalizeTitle to strip a draft prefix for duplicate detection, so the dedup key for those titles was corrupted (for example "Draft tooling" collapsed onto "tooling").
  • A single anchored DRAFT_TITLE_PATTERN now matches only genuine markers ([draft], Draft:, and Draft - with a spaced dash) and is shared by both the classifier and the normalizer so they stay consistent. Requiring a space before the dash keeps hyphenated names such as draft-js and draft-mode from matching.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥97% coverage of the lines AND branches you changed (aim for 98%+ on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Nothing was skipped. The full suite ran through npm run test:ci plus npm audit --audit-level=moderate, all green.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

Not applicable. The change is backend only, with no visible UI, frontend, docs, or extension changes.

Notes

  • The change is backend only and does not touch auth, sessions, CORS, the GitHub App, OpenAPI, MCP, the UI, docs, or changelogs.
  • Coverage of every changed line is complete, including both sides of the new condition in isDraftPullRequest. Regression tests cover the misclassified titles, the genuine markers, and the dedup key behavior in normalizeTitle.
  • The normalizer change was verified to never cluster distinct PRs together and to remove the earlier false clustering of titles such as "Draft tooling".

@Dexterity104 Dexterity104 requested a review from JSONbored as a code owner June 26, 2026 14:02
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 26, 2026
@superagent-security

Copy link
Copy Markdown

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.45%. Comparing base (6b1389b) to head (32f677b).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1529   +/-   ##
=======================================
  Coverage   95.45%   95.45%           
=======================================
  Files         195      195           
  Lines       21121    21121           
  Branches     7637     7637           
=======================================
  Hits        20161    20161           
  Misses        383      383           
  Partials      577      577           
Files with missing lines Coverage Δ
src/scoring/pending-pr-scenarios.ts 96.29% <100.00%> (ø)
src/signals/contributor-open-pr-monitor.ts 96.15% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant