Skip to content

feat(mcp): add remote + stdio mirror for loopover_get_upstream_ruleset - #7855

Closed
bohdansolovie wants to merge 1 commit into
JSONbored:mainfrom
bohdansolovie:feat/mcp-upstream-ruleset-7807-v2
Closed

feat(mcp): add remote + stdio mirror for loopover_get_upstream_ruleset#7855
bohdansolovie wants to merge 1 commit into
JSONbored:mainfrom
bohdansolovie:feat/mcp-upstream-ruleset-7807-v2

Conversation

@bohdansolovie

Copy link
Copy Markdown
Contributor

Summary

  • Register loopover_get_upstream_ruleset as a remote MCP tool (utility, no input) that returns getLatestUpstreamRulesetSnapshot, including a normal upstream_ruleset_not_found result when empty.
  • Register the matching local stdio MCP tool that proxies GET /v1/upstream/ruleset.
  • Bump the stdio discovery pin to 80 tools.

Closes #7807

Scope

  • src/mcp/server.ts — remote tool + category + output schema
  • packages/loopover-mcp/bin/loopover-mcp.ts — stdio descriptor + apiGet proxy
  • Unit/integration tests + fixture coverage for found/not-found paths

Validation

  • vitest run test/unit/mcp-upstream-ruleset.test.ts test/unit/mcp-cli-upstream-ruleset.test.ts test/unit/mcp-tool-rename-aliases.test.ts test/unit/mcp-output-schemas.test.ts

Safety

  • Read-only public discovery surface; no auth change; no human CLI verb; no REST changes.

Made with Cursor

@bohdansolovie
bohdansolovie requested a review from JSONbored as a code owner July 21, 2026 15:12
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 21, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security

Copy link
Copy Markdown
Contributor

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

Expose GET /v1/upstream/ruleset through remote MCP and local stdio using the
same public, no-argument shape as loopover_get_upstream_drift, including the
upstream_ruleset_not_found result when no snapshot exists.

Closes JSONbored#7807

Co-authored-by: Cursor <cursoragent@cursor.com>
@bohdansolovie
bohdansolovie force-pushed the feat/mcp-upstream-ruleset-7807-v2 branch from 3fe4960 to 1bf3d96 Compare July 21, 2026 15:13
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.34%. Comparing base (299c842) to head (1bf3d96).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/loopover-mcp/bin/loopover-mcp.ts 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (299c842) and HEAD (1bf3d96). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (299c842) HEAD (1bf3d96)
shard-3 2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7855       +/-   ##
===========================================
- Coverage   91.37%   81.34%   -10.03%     
===========================================
  Files         729       90      -639     
  Lines       74694    24351    -50343     
  Branches    22795     4685    -18110     
===========================================
- Hits        68252    19809    -48443     
+ Misses       5396     4342     -1054     
+ Partials     1046      200      -846     
Flag Coverage Δ
shard-1 15.36% <77.77%> (-39.13%) ⬇️
shard-2 12.68% <22.22%> (-42.51%) ⬇️
shard-3 24.57% <55.55%> (-26.76%) ⬇️

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

Files with missing lines Coverage Δ
src/mcp/server.ts 96.48% <100.00%> (+0.02%) ⬆️
packages/loopover-mcp/bin/loopover-mcp.ts 0.00% <0.00%> (ø)

... and 639 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-21 15:25:08 UTC

8 files · 1 AI reviewer · no blockers · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
This PR mirrors the existing loopover_get_upstream_drift tool pattern to add a new public, read-only loopover_get_upstream_ruleset tool (remote + stdio proxy), returning the cached upstream ruleset snapshot or a normal not-found result. The implementation is consistent with existing conventions in src/mcp/server.ts and packages/loopover-mcp/bin/loopover-mcp.ts, the tool count bump to 80 is updated everywhere it's asserted, and the added tests cover both found/not-found paths plus schema and financial-field-leak checks. No wiring or schema-parity issues are visible in the diff.

Nits — 5 non-blocking
  • codecov/patch reports only 77.77% of the diff hit vs. the repo's ~99% target — check which branch (likely the found-vs-not-found or the payload cast) is uncovered before merging, per the repo's stated coverage bar.
  • src/mcp/server.ts and packages/loopover-mcp/bin/loopover-mcp.ts are already very large files (per the external size-smell brief); this PR adds to that debt incrementally, worth a follow-up split-out issue rather than blocking here.
  • The output schema's `payload: z.unknown().optional()` and `data: ruleset as unknown as Record<string, unknown>` cast in getUpstreamRuleset (src/mcp/server.ts) bypass real schema validation for the nested registry payload — confirm this is intentional parity with getUpstreamDrift rather than an oversight.
  • The FAILED validate / validate-tests-merge checks show no detail; given the branch is 2 commits behind default, this is more likely caused by upstream changes than this diff's content — worth confirming with a rebase rather than assuming a defect.
  • Add a coverage assertion or check for the uncovered branch flagged by codecov/patch before merge.

CI checks failing

  • validate
  • validate-tests-merge
  • codecov/patch — 77.77% of diff hit (target 99.00%)
Flagged checks (non-blocking)
  • Contributor trust — Contributor flagged for review

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 #7807
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: 64 registered-repo PR(s), 21 merged, 7 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bohdansolovie; Gittensor profile; 64 PR(s), 7 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR registers loopover_get_upstream_ruleset as both a remote MCP tool (utility category, no-arg input, calling getLatestUpstreamRulesetSnapshot with a normal not-found result) and a local stdio tool proxying GET /v1/upstream/ruleset, exactly mirroring the loopover_get_upstream_drift pattern with no new REST route or CLI verb.

Review context
  • Author: bohdansolovie
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, C++, JavaScript
  • Official Gittensor activity: 64 PR(s), 7 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 (CI is failing (validate, validate-tests-merge, codecov/patch)). 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
loopover-orb Bot pushed a commit that referenced this pull request Jul 21, 2026
…set (#7921)

Mirror loopover_get_upstream_drift on both the remote MCP server and local
stdio wrapper. Cover found/not-found remotely and instrument the bin via the
#7764 in-process exported-server pattern so codecov/patch sees the new lines
(unlike bin-only #7855).

Closes #7807

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

loopover_get_upstream_ruleset has a REST route but no remote MCP tool or local stdio MCP tool

1 participant