fix(predicted-gate): limit the duplicate check to open siblings#1522
fix(predicted-gate): limit the duplicate check to open siblings#1522Dexterity104 wants to merge 2 commits into
Conversation
|
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 #1522 +/- ##
=======================================
Coverage 95.37% 95.37%
=======================================
Files 199 199
Lines 21546 21547 +1
Branches 7791 7791
=======================================
+ Hits 20550 20551 +1
Misses 416 416
Partials 580 580
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review — blocked
🛑 Blocked Review summary CI checks failing
Nits — 2 non-blocking
Review context
Contributor next steps
Signal definitions
Review detailsGenerated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative. The fix filters `pullRequests` to `state === 'open'` before passing to `buildPullRequestAdvisory`, restoring parity with the live gate (`listOtherOpenPullRequests`) and the maintainer preview path. The `authorHistory` slice intentionally retains the full snapshot for first-contribution grace counts, and the inline comment documents that asymmetry precisely. The regression test exercises both the merged-sibling and closed-sibling cases in a single call and asserts both the absence of `duplicate_pr_risk` and the `success` conclusion — sufficient coverage for the parity gap being closed. Nits (2)
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
The pre-submission gate predictor passed the full pull request snapshot into the duplicate detector. That snapshot comes from
listPullRequests, which has no state filter, so closed and merged pull requests that shared a linked issue were treated as live competitors and raisedduplicate_pr_risk. That finding blocks by default, so a contributor saw a predicted failure for a pull request the real gate would pass.Every other gate path already compares against open siblings only: the live gate through
listOtherOpenPullRequests, and the maintainer activation preview through an explicitstate === "open"filter. The predictor now filters the snapshot to open siblings before building the advisory, which restores that parity and keeps the busy queue count honest.authorHistorystill reads the full snapshot, because the first contribution grace counts depend on merged and closed rows.A regression test places a merged sibling and a closed sibling that both share the linked issue, then asserts that no
duplicate_pr_riskblocker appears in the predicted verdict.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchneeds at least 97% of the changed lines and branches, and the changed lines here measure 100%.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
src/rules/predicted-gate.tsand its unit test. No workflow, Cloudflare Worker, MCP package, or UI surface is affected, soactionlint,test:workers,build:mcp,test:mcp-pack, theui:*suite, andnpm auditare left for the fullnpm run test:cirun before push.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails.UI Evidence
Not applicable. This change has no visible UI, frontend, docs, or extension surface.
Notes