Skip to content

feat(mcp): add a contributor-profile CLI command#6961

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jeffrey701:feat-mcp-contributor-profile-cli-6737
Jul 17, 2026
Merged

feat(mcp): add a contributor-profile CLI command#6961
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jeffrey701:feat-mcp-contributor-profile-cli-6737

Conversation

@jeffrey701

Copy link
Copy Markdown
Contributor

Closes #6737

Problem

The MCP tool loopover_get_contributor_profile (src/mcp/server.ts:1992) mirrors GET /v1/contributors/:login/profile (src/api/routes.ts:3093, gated by requireContributorAccess — the same gate decision-pack/repo-decision already satisfy). No CLI mirror existed, despite that family of contributor commands already sharing the identical route shape and login-resolution logic.

Fix

Add a contributor-profile top-level CLI command, mirroring decisionPackCli's structure: it resolves the login from --login → the active session → LOOPOVER_LOGINGITHUB_LOGIN (identical to the sibling commands, so a logged-in contributor never retypes their own login), GETs /v1/contributors/{login}/profile, prints a one-line summary on the plain path and the full payload with --json. Named contributor-profile because the top-level profile command is already taken (it manages MCP client profiles). Registered in the command-completion map so the shell completers list it.

Tests

New test/unit/mcp-cli-contributor-profile.test.ts:

  1. an explicit --login mirrors GET /v1/contributors/:login/profile and prints the summary (plain) / full payload (--json) — asserting output parity between the two surfaces;
  2. an omitted --login resolves from LOOPOVER_LOGIN and url-encodes it into the path;
  3. an unresolvable login errors with the Pass --login guidance and issues no request.

A /v1/contributors/:login/profile fixture route is added to the shared CLI harness (additive, mirroring the existing contributor-route fixtures).

Validation

  • npx vitest run test/unit/mcp-cli-contributor-profile.test.ts3/3 pass; test/unit/mcp-cli-basics.test.ts (the completer) still green.
  • Full MCP net → zero net-new failures vs the pristine baseline.
  • npm run typecheckclean (0 errors); node --check passes.
  • packages/loopover-mcp/** and test/** are outside the Codecov include, so no codecov/patch obligation.
  • Scope: 1 source file + 1 harness fixture + 1 new test.

@jeffrey701
jeffrey701 requested a review from JSONbored as a code owner July 17, 2026 15:53
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.71%. Comparing base (a4310f1) to head (3aeedfb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6961       +/-   ##
===========================================
+ Coverage   82.38%   93.71%   +11.32%     
===========================================
  Files         685      685               
  Lines       68379    68379               
  Branches    18730    18730               
===========================================
+ Hits        56337    64080     +7743     
+ Misses       9594     3302     -6292     
+ Partials     2448      997     -1451     
Flag Coverage Δ
shard-1 43.75% <ø> (?)
shard-2 36.80% <ø> (+0.01%) ⬆️
shard-3 32.93% <ø> (+0.17%) ⬆️
shard-4 34.26% <ø> (?)
shard-5 31.88% <ø> (-0.29%) ⬇️
shard-6 45.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 202 files with indirect coverage changes

@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
@loopover-orb

loopover-orb Bot commented Jul 17, 2026

Copy link
Copy Markdown

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-17 16:01:46 UTC

3 files · 1 AI reviewer · no blockers · readiness 80/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds a `contributor-profile` CLI command mirroring the existing `loopover_get_contributor_profile` MCP tool and its underlying `/v1/contributors/:login/profile` route, following the same structural pattern as `decision-pack`/`repo-decision`/`monitor-open-prs`. The change is small, additive, and closes issue #6737 as required. Login resolution, JSON escaping via `sanitizePlainTextTerminalOutput`, and the new fixture-server route all look correct, though the login-resolution order and help documentation diverge slightly from the sibling commands the PR claims to mirror exactly.

Nits — 5 non-blocking
  • packages/loopover-mcp/bin/loopover-mcp.js: `contributorProfileCli` adds an `activeProfile.session?.login` fallback between `--login` and `LOOPOVER_LOGIN` that `decisionPackCli` (shown in the diff context) doesn't have — the PR claims 'identical to sibling commands,' so either add the session fallback to the siblings too or explain why this command alone gets it.
  • packages/loopover-mcp/bin/loopover-mcp.js: unlike `decisionPackCli`, `contributorProfileCli` has no `options.help`/`printContributorProfileHelp` branch and the diff doesn't show a top-level `--help` usage line being added, so `contributor-profile --help` likely falls through to generic/no help — sibling commands (e.g. monitor-open-prs) are tested for self-documenting `--help` output but this one isn't.
  • test/unit/mcp-cli-contributor-profile.test.ts: the parity test only checks plain-vs-json output from the same fixture payload rather than proving CLI-vs-MCP-tool parity the way `mcp-cli-monitor-open-prs.test.ts` does (calling the actual tool via stdio and diffing structuredContent against the CLI's `--json` output), so it's weaker coverage of the 'mirrors the MCP tool' claim in the description.
  • Add a `printContributorProfileHelp()` mirroring `printDecisionPackHelp()` and wire `options.help` the same way, then assert it in `--help`/`contributor-profile --help` tests for parity with sibling commands.
  • Add a stdio-transport test (like mcp-cli-monitor-open-prs.test.ts's `loopover_monitor_open_prs stdio proxy` describe block) that calls `loopover_get_contributor_profile` via the MCP client and diffs its structuredContent against the CLI's `--json` output to actually prove mirror parity.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #6737
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: 134 registered-repo PR(s), 64 merged, 32 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jeffrey701; Gittensor profile; 134 PR(s), 32 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR adds a contributor-profile CLI command that GETs /v1/contributors/{login}/profile, resolves login via --login/session/LOOPOVER_LOGIN/GITHUB_LOGIN mirroring decisionPackCli, supports --json, and includes a unit test with plain/json parity, LOOPOVER_LOGIN resolution with URL-encoding, and a no-login error case.

Review context
  • Author: jeffrey701
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 134 PR(s), 32 issue(s).
  • Related work: Titles/paths share 4 meaningful terms. (PR #6958)
  • Related work: Titles/paths share 7 meaningful terms. (issue #6737, issue #6747)
  • Related work: Titles/paths share 8 meaningful terms. (issue #6737, issue #6734)
  • Additional title-only matches omitted; title-only overlap does not block.
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://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.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 484c9c8 into JSONbored:main Jul 17, 2026
16 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 17, 2026
12 tasks
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.

CLI mirror for loopover_get_contributor_profile

1 participant