fix(engine): surface linked-issue overflow in the predicted-gate preview - #9043
Conversation
The predicted-gate engine's extractor silently truncated PR bodies with more than MAX_LINKED_ISSUE_NUMBERS closing references, so the local preview looked ready while the maintainer-side linked-issue hard rule (which reads the SAME overflow signal via extractLinkedIssueNumbersWithOverflow in src/review/linked-issue-hard-rules.ts) would close the PR outright. Mirror the maintainer helper's shape: expose an overflow-aware extractor alongside the existing one and have buildPreflightResult raise a critical linked_issue_overflow finding carrying the maintainer gate's own message when the cap is exceeded.
|
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 #9043 +/- ##
==========================================
- Coverage 93.88% 93.87% -0.01%
==========================================
Files 807 807
Lines 80496 80502 +6
Branches 24411 24413 +2
==========================================
+ Hits 75572 75574 +2
Misses 3560 3560
- Partials 1364 1368 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 16:29:55 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionPartially addressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
The predicted-gate engine's local
extractLinkedIssueNumberssilently truncated a PR body atMAX_LINKED_ISSUE_NUMBERS = 50and returned the trimmed list with no other signal. The maintainer-side linked-issue hard rule (src/review/linked-issue-hard-rules.ts, viasrc/db/repositories.ts'sextractLinkedIssueNumbersWithOverflow) hard-fails the same body with"PR body links more issues than LoopOver can safely verify automatically; please reduce linked closing references or request maintainer review."— so the local prediction told miners the PR was ready while the upstream gate would close it.Mirror the maintainer helper's shape:
extractLinkedIssueNumbersWithOverflow(text, repoFullName): { numbers, overflow }next to the existing extractor (kept as a thin wrapper so unrelated callers don't move).buildPreflightResultconsume the overflow flag and push alinked_issue_overflowfinding atseverity: "critical"(the existinghasWarningcheck already lifts a critical finding tostatus: "needs_work"), carrying the maintainer gate's own reason string verbatim so miners see identical wording.predictedGateEngineInternalsfor parity tests.Added a regression test with 51 distinct closing references that asserts the finding, its critical severity, the exact detail string,
status === "needs_work", and the direct extractor result. A second test pins the negative cases: a body at exactly 50 unique references, and a 100-line body that dedupes to 50 uniques, must NOT flag overflow (matching the maintainer helper'slength > capsemantics).Validation
npx turbo run build --filter=@loopover/engine && npx turbo run build --filter=@loopover/mcp && npx turbo run build:tsc build:verify --filter=@loopover/miner— greennpx vitest run --changed=upstream/main --passWithNoTests— 12421 pass / 16 skippednpm test— full suite green after prerequisitenpm run build --workspace @loopover/ui-kit(that test file's own name flags the build as an environment prereq; unrelated to this diff)npx vitest run test/unit/predicted-gate-engine.test.ts— 36 pass, including the new fix(engine): predicted-gate's linked-issue extractor truncates instead of mirroring the maintainer gate's overflow hard-fail #8868 regression + at-cap negative testCloses #8868