Skip to content

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

Merged
JSONbored merged 7 commits into
JSONbored:mainfrom
kiannidev:feat/1697-history-analyzer-passthrough
Jun 30, 2026
Merged

feat(enrichment): PR history analyzer + engine context passthrough#1849
JSONbored merged 7 commits into
JSONbored:mainfrom
kiannidev:feat/1697-history-analyzer-passthrough

Conversation

@kiannidev

@kiannidev kiannidev commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Merge main and resolve enrichment conflicts with upstream's REES registry + full history analyzer stack
  • Pass PR body and author through buildReviewEnrichment so REES history can parse linked issues and classify author context
  • Wire processors to forward body alongside existing opt-in REES_FORWARD_GITHUB_TOKEN GitHub token forwarding
  • Remove superseded engine-side prefetch modules (upstream REES now owns GitHub-backed analyzer execution)

Fixes #1697

Supersedes #1701 (closed due to merge conflicts; conflicts resolved on this branch).

Validation

cd review-enrichment && npm test
npx vitest run test/unit/enrichment-wire.test.ts test/unit/enrichment-wiring.test.ts

Test plan

  • Linked issue parsing (default repo + explicit org/repo#N) — REES history analyzer
  • Author tier classification from merged PR search count — REES history analyzer
  • Graceful degradation without token (body parsing only)
  • Engine POST includes author/body; wiring test asserts processor path
  • Branch merges cleanly with main

kiannidev and others added 7 commits June 29, 2026 01:26
Add REES history analyzer for author track record and linked-issue alignment.
Pass author, body, and installation token through enrichment-wire so webhook
reviews can run historical analysis during the AI review path.

Fixes JSONbored#1697

Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise null author/body, missing installation id, allowlist-off path,
and installation-token resolution in enrichment wiring tests.

Fixes JSONbored#1697

Co-authored-by: Cursor <cursoragent@cursor.com>
… to REES

Move history GitHub API calls into enrichment-prefetch.ts so installation
tokens stay in the engine process. REES receives structured prefetch findings
only; githubToken is removed from the enrich wire contract.

Fixes JSONbored#1697

Co-authored-by: Cursor <cursoragent@cursor.com>
Engine-side CODEOWNERS scan restores the prefetch contract without sending
tokens to REES; expanded prefetch unit tests cover abort signals and branches.

Co-authored-by: Cursor <cursoragent@cursor.com>
…n try

Relocate engine-side CODEOWNERS fetch/match into src/review so vitest
covers the patch; wrap prefetch in buildReviewEnrichment's fail-safe try.

Co-authored-by: Cursor <cursoragent@cursor.com>
Rebase onto upstream's REES registry/history analyzer stack and keep the
JSONbored#1697 engine context passthrough: PR body and author now POST to REES.
Drop superseded engine-side prefetch modules in favor of upstream's
opt-in REES_FORWARD_GITHUB_TOKEN wiring.

Fixes JSONbored#1697

Co-authored-by: Cursor <cursoragent@cursor.com>
@kiannidev kiannidev requested a review from JSONbored as a code owner June 30, 2026 08:36
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 30, 2026
@gittensory-orb

gittensory-orb Bot commented Jun 30, 2026

Copy link
Copy Markdown

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-06-30 10:46:33 UTC

5 files · 1 AI reviewer · no blockers · readiness 57/100 · CI green · unknown

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review

Review summary
The diff narrowly extends the engine-to-REES enrichment request by forwarding PR body text from the processor path and covering that in the unit wiring tests. The changed production path is coherent: `runAiReviewForAdvisory` now passes `args.pr.body`, and `buildReviewEnrichment` serializes it into the POST body alongside the existing author/token fields. I do not see a reachable correctness break in the visible hunks, but the coverage config change is unrelated to the passthrough and deserves scrutiny because it pulls a non-`src/**` analyzer file into this package's coverage accounting.

Nits — 8 non-blocking
  • nit: `src/review/enrichment-wire.ts:243` uses a truthiness check for `input.body`, so an intentionally empty PR body is omitted rather than forwarded as an empty string; use an undefined check if REES distinguishes empty from absent.
  • nit: `src/review/enrichment-wire.ts:245` adds `linkedIssue` passthrough support without any producer or assertion in this diff, so confirm this is intentional future-facing API surface rather than leftover conflict-resolution code.
  • nit: `vitest.config.ts:29` adds `review-enrichment/src/analyzers/codeowners.ts` to coverage while leaving the existing `src/**` scope; this is surprising for an engine wiring PR and should either be explained or moved to the REES package's own coverage config.
  • In `src/review/enrichment-wire.ts:243`, prefer `...(input.body !== undefined ? { body: input.body } : {})` so the request preserves the caller's value exactly.
  • In `test/unit/enrichment-wire.test.ts:107`, add a small assertion for `body: ""` if empty-body preservation matters to the REES 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 #1697
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:S; 1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR; address the blocker before review.
Contributor workload ✅ 10/10 Author activity: 3134 registered-repo PR(s), 1794 merged, 49 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kiannidev; Gittensor profile; 3134 PR(s), 49 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: 3134 PR(s), 49 issue(s).
  • Related work: Titles/paths share 7 meaningful terms. (PR #1861)
  • Related work: Titles/paths share 5 meaningful terms. (PR #1862)
  • Related work: Items reference the same linked issue feat(enrichment): Package maintenance-health / deprecated-dep scorer #1511. (issue #1511, PR #1850)
  • 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

@dosubot dosubot Bot added the lgtm Approved by a maintainer. label Jun 30, 2026
@JSONbored JSONbored merged commit d212404 into JSONbored:main Jun 30, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 30, 2026
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 1.25x multiplier. gittensor Gittensor contributor context lgtm Approved by a maintainer. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

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

2 participants