feat: REST + CLI mirror for loopover_pr_outcome (#6747) - #6963
Closed
jaytbarimbao-collab wants to merge 1 commit into
Closed
feat: REST + CLI mirror for loopover_pr_outcome (#6747)#6963jaytbarimbao-collab wants to merge 1 commit into
jaytbarimbao-collab wants to merge 1 commit into
Conversation
The loopover_pr_outcome MCP tool returned a contributor's own merged-PR outcome history, but no REST route or CLI stdio tool exposed it — unlike its siblings in the /v1/contributors/:login/* family. - New src/signals/contributor-pr-outcomes.ts: buildContributorPrOutcomes(env, login, limit) — the single source of truth, mapping the contributor's pull_request_merged notification deliveries into outcome records. The MCP tool now delegates to it, so all three surfaces return identical data (mirrors how buildContributorOpenPrMonitor backs its own trio). - REST: GET /v1/contributors/:login/pr-outcomes[?limit=N] in routes.ts, gated by requireContributorAccess (same self-scoping as the tool), limit clamped. - CLI: loopover_pr_outcome stdio tool in loopover-mcp.js, hitting the new route (count guard 72 -> 73). Tests: builder unit coverage (mapping / event-type filter / empty / limit), REST parity (route output equals the shared builder byte-for-byte), limit query, and the forbidden_contributor guard for the shared MCP token. The existing loopover_pr_outcome MCP test still passes through the shared builder. Closes JSONbored#6747
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
This was referenced Jul 17, 2026
JSONbored
reviewed
Jul 17, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
Merge conflicts:
This branch has conflicts that must be resolved
Use the [web editor](https://github.com/JSONbored/loopover/pull/6963/conflicts) or the command line to resolve conflicts before continuing.
test/unit/mcp-tool-rename-aliases.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6747.
The
loopover_pr_outcomeMCP tool returns a contributor's own merged-PR outcome history, but no REST route or CLI stdio tool exposed it — unlike its siblings in the/v1/contributors/:login/*family.Change
src/signals/contributor-pr-outcomes.ts—buildContributorPrOutcomes(env, login, limit), the single source of truth: maps the contributor'spull_request_mergednotification deliveries into outcome records (newest first, login lowercased). The MCP tool'sprOutcomesnow delegates to it, so all three surfaces return identical data — mirroring howbuildContributorOpenPrMonitorbacks its own MCP/REST/CLI trio.GET /v1/contributors/:login/pr-outcomes[?limit=N]inroutes.ts, gated byrequireContributorAccess(the same self-scoping as the tool);limitclamped, defaulting to the tool's own default.loopover_pr_outcomestdio tool inloopover-mcp.js, calling the new route (tool count guard 72 → 73; the guard also picks up the tool via its derived name-set assertion).Tests
pull_request_merged-only filtering, empty history, and explicit limit.?limit=query, and theforbidden_contributorguard rejecting the shared MCP token reading an arbitrary contributor.loopover_pr_outcomeMCP test still passes (now through the shared builder).Verified locally: new suite +
mcp-tool-rename-aliases(count 73),mcp-output-schemas,mcp-cli-tools,openapi, andtscall green.loopover-mcp/bin/**is outsidecoverage.include; the coverage-gatedsrc/**additions (the builder + route) are fully covered.