Skip to content

Self-tune override audit trail (selftune/overrides/audit) has no remote MCP tool, local stdio MCP tool, or CLI verb #7798

Description

@JSONbored

Context

GET /v1/repos/:owner/:repo/selftune/overrides/audit (src/api/routes.ts:3084) returns the self-tune override audit trail (listOverrideAudit) so an operator can inspect why the LOOPOVER_REVIEW_SELFTUNE loop promoted a live override, without direct D1 access. It's gated by requireRepoMaintainer — the exact same gate loopover_get_gate_precision uses, and the route's own comment says it "mirror[s] the gate-precision route above." Despite that, it has no remote MCP tool and no local stdio MCP toolloopover_get_gate_precision has both plus a dedicated CLI verb (maintain precision, packages/loopover-mcp/bin/loopover-mcp.ts maintainCli subcommand), but the override-audit sibling has none of the three.

Requirements

⚠️ Required pattern — mirror loopover_get_gate_precision's surfaces exactly: remote tool registration (src/mcp/server.ts:2017), stdio-tool registration (packages/loopover-mcp/bin/loopover-mcp.ts:2587-2594), and the maintain precision CLI verb (maintainCli's subcommand === "precision" branch). Read all three before starting — do not invent a different shape.

  • Register loopover_get_selftune_override_audit as a remote MCP tool in src/mcp/server.ts, input schema scoped to owner/repo (+ optional limit, matching the REST route's ?limit query param), calling the existing GET .../selftune/overrides/audit route's underlying listOverrideAudit.
  • Add loopover_get_selftune_override_audit to MCP_TOOL_CATEGORIES as "maintainer".
  • Register loopover_get_selftune_override_audit as a local stdio MCP tool in packages/loopover-mcp/bin/loopover-mcp.ts, calling GET ${repoBase}/selftune/overrides/audit via apiGet.
  • Add a maintain selftune-audit --repo owner/repo [--limit N] CLI verb to maintainCli, following the exact structure of the existing precision subcommand (same emit/--json handling).
  • Do not change listOverrideAudit, the REST route, or its requireRepoMaintainer gate — this issue only adds the three missing mirror surfaces.

Deliverables

  • loopover_get_selftune_override_audit registered as a remote MCP tool in src/mcp/server.ts, category "maintainer".
  • loopover_get_selftune_override_audit registered as a local stdio MCP tool in packages/loopover-mcp/bin/loopover-mcp.ts.
  • maintain selftune-audit CLI verb added to maintainCli, mirroring the precision subcommand's structure.

Test Coverage Requirements

Codecov patch gate is 99%+ on src/**; add a regression test for the new remote-tool registration mirroring loopover_get_gate_precision's own test. For packages/loopover-mcp, add tests for both the new stdio tool and the new maintain selftune-audit verb following the existing precision subcommand's test coverage shape — confirm this package's own coverage.include scoping first.

Expected Outcome

The self-tune override audit trail has the same three-surface reach as gate-precision: remote MCP, local stdio MCP, and a maintain selftune-audit CLI verb, not just raw REST.

Links & Resources

  • src/api/routes.ts:3084 (existing REST route)
  • src/mcp/server.ts:2017, packages/loopover-mcp/bin/loopover-mcp.ts:2587-2594 (the loopover_get_gate_precision two-surface pattern), and maintainCli's precision subcommand (the CLI-verb pattern)
  • src/mcp/server.ts:1798-1890 (MCP_TOOL_CATEGORIES map)

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