feat(mcp): add repo-agnostic AI issue-planning tool#7476
Conversation
Adds loopover_plan_repo_issues: given a maintainer-supplied free-form goal, AI-generates a small set of structured GitHub issue drafts (title/body/labels) for any repo the caller's App/Orb is installed on. Unlike generateContributorIssueDrafts (loopover-specific static signals, zero LLM cost), this genuinely generates from the goal text, mirroring review/planner.ts's model-call/retry/budget shape. Dry-run by default; creates only via the installation-token/Orb-broker path (#7425), never a flat PAT. Response includes full draft title/body, unlike the scrubbed contributor-drafts tool, since there is no loopover-internal signal to hide here. No dedicated per-repo enable flag: gated by the existing fleet-wide AI_SUMMARIES_ENABLED/AI_PUBLIC_COMMENTS_ENABLED switches and MCP access control (requireRepoManageAccess) rather than a new config-as-code surface, since this is opt-in simply by a maintainer calling the tool. Closes #7426
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7476 +/- ##
========================================
Coverage 91.36% 91.37%
========================================
Files 717 718 +1
Lines 73016 73178 +162
Branches 21631 21678 +47
========================================
+ Hits 66713 66864 +151
- Misses 5265 5272 +7
- Partials 1038 1042 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-20 13:56:55 UTC
Review summary Nits — 6 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk 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.
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.
|
Summary
loopover_plan_repo_issues, a new MCP tool: given a maintainer-supplied free-form planning goal, AI-generates a small set of structured GitHub issue drafts (title/body/labels) for any repo the caller's App/Orb-brokered install is actually installed on.generateContributorIssueDrafts(src/services/contributor-issue-draft.ts), which derives candidates purely from loopover-specific static signals (policy readiness, upstream drift, focus-manifest wanted paths) at zero LLM cost, the newsrc/services/issue-plan-draft.tscalls the configured AI reviewer, mirroringsrc/review/planner.ts's@loopover planmodel-call/retry/budget shape closely (same primary+fallback model, same rate-limit short-circuit, sameAI_DAILY_NEURON_BUDGETaccounting).{create:true, dryRun:false}is required to write, and creation goes exclusively through the installation-token/Orb-broker path added in #7425/#7467 — never a flat PAT — so it only works on a repo the caller's own App/Orb actually covers.generateContributorIssueDrafts's deliberate scrub of that field): the content here is generated fresh from the caller's own goal for their own repo, so there is no loopover-internal signal to hide, and the whole point of the dry-run-by-default posture is letting a maintainer actually read the proposal before deciding to create it.contributor-issue-draft.tsbut with its own marker prefix (loopover-issue-plan-draft) — that module's own marker functions are hardcoded to its own prefix, so directly reusing them would mistag these drafts..loopover.yml settings.advisoryAiRouting.issuePlanning-style enable flag was added, unlike the other 4 advisory-tier AI capabilities (slop,e2eTestGen,planner,summaries). This capability is opt-in simply by a maintainer calling the tool (gated byrequireRepoManageAccess), and additionally respects the existing fleet-wideAI_SUMMARIES_ENABLED/AI_PUBLIC_COMMENTS_ENABLEDkill switches — a reasonable substitute given the primary safety layer here is access control, not automatic/webhook-triggered firing. A dedicated advisory-routing flag (full config-as-code wiring: schema + resolver +.loopover.ymlschema + docs) is a good candidate for a fast-follow if a self-hoster asks for cost-conscious local-model routing on this specific capability.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run typechecknpm run test:coveragelocally — full unsharded suite: 1011 files / 19224 tests passed, 2 skipped. The same 9 pre-existing failures in 3 unrelated miner test files (local-branch.test.ts,miner-init-verify-token.test.ts,miner-self-review-context.test.ts) reproduce identically on a clean checkout with this branch's changes stashed out (confirmed separately, tracked independently, unrelated to this PR). New code (src/services/issue-plan-draft.ts, the new MCP wiring insrc/mcp/server.ts) is 100% branch-covered.npm run selfhost:env-reference:check/npm run ui:openapi:check/npm run docs:drift-check/npm run manifest:drift-check— all clean; no new env vars introduced (reuses the already-documentedAI_SUMMARIES_ENABLED/AI_PUBLIC_COMMENTS_ENABLED/AI_DAILY_NEURON_BUDGET/AI_GATEWAY_ID), no OpenAPI/manifest surface touched (MCP-only).npm run ui:lint/npm run ui:typecheck/npm run ui:build— not run; this PR touches no files underapps/loopover-ui/**.test/unit/issue-plan-draft.test.ts(29 tests, 100% branch coverage of the new service) andtest/unit/mcp-plan-repo-issues.test.ts(7 tests: access control, theexplicit_create_requires_dry_run_falseguard, goal validation, and surface parity with the underlying service).If any required check was skipped, explain why:
ui:lint/ui:typecheck/ui:build: noapps/loopover-ui/**files changed.Safety
isFocusManifestPublicSafebefore ever being proposed or created, matchingcontributor-issue-draft.ts's own contract.UI Evidencesection. (N/A — backend/MCP-only change.)UI Evidence
N/A — this is a backend/MCP-only change with no visible UI, frontend, or docs surface.
Notes
Closes #7426