⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
packages/loopover-miner/lib/self-review-context.ts's own docstring (lines 57-59) claims it builds SelfReviewContext "at the SAME fidelity" as the live gate's DB-backed construction. But its call site (line 517) hardcodes buildIssueQualityReport(repo, issues, pullRequests, fullName, [], collisions, []) -- an empty array for recentMergedPullRequests -- while the host engine's packages/loopover-engine/src/signals/issue-quality-report.ts:140,199-214 uses that argument for issue-lifecycle classification and merged-PR-based duplicate detection. An issue already fixed by a PR that has since merged and closed is invisible to this collision path, unlike the live gate. Line 70 and 515 in the same file already acknowledge "does not yet pull... merge history" as a known gap.
Requirements
Fetch real recently-merged PRs for the target repo (the same shape the live gate's DB-backed path supplies -- check packages/loopover-engine/src/signals/issue-quality-report.ts callers for the expected shape) and pass them into buildIssueQualityReport in place of the hardcoded []. If a live GitHub fetch is out of scope for this module's design, update the docstring to explicitly retract the "SAME fidelity" claim and document this specific gap instead -- but the fetch-and-wire fix is the default expectation for this issue; do not silently choose the docstring-only path without a comment explaining why the fetch wasn't feasible.
Deliverables
All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
packages/loopover-miner/** -- 99%+ patch coverage, both the populated and empty-history branches.
Expected Outcome
The miner's local self-review preview correctly detects that a candidate issue was already resolved by a recently-merged PR, matching the live gate's actual behavior.
Links & Resources
packages/loopover-miner/lib/self-review-context.ts:57-59,70,515,517
packages/loopover-engine/src/signals/issue-quality-report.ts:140,199-214
Context
packages/loopover-miner/lib/self-review-context.ts's own docstring (lines 57-59) claims it buildsSelfReviewContext"at the SAME fidelity" as the live gate's DB-backed construction. But its call site (line 517) hardcodesbuildIssueQualityReport(repo, issues, pullRequests, fullName, [], collisions, [])-- an empty array forrecentMergedPullRequests-- while the host engine'spackages/loopover-engine/src/signals/issue-quality-report.ts:140,199-214uses that argument for issue-lifecycle classification and merged-PR-based duplicate detection. An issue already fixed by a PR that has since merged and closed is invisible to this collision path, unlike the live gate. Line 70 and 515 in the same file already acknowledge "does not yet pull... merge history" as a known gap.Requirements
Fetch real recently-merged PRs for the target repo (the same shape the live gate's DB-backed path supplies -- check
packages/loopover-engine/src/signals/issue-quality-report.tscallers for the expected shape) and pass them intobuildIssueQualityReportin place of the hardcoded[]. If a live GitHub fetch is out of scope for this module's design, update the docstring to explicitly retract the "SAME fidelity" claim and document this specific gap instead -- but the fetch-and-wire fix is the default expectation for this issue; do not silently choose the docstring-only path without a comment explaining why the fetch wasn't feasible.Deliverables
self-review-context.tspasses a real, non-emptyrecentMergedPullRequestsarray (fetched via the same GitHub client this module already uses forissues/pullRequests) intobuildIssueQualityReportself-review-context's output, where it previously would not have beenAll of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test Coverage Requirements
packages/loopover-miner/**-- 99%+ patch coverage, both the populated and empty-history branches.Expected Outcome
The miner's local self-review preview correctly detects that a candidate issue was already resolved by a recently-merged PR, matching the live gate's actual behavior.
Links & Resources
packages/loopover-miner/lib/self-review-context.ts:57-59,70,515,517packages/loopover-engine/src/signals/issue-quality-report.ts:140,199-214