Skip to content

feat(enrichment): blame-to-PR regression linker analyzer #2034

Description

@JSONbored

New REES github-light analyzer (the #1499 epic 'Blame-to-PR regression linker' idea) that, for lines this PR modifies/deletes, resolves which prior PR most recently introduced them (via commit history for the touched ranges) and surfaces those originating PRs — giving the reviewer instant context on what the change is altering. Bounded lookups, fail-safe.

Deliverables

  • Add BlameLinkFinding ({ file, line, introducedByPr?: number, introducedByShaPrefix?: string }) + blameLink? key to review-enrichment/src/types.ts (sha prefix only)
  • Create review-enrichment/src/analyzers/blame-link.ts: for a bounded set of changed files/ranges, walk commit history for the path and map the most recent introducing commit to its PR via the commits/PR-association API (injected fetch); strict maxFilesProbed + maxLookups caps; emit partial on cap
  • Register a descriptor (category 'history', cost 'github-light', requires ['files','github-token']) in review-enrichment/src/analyzers/registry.ts with inline render()
  • Add review-enrichment/test/blame-link.test.ts covering a resolved originating PR, an unresolvable line (no finding), the lookup cap, and the token-absent skip

References

  • review-enrichment/src/analyzers/commit-signature.ts (github-light commits-API analyzer template)
  • review-enrichment/src/analyzers/churn-hotspot.ts (per-file commit-history probe with caps)
  • gh issue 1499 lists 'Blame-to-PR regression linker' as a later idea

Part of #1499.


size: S · gittensor:feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions