Skip to content

refactor(providers): import provider contracts directly (runtime) - #27965

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

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

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9 $\color{#cf222e}{\Huge{\mathbf{−}}}$​9 0
Prod 17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​21 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4

ELI5

src/main/providers/types.ts is a forwarding file that re-exports the terminal, file and git provider contracts from their own files. #27813 moved src/main (outside runtime and ipc) to import each contract from its own file. This PR does the same for src/main/runtime.

What Changed

Users see no difference: 26 files under src/main/runtime/, all type-only imports, now import IPtyProvider, IFilesystemProvider, IGitProvider and related types straight from pty-provider-contract.ts, filesystem-provider-contract.ts and git-provider-contract.ts. This includes the test-mock module's IPtyProvider type re-export. The barrel itself stays until the ipc PR (3.4c) moves its last importers and deletes it.

Net: 0 lines (26 imports re-pointed).

Why

Phase 3.99 rule: no barrels. One import path per contract makes it obvious which contract a file depends on. Splitting the work by directory keeps each PR easy to review.

Linked Issue

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

Visual Proof

N/A, no UI or behaviour change.

Testing

  • rg "providers/types'" src/main/runtime returns nothing. All rewritten imports stay import type.

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

  • pnpm test src/main/runtime/orca-runtime-tests plus the changed test files: 8 files, 141 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 path changes; no runtime code changes. 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: 10dc9697-b583-4314-adba-8d8cbcf61902

📥 Commits

Reviewing files that changed from the base of the PR and between 799ec59 and 82a0b41.


📒 Files selected for processing (26)
  • src/main/runtime/folder-workspace-pty-teardown.ts
  • src/main/runtime/headless-seed-ownership.test.ts
  • src/main/runtime/missing-worktree-terminal-reconciliation.test.ts
  • src/main/runtime/missing-worktree-terminal-reconciliation.ts
  • src/main/runtime/orca-runtime-build-controller-terminal-identities.ts
  • src/main/runtime/orca-runtime-capture-provider-terminal-buffer.ts
  • src/main/runtime/orca-runtime-emit-daemon-pty-transient-fact.ts
  • src/main/runtime/orca-runtime-fit-override-listeners.ts
  • src/main/runtime/orca-runtime-preserved-branch-cleanup.ts
  • src/main/runtime/orca-runtime-pty-foreground-process-reads.ts
  • src/main/runtime/orca-runtime-serialize-terminal-buffer-from-available-state.ts
  • src/main/runtime/orca-runtime-state-fields.ts
  • src/main/runtime/orca-runtime-terminal-create-idempotency.test.ts
  • src/main/runtime/orca-runtime-test-mocks.spec.ts
  • src/main/runtime/runtime-file-command-access.ts
  • src/main/runtime/runtime-git-status-commands.ts
  • src/main/runtime/runtime-pty-controller-contract.ts
  • src/main/runtime/runtime-terminal-state-records.ts
  • src/main/runtime/structured-session-worktree-teardown.test.ts
  • src/main/runtime/terminal-intentional-stop-exit.test.ts
  • src/main/runtime/terminal-run-facts-input.test.ts
  • src/main/runtime/unstopped-pty-verification.ts
  • src/main/runtime/worktree-pty-surface-sweeps.ts
  • src/main/runtime/worktree-teardown-unstopped-pty.test.ts
  • src/main/runtime/worktree-teardown.test.ts
  • src/main/runtime/worktree-teardown.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

Runtime modules, tests, and a test-mock re-export now import provider types from provider-specific contract modules instead of providers/types. The changes do not alter runtime behavior or test expectations.

Estimated code review effort


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 82a0b

This is an internal type-import cleanup with no identified behavior change or actionable merge-blocking risk.

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 26 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 and concisely identifies the main change: direct imports of provider contracts in the runtime code.
Description check Passed The description covers the required change, rationale, scope, testing, visual proof, review, compatibility notes, and checklist. It omits the AI Disclosure heading, but this is non-critical for an int…
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 c77bebf into main Oct 12, 2026
30 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