Skip to content

CLI mirror for loopover_explain_gate_disposition #6740

Description

@JSONbored

Context

The MCP tool loopover_explain_gate_disposition (src/mcp/server.ts:2034, via explainGateDisposition at src/mcp/server.ts:3774) computes the same PredictedGateVerdict the CLI's already-mirrored loopover_predict_gate tool gets from POST /v1/local/branch-analysis's predictedGate field (loopover-mcp.js:1451-1468), then runs it through buildGateDispositions(verdict) (defined at src/mcp/server.ts:1244, not exported from @loopover/engine) to itemize per-rule block/advise dispositions. No CLI mirror exists despite the sibling tool already fetching the exact input this needs.

Requirements

  • Export buildGateDispositions (and its GateDisposition type) from @loopover/engine alongside buildFeasibilityVerdict/buildPrTextLint.
  • Add registerStdioTool("loopover_explain_gate_disposition", ...) in loopover-mcp.js that calls the same /v1/local/branch-analysis route loopover_predict_gate already calls, then runs the shared buildGateDispositions locally on the returned predictedGate.

Deliverables

  • buildGateDispositions exported from @loopover/engine
  • registerStdioTool("loopover_explain_gate_disposition", ...)
  • Unit test

Test Coverage Requirements

99%+ Codecov patch coverage on every changed line and branch in the new route/tool/CLI code, plus a test asserting output parity between the mirrored surfaces for identical input.

Expected Outcome

A contributor can get a per-rule gate-disposition explanation locally via the CLI before pushing.

Links & Resources

Precedent: registerStdioTool("loopover_predict_gate", ...) at loopover-mcp.js:1451-1468, and the existing engine re-export pattern in src/mcp/local-write-tools.ts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions