Skip to content

feat(mcp): add CLI mirror for loopover_explain_gate_disposition#6958

Closed
bohdansolovie wants to merge 2 commits into
JSONbored:mainfrom
bohdansolovie:feat/cli-explain-gate-disposition-6740-v4
Closed

feat(mcp): add CLI mirror for loopover_explain_gate_disposition#6958
bohdansolovie wants to merge 2 commits into
JSONbored:mainfrom
bohdansolovie:feat/cli-explain-gate-disposition-6740-v4

Conversation

@bohdansolovie

Copy link
Copy Markdown
Contributor

Summary

  • Export buildGateDispositions from @loopover/engine and register a stdio loopover_explain_gate_disposition tool that proxies /v1/local/branch-analysis (metadata-only) and reshapes predictedGate into per-rule dispositions — matching the remote MCP tool.
  • Bump the stdio discovery invariant to 74 tools (main pins 73 after REST + CLI mirror for loopover_plan_idea_claims #6756; this adds one).

Closes #6740

Scope

  • packages/loopover-engine — export buildGateDispositions / GateDisposition
  • packages/loopover-mcp — CLI/stdio mirror
  • src/mcp/server.ts — import shared helper (remove duplicate)
  • Unit tests for CLI HTTP paths + discovery count

Validation

  • vitest run test/unit/mcp-tool-rename-aliases.test.ts test/unit/mcp-cli-plan-scorer-tools.test.ts (30 passed locally)

Safety

  • Read-only metadata analysis; no git writes, no PR mutations.

Made with Cursor

bohdansolovie and others added 2 commits July 17, 2026 17:33
Export buildGateDispositions from @loopover/engine and register the
stdio tool as a metadata-only /v1/local/branch-analysis proxy that
reshapes predictedGate into per-rule dispositions, matching the remote MCP tool.

Closes JSONbored#6740

Co-authored-by: Cursor <cursoragent@cursor.com>
Main already pins 73 after JSONbored#6756; this CLI mirror adds one more registered loopover_ tool.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bohdansolovie
bohdansolovie requested a review from JSONbored as a code owner July 17, 2026 15:34
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 17, 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.

@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 93.71%. Comparing base (8fa47d1) to head (e77db49).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6958   +/-   ##
=======================================
  Coverage   93.71%   93.71%           
=======================================
  Files         685      685           
  Lines       68373    68373           
  Branches    18729    18729           
=======================================
  Hits        64074    64074           
  Misses       3302     3302           
  Partials      997      997           
Flag Coverage Δ
shard-1 43.75% <0.00%> (ø)
shard-2 36.79% <0.00%> (-0.02%) ⬇️
shard-3 32.75% <66.66%> (+0.01%) ⬆️
shard-4 34.61% <0.00%> (-0.01%) ⬇️
shard-5 32.13% <0.00%> (ø)
shard-6 45.75% <100.00%> (ø)

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

Files with missing lines Coverage Δ
packages/loopover-engine/src/predicted-gate.ts 100.00% <100.00%> (ø)
src/mcp/server.ts 96.29% <ø> (-0.02%) ⬇️

@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

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-17 16:05:43 UTC

6 files · 1 AI reviewer · no blockers · CI green · dirty

⏸️ Suggested Action - Manual Review

Review summary
This PR moves buildGateDispositions from src/mcp/server.ts into @​loopover/engine's predicted-gate.ts, exports it, and wires a new CLI/stdio mirror tool loopover_explain_gate_disposition that proxies /v1/local/branch-analysis and reshapes predictedGate the same way the remote tool does. The refactor is clean — server.ts re-exports the moved symbols for backward compatibility, the discovery-count pin is correctly bumped from 73 to 74, and new tests cover registration, HTTP proxying, parity with loopover_predict_gate, API-failure surfacing, and input validation. The main gap is that #6740 is only partially addressed per the external brief, though the visible diff is internally consistent and correct.

Nits — 4 non-blocking
  • packages/loopover-mcp/bin/loopover-mcp.js: the new tool duplicates the same body-construction and apiPost pattern already used by loopover_predict_gate a few dozen lines above — consider extracting a shared helper to avoid drift between the two.
  • src/mcp/server.ts:167-168: re-exporting buildGateDispositions/GateDisposition from server.ts right after importing them is a bit unusual placement (mid-import-block) — consider moving the re-export near the other public exports for clarity.
  • packages/loopover-engine/src/predicted-gate.ts: buildGateDispositions takes Pick<PredictedGateVerdict, 'blockers'|'warnings'> but the CLI call site passes predictedGate straight from an untyped HTTP response — consider a runtime shape check or note that it trusts the API response.
  • Consider extracting a shared 'buildBranchAnalysisRequestBody' helper reused by loopover_predict_gate and loopover_explain_gate_disposition in loopover-mcp.js to reduce duplication.
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 #6740
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: 85 registered-repo PR(s), 30 merged, 6 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bohdansolovie; Gittensor profile; 85 PR(s), 6 issue(s).
Improvement ✅ Minor risk: clean · value: minor
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: not available
  • Official Gittensor activity: 85 PR(s), 6 issue(s).
  • Related work: Titles/paths share 7 meaningful terms. (issue #6740, issue #6747)
  • Related work: Titles/paths share 7 meaningful terms. (issue #6740, issue #6741)
  • Related work: Titles/paths share 8 meaningful terms. (issue #6744, issue #6743)
  • 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 &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

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.

@loopover-orb

loopover-orb Bot commented Jul 17, 2026

Copy link
Copy Markdown

LoopOver is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR). 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

contributor:flagged Contributor flagged for review by trust analysis. 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.

CLI mirror for loopover_explain_gate_disposition

1 participant