Skip to content

Remove unused legacy barrel re-exports - #1363

Merged
kentcdodds merged 2 commits into
mainfrom
cursor/legacy-dead-reexports-4995
Aug 10, 2026
Merged

kentcdodds merged 2 commits into
mainfrom
cursor/legacy-dead-reexports-4995

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Aug 10, 2026 •

Copy link
Copy Markdown
Owner

Intent

Remove unused and test-only barrel re-exports so production modules expose only their owned service APIs and callers import helpers from canonical modules.

Summary

  • remove dead re-exports from email, MCP search, package runtime, and run-record services
  • retarget tests for executor proxy source, DR inventory, remote connector paths, and RBAC helpers to canonical modules
  • retarget the remaining outbound email caller to canonical blob-key and repository modules
  • preserve runtime behavior

Testing

  • Pre-change usage audit confirmed no production consumers through seven listed barrel paths and identified one stale same-folder email caller during full validation
  • npm run validate β€” passed (590 test files, 2,046 tests, and E2E)

Conductor report

  • Track: B β€” legacy dead re-exports
  • Status: validated; CI and squash-merge pending
  • Scope: only the eight requested barrel surfaces and their canonical consumers
  • Risk: low; export-surface cleanup with no runtime behavior changes

System changes

System recap β€” composes existing primitives (low risk)

Mode: recap Β· Base: main @ 4f934f09 Β· Head: fb7327a3

Classification: composes β€” removes unused forwarding exports and points callers at existing canonical modules; no primitive behavior, storage, or invariants change.

Primitives touched

Primitive Group Impact
app-ui surfaces composes β€” RBAC tests import universal helpers directly
backup-control-plane storage composes β€” inventory test imports canonical inventory module
connector-ingress surfaces composes β€” route helper test imports shared implementation
email assistant composes β€” dead service forwarding exports removed and outbound imports canonical modules
mcp-server surfaces composes β€” dead search/executor forwarding exports removed
package-runtime runtime composes β€” dead artifact forwarding export removed
remote-connectors assistant composes β€” canonical shared route helper ownership retained
run-records storage composes β€” dead activation forwarding export removed

System map

Each touched barrel now exposes only its owned API; callers resolve helper symbols directly from existing canonical modules.

Legend: green = composes (wiring only) Β· amber = extended by this PR Β· red = new primitive Β· gray = context (unchanged, included only when an edge crosses it).

flowchart LR
	email["email<br/>Email"]:::touched
	mcpServer["mcp-server<br/>MCP endpoint (/mcp)"]:::touched
	packageRuntime["package-runtime<br/>Package runtime"]:::touched
	backupControl["backup-control-plane<br/>Production backup control plane"]:::touched
	remoteConnectors["remote-connectors<br/>Remote connectors"]:::touched
	appUi["app-ui<br/>Browser app (Remix 3)"]:::touched
	email -->|"outbound imports blob keys and sender identity canonically"| email
	mcpServer -->|"tests import proxy source directly"| packageRuntime
	backupControl -->|"tests import inventory directly"| backupControl
	remoteConnectors -->|"tests import shared ingress path directly"| remoteConnectors
	appUi -->|"tests import universal RBAC helpers directly"| appUi
	classDef touched fill:#1a7f37,color:#fff
	classDef extended fill:#9a6700,color:#fff
	classDef added fill:#cf222e,color:#fff
	classDef untouched fill:#57606a,color:#fff
Loading
Open in WebΒ Open in CursorΒ 

Summary by CodeRabbit

  • Refactor

    • Consolidated access to internal authorization, email, integration, connector, package, and MCP utilities through their dedicated modules.
    • Removed redundant public re-exports from worker services to clarify supported module boundaries.
    • Updated related tests to use the appropriate direct imports.
  • Tests

    • Adjusted test imports without changing existing test behavior or coverage.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d34c7427-9203-4c15-b363-529bdef5f679

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 4f934f0 and fb7327a.

πŸ“’ Files selected for processing (14)
  • packages/worker/src/app/permissions-server.node.test.ts
  • packages/worker/src/app/permissions-server.ts
  • packages/worker/src/dr/exporter.node.test.ts
  • packages/worker/src/dr/exporter.ts
  • packages/worker/src/email/outbound.ts
  • packages/worker/src/email/service.ts
  • packages/worker/src/mcp/executor.node.test.ts
  • packages/worker/src/mcp/executor.ts
  • packages/worker/src/mcp/run-kody-registry.node.test.ts
  • packages/worker/src/mcp/tools/search-descriptors.ts
  • packages/worker/src/package-runtime/module-graph.ts
  • packages/worker/src/remote-connector/connector-session-key.node.test.ts
  • packages/worker/src/remote-connector/connector-session-key.ts
  • packages/worker/src/run-records/service.ts
πŸ’€ Files with no reviewable changes (7)
  • packages/worker/src/package-runtime/module-graph.ts
  • packages/worker/src/run-records/service.ts
  • packages/worker/src/mcp/tools/search-descriptors.ts
  • packages/worker/src/remote-connector/connector-session-key.ts
  • packages/worker/src/dr/exporter.ts
  • packages/worker/src/mcp/executor.ts
  • packages/worker/src/app/permissions-server.ts

πŸ“ Walkthrough

Walkthrough

This change removes selected compatibility re-exports from worker modules. Tests and production imports now reference the modules that define each helper. Runtime behavior remains unchanged.

Changes

Canonical module imports

Layer / File(s) Summary
Authorization and export imports
packages/worker/src/app/permissions-server*, packages/worker/src/dr/exporter*
Permission and inventory helpers now use their defining modules. The previous compatibility re-exports are removed.
Email import boundaries
packages/worker/src/email/outbound.ts, packages/worker/src/email/service.ts
Outbound email imports helpers from dedicated modules. EmailRawMimeStorageError is no longer re-exported.
MCP and runtime import boundaries
packages/worker/src/mcp/*, packages/worker/src/package-runtime/module-graph.ts
MCP tests import createKodyProviderProxySource directly. The MCP and module graph compatibility re-exports are removed.
Shared helper exports
packages/worker/src/remote-connector/*, packages/worker/src/run-records/service.ts
Tests import the shared connector path helper directly. Compatibility re-exports for that helper and countsTowardPackageActivation are removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: kody-bot

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Title check βœ… Passed The title clearly and concisely summarizes the removal of unused legacy barrel re-exports.
Description check βœ… Passed The description includes intent, summary, testing, and system changes with clear scope, risk, and validation details.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/legacy-dead-reexports-4995

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kentcdodds
kentcdodds marked this pull request as ready for review August 10, 2026 08:26
@github-actions

Copy link
Copy Markdown
Contributor

πŸ”Ž Preview deployed: https://kody-pr-1363.kody-a99.workers.dev

Worker: kody-pr-1363
D1: kody-pr-1363-db
KV: kody-pr-1363-oauth-kv

Mocks:

@kentcdodds
kentcdodds merged commit c5e5c69 into main Aug 10, 2026
18 checks passed
@kentcdodds
kentcdodds deleted the cursor/legacy-dead-reexports-4995 branch August 10, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants