Skip to content

feat(enrichment): PR history analyzer + engine context passthrough #1697

Description

@kiannidev

Summary

Ship the history analyzer (#1478) in REES and pass the metadata the engine already has (author, body, short-lived GitHub token) through enrichment-wire so historical analysis can run during webhook-triggered reviews.

Behavior

REES history analyzer:

  • Parse linked issues from PR body (Fixes #123, Closes org/repo#456)
  • When a broker/installation token is present, fetch issue state/title and author merged-PR count in-repo
  • Report newcomer vs established author, linked-issue alignment, and missing issue references

Engine passthrough:

  • Extend buildReviewEnrichment payload with author, body, baseSha, githubToken
  • Resolve installation token in runAiReviewForAdvisory (best-effort, same pattern as grounding/RAG)

Scope

  • review-enrichment/src/analyzers/history.ts + types/render/brief wiring
  • src/review/enrichment-wire.ts + src/queue/processors.ts
  • Tests: review-enrichment/test/ + test/unit/enrichment-wire.test.ts

Acceptance criteria

  • Linked issues parsed from PR body
  • Author track record fetched when token available; degraded gracefully without
  • Engine POST includes new fields; flag-off path unchanged
  • Full local gate green with patch coverage

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions