Skip to content

feat(mcp): add remote + stdio surfaces for loopover_get_repo_focus_manifest#7936

Closed
kai392 wants to merge 1 commit into
JSONbored:mainfrom
kai392:feat/7808-mcp-repo-focus-manifest
Closed

feat(mcp): add remote + stdio surfaces for loopover_get_repo_focus_manifest#7936
kai392 wants to merge 1 commit into
JSONbored:mainfrom
kai392:feat/7808-mcp-repo-focus-manifest

Conversation

@kai392

@kai392 kai392 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Closes loopover_get_repo_focus_manifest (read-only) has a REST route but no remote MCP tool or local stdio MCP tool #7808: register loopover_get_repo_focus_manifest on remote MCP + local stdio (thin mirror of GET /v1/repos/:owner/:repo/focus-manifest).
  • Auth matches REST precisely: requireAppRole([maintainer,owner,operator]) + session repo access; static mcp rejected (insufficient_role). No refresh/PUT tools.
  • outputSchema + authorized/forbidden coverage in mcp-output-schemas (api, mcp reject, session role reject, operator allow) + in-process stdio proxy test.
  • Pins stdio tool count 87 → 88.

Scope

  • Conventional Commit title
  • Focused MCP-only change
  • Linked open issue Closes #7808

Validation

  • git diff --check
  • npm run branding-drift:check
  • npm run typecheck
  • npm run build:mcp
  • vitest --coverage mcp-output-schemas + mcp-cli-repo-focus-manifest + mcp-tool-rename-aliases (64/64)
  • Local patch coverage on changed executable lines: 100% (19/19)
  • Full unsharded test:coverage deferred to CI

Safety

  • No secrets exposed
  • Auth negative paths covered (static mcp + non-role session)
  • No UI changes (UI Evidence N/A)
  • No write-side refresh/PUT MCP tools

UI Evidence

N/A — MCP/API only.

Notes

  • One-shot PR: will not push follow-up commits onto this branch after open.

Made with Cursor

@kai392
kai392 requested a review from JSONbored as a code owner July 21, 2026 19:31
@superagent-security

Copy link
Copy Markdown
Contributor

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

…nifest

Closes JSONbored#7808: mirror GET focus-manifest on remote MCP and local stdio with requireAppRole/session-repo auth, outputSchema, and mcp-output-schemas coverage; pin tool count 87→88.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.51%. Comparing base (c6d28ab) to head (27472d5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7936       +/-   ##
===========================================
+ Coverage   65.46%   82.51%   +17.05%     
===========================================
  Files         733       90      -643     
  Lines       75133    24454    -50679     
  Branches    22918     4702    -18216     
===========================================
- Hits        49183    20179    -29004     
+ Misses      22166     4039    -18127     
+ Partials     3784      236     -3548     
Flag Coverage Δ
shard-1 22.74% <15.78%> (?)
shard-2 22.22% <26.31%> (?)
shard-3 33.33% <89.47%> (-22.93%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-mcp/bin/loopover-mcp.ts 14.06% <100.00%> (+2.50%) ⬆️
src/mcp/server.ts 96.69% <100.00%> (+31.72%) ⬆️

... and 643 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 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-21 19:48:54 UTC

7 files · 1 AI reviewer · no blockers · CI green · dirty

⏸️ Suggested Action - Manual Review

Review summary
This PR wires a thin, read-only MCP surface for the repo-owned focus manifest, mirroring the REST route's auth precisely: a new requireFocusManifestReadAccess method duplicates the existing pattern (static mcp rejected, session must have maintainer/owner/operator role, then requireRepoAccess), and both remote (src/mcp/server.ts) and stdio (loopover-mcp.ts) surfaces are registered with matching output schemas. Test coverage is solid: authorized api identity, rejected static mcp, rejected non-privileged session, allowed operator session, plus an in-process stdio proxy test and the tool-count bump from 87 to 88 is applied consistently across mcp-tool-rename-aliases and api.test.ts. The flagged 'leaked secret' at mcp-cli-repo-focus-manifest.test.ts:32 is a placeholder test token (`in-process-token`), consistent with the same pattern used by sibling test files, not a real credential.

Nits — 6 non-blocking
  • The new requireFocusManifestReadAccess (src/mcp/server.ts:3160) is nearly identical to the existing requireRepoManageAccess-style helpers seen elsewhere in this file — worth a comment or shared helper if a fourth near-duplicate role-check appears next time to avoid drift between them.
  • packages/loopover-mcp/bin/loopover-mcp.ts's stdio registration uses `async ({ owner, repo }: any) =>` (flagged around line 1587) — an explicit `any` on the callback param where the existing ownerRepoShape zod schema could type it, consistent with the file's existing style but still worth tightening opportunistically.
  • The output schema's `manifest`/`policy` fields are typed as z.unknown() (src/mcp/server.ts) — fine for a thin mirror, but if the REST route's response shape is more concretely typed it'd be worth matching rather than opting out of schema validation.
  • Confirm `compileFocusManifestPolicy` and `loadRepoFocusManifest` (imported at src/mcp/server.ts:173-174) return shapes consistent with what the REST route returns, since that parity is the core correctness claim of this PR.
  • Consider extracting the repeated maintainer/owner/operator role-check block into a shared helper if a similar tool is added again, per repo#7800/loopover_get_activation_preview has a REST route but no remote MCP tool or local stdio MCP tool #7799 precedent of adding near-identical auth wrappers per tool.
  • Possible secret-shaped assignment in the diff (generic_secret_assignment) — Verify the value is not a real credential.

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 #7808
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low 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: 60 registered-repo PR(s), 33 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kai392; Gittensor profile; 60 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The PR registers loopover_get_repo_focus_manifest as both a remote MCP tool (with ownerRepoShape input, maintainer category, and a dedicated auth helper replicating requireAppRole([maintainer,owner,operator]) plus session-repo-access) and a local stdio tool proxying GET .../focus-manifest, matching the required two-surface pattern while explicitly avoiding refresh/PUT tools or a new CLI verb.

Review context
  • Author: kai392
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, Kotlin, Perl, TypeScript, Vue
  • Official Gittensor activity: 60 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR). 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.

@loopover-orb loopover-orb Bot closed this Jul 21, 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. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

loopover_get_repo_focus_manifest (read-only) has a REST route but no remote MCP tool or local stdio MCP tool

2 participants