Skip to content

feat(mcp): register loopover_generate_contributor_issue_drafts as a local stdio tool - #7978

Closed
real-venus wants to merge 1 commit into
JSONbored:mainfrom
real-venus:feat/generate-contributor-issue-drafts-stdio-tool-7755
Closed

feat(mcp): register loopover_generate_contributor_issue_drafts as a local stdio tool#7978
real-venus wants to merge 1 commit into
JSONbored:mainfrom
real-venus:feat/generate-contributor-issue-drafts-stdio-tool-7755

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

Summary

Closes #7755loopover_generate_contributor_issue_drafts has a remote MCP tool (src/mcp/server.ts) and a maintain generate-issue-drafts CLI command, but no local stdio MCP tool registration. #6757 added the REST route + CLI but never the matching stdio tool.

What changed (packages/loopover-mcp/bin/loopover-mcp.ts)

  • A registerStdioTool("loopover_generate_contributor_issue_drafts", …) block, mirroring the sibling write-tool loopover_plan_repo_issues pattern — proxies POST to the same {repoBase}/contributor-issue-drafts/generate route the maintain generate-issue-drafts CLI already calls.
  • Dry-run by default / create-safety preserved: input generateContributorIssueDraftsShape mirrors the remote (owner/repo/dryRun default true/create default false/limit 1–20 default 5); the schema-defaulted dryRun/create are forwarded verbatim, and the route re-applies its own explicit_create_requires_dry_run_false guard — so create alone is rejected and only an explicit {create:true, dryRun:false} reaches the write path. Description via stdioToolDescription(...); category: "maintainer".

Testing / coverage

  • test/unit/mcp-cli-generate-contributor-issue-drafts.test.ts drives it in-process (the loopover_plan_repo_issues has no REST route, CLI command, or local stdio MCP tool #7764 isProcessEntrypoint guard + InMemoryTransport) for real Codecov-measured coverage — asserting both the dry-run-default forwarding ({dryRun:true, create:false, limit:5}) and the explicit-create forwarding ({dryRun:false, create:true, limit:3}).
  • Tool-count invariant bumped to 98.

No REST/OpenAPI/CLI-surface change — ui:openapi:check, command-reference:check, docs/manifest drift all clean; build:mcp clean.

…ocal stdio tool

loopover_generate_contributor_issue_drafts has a remote MCP tool (src/mcp/server.ts)
and a `maintain generate-issue-drafts` CLI command, but no local stdio MCP tool
registration. JSONbored#6757 added the REST route + CLI but never the matching stdio tool.

Adds the registerStdioTool block mirroring the sibling loopover_plan_repo_issues
write-tool pattern -- proxies POST {repoBase}/contributor-issue-drafts/generate (the
same route the CLI hits). Dry-run BY DEFAULT: the schema defaults dryRun=true/
create=false and the route re-applies its explicit_create_requires_dry_run_false
guard, so `create` alone is rejected and only an explicit {create:true,dryRun:false}
reaches the write path. Input mirrors the remote generateContributorIssueDraftsShape;
description via stdioToolDescription; category "maintainer".

test/unit/mcp-cli-generate-contributor-issue-drafts.test.ts drives it in-process
(JSONbored#7764 entrypoint guard) so the registration + handler get real Codecov coverage,
asserting the dry-run-default and explicit-create forwarding. Count 97 -> 98.

Closes JSONbored#7755
@real-venus
real-venus requested a review from JSONbored as a code owner July 22, 2026 01:18
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.92%. Comparing base (4dccaa6) to head (94fa841).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7978      +/-   ##
==========================================
- Coverage   91.89%   81.92%   -9.98%     
==========================================
  Files         738       94     -644     
  Lines       75709    23949   -51760     
  Branches    23009     4602   -18407     
==========================================
- Hits        69576    19621   -49955     
+ Misses       5041     4132     -909     
+ Partials     1092      196     -896     
Flag Coverage Δ
shard-1 11.81% <100.00%> (-46.55%) ⬇️
shard-2 0.00% <0.00%> (-52.13%) ⬇️
shard-3 0.00% <0.00%> (-50.04%) ⬇️

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 11.81% <100.00%> (-5.07%) ⬇️

... and 644 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 22, 2026
@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-22 01:24:45 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR registers the missing local stdio tool for loopover_generate_contributor_issue_drafts, mirroring the existing pattern used by the sibling loopover_plan_repo_issues write-tool and forwarding to the same REST route the CLI already calls. The input shape and create-safety semantics (dryRun default true, create default false, route re-applies its own guard) exactly match the remote tool's shape shown in the reference context (src/mcp/server.ts), and the added in-process test verifies both the dry-run-default and explicit-create forwarding paths. The tool-count bump to 98 is consistently applied across the descriptor list and the two assertion sites in mcp-tool-rename-aliases.test.ts.

Nits — 5 non-blocking
  • The external brief flags a possible secret assignment at test/unit/mcp-cli-generate-contributor-issue-drafts.test.ts:27, but that line is just `process.env.LOOPOVER_API_TOKEN = "in-process-token";`, a hardcoded test fixture token, not a real secret — worth confirming but very likely a false positive.
  • packages/loopover-mcp/bin/loopover-mcp.ts:3098 — the handler parameter is typed `async ({ owner, repo, dryRun, create, limit }: any) =>`, matching the sibling write-tools' existing `any`-typed handlers in this file, so it's consistent with local convention rather than a new pattern.
  • The magic numbers 20/5 in `generateContributorIssueDraftsShape` (loopover-mcp.ts:1031) mirror the remote shape's literal bounds already present in src/mcp/server.ts verbatim, so introducing a shared constant would be a separate cross-cutting refactor, not something this PR should take on.
  • Consider a comment cross-referencing src/mcp/server.ts's generateContributorIssueDraftsShape next to the new stdio shape (loopover-mcp.ts:1024) the way the PR description already explains, so a future editor changing one bound remembers to update the other.
  • 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 #7755
Related work ⚠️ 1 scoped overlap 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: 112 registered-repo PR(s), 50 merged, 19 issue(s).
Contributor context ✅ Confirmed Gittensor contributor real-venus; Gittensor profile; 112 PR(s), 19 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The PR adds a registerStdioTool block for loopover_generate_contributor_issue_drafts using the same pattern as sibling tools, reuses the existing REST endpoint call via apiPost (no duplicated HTTP logic), sources its description from stdioToolDescription, and updates the tool-count invariant plus adds a dedicated test file mirroring the sibling coverage convention.

Review context
  • Author: real-venus
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript, Python, Rust, CSS, MDX, Svelte, Swift
  • Official Gittensor activity: 112 PR(s), 19 issue(s).
  • Related work: Titles/paths share 7 meaningful terms. (PR #7977)
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
Contributor

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.

@real-venus

Copy link
Copy Markdown
Contributor Author

@JSONbored
Please review this

@andriypolanski

Copy link
Copy Markdown
Contributor

Hey,
PR #7977 was approved earlier than your PR, #7978.
As I said before, maintainer updated bot.

@JSONbored

Copy link
Copy Markdown
Owner

Hey, PR #7977 was approved earlier than your PR, #7978. As I said before, maintainer updated bot.

Don't worry, it won't merge out of order - few minor bugs i'm still working out with the new changes, but you should notice that ordering is pretty solid now (especially in the case of consecutive overlapping linked issue PRs), so first submission will win unless it has a problem that leads to a closure.

@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, closing:

This branch has conflicts that must be resolved
Use the [web editor](https://github.com/JSONbored/loopover/pull/7978/conflicts) or the command line to resolve conflicts before continuing.

test/unit/mcp-tool-rename-aliases.test.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register loopover_generate_contributor_issue_drafts as a local stdio MCP tool

3 participants