Skip to content

refactor(providers): import provider contracts directly (ipc); delete the barrel - #27966

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-4c
Oct 12, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-4c

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 0
Prod 28 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​39 $\color{#cf222e}{\Huge{\mathbf{−}}}$​61 $\color{#cf222e}{\Huge{\mathbf{−}}}$​22

ELI5

src/main/providers/types.ts was a forwarding file for the terminal, file and git provider contracts. Its last importers were in src/main/ipc. This PR points them at the contract files and deletes the forwarding file.

What Changed

Users see no difference.

  • 32 files under src/main/ipc/ now import IPtyProvider, IFilesystemProvider, IGitProvider, FileStat and related types straight from pty-provider-contract.ts, filesystem-provider-contract.ts and git-provider-contract.ts. All of these were type-only imports and stay type-only.
  • src/main/providers/types.ts is deleted. Nothing in src, tests, mobile, config or .github references it now.

Net: production −34 (the barrel), with 32 import paths re-pointed.

Why

Phase 3.99 rule: no barrels. This finishes the work of #27813 (main) and #27965 (runtime). Each file now names the contract it depends on, and there is one place to import each one from.

Linked Issue

N/A, internal Phase 3.99 cleanup (PR 3.4c).

Visual Proof

N/A, no UI or behaviour change.

Testing

  • rg "providers/types" across src tests mobile config .github returns nothing, @ts-nocheck files included. FileRangeReadUnsupportedError, the barrel's only runtime value, had no importer through it.

  • pnpm tc, pnpm lint, pnpm run check:code-quality:changed (0 findings), build:electron-vite, build:cli and build:orcad pass.

  • Changed ipc test files: 5 files, 25 tests pass.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

P0/P1 review: my own review plus an independent reviewer.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Type-only import changes plus deleting a module that only re-exported. SSH, wire and platforms are not affected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 851954de-faad-477d-8768-6d0da2a32133

📥 Commits

Reviewing files that changed from the base of the PR and between c77bebf and e93f609.


📒 Files selected for processing (33)
  • src/main/ipc/pty-controller-process-inventory.test.ts
  • src/main/ipc/pty/delivery/attached-pty-size.ts
  • src/main/ipc/pty/host-env/fresh-spawn-routing.ts
  • src/main/ipc/pty/ipc/renderer-kill.ts
  • src/main/ipc/pty/ipc/spawn-begin.ts
  • src/main/ipc/pty/ipc/spawn-commit.ts
  • src/main/ipc/pty/ipc/spawn-reattach-size-cache.test.ts
  • src/main/ipc/pty/ipc/spawn-state.ts
  • src/main/ipc/pty/ipc/spawn-types.ts
  • src/main/ipc/pty/ipc/write-input.ts
  • src/main/ipc/pty/pane/agent-session-owners.ts
  • src/main/ipc/pty/pane/spawn-registration.ts
  • src/main/ipc/pty/pane/spawn-reservation.ts
  • src/main/ipc/pty/pane/stable-owner.ts
  • src/main/ipc/pty/pane/stable-pane-absence-death-certificate.test.ts
  • src/main/ipc/pty/pane/stable-pane-absence-respawn.test.ts
  • src/main/ipc/pty/pane/terminal-spawn-restore.ts
  • src/main/ipc/pty/provider/liveness.ts
  • src/main/ipc/pty/provider/registry-host-routing.test.ts
  • src/main/ipc/pty/provider/registry.ts
  • src/main/ipc/pty/provider/shutdown-detect.ts
  • src/main/ipc/pty/runtime/controller-deps.ts
  • src/main/ipc/pty/runtime/kill.ts
  • src/main/ipc/pty/runtime/operations.ts
  • src/main/ipc/pty/runtime/spawn-early.ts
  • src/main/ipc/pty/runtime/spawn-execute.ts
  • src/main/ipc/pty/runtime/spawn-options.ts
  • src/main/ipc/pty/runtime/spawn-preflight.ts
  • src/main/ipc/pty/runtime/spawn-state.ts
  • src/main/ipc/pty/session.ts
  • src/main/ipc/worktree-base-directory-watch-targets.ts
  • src/main/ipc/worktree-common-git-directory.ts
  • src/main/providers/types.ts

💤 Files with no reviewable changes (1)
  • src/main/providers/types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.



📝 Walkthrough

Walkthrough

PTY and filesystem type imports now reference their provider contract modules instead of providers/types. The providers/types.ts barrel file was removed. The changes do not alter runtime behavior.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to e93f6

The provider import cleanup leaves no tracked dangling references or missing contract exports; no actionable merge risk remains.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 32 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the direct provider-contract imports and deletion of the barrel, which are the main changes.
Description check Passed The description covers the change, rationale, scope, testing, lack of user-visible impact, and checklist items. The N/A linked-issue entry is explained as an internal cleanup, while the related issue …
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.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@OrcaWin
OrcaWin merged commit 3c49cdf into main Oct 12, 2026
37 checks passed
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.

1 participant