Skip to content

feat(mcp): CLI mirror for loopover_explain_gate_disposition#6966

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:feat/explain-gate-disposition-cli-6740
Jul 17, 2026
Merged

feat(mcp): CLI mirror for loopover_explain_gate_disposition#6966
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
RealDiligent:feat/explain-gate-disposition-cli-6740

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • Export buildGateDispositions / GateDisposition from @loopover/engine (MCP re-exports the same pure reshaper).
  • Register loopover_explain_gate_disposition stdio tool: fetch predictedGate via POST /v1/local/branch-analysis (same as loopover_predict_gate), then reshape locally.
  • Bump stdio tool-count pin 75 → 76; add engine + CLI parity tests.

Closes #6740.

Test plan

  • CI validate-code / unit tests green
  • codecov/patch ≥ 99%
  • loopover-mcp tools --json reports count 76 and lists the new tool
  • Stdio call returns dispositions matching buildGateDispositions on the fixture verdict

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 17, 2026 16:08
@superagent-security

Copy link
Copy Markdown
Contributor

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

Export buildGateDispositions from @loopover/engine and register the stdio tool that reshapes predictedGate locally.

Closes JSONbored#6740.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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 (244988b) to head (35e03c6).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6966   +/-   ##
=======================================
  Coverage   93.71%   93.71%           
=======================================
  Files         685      685           
  Lines       68379    68379           
  Branches    18730    18730           
=======================================
  Hits        64080    64080           
  Misses       3302     3302           
  Partials      997      997           
Flag Coverage Δ
shard-1 43.75% <0.00%> (ø)
shard-2 36.80% <0.00%> (ø)
shard-3 32.93% <66.66%> (+0.13%) ⬆️
shard-4 33.85% <0.00%> (-0.59%) ⬇️
shard-5 32.13% <0.00%> (-0.04%) ⬇️
shard-6 45.74% <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

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-17 16:15:28 UTC

8 files · 1 AI reviewer · no blockers · readiness 80/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR moves buildGateDispositions from src/mcp/server.ts into @​loopover/engine (predicted-gate.ts), re-exports it from src/mcp/server.ts for backward compatibility, and registers a new loopover_explain_gate_disposition stdio tool that fetches predictedGate via the existing branch-analysis endpoint and reshapes it locally with the shared engine function. The tool-count pin is correctly bumped 75→76 and both engine-level and CLI-parity tests are added, including a fixture update that now exercises a real advisory warning instead of an empty array. The move is a clean, low-risk relocation of pure logic with no behavior change and good MCP/CLI parity coverage.

Nits — 5 non-blocking
  • packages/loopover-mcp/bin/loopover-mcp.js: the tool description says 'per-rule dispositions' but doesn't document that verdict?.pack falls back to 'unknown' pack; worth a one-line note for callers relying on `pack`.
  • src/mcp/server.ts:167-168 re-exports buildGateDispositions/GateDisposition solely for backward compatibility with any existing importers of that path — confirm nothing still imports the type from src/rules/predicted-gate directly and that this re-export isn't dead weight.
  • packages/loopover-engine/test/gate-dispositions.test.ts imports from `../dist/predicted-gate.js` (built output) rather than `../src/predicted-gate.ts`, which is consistent with existing engine test conventions but means the test won't catch source-level type errors without a build step first — verify this matches how other engine tests are wired.
  • Consider adding a short doc comment on the re-export in src/mcp/server.ts:167 clarifying it's kept for compatibility now that the canonical definition lives in @​loopover/engine.
  • The fixture change in test/unit/support/mcp-cli-harness.ts (warnings: [] → one warning) is shared infrastructure — worth double-checking no other existing test asserted on the old empty-warnings shape and is now silently passing a different fixture.

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: 389 registered-repo PR(s), 194 merged, 33 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 389 PR(s), 33 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR exports buildGateDispositions/GateDisposition from @​loopover/engine (moving the pure reshaper into predicted-gate.ts and re-exporting via index.ts), and registers a loopover_explain_gate_disposition stdio tool in loopover-mcp.js that calls the same /v1/local/branch-analysis route as loopover_predict_gate before running buildGateDispositions locally, exactly matching the issue's requirements

Review context
  • Author: RealDiligent
  • 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: 389 PR(s), 33 issue(s).
  • Related work: Titles/paths share 7 meaningful terms. (issue #6747, issue #6740)
  • Related work: Items reference the same linked issue REST + CLI mirror for loopover_pr_outcome #6747. (issue #6747, PR #6963)
  • Related work: Titles/paths share 7 meaningful terms. (issue #6741, issue #6740)
  • 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 merged commit 4966070 into JSONbored:main Jul 17, 2026
16 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 17, 2026
12 tasks
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.

CLI mirror for loopover_explain_gate_disposition

1 participant