Context
packages/loopover-miner/lib/self-review-context.js:206-215 has a bare LINKED_PR_PATTERN = /\b(?:PR|pull request)\s+#(\d+)\b/gi with no closing-keyword requirement, despite its own comment claiming it "mirrors src/db/repositories.ts's extractLinkedPrNumbers exactly." The actual current host implementation (src/db/repositories.ts:7985-7988) requires a closing-keyword prefix (close[sd]?|fix(?:e[sd])?|resolve[sd]?) specifically to avoid counting an incidental "PR #N" mention as a real link (see that file's own #issue-body-pr-mention-pollution comment). The miner's copy never received this fix — a bare, unrelated "PR #501" mention in an issue body now wrongly makes toIssueRecord's linkedPrs non-empty, which the engine's issue-quality-report surfaces as "already references a PR," causing the miner to treat an available issue as already-worked.
Requirements
- Change
LINKED_PR_PATTERN to require the same closing-keyword prefix as the current host implementation: /\b(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s+(?:PR|pull request)\s+#(\d+)\b/gi.
- Re-verify the "mirrors ... exactly" comment against current host source as part of the fix.
Deliverables
Test Coverage Requirements
99%+ Codecov patch coverage on every changed line and branch, plus a regression test that reproduces the exact failure mode described above and asserts it's fixed.
Expected Outcome
The miner no longer skips an available issue purely because its body incidentally mentions an unrelated PR number.
Links & Resources
packages/loopover-miner/lib/self-review-context.js:206-215,257, src/db/repositories.ts:7985-7988.
Context
packages/loopover-miner/lib/self-review-context.js:206-215has a bareLINKED_PR_PATTERN = /\b(?:PR|pull request)\s+#(\d+)\b/giwith no closing-keyword requirement, despite its own comment claiming it "mirrorssrc/db/repositories.ts'sextractLinkedPrNumbersexactly." The actual current host implementation (src/db/repositories.ts:7985-7988) requires a closing-keyword prefix (close[sd]?|fix(?:e[sd])?|resolve[sd]?) specifically to avoid counting an incidental "PR #N" mention as a real link (see that file's own#issue-body-pr-mention-pollutioncomment). The miner's copy never received this fix — a bare, unrelated "PR #501" mention in an issue body now wrongly makestoIssueRecord'slinkedPrsnon-empty, which the engine's issue-quality-report surfaces as "already references a PR," causing the miner to treat an available issue as already-worked.Requirements
LINKED_PR_PATTERNto require the same closing-keyword prefix as the current host implementation:/\b(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s+(?:PR|pull request)\s+#(\d+)\b/gi.Deliverables
LINKED_PR_PATTERNinself-review-context.jslinkedPrs; "Closes PR fix(signals): account for queue burden in readiness score #501" doesTest Coverage Requirements
99%+ Codecov patch coverage on every changed line and branch, plus a regression test that reproduces the exact failure mode described above and asserts it's fixed.
Expected Outcome
The miner no longer skips an available issue purely because its body incidentally mentions an unrelated PR number.
Links & Resources
packages/loopover-miner/lib/self-review-context.js:206-215,257,src/db/repositories.ts:7985-7988.