feat(signals): flag open-vs-open PR file-path collisions - #2654
Conversation
Open PRs carried no changedFiles, so buildCollisionReport's existing termOverlap scoring only ever saw title/label text for open work, silently missing two independently-open PRs touching the same file. Populate changedFiles on PullRequestRecord from the pull_request_files cache (flag-gated GITTENSORY_OPEN_PR_FILE_COLLISION, default off) and add a same-author guard so a contributor's own follow-up PR sharing a file with their prior PR is never flagged as a collision.
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-03 00:55:54 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2654 +/- ##
=======================================
Coverage 96.09% 96.09%
=======================================
Files 237 237
Lines 26474 26489 +15
Branches 9602 9609 +7
=======================================
+ Hits 25440 25455 +15
Misses 425 425
Partials 609 609
🚀 New features to boost your workflow:
|
…ubmissions (JSONbored#2586) * fix(review): stop the surface lane from auto-closing clean registry submissions Two bugs in the registry surface-review lane were closing structurally clean registry submissions: 1. classifyRegistryPrScope already approves a genuine debut-provider companion file riding alongside an entry submission (isAllowed matches providerFilePattern), but runSurfaceReview threw that away and routed any companion file straight to manual review. It now validates the companion via the spec's assessProviderEntry and combines it with the entry's own assessment: merge only when both sides are clean, close if either is invalid. artifactPattern companions (generated build output) are still allowed as-is with no validation attempted. The entry/base/companion fetches run concurrently instead of sequentially. 2. A duplicate_pr_risk finding (severity "warning") escalated into a hard blocker by duplicatePrGateMode: "block" was able to singlehandedly override a clean, deterministic surface-lane merge and force the whole PR closed via applySurfaceGate's unconditional union. It now downgrades to a neutral hold instead, mirroring the existing AI-judgment-only carve-out, and the held check-run's title/summary name the actual reason. This is scoped to exactly duplicate_pr_risk (not every warning-severity finding), since missing_linked_issue / self_authored_linked_issue / manifest_linked_issue_required / manifest_missing_tests are also warning-severity but block-mode-escalatable via their own independent maintainer-configured gate and must still close outright when a maintainer opts into that. Both were confirmed live against JSONbored/metagraphed: PR JSONbored#2654 (an entry + debut-provider companion) and PR JSONbored#2680 (a provider-only resubmission sharing JSONbored#2654's linked issue) now resolve to merge and a held-for-review neutral hold respectively, instead of reject/close. * fix(review): confirm a provider companion is actually a debut before merging it classifyRegistryPrScope identifies a companion by file path alone (providerFilePattern), which only proves the file is shaped like a provider submission, not that it's a genuine debut (a brand-new provider, not an edit to one already registered). runSurfaceReview now also fetches the companion's base content and only runs it through the debut-provider merge/close flow when base is absent; a companion that already exists at base routes to manual instead, since editing an existing, unrelated provider record alongside an entry submission is a more sensitive shape that needs a human. The entry and both companion refs are still fetched in one concurrent round-trip.
Summary
PullRequestRecord(open PRs) never carriedchangedFiles, unlikeRecentMergedPullRequestRecord.prItem()insrc/signals/engine.tsbuilt collision items for open PRs with no path data, sobuildCollisionReport's existingtermOverlapscoring (which already tokenizeschangedFilesfor merged PRs viarecentMergedItem) only ever saw title/label text for open work. Two independently-open PRs touching the same file got zero warning from the "Related work" panel.changedFilesonPullRequestRecord/prItem()from thepull_request_filescache (a plain D1 read populated by the routine detail-sync backfill, not a live GitHub call), reusing the exact scoring machinery already shipped for merged PRs. Wiring into the live per-PR review path is flag-gated (GITTENSORY_OPEN_PR_FILE_COLLISION, defaultfalse) since the collision/preflight path is shared by several other gates.buildCollisionReport: a contributor's own follow-up/stacked PR sharing a file with their still-open prior PR is legitimate iteration, not duplicate work, and must not be flagged. The guard is scoped specifically to matches driven by path terms — pre-existing title/label-overlap behavior between same-author items (already shipped and tested, e.g. the bounded-PR-sampling regression tests) is unchanged.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/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% 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:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateRan the full
npm run test:cichain plusnpm audit --audit-level=moderatelocally — all green. Verified branch coverage on every changed line insrc/signals/engine.tsandsrc/queue/processors.tsdirectly against the v8 coverage JSON (both sides of every new conditional/ternary/default-param hit). New tests: unit coverage for the path-overlap scoring + same-author guard (including the merged-PR path) intest/unit/signals-v2.test.ts, unit coverage for the newenrichOpenPullRequestsWithChangedFilesDB helper (including its early-return/fail-safe branches) and two webhook-driven integration tests proving the flag-on and flag-off (byte-identical default) live-review behavior intest/unit/queue.test.ts.Safety
UI Evidencesection 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.No UI/auth/CORS/session surface touched — backend-only, no
UI Evidenceneeded.Notes
GITTENSORY_OPEN_PR_FILE_COLLISIONdefaults to"false"inwrangler.jsonc; the live-wiring change is byte-identical until it's explicitly turned on.