Skip to content

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

Closed
kiannidev wants to merge 1 commit into
JSONbored:mainfrom
kiannidev:feat/enrichment-rees-context-passthrough
Closed

feat(enrichment): forward PR body and linked-issue envelope to REES#1852
kiannidev wants to merge 1 commit into
JSONbored:mainfrom
kiannidev:feat/enrichment-rees-context-passthrough

Conversation

@kiannidev

Copy link
Copy Markdown
Contributor

Summary

  • Forward PR body from runAiReviewForAdvisory through buildReviewEnrichment into the REES POST
  • Resolve the primary linked issue from the engine cache (getIssue) and send a compact linkedIssue envelope
  • Add resolveEnrichmentLinkedIssue() with fail-safe { number } fallback when the issue row is missing

Fixes #1851

Why

REES history already accepts body and linkedIssue, but the engine never sent them — so linked-issue parsing and requirement-alignment degraded silently.

Validation

npx vitest run test/unit/enrichment-wire.test.ts test/unit/enrichment-wiring.test.ts

Test plan

  • REES POST includes body when the PR has one
  • REES POST includes linkedIssue when the engine has a cached issue row
  • Missing issue cache degrades to { number } only
  • Processor wiring test covers the full advisory → enrichment path

Made with Cursor

Wire the engine enrichment POST through body plus a cached linkedIssue
envelope so the REES history analyzer can parse Fixes #N references and
measure diff coverage against the issue requirement without extra fetches.

Fixes JSONbored#1851

Co-authored-by: Cursor <cursoragent@cursor.com>
@kiannidev kiannidev requested a review from JSONbored as a code owner June 30, 2026 08:43
@dosubot dosubot Bot added the size:M label Jun 30, 2026
@loopover-orb

loopover-orb Bot commented Jun 30, 2026

Copy link
Copy Markdown

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-06-30 19:05:31 UTC

4 files · 1 AI reviewer · no blockers · readiness 55/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review

Review summary
The change correctly threads the PR body and a compact linked-issue envelope into the REES enrichment request, with a fail-safe number-only fallback when the cached issue row is absent. The new unit coverage exercises the direct POST payload, cached issue resolution, and the advisory-to-enrichment path, so the visible behavior matches the PR description. The notable rough edge is that linked-issue resolution now happens before the enrichment flag/allowlist check, adding unnecessary DB work on disabled paths.

Nits — 8 non-blocking
  • nit: src/queue/processors.ts:3811 resolves the linked issue before `isEnrichmentEnabled(env) && convergedRepoAllowed`, so disabled or non-allowlisted enrichment still performs a DB lookup despite the surrounding flag-off comments promising no enrichment branch/work.
  • nit: src/review/enrichment-wire.ts:151 forwards the cached issue body without a local size cap in this helper; the repository layer likely already bounds stored bodies, but keeping the envelope bounded here would make the REES contract self-contained.
  • Move `resolveEnrichmentLinkedIssue(...)` inside the `isEnrichmentEnabled(env) && convergedRepoAllowed` branch in src/queue/processors.ts so flag-off reviews avoid the extra cache read.
  • Consider applying the same explicit body length discipline used by stored GitHub bodies when constructing `linkedIssue.body` in src/review/enrichment-wire.ts.
  • Add a small negative processor test in test/unit/enrichment-wiring.test.ts that enrichment disabled does not call the issue cache resolver, preserving the no-work flag-off contract.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #1851
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:M; 1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR; address the blocker before review.
Contributor workload ✅ 10/10 Author activity: 3148 registered-repo PR(s), 1801 merged, 53 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kiannidev; Gittensor profile; 3148 PR(s), 53 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
  • Author: kiannidev
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 3148 PR(s), 53 issue(s).
  • Related work: Titles/paths share 7 meaningful terms. (PR #1864)
  • Related work: Titles/paths share 5 meaningful terms. (PR #1882)
  • Related work: Items reference the same linked issue feat(enrichment): Churn-hotspot + bug-density scorer #1513. (issue #1513, PR #1882)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Fix the blocker.
  • Triage stale or unlinked PRs.
  • Refresh registry data or choose a registered active repo.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added gittensor Gittensor contributor context gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jun 30, 2026

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix this and resubmit once fixed:

The notable rough edge is that linked-issue resolution now happens before the enrichment flag/allowlist check, adding unnecessary DB work on disabled paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor Gittensor contributor context

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

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

2 participants