Skip to content

refactor(runtime): import runtime helpers from their owning modules, not re-export shims - #30373

Merged
nwparker merged 1 commit into
mainfrom
nwparker/r2-debarrel-main-runtime
Oct 18, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/r2-debarrel-main-runtime

Conversation

@nwparker

@nwparker nwparker commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 37 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​72 $\color{#cf222e}{\Huge{\mathbf{−}}}$​43 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​29
Prod 81 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​88 $\color{#cf222e}{\Huge{\mathbf{−}}}$​258 $\color{#cf222e}{\Huge{\mathbf{−}}}$​170

ELI5

22 modules in src/main/runtime partly forwarded exports that live in other files. Code now imports each name from the file that defines it, and the forwarding lines are gone. Nothing the app does changes.

What Changed

  • Re-export lines removed (export {…} from, export * from, and import + export { … } pairs) from:
    • agent-prompt-submission-verification, agent-session-recovery-capsule
    • claude-agent-teams-service
    • mobile-notification-dismissal-store, mobile-session-terminal-retirement-proof
    • orca-runtime-git
    • orchestration/worker-terminal-process-liveness, worker-transcript-payload
    • rpc/e2ee-crypto, rpc/orchestration-mutation-executor
    • rpc/methods/browser-schemas, client-ui-schemas, clipboard, workspace-cleanup-ui-schema
    • rpc/methods/orchestration/worker/worker-release-completion, worker-start-schema
    • runtime-rpc, runtime-skill-command-surface, runtime-skill-types
    • structured-worker-identity, terminal-viewport, worktree-teardown
  • Importers rewritten in src/main/runtime, server, native-chat and one cross-version e2e unit test. Duplicate imports are merged.
  • Size: production +85/−255, tests +74/−45.

Why

The user's rule is: no barrel or re-export modules.

Skipped, because open PRs edit them:

Skipped on purpose: orca-runtime-create-terminal-dependencies.ts and runtime-linear-command-dependencies.ts. They re-export node:crypto as an injectable dependency seam, and tests mock that seam. Removing it changes how those tests inject randomness, which is a design change rather than a de-barrel.

Linked Issue

N/A (SSH hardening round 2, de-barrel follow-up).

Visual Proof

N/A: an import-only refactor.

Testing

  • typecheck:ci: clean.
  • All of src/main/runtime, plus the changed server, native-chat and e2e unit test folders, single worker: 1,507 files, 15,461 tests, all passing.
  • Full local "static analysis and typecheck" job: clean.
  • Codex review (gpt-6.1-sol, high): clean.

…not re-export shims

Removes the re-export lines in 22 src/main/runtime modules (rpc schemas, skill surface, worker
identity, terminal viewport, teardown, git, e2ee crypto and more); importers and test mocks name
the real modules.
@coderabbitai

coderabbitai Bot commented Oct 18, 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: 6d98a911-079d-497d-84e5-7f05c8ec3b6a
📥 Commits

Reviewing files that changed from the base of the PR and between e1b2d58 and 8c8484b.

📒 Files selected for processing: 118
  • src/main/native-chat/agent-session-wire/structured-agent-session-restart-failure-ledger.ts
  • src/main/runtime/agent-prompt-submission-verification.test.ts
  • src/main/runtime/agent-prompt-submission-verification.ts
  • src/main/runtime/agent-session-recovery-capsule.test.ts
  • src/main/runtime/agent-session-recovery-capsule.ts
  • src/main/runtime/claude-agent-teams-service.test.ts
  • src/main/runtime/claude-agent-teams-service.ts
  • src/main/runtime/construction/runtime-construction.ts
  • src/main/runtime/construction/runtime-service-state.ts
  • src/main/runtime/mobile-cloud-relay/desktop-relay-service.test.ts
  • src/main/runtime/mobile-cloud-relay/desktop-relay-service.ts
  • src/main/runtime/mobile-cloud-relay/relay-pairing-authorization.ts
  • src/main/runtime/mobile-cloud-relay/simulated-mobile-e2ee-v2-peer.ts
  • src/main/runtime/mobile-notification-dismissal-store.ts
  • src/main/runtime/mobile-session-terminal-retirement-proof.test.ts
  • src/main/runtime/mobile-session-terminal-retirement-proof.ts
  • src/main/runtime/mobile-session-terminal-retirement.ts
  • src/main/runtime/orca-runtime-browser-screencast-e2ee-backlog.test.ts
  • src/main/runtime/orca-runtime-core.ts
  • src/main/runtime/orca-runtime-git-branch-diff.test.ts
  • src/main/runtime/orca-runtime-git-diff-budget.test.ts
  • src/main/runtime/orca-runtime-git.test.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/runtime/orca-runtime-test-mocks/imported-values.spec.ts
  • src/main/runtime/orchestration/db/schema/structured-worker-orca-session-backfill.ts
  • src/main/runtime/orchestration/worker-output-archive.ts
  • src/main/runtime/orchestration/worker-terminal-process-liveness.ts
  • src/main/runtime/orchestration/worker-transcript-payload.test.ts
  • src/main/runtime/orchestration/worker-transcript-payload.ts
  • src/main/runtime/paired-client-navigation-test-harness.ts
  • src/main/runtime/remote-desktop-terminal-floor.ts
  • src/main/runtime/rpc/device-key-auth.test.ts
  • src/main/runtime/rpc/e2ee-channel-text-backpressure.test.ts
  • src/main/runtime/rpc/e2ee-channel-v2.test.ts
  • src/main/runtime/rpc/e2ee-channel.test.ts
  • src/main/runtime/rpc/e2ee-channel.ts
  • src/main/runtime/rpc/e2ee-crypto.test.ts
  • src/main/runtime/rpc/e2ee-crypto.ts
  • src/main/runtime/rpc/e2ee-integration.test.ts
  • src/main/runtime/rpc/methods/browser-core.ts
  • src/main/runtime/rpc/methods/browser-extras.ts
  • src/main/runtime/rpc/methods/browser-identity-rpc.ts
  • src/main/runtime/rpc/methods/browser-profile-rpc-methods.ts
  • src/main/runtime/rpc/methods/browser-schemas.ts
  • src/main/runtime/rpc/methods/browser-screencast.ts
  • src/main/runtime/rpc/methods/browser-text-rpc-methods.ts
  • src/main/runtime/rpc/methods/browser.test.ts
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/main/runtime/rpc/methods/client-ui.ts
  • src/main/runtime/rpc/methods/clipboard.test.ts
  • src/main/runtime/rpc/methods/clipboard.ts
  • src/main/runtime/rpc/methods/orchestration-caller-workspace.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federated-worker-release-host.ts
  • src/main/runtime/rpc/methods/orchestration/federation/federation-attachment-observation.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/message-methods.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/send-methods.ts
  • src/main/runtime/rpc/methods/orchestration/worker/explicit-worker-terminal-validation.ts
  • src/main/runtime/rpc/methods/orchestration/worker/retried-worker-terminal-release.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-control.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-launch-preferences.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-list-method.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-observation.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-release-completion.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-release.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-agent-placement-teardown.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-launch-executor-parity.test.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-receipt.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-start-schema.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-stop.ts
  • src/main/runtime/rpc/methods/orchestration/worker/worker-terminal-release-lease.ts
  • src/main/runtime/rpc/methods/orchestration/worker/workers.ts
  • src/main/runtime/rpc/methods/workspace-cleanup-ui-schema.test.ts
  • src/main/runtime/rpc/methods/workspace-cleanup-ui-schema.ts
  • src/main/runtime/rpc/mobile-auth-acl-critical-path.test.ts
  • src/main/runtime/rpc/mobile-e2ee-auth-validation.ts
  • src/main/runtime/rpc/mobile-e2ee-desktop-outbound-owner.ts
  • src/main/runtime/rpc/mobile-e2ee-legacy-reply-senders.ts
  • src/main/runtime/rpc/mobile-e2ee-v2-desktop-session.test.ts
  • src/main/runtime/rpc/mobile-e2ee-v2-desktop-session.ts
  • src/main/runtime/rpc/mobile-socket-wiring.test.ts
  • src/main/runtime/rpc/orchestration-mutation-executor.ts
  • src/main/runtime/rpc/schemas.test.ts
  • src/main/runtime/rpc/web-session-pairing.test.ts
  • src/main/runtime/runtime-git-execution-host-ownership.test.ts
  • src/main/runtime/runtime-mobile-notification-controller.ts
  • src/main/runtime/runtime-mobile-session-result-finalization.ts
  • src/main/runtime/runtime-rpc-browser-host-admission.test.ts
  • src/main/runtime/runtime-rpc-device-revocation.test.ts
  • src/main/runtime/runtime-rpc-dispatch-inject-long-poll.test.ts
  • src/main/runtime/runtime-rpc-long-poll-transport.test.ts
  • src/main/runtime/runtime-rpc-metadata-lifecycle.test.ts
  • src/main/runtime/runtime-rpc-mobile-ws-test-harness.ts
  • src/main/runtime/runtime-rpc-websocket-reply-size-limit.test.ts
  • src/main/runtime/runtime-rpc.ts
  • src/main/runtime/runtime-skill-command-contract.ts
  • src/main/runtime/runtime-skill-command-surface.ts
  • src/main/runtime/runtime-skill-install-authority.ts
  • src/main/runtime/runtime-skill-install-commands.ts
  • src/main/runtime/runtime-skill-install-queries.ts
  • src/main/runtime/runtime-skill-types.ts
  • src/main/runtime/runtime-terminal-contracts.ts
  • src/main/runtime/session-tabs/headless-terminal-tab-close.ts
  • src/main/runtime/structured-worker-authority.ts
  • src/main/runtime/structured-worker-identity.test.ts
  • src/main/runtime/structured-worker-identity.ts
  • src/main/runtime/terminal-viewport.ts
  • src/main/runtime/terminal/launch/terminal-split-source-authority.ts
  • src/main/runtime/terminal/layout/mobile-terminal-activity.ts
  • src/main/runtime/terminal/layout/mobile-terminal-subscribe-internal.ts
  • src/main/runtime/terminal/layout/terminal-input-floor.ts
  • src/main/runtime/terminal/layout/terminal-resize-listeners.ts
  • src/main/runtime/terminal/output/terminal-orchestration-authority.ts
  • src/main/runtime/terminal/output/terminal-output-path.ts
  • src/main/runtime/terminal/stop/worktree-terminal-sleep.ts
  • src/main/runtime/terminal/stop/worktree-terminal-stop.ts
  • src/main/runtime/worktree-teardown.ts
  • src/main/server/serve-readiness.ts
  • tests/e2e/cross-version-wire/cross-version-web-device-key.unit.test.ts
💤 Files with no reviewable changes: 18
  • src/main/runtime/agent-session-recovery-capsule.ts
  • src/main/runtime/mobile-notification-dismissal-store.ts
  • src/main/runtime/terminal-viewport.ts
  • src/main/runtime/rpc/orchestration-mutation-executor.ts
  • src/main/runtime/worktree-teardown.ts
  • src/main/runtime/rpc/methods/client-ui-schemas.ts
  • src/main/runtime/orchestration/worker-transcript-payload.ts
  • src/main/runtime/rpc/methods/clipboard.ts
  • src/main/runtime/runtime-skill-types.ts
  • src/main/runtime/mobile-session-terminal-retirement-proof.ts
  • src/main/runtime/rpc/methods/workspace-cleanup-ui-schema.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/runtime/rpc/e2ee-crypto.ts
  • src/main/runtime/agent-prompt-submission-verification.ts
  • src/main/runtime/orchestration/worker-terminal-process-liveness.ts
  • src/main/runtime/claude-agent-teams-service.ts
  • src/main/runtime/rpc/methods/browser-schemas.ts
  • src/main/runtime/runtime-rpc.ts

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

📝 Walkthrough

The changes redirect imports to shared or feature-specific modules across runtime, RPC, orchestration, and tests. Several re-export declarations and re-export-only modules were removed. The supplied summaries report no runtime behavior changes.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 8c848

The import-boundary refactor has no identified concrete merge risk and is ready to merge with normal checks.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive 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 3 functions across 50 files. (50 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: replacing imports from runtime re-export shims with imports from owning modules.
Description check Passed The description includes the core template sections, explains the refactor and rationale, documents skipped modules, provides visual-proof rationale, and reports detailed testing. Some optional or non…
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.
Full details: Description check

Explanation

The description includes the core template sections, explains the refactor and rationale, documents skipped modules, provides visual-proof rationale, and reports detailed testing. Some optional or non-critical sections, such as Review, Notes, and Checklist, are not completed.

Full details: Docstring Coverage

Explanation

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 3 functions across 50 files. (50 skipped: 50 over the file limit.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ 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.

@nwparker
nwparker merged commit 9905da8 into main Oct 18, 2026
45 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