(janitor/dead-code): remove unused ownerScopeFromRouteScope helper - #5521
Merged
pandemicsyn merged 1 commit intoAug 26, 2026
Merged
Conversation
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.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by grok-4.6 · Input: 26.8K · Output: 2.9K · Cached: 116.1K Review guidance: REVIEW.md from base branch |
pandemicsyn
approved these changes
Aug 26, 2026
pandemicsyn
deleted the
janitor/dead-code-mcp-gateway-owner-scope-helper
branch
August 26, 2026 19:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was deleted
ownerScopeFromRouteScopeinpackages/mcp-gateway/src/routes.ts, and its re-export frompackages/mcp-gateway/src/index.ts. This helper mappedGatewayRouteScope(user/org) toGatewayOwnerScope(personal/organization).Evidence of unreachability
ownerScopeFromRouteScopeacrossapps/,services/,packages/,dev/,scripts/,tools/only matched its own definition and the barrel re-export — zero call sites.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.packages/mcp-gateway/src/index.test.ts(the package's only test file) references it.git logshows the function was introduced once, in the original PR that added the wholemcp-gatewayOAuth 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-gatewayis"private": truewithexports: { ".": "./src/index.ts" }— not published to npm, no external SDK contract.Kilo-Org/kilocodeextension repo (the primary external API consumer) via a fresh clone and grep.wrangler.jsonc, binding, queue, cron, alarm, or Durable Object.Contract and compatibility considerations
Purely an internal, unused, unpublished helper function — no persisted data, migration, or public contract involves it.
GatewayRouteScopeandGatewayOwnerScopethemselves 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.pnpm format:changed→ no formatting diffs;git diff --checkclean.apps/webfull typecheck (which builds@kilocode/trpcfirst) exceeded the 2-minute command budget for this environment and was not completed; the removed symbol has no references inapps/webper the repo-wide grep above, so this is not expected to affect that build.