Skip to content

feat: REST + CLI mirror for loopover_pr_outcome (#6747) - #6963

Closed
jaytbarimbao-collab wants to merge 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:feat-rest-pr-outcomes-mirror-6747
Closed

feat: REST + CLI mirror for loopover_pr_outcome (#6747)#6963
jaytbarimbao-collab wants to merge 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:feat-rest-pr-outcomes-mirror-6747

Conversation

@jaytbarimbao-collab

Copy link
Copy Markdown
Contributor

Closes #6747.

The loopover_pr_outcome MCP 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

  • New src/signals/contributor-pr-outcomes.tsbuildContributorPrOutcomes(env, login, limit), the single source of truth: maps the contributor's pull_request_merged notification deliveries into outcome records (newest first, login lowercased). The MCP tool's prOutcomes now delegates to it, so all three surfaces return identical data — mirroring how buildContributorOpenPrMonitor backs its own MCP/REST/CLI trio.
  • RESTGET /v1/contributors/:login/pr-outcomes[?limit=N] in routes.ts, gated by requireContributorAccess (the same self-scoping as the tool); limit clamped, defaulting to the tool's own default.
  • CLIloopover_pr_outcome stdio tool in loopover-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

  • Builder unit coverage: the merged-delivery mapping, pull_request_merged-only filtering, empty history, and explicit limit.
  • Parity: the REST route returns byte-for-byte what the shared builder produces for identical input.
  • The ?limit= query, and the forbidden_contributor guard rejecting the shared MCP token reading an arbitrary contributor.
  • The existing loopover_pr_outcome MCP 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, and tsc all green. loopover-mcp/bin/** is outside coverage.include; the coverage-gated src/** additions (the builder + route) are fully covered.

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
@superagent-security

Copy link
Copy Markdown
Contributor

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

@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.

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

@JSONbored JSONbored closed this Jul 17, 2026
@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 17, 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.

REST + CLI mirror for loopover_pr_outcome

2 participants