Skip to content

feat(mcp): add loopover_get_pr_reviewability tool on both MCP servers - #6197

Closed
lourincedaging0-commits wants to merge 1 commit into
JSONbored:mainfrom
lourincedaging0-commits:feat/mcp-pr-reviewability-tool
Closed

feat(mcp): add loopover_get_pr_reviewability tool on both MCP servers#6197
lourincedaging0-commits wants to merge 1 commit into
JSONbored:mainfrom
lourincedaging0-commits:feat/mcp-pr-reviewability-tool

Conversation

@lourincedaging0-commits

Copy link
Copy Markdown
Contributor

Summary

The GET /v1/repos/:owner/:repo/pulls/:number/reviewability route is already MCP-auth-aware (isMcpReadRepoAllowed, the same repo-allowlist gate /intelligenceloopover_get_repo_context and /issue-qualityloopover_get_issue_quality use) but had no tool on either server. This wires it up.

  • Remote server (src/mcp/server.ts): adds loopover_get_pr_reviewability, mirroring loopover_get_issue_quality exactly — the same canAccessRepo gate, the cached-snapshot-then-compute pattern (serving the persisted pr-reviewability snapshot the route already writes before recomputing), and the same freshnessResponseOutputSchema. Reuses the existing loadContributorFastContext loader and calls the same buildPullRequestReviewability the route does, with identical inputs.
  • Local server (packages/loopover-mcp): adds the equivalent apiGet proxy tool, per the convention that a new remote tool gets a local mirror.
  • Tests: server-level coverage (forbidden / not_found / cached-snapshot / snapshot timestamp fallback / computed-with-contributor / computed-no-author) and a stdio-proxy test asserting the tool registers and proxies to the correct route.

Response shape matches the loopover_get_issue_quality wrapper; no new response shape invented.

Closes #6154.

The GET /v1/repos/:owner/:repo/pulls/:number/reviewability route is already
MCP-auth-aware (isMcpReadRepoAllowed, same gate as /intelligence and
/issue-quality) but had no tool on either server. Adds
loopover_get_pr_reviewability to the remote server, mirroring
loopover_get_issue_quality's cached-snapshot-then-compute pattern and reusing
the existing contributor-fast-context loader, plus the equivalent apiGet proxy
tool on the local stdio server.

Closes JSONbored#6154.
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.10%. Comparing base (4a5bd94) to head (c436f54).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/mcp/server.ts 94.73% 0 Missing and 1 partial ⚠️

❗ There is a different number of reports uploaded between BASE (4a5bd94) and HEAD (c436f54). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (4a5bd94) HEAD (c436f54)
shard-3 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6197      +/-   ##
==========================================
- Coverage   95.33%   89.10%   -6.23%     
==========================================
  Files         599      599              
  Lines       47186    47205      +19     
  Branches    15032    15037       +5     
==========================================
- Hits        44983    42063    -2920     
- Misses       1477     3643    +2166     
- Partials      726     1499     +773     
Flag Coverage Δ
shard-1 43.92% <10.52%> (-0.02%) ⬇️
shard-2 36.65% <10.52%> (-0.02%) ⬇️
shard-3 ?
shard-4 34.13% <10.52%> (+0.13%) ⬆️
shard-5 32.20% <10.52%> (+0.71%) ⬆️
shard-6 44.91% <94.73%> (-0.29%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/mcp/server.ts 94.12% <94.73%> (-2.09%) ⬇️

... and 106 files with indirect coverage changes

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 15, 2026
@loopover-orb

loopover-orb Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 LoopOver review result - fixes required

Review updated: 2026-07-15 21:17:08 UTC

5 files · 1 AI reviewer · no blockers · readiness 82/100 · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
The AI review returned non-blocking notes for this change but did not include a separate narrative summary. Review the nits below before deciding this PR.

Nits — 2 non-blocking
  • Consider adding a light runtime check (e.g. verifying `payload.pullNumber` matches `input.number`) before trusting a cached snapshot, so a targetKey collision or schema drift surfaces as a mismatch rather than a silently wrong report.
  • The local server's `apiGet` proxy test only exercises the happy path with `number: 7`; consider asserting the client-side zod validation rejects `number: 0` or a negative number to lock in the `positive()` constraint client-side too.

CI checks failing

  • codecov/patch — 94.73% of diff hit (target 99.00%)
  • validate
  • validate-tests (3)
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #6154
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 (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 85 registered-repo PR(s), 35 merged, 5 issue(s).
Contributor context ✅ Confirmed Gittensor contributor lourincedaging0-commits; Gittensor profile; 85 PR(s), 5 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Review context
Contributor next steps
  • Start here: Review top overlaps.
  • Then work through the remaining 2 steps in the Signals table above.
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.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch, validate, validate-tests (3))). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 15, 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 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): add an MCP tool for GET /v1/repos/:owner/:repo/pulls/:number/reviewability (route already MCP-auth-aware, no tool on either server)

1 participant