Skip to content

self-review-context.js's linked-PR extractor regressed a previously-fixed false-positive bug from the host repo #6769

Description

@JSONbored

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions