feat(review): event-driven re-gate trigger on sibling PR merge - #4181
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 #4181 +/- ##
=======================================
Coverage 93.73% 93.73%
=======================================
Files 387 387
Lines 36377 36387 +10
Branches 13319 13323 +4
=======================================
+ Hits 34099 34109 +10
Misses 1621 1621
Partials 657 657
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-08 10:25:06 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 7 non-blocking
Linked issue satisfactionAddressed 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.
|
Summary
On a genuine PR merge (a
pull_requestwebhook withaction: "closed"and amerged_attimestamp), enqueue a bounded, staggered
agent-regate-prjob for each of the repo's other openPRs. Today nothing proactively re-checks a sibling PR when a merge invalidates its gate verdict
(a newly-conflicting base, a duplicate cluster missing its winner, a linked-issue cap that just
freed up) — it either waits for the next scheduled re-gate sweep tick (bounded to 3 PRs per repo
per ~2-minute tick) or a fresh webhook on that specific PR. This closes that latency gap: a
sibling now gets its verdict refreshed within normal per-PR job latency instead of a full sweep
cycle or more.
An ordinary close without a merge changes nothing on the base branch, so it does not trigger this
fan-out (verified by a dedicated test). The fan-out itself is capped by a new
MERGE_WAKE_MAX_PRSconstant (15) — smaller than the existing one-shot
ISSUE_WAKE_MAX_PRS(25) budget, since a mergeis a far more frequent trigger than an issue-label change and repeated merges inside one
rate-limit window would otherwise compound. It reuses the caller's already-fetched,
already-bounded (100-row, ascending-by-PR-number) sibling list rather than re-querying, so a repo
with many open PRs cannot turn one merge into an unbounded burst, and the lowest-numbered open
siblings are re-gated first.
Scoped to the same repos the existing re-gate sweep already covers (self-host
convergence-allowlisted OR hosted agent-configured) — this is a latency improvement for repos
already receiving proactive re-gates, not a scope expansion.
Closes #4005
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.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=moderateSafety
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. (N/A — backend-only change.)UI Evidence
N/A — this is a backend-only change to webhook processing (
src/queue/processors.ts,src/settings/agent-sweep.ts); there is no visible UI surface.Notes
MERGE_WAKE_MAX_PRSlives insrc/settings/agent-sweep.tsalongside its siblingfan-out-cap constants (
SWEEP_MAX_PRS,ISSUE_WAKE_MAX_PRS) for a single home for this tuningknob, with its own REST-budget reasoning documented next to it.
existing
maybeEnqueueRagReindexForMergedPrmerge-triggered convergence call) — no existinglines were reindented or restructured.