feat(mcp): add a loopover_get_maintainer_lane CLI mirror#6942
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
1 similar comment
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6942 +/- ##
=======================================
Coverage 93.71% 93.71%
=======================================
Files 685 685
Lines 68358 68358
Branches 18726 18726
=======================================
Hits 64059 64059
Misses 3302 3302
Partials 997 997
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-17 14:54:33 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed 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.
|
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.
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.
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.
Closes #6739
Problem
The MCP tool
loopover_get_maintainer_lane(src/mcp/server.ts:1863) returns data that already ships as the.maintainerLanefield ofGET /v1/repos/:owner/:repo/intelligence. The CLI already proxies that exact same endpoint for its sibling fields —loopover_get_label_auditpicks out.labelAudit,loopover_get_burden_forecastpicks out its own — butmaintainerLane, which sits right beside them in the samebuildRepoIntelligenceResponsepayload, had no CLI extraction.Fix
Add
registerStdioTool("loopover_get_maintainer_lane", { inputSchema: ownerRepoShape }, ...), copyingloopover_get_label_audit's implementation exactly and returning{ repoFullName, generatedAt, maintainerLane: intelligence?.maintainerLane ?? null }, plus its registry entry (category: "maintainer") sostdioToolDescriptionresolves. No new route and no new fetch shape — it reuses the GET the sibling tools already make.Tests
New
test/unit/mcp-cli-maintainer-lane.test.ts(mirrorsmcp-cli-label-audit.test.ts):owner/repoto/v1/repos/:owner/:repo/intelligenceviaapiGetand returns the maintainer lane (public-safety regex asserted, as the sibling does);/intelligencerouteloopover_get_label_audituses, agrees with it onrepoFullName/generatedAtfor identical input, and each tool surfaces only its own slice (maintainerLanevslabelAudit).mcp-tool-rename-aliases.test.ts's two exact tool-count assertions are updated 70 → 71 (the count is asserted against both the live server andloopover-mcp tools --json).Validation
npx vitest run test/unit/mcp-cli-maintainer-lane.test.ts test/unit/mcp-tool-rename-aliases.test.ts test/unit/mcp-cli-label-audit.test.ts→ 15/15 passtest/unit/mcp-*.test.ts) → zero net-new failures vs the pristine baseline (the failing set is byte-identical; those are Windows-only npm-registry/telemetry/file-mode cases).npm run typecheck→ clean (0 errors);npm run build:mcppasses;npm run command-reference:checkpasses.main(363a8b5) so the new tool sits alongside the freshly-mergedloopover_intake_idea/loopover_simulate_open_pr_pressure/loopover_build_results_payloadmirrors.