Skip to content

feat(api): mirror plan-idea-claims over REST and the local MCP#6790

Closed
bitfathers94 wants to merge 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-6756
Closed

feat(api): mirror plan-idea-claims over REST and the local MCP#6790
bitfathers94 wants to merge 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-6756

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

feat(api): mirror plan-idea-claims over REST and the local MCP

The loopover_plan_idea_claims MCP tool was remote-only: no REST route and no
local CLI/stdio surface, so idea-claim planning was unreachable outside the
hosted MCP server. Add POST /v1/loop/plan-idea-claims and a loopover_plan_idea_claims
stdio tool, both delegating to a shared pure buildIdeaClaimPlanResult in
@loopover/engine so the MCP, REST, and local surfaces can never disagree for
identical input. The remote tool is refactored onto the same builder.

Follows the POST /v1/lint/slop-risk mirror pattern: loose input schema (the
engine's validateIdeaSubmission owns the semantic checks), a malformed/empty
submission returns a 200 { ok:false, errors } domain result rather than a
transport error, and the route is allowlisted for session identities like the
other agent-native self-checks. The stdio tool computes in-process with no API
round-trip. Tests cover every changed line and branch plus output parity across
the mirrored surfaces.

Closes #6756

The loopover_plan_idea_claims MCP tool was remote-only: no REST route and no
local CLI/stdio surface, so idea-claim planning was unreachable outside the
hosted MCP server. Add POST /v1/loop/plan-idea-claims and a loopover_plan_idea_claims
stdio tool, both delegating to a shared pure buildIdeaClaimPlanResult in
@loopover/engine so the MCP, REST, and local surfaces can never disagree for
identical input. The remote tool is refactored onto the same builder.

Follows the POST /v1/lint/slop-risk mirror pattern: loose input schema (the
engine's validateIdeaSubmission owns the semantic checks), a malformed/empty
submission returns a 200 { ok:false, errors } domain result rather than a
transport error, and the route is allowlisted for session identities like the
other agent-native self-checks. The stdio tool computes in-process with no API
round-trip. Tests cover every changed line and branch plus output parity across
the mirrored surfaces.

Closes JSONbored#6756
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 17, 2026 06:45
@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 17, 2026
@loopover-orb

loopover-orb Bot commented Jul 17, 2026

Copy link
Copy Markdown

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-17 06:53:26 UTC

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

🛑 Suggested Action - Fix Blockers

Review summary
This PR mirrors the existing loopover_plan_idea_claims MCP tool over REST (POST /v1/loop/plan-idea-claims) and the local stdio CLI, both delegating to a new shared pure builder buildIdeaClaimPlanResult in @​loopover/engine, and refactors the remote MCP tool onto the same builder. The implementation is clean and correctly composed (validated against the hand-composed validate→buildTaskGraph→buildClaimPlan primitives in tests), follows the established slop-risk mirror pattern (loose schema, 200 domain-result for invalid submissions, allowlisted for session identities), and has thorough parity tests across MCP/REST/CLI including an unreachable-API-endpoint test proving the stdio tool computes in-process. The two CI failures (validate, validate-tests (3)) are worth checking before merge since they aren't explained by anything visible in the diff.

Nits — 4 non-blocking
  • The magic-number schema literals (200/4000/40000/50 char caps) are duplicated three times now (remote MCP intakeIdeaShape, this new REST schema, this new stdio schema) — consider a shared constant/schema in @​loopover/engine so the three bounds can't drift.
  • src/idea-intake.ts and packages/loopover-mcp/bin/loopover-mcp.js are both very large files; not this PR's fault but worth flagging for a future split.
  • Extract the repeated planIdeaClaimsShape/planIdeaClaimsSchema field definitions (routes.ts:499-511, loopover-mcp.js:558-567) into a single exported zod shape in @​loopover/engine so REST, stdio, and the remote MCP tool can't silently diverge on bounds.
  • Confirm the two failing checks (validate, validate-tests (3)) aren't caused by this change before merge.

CI checks failing

  • validate
  • validate-tests (3)

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 #6756
Related work ⚠️ 3 scoped overlaps 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: 0 registered-repo PR(s), 0 merged, 0 issue(s).
Contributor context ℹ️ No public Gittensor match bitfathers94; not a blocker.
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Review context
  • Author: bitfathers94
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Contributor context: Public profile only; not a blocker.
  • Related work: Titles/paths share 8 meaningful terms. (issue #6744, issue #6756)
  • Related work: Titles/paths share 8 meaningful terms. (issue #6747, issue #6756)
  • Related work: Titles/paths share 8 meaningful terms. (issue #6746, issue #6756)
  • Additional title-only matches omitted; title-only overlap does not block.
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 <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.

🟩 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

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.26%. Comparing base (544cb31) to head (7079c58).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6790      +/-   ##
==========================================
- Coverage   93.63%   89.26%   -4.38%     
==========================================
  Files         683      683              
  Lines       68148    68159      +11     
  Branches    18703    18706       +3     
==========================================
- Hits        63812    60842    -2970     
- Misses       3350     5559    +2209     
- Partials      986     1758     +772     
Flag Coverage Δ
shard-1 43.65% <20.00%> (-0.01%) ⬇️
shard-2 36.84% <53.33%> (+0.06%) ⬆️
shard-3 ?
shard-4 34.67% <20.00%> (-0.13%) ⬇️
shard-5 31.00% <20.00%> (-0.01%) ⬇️
shard-6 45.68% <100.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
packages/loopover-engine/src/idea-intake.ts 100.00% <100.00%> (ø)
src/api/routes.ts 83.22% <100.00%> (-11.45%) ⬇️
src/mcp/server.ts 94.33% <100.00%> (-2.03%) ⬇️

... and 102 files with indirect coverage changes

@loopover-orb

loopover-orb Bot commented Jul 17, 2026

Copy link
Copy Markdown

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests (3))). 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 17, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REST + CLI mirror for loopover_plan_idea_claims

2 participants