Skip to content

chore(mcp): delete orphaned changelog config and dead schema literals, lock the package against unused locals - #9528

Merged
JSONbored merged 2 commits into
mainfrom
chore/mcp-hygiene-sweep-9516
Jul 28, 2026
Merged

chore(mcp): delete orphaned changelog config and dead schema literals, lock the package against unused locals#9528
JSONbored merged 2 commits into
mainfrom
chore/mcp-hygiene-sweep-9516

Conversation

@JSONbored

@JSONbored JSONbored commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Deletes cliff.mcp.toml, which nothing referenced. The MCP changelog is generated by scripts/generate-mcp-changelog.ts / scripts/mcp-release-core.ts and verified by scripts/check-changelog.ts --mcp; only the root cliff.toml is ever passed to git-cliff (package.json:89, check-changelog.ts:37). The orphan still carried a commit_preprocessors rewrite rule for a one-off historical commit, which read as live config to anyone who opened it. npm run changelog:check:mcp still runs and reports normally with the file gone — positive proof it was unused.
  • Deletes five hand-written output-schema literals that had been unreferenced since feat(mcp): add structured output schemas for existing tools #291 (repoContextOutputSchema, preflightOutputSchema, decisionPackOutputSchema, localStatusOutputSchema, agentPlanOutputSchema). Real output schemas arrive via @loopover/contract in contract(remote): migrate the remote MCP server's tools to @loopover/contract — typed handlers, real output schemas #9518 rather than by resurrecting these; the comment above loopover_local_status_structured now points at that issue instead of describing an abandoned plan.
  • Enables noUnusedLocals + noUnusedParameters for the package so this cannot silently accumulate again. That gate immediately found two more dead items, both removed: isValidationStatus (superseded by isValidationStatusLike; callers reach normalizeValidationStatus directly, so no validation path is affected) and an unused join import from node:path in lib/local-branch.ts (every join( in that file is Array.prototype.join).
  • Fixes two comments whose facts had rotted: the registration wrapper claimed "37 call sites" (it is every tool in the file), and the tools search example cited get_subnet_stake_quote — a metagraphed tool that does not exist in this repo — now replaced with a real one (loopover_check_before_start, where the match term "duplicate" genuinely appears only in the description). Both rewritten so they cannot go stale on a count again.

Preparatory hygiene for the #9515 epic: the contract migration should start from a surface where everything present is live.

Pre-existing CI bug fixed here (it blocked this PR)

validate-code failed on the first run and again on re-run — deterministic, not a flake. Root cause is a gate asymmetry in .github/workflows/ci.yml:

  • Typecheck runs when backend || engine || mcp || miner changed.
  • Build engine package ran when backend || engine || ui changed.

So an mcp-only or miner-only PR (exactly this one) ran Typecheck against an unbuilt engine. test/** imports @loopover/engine directly and its types resolve to packages/loopover-engine/dist/index.d.ts, which that skipped step is what produces — yielding a wall of phantom Cannot find module '@loopover/engine' errors and every TS7006 implicit-any cascading from them, none related to this diff. The job log confirms it: Build engine package … skipped.

Fixed by widening the build gate to match typecheck's — the same widening the Typecheck step itself already received for the mirror-image gap, per its own comment. Any trigger that typechecks must also have built what typechecking reads. This would have broken every mcp-only and miner-only PR, contributor ones included, where the gate auto-closes on red CI.

Closes #9516

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 actionlint
  • npm run typecheck (via npm run build:mcptsc -p packages/loopover-mcp/tsconfig.json is the compile surface this PR changes)
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

Targeted suites run and green: mcp-cli-tools, mcp-discovery, mcp-cli-completion-spec (38 tests), plus local-branch, local-branch-file-classifiers, mcp-cli-analyze-branch (97 tests) — the registry/discovery surface and both edited files.

If any required check was skipped, explain why:

  • This is a deletion-only change to dead code plus a tsconfig strictness flag: no src/** line is added or modified, so there is no codecov/patch surface and no new behavior to test. The unchecked items are unaffected surfaces (no UI, OpenAPI, worker, workflow, or dependency changes); CI runs them in full.
  • changelog:check:mcp reports the MCP changelog as stale — pre-existing, caused by released-but-unregenerated commits, and unrelated to this diff. It runs in test:release, not test:ci, and per CLAUDE.md changelogs are only edited in release-prep PRs.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (n/a — none touched)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (No wire behavior changes: no tool, schema, or CLI surface is added, removed, or altered — the deleted literals were never attached to a registerTool call.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (n/a)
  • Visible UI changes include a UI Evidence section below. (n/a — no visible change)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

Notes

Part of #9515 (MCP contract standardization). This is the group-1 hygiene sweep; the contract package lands next in #9517.

@loopover-orb

loopover-orb Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-28 06:47:44 UTC

5 files · 1 AI reviewer · no blockers · CI pending · unstable

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): .github/workflows/ci.yml (matched .github/workflows/**).

Review summary
This is a scoped hygiene PR: it deletes an orphaned git-cliff config (cliff.mcp.toml), removes five dead output-schema literals unreferenced since #291, drops an unused isValidationStatus helper and an unused join import (verified absent from lib/local-branch.ts's full content), fixes two stale comments, and turns on noUnusedLocals/noUnusedParameters for the package so dead locals fail the build going forward. The individual deletions are well-justified and traceable in the diff and full file content shown. CI shows validate-code/validate-tests/validate all FAILED with no detail — this branch is 1 commit behind the current default branch, which is a documented cause of undetailed CI failures independent of this diff's own content, so the failure cause can't be attributed to a defect here without more information.

Nits — 8 non-blocking
  • Enabling noUnusedLocals/noUnusedParameters (tsconfig.json) across a ~6374-line file is a real gate change beyond the five known dead items — worth confirming locally that `tsc --noEmit` is clean end-to-end for the whole file, not just the diff hunks shown.
  • packages/loopover-mcp/bin/loopover-mcp.ts: removal of isValidationStatus relies on the description's claim that callers reach normalizeValidationStatus directly — I can't grep the full 6374-line file from what's provided, so this is unverifiable from the diff alone (though the new noUnusedLocals gate is exactly the mechanism that would have caught a still-used symbol).
  • No test-path changes accompany the noUnusedLocals/noUnusedParameters config flip — even though it's a compiler gate rather than runtime logic, a regression test or CI note confirming a clean build would strengthen the 'this cannot silently regress' claim in the PR body.
  • Confirm and state in the PR description that `tsc --noEmit` (or the package's real build command) passes clean with the new tsconfig flags before merge, since that's the actual gate being claimed.
  • If issue mcp: hygiene sweep — orphaned cliff.mcp.toml, dead schema literals, stale counts, noUnusedLocals #9516 is the governing issue per the external brief (marked 'partial' coverage), link it explicitly in the PR description rather than only implicitly via inline code comments (mcp: hygiene sweep — orphaned cliff.mcp.toml, dead schema literals, stale counts, noUnusedLocals #9516 appears only in a tsconfig comment, not the PR body itself).
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ⚠️ Gate result — Not blocking (Advisory; not blocking this PR.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #9516
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: 14 registered-repo PR(s), 13 merged, 328 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 14 PR(s), 328 issue(s).
Improvement ℹ️ None detected risk: low · value: none
Linked issue satisfaction

Addressed
The diff deletes cliff.mcp.toml, removes all five named dead schema constants, enables noUnusedLocals/noUnusedParameters in the package tsconfig and fixes the resulting fallout (isValidationStatus, unused join import), and rewrites the two stale-count comments at the register wrapper and tools-search sites with rot-proof phrasing.

Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 14 PR(s), 328 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Treat this as maintainer-lane context rather than normal contributor-lane activity.
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 <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> 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.

Decision record
  • action: hold · clause: guardrail_hold
  • config: 9518f21ba3d1c2e14160a5afa0238e9f4ffd1587e40d3d5758c2c583ccde73e6 · pack: oss-anti-slop · ci: failed
  • record: 0e665bd34771bebcd1c6faa66350fd0150a304f8e0f2516bb9a93eaf2e8f7392 (schema v5, head 70bb7e4)

🟩 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

@JSONbored JSONbored self-assigned this Jul 28, 2026
@superagent-security

superagent-security Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.56%. Comparing base (6f3b613) to head (6018fcb).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9528   +/-   ##
=======================================
  Coverage   89.56%   89.56%           
=======================================
  Files         843      843           
  Lines      110201   110195    -6     
  Branches    26230    26230           
=======================================
- Hits        98705    98700    -5     
+ Misses      10233    10232    -1     
  Partials     1263     1263           
Flag Coverage Δ
backend 95.28% <ø> (+<0.01%) ⬆️
control-plane 99.86% <ø> (ø)
rees 89.62% <ø> (ø)

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.31% <ø> (-0.08%) ⬇️
packages/loopover-mcp/lib/local-branch.ts 100.00% <ø> (ø)

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 28, 2026
…, lock the package against unused locals

cliff.mcp.toml was referenced by nothing -- the MCP changelog is generated by
scripts/generate-mcp-changelog.ts via cliff.toml, and check-changelog.ts --mcp
still passes without it. It carried a stale commit_preprocessors rewrite rule
that read as live config.

Five hand-written output-schema literals (repoContext, preflight, decisionPack,
localStatus, agentPlan) sat unreferenced since #291. Enabling noUnusedLocals /
noUnusedParameters is what keeps the next one from accumulating; it immediately
surfaced two more dead items, both removed: isValidationStatus, superseded by
isValidationStatusLike with callers reaching normalizeValidationStatus directly,
and an unused node:path join import in local-branch.ts.

Comment fixes for counts that had already rotted: the registration wrapper said
37 call sites, and the tools-search example cited get_subnet_stake_quote, a tool
that does not exist in this repo. Both now describe the surface without pinning
a number that goes stale.

Refs #9516
The "Build engine package" step gated on backend/engine/ui, while "Typecheck"
gated on backend/engine/mcp/miner. An mcp-only or miner-only PR therefore ran
typecheck against an unbuilt engine: test/** imports @loopover/engine directly,
and its "types" resolve to packages/loopover-engine/dist/index.d.ts, which that
step is what produces. The result was a wall of phantom "Cannot find module
'@loopover/engine'" errors plus every implicit-any that cascades from them, none
of which related to the PR's actual diff.

Widens the build gate to match typecheck's, the same fix typecheck itself already
received for the mirror-image gap. Any trigger that typechecks must also have
built what typechecking reads.

Refs #9516
@JSONbored
JSONbored force-pushed the chore/mcp-hygiene-sweep-9516 branch from 70bb7e4 to 6018fcb Compare July 28, 2026 06:29
@JSONbored
JSONbored merged commit d6c4334 into main Jul 28, 2026
7 checks passed
@JSONbored
JSONbored deleted the chore/mcp-hygiene-sweep-9516 branch July 28, 2026 06:48
@github-actions github-actions Bot mentioned this pull request Jul 28, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mcp: hygiene sweep — orphaned cliff.mcp.toml, dead schema literals, stale counts, noUnusedLocals

1 participant