Skip to content

feat(enrichment): forward PR body and linked-issue envelope to REES #1851

Description

@kiannidev

Problem

The REES history analyzer already accepts body and linkedIssue on /v1/enrich so it can:

  • parse Fixes #123 references from the PR body when no token is available
  • measure diff coverage against the linked issue's stated requirement without an extra GitHub fetch

The engine's buildReviewEnrichment path never forwards those fields today — only author, files, and diff reach REES.

Proposal

  • Extend buildReviewEnrichment to POST body when present
  • Resolve the PR's primary linked issue from the engine cache (getIssue) and send a compact linkedIssue envelope { number, title?, body? }
  • Wire runAiReviewForAdvisory to pass pr.body and pr.linkedIssues

Acceptance criteria

  • REES POST includes body when the PR has one
  • REES POST includes linkedIssue when the PR links an issue the engine has cached
  • Fail-safe: missing cache/issue data omits linkedIssue (history analyzer degrades gracefully)
  • Unit + wiring tests cover the processor → enrichment-wire path

Notes

Parent capability: #1478 / #1697. This is the remaining engine-side passthrough after the REES history analyzer landed on main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions