Skip to content

(janitor/dead-code): remove unused ownerScopeFromRouteScope helper - #5521

Merged
pandemicsyn merged 1 commit into
mainfrom
janitor/dead-code-mcp-gateway-owner-scope-helper
Aug 26, 2026
Merged

(janitor/dead-code): remove unused ownerScopeFromRouteScope helper#5521
pandemicsyn merged 1 commit into
mainfrom
janitor/dead-code-mcp-gateway-owner-scope-helper

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What was deleted

ownerScopeFromRouteScope in packages/mcp-gateway/src/routes.ts, and its re-export from packages/mcp-gateway/src/index.ts. This helper mapped GatewayRouteScope (user/org) to GatewayOwnerScope (personal/organization).

Evidence of unreachability

  • Repo-wide grep for ownerScopeFromRouteScope across apps/, services/, packages/, dev/, scripts/, tools/ only matched its own definition and the barrel re-export — zero call sites.
  • The one place in the codebase that needs this exact mapping, apps/web/src/lib/mcp-gateway/route-params.ts (parseScopedRouteParams), already hand-inlines the 'personal'/'organization' logic instead of calling this helper, confirming it was never adopted.
  • No test in packages/mcp-gateway/src/index.test.ts (the package's only test file) references it.
  • git log shows the function was introduced once, in the original PR that added the whole mcp-gateway OAuth runtime gateway (feat(mcp-gateway): implement OAuth runtime gateway #3717), and has never been touched or used since.

Dynamic and configured entry points checked

  • packages/mcp-gateway is "private": true with exports: { ".": "./src/index.ts" } — not published to npm, no external SDK contract.
  • Confirmed no reference in the Kilo-Org/kilocode extension repo (the primary external API consumer) via a fresh clone and grep.
  • Not a Next.js file-route, not referenced by any Cloudflare wrangler.jsonc, binding, queue, cron, alarm, or Durable Object.
  • No CLI/bin entry, script, or CI job references the symbol name.

Contract and compatibility considerations

Purely an internal, unused, unpublished helper function — no persisted data, migration, or public contract involves it. GatewayRouteScope and GatewayOwnerScope themselves are untouched and still exported/used elsewhere.

Validation performed

  • packages/mcp-gateway: pnpm test → 44/44 passing (baseline and post-change).
  • packages/mcp-gateway: pnpm typecheck (tsgo --noEmit) → clean (baseline and post-change).
  • packages/mcp-gateway: pnpm lint (oxlint) → 0 warnings/errors.
  • Repo-wide grep post-deletion confirms zero remaining references anywhere.
  • pnpm format:changed → no formatting diffs; git diff --check clean.
  • apps/web full typecheck (which builds @kilocode/trpc first) exceeded the 2-minute command budget for this environment and was not completed; the removed symbol has no references in apps/web per the repo-wide grep above, so this is not expected to affect that build.

The mcp-gateway package exported ownerScopeFromRouteScope, but it had
zero call sites anywhere in the monorepo. The one place that needed
this mapping (apps/web/src/lib/mcp-gateway/route-params.ts) already
inlines the same 'personal'/'organization' logic instead of calling
it. No tests reference it either.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Aug 26, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/mcp-gateway/src/index.ts
  • packages/mcp-gateway/src/routes.ts

Reviewed by grok-4.6 · Input: 26.8K · Output: 2.9K · Cached: 116.1K

Review guidance: REVIEW.md from base branch main

@pandemicsyn
pandemicsyn merged commit e6826e0 into main Aug 26, 2026
14 checks passed
@pandemicsyn
pandemicsyn deleted the janitor/dead-code-mcp-gateway-owner-scope-helper branch August 26, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant