Skip to content

feat(mcp): add REST + CLI + stdio surfaces for loopover_plan_repo_issues - #7834

Closed
xfodev wants to merge 1 commit into
JSONbored:mainfrom
xfodev:feat/plan-repo-issues-three-surfaces-7764
Closed

feat(mcp): add REST + CLI + stdio surfaces for loopover_plan_repo_issues#7834
xfodev wants to merge 1 commit into
JSONbored:mainfrom
xfodev:feat/plan-repo-issues-three-surfaces-7764

Conversation

@xfodev

@xfodev xfodev commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

loopover_plan_repo_issues (backed by generateIssuePlanDrafts, src/services/issue-plan-draft.ts) shipped only as a remote MCP tool (via Epic #7424, after the MCP-parity milestone had closed), so it never got the REST + CLI + local-stdio mirror surfaces every other repo-scoped, requireRepoManageAccess-gated tool has. This adds the three missing surfaces, mirroring its closest analog loopover_generate_contributor_issue_drafts exactly:

  • REST routePOST /v1/repos/:owner/:repo/issue-plan-drafts/generate in src/api/routes.ts, calling generateIssuePlanDrafts with the required goal from the body, gated identically to the contributor sibling (requireAppRole → session repo access → write-access on the create path), plus the canSessionAccessPath matcher entry and the OpenAPI registerPath.
  • CLI commandloopover-mcp maintain plan-issues, POSTing to the new route via the same apiPost/repoBase helper the sibling uses (dry-run by default; --create opts in).
  • Local stdio MCP toolregisterStdioTool("loopover_plan_repo_issues", …) calling the new CLI logic, mirroring the sibling stdio block.

generateIssuePlanDrafts, the remote tool, and src/services/** are unchanged — this is purely the three missing mirror surfaces.

Tests

  • test/unit/routes-issue-plan-draft.test.ts (new, mirrors the contributor route test): success, both auth-gate branches incl. write-granted create fall-through, invalid-JSON, invalid-body, explicit-create guard, and cross-repo/forbidden — the new routes.ts lines are 100% statement + branch covered.
  • test/unit/mcp-cli-plan-issues.test.ts (new, mirrors mcp-generate-contributor-issue-drafts): in-process coverage of the CLI command + stdio tool (both the committed .js and its .ts). The bin was made importable via an entrypoint guard + exported server/maintainCli (the maintainer-prescribed testable-export refactor; subprocess launch unchanged).

Validation

  • Root tsc --noEmit clean; new route/CLI/stdio + completion-spec (CLI_COMMAND_SPEC parity) tests pass; ui:openapi:check, ui:openapi:settings-parity, command-reference:check, docs:drift-check all green; OpenAPI regenerated + committed; rebased on latest main.
  • Auth/CORS negative-path tests included (forbidden / cross-repo / unauthorized session). No wallet/hotkey/trust-score/reward terms in route output or CLI text.

Closes #7764

…lan_repo_issues

loopover_plan_repo_issues (generateIssuePlanDrafts) shipped only as a remote MCP
tool and never got the REST + CLI + local-stdio mirror surfaces its repo-scoped,
requireRepoManageAccess-gated siblings all have. Mirrors
loopover_generate_contributor_issue_drafts exactly: a POST
/v1/repos/:owner/:repo/issue-plan-drafts/generate route (same gate), a
maintain plan-issues CLI command calling it, and a loopover_plan_repo_issues
stdio tool. generateIssuePlanDrafts and the remote tool are unchanged.

Closes JSONbored#7764
@xfodev
xfodev requested a review from JSONbored as a code owner July 21, 2026 14:22
@superagent-security

Copy link
Copy Markdown
Contributor

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

@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 14:31:28 UTC

10 files · 1 AI reviewer · no blockers · CI pending · dirty

⏸️ Suggested Action - Manual Review

Review summary
This PR adds the REST route, CLI subcommand, and stdio MCP tool mirrors for the previously remote-only loopover_plan_repo_issues tool, closely following the existing generateContributorIssueDrafts pattern including auth gating, create-safety (dryRun/create guard), and path admission matching. The entrypoint-guard refactor (isProcessEntrypoint/runAsCliEntrypoint) is a real behavioral change applied to the whole bin file to enable in-process testing, not scoped-only to the new feature, but it is well-reasoned and covered by tests exercising both the CLI dispatch and stdio connect gating. Test coverage is thorough, mirroring the sibling test file structure with auth-branch, error-branch, and fallback-branch coverage.

Nits — 6 non-blocking
  • The external brief flags a possible secret-like literal at test/unit/mcp-cli-plan-issues.test.ts:31, but it's just the fixture token `"in-process-token"` used for the local test harness — not a real secret, though worth a quick glance to confirm.
  • Magic numbers like the 2000-char goal cap and 10-draft limit cap (src/api/routes.ts:963,966) aren't named constants, though the PR description explains the rationale (LLM cost) inline via comments.
  • The `.js` file changes are a compiled mirror of the `.ts` source and must be kept in sync manually — worth confirming there's a build step or lint check that verifies this pairing, since a drift here would be silent.
  • Consider extracting the repeated 2000/10/5 limits into a shared named constant if `issue-plan-draft` schemas proliferate further, though at one call site this is a nit not worth blocking on.
  • If not already covered elsewhere, add a CI step or comment note confirming `loopover-mcp.js` is generated from `loopover-mcp.ts` via `tsc`, so future reviewers know not to hand-edit only one side.
  • 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 #7764
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: 71 registered-repo PR(s), 42 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor xfodev; Gittensor profile; 71 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR adds a POST /v1/repos/:owner/:repo/issue-plan-drafts/generate REST route gated the same way as the contributor sibling, a `maintain plan-issues` CLI command forwarding to that route, and a `registerStdioTool("loopover_plan_repo_issues", ...)` block mirroring the prescribed pattern, plus regression tests for the new route and CLI/stdio surfaces. This covers all three required mirror surfaces

Review context
  • Author: xfodev
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, TypeScript
  • Official Gittensor activity: 71 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 <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> 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.

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/ before / (scroll)
before / (scroll)
after / (scroll)
after / (scroll)

A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show.

🟩 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

This pull request changes UI/visual code but its screenshot evidence is incomplete. Every required viewport × theme combination needs its own before/after image pair in a labeled table row (e.g. "Desktop · Light | before | after"). Still missing: Desktop · Dark, Tablet · Dark, Mobile · Dark.

Please resubmit with the remaining rows filled in.

See https://github.com/JSONbored/loopover/blob/main/.claude/skills/contributing-to-loopover/SKILL.md for the exact format and examples. This is an automated maintenance action.

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.

loopover_plan_repo_issues has no REST route, CLI command, or local stdio MCP tool

1 participant