feat(api): REST + CLI mirror for loopover_pr_outcome - #6965
feat(api): REST + CLI mirror for loopover_pr_outcome#6965lourincedaging0-commits wants to merge 1 commit into
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
The loopover_pr_outcome MCP tool (src/mcp/server.ts) returns a contributor's own merged-PR outcome history, self-scoped via requireContributorAccess, but had no REST route or CLI mirror despite fitting the existing /v1/contributors/:login/... route family. Add GET /v1/contributors/:login/pr-outcomes (self-scoped, ?limit=N mirroring the tool's 1..100 bound) and register the loopover_pr_outcome CLI stdio tool. Both, and the existing MCP tool, now delegate to one shared buildContributorPrOutcomes builder in src/signals/ (mirroring the buildContributorOpenPrMonitor sibling), so all three surfaces return one byte-identical payload and can never drift. Reconcile the stdio tool-count invariant to the true live count of 73: the base was 71, JSONbored#6942's get_maintainer_lane mirror brought it to 72 without updating the invariant (leaving main red on validate-tests), and this tool takes it to 73. Tests: routes-pr-outcomes (self-scoping, operator override, ?limit validation, empty-history, no wallet/hotkey/reward leakage) and mcp-cli-pr-outcome-tool (stdio registration, route-proxy payload parity, limit forwarding), plus the shared mcp-cli-harness fixture route.
adf6e46 to
5b5fba9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6965 +/- ##
=======================================
Coverage 93.71% 93.71%
=======================================
Files 685 686 +1
Lines 68379 68393 +14
Branches 18730 18733 +3
=======================================
+ Hits 64080 64094 +14
Misses 3302 3302
Partials 997 997
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Caution 🛑 LoopOver review result - reject/close recommendedReview updated: 2026-07-17 16:20:41 UTC
Review summary Nits — 5 non-blocking
Why this is blocked
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk 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.
Full command reference: https://loopover.ai/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.
|
|
LoopOver is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR; No linked issue detected; Maintainer requires a linked issue). 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. |
What
The
loopover_pr_outcomeMCP tool returns a contributor's own merged-PR outcomehistory (self-scoped via
requireContributorAccess), but it was the only surfacefor that data — no REST route, no CLI mirror — despite fitting the existing
/v1/contributors/:login/...route family alongside the open-PR monitor.This adds the two missing surfaces and collapses all three onto one shared builder:
GET /v1/contributors/:login/pr-outcomes— self-scoped, with?limit=Nmirroring the tool's
1..100bound.loopover_pr_outcomestdio tool, which proxies that route.buildContributorPrOutcomesinsrc/signals/(mirroring thebuildContributorOpenPrMonitorsibling), so the three surfaces return abyte-identical payload and can't drift.
Also reconciles the stdio tool-count invariant to the true live count of 73 (base
was 71; #6942's
get_maintainer_lanemirror took it to 72 without bumping theinvariant, leaving
mainred onvalidate-tests; this tool makes it 73).Tests
routes-pr-outcomes.test.ts(7) — own-history happy path, self-scoping (a sessioncan't read another login), operator-token override,
?limitapplied + malformed?limitrejected with 400 (not clamped), empty-history returns[]not an error,and no wallet/hotkey/trust-score/reward terms leak.
mcp-cli-pr-outcome-tool.test.ts(3) — tool is registered on the stdio server,proxies to
GET /v1/contributors/:login/pr-outcomesreturning the route payloadverbatim (parity), and forwards the optional
limitas a query param.mcp-cli-harnesswith the/pr-outcomesfixture route and anonApiRequesthook.