Skip to content

fix(mcp): mirror loopover_clear_selftune_override in the CLI stdio package - #9361

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
andriypolanski:fix/9300-mcp-clear-selftune-override
Jul 27, 2026
Merged

fix(mcp): mirror loopover_clear_selftune_override in the CLI stdio package#9361
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
andriypolanski:fix/9300-mcp-clear-selftune-override

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Summary

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run build:mcp
  • npx vitest run test/unit/mcp-cli-clear-selftune-override.test.ts test/unit/mcp-tool-rename-aliases.test.ts — 12 passed
  • Scoped diff-cover vs origin/main on packages/loopover-mcp/bin/loopover-mcp.ts100% patch lines
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

CLI mirror of an existing REST/MCP tool; targeted MCP CLI + tool-count tests cover the happy path and confirm-rejection path. Full test:ci left for CI.

Safety

  • If my change touches auth, CORS, CSRF, cookies, sessions, webhooks, or repo/path access: I added negative-path tests for unauthenticated, cross-repo/unauthorized, and browser-origin requests where applicable.
  • No secrets, wallets, hotkeys, trust scores, or reward values.
  • Does not touch site/, CNAME, **/lovable/**, or root CHANGELOG.md.

UI Evidence

N/A — CLI/stdio MCP tool registration only; no visible UI change.

Notes for reviewers / gate

  • No OpenAPI regeneration (DELETE route unchanged).
  • Tool-count assertion updated 101 → 102.

Made with Cursor

…ckage (JSONbored#9300)

Add the write-side sibling of loopover_get_selftune_override_audit so
CLI/stdio users can DELETE a live self-tune override with confirm:true,
matching the remote MCP tool.

Co-authored-by: Cursor <cursoragent@cursor.com>
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.59%. Comparing base (d158034) to head (eb7cd9c).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9361      +/-   ##
==========================================
- Coverage   75.38%   74.59%   -0.79%     
==========================================
  Files         275      276       +1     
  Lines       58023    60277    +2254     
  Branches     6181     7039     +858     
==========================================
+ Hits        43739    44965    +1226     
- Misses      14014    14737     +723     
- Partials      270      575     +305     
Flag Coverage Δ
backend 54.39% <100.00%> (?)

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

Files with missing lines Coverage Δ
packages/loopover-mcp/bin/loopover-mcp.ts 54.39% <100.00%> (ø)

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 27, 2026
@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-27 14:19:50 UTC

4 files · 1 AI reviewer · no blockers · readiness 95/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds a straightforward CLI mirror of the existing loopover_clear_selftune_override remote MCP tool: a new registerStdioTool wired to the existing apiDelete helper, DELETE {repoBase}/selftune/overrides with a schema-enforced confirm:true (z.literal(true) rejects omitted/false before any network call). The fixture-harness route match (`!request.url.includes("/audit")`) correctly disambiguates the new DELETE route from the existing audit GET route on the same path prefix, and the tool-count pin test is bumped from 101 to 102 consistently across all three assertions. This is a narrow, well-tested addition consistent with the file's existing patterns (same apiDelete usage as the unwatch action, same descriptor/registerStdioTool shape as neighboring tools).

Nits — 6 non-blocking
  • packages/loopover-mcp/bin/loopover-mcp.ts:3217 — the handler parameter is typed `: any`, but this matches the pre-existing convention for every other registerStdioTool handler in this file, so it's a pattern to fix file-wide rather than in this PR.
  • test/unit/mcp-cli-clear-selftune-override.test.ts:34 — `LOOPOVER_API_TOKEN = "in-process-token"` is a hardcoded test fixture value, not a real credential; no rotation needed, but consider a lint-suppression comment if the secret scanner flags it repeatedly.
  • The new route match in mcp-cli-harness.ts (`request.url?.startsWith(...) && !request.url.includes("/audit")`) is a bit fragile as a disambiguator — worth a comment noting it depends on the audit route always including that literal substring.
  • Consider matching on `request.method === "DELETE"` first before the startsWith/includes check for a more readable route dispatch in mcp-cli-harness.ts.
  • The inline `// mcp(cli): packages/loopover-mcp missing loopover_clear_selftune_override (sibling loopover_get_selftune_override_audit already mirrored, #7997) #9300` comments are helpful for traceability but could be trimmed to one per section rather than duplicated at each edit site.
  • Possible secret-shaped assignment in the diff (generic_secret_assignment) — Verify the value is not a real credential.

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 #9300
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low 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: 174 registered-repo PR(s), 113 merged, 22 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 174 PR(s), 22 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The PR adds loopover_clear_selftune_override to the CLI tool catalog and wires a registerStdioTool block right next to the audit tool using apiDelete with confirm schema-enforced as z.literal(true), matching all stated requirements, and includes tests covering the happy path and the missing/false-confirm rejection path plus a regression test asserting the DELETE call shape.

Review context
  • Author: andriypolanski
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Rust, Cuda, JavaScript, Kotlin, MDX, Scala
  • Official Gittensor activity: 174 PR(s), 22 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
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
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp(cli): packages/loopover-mcp missing loopover_clear_selftune_override (sibling loopover_get_selftune_override_audit already mirrored, #7997)

2 participants