Skip to content

refactor(orcad): deploy and serve orcad through a host transport interface - #27686

Merged
nwparker merged 1 commit into
mainfrom
nwparker/wsl-b1-orcad-host-transport
Oct 12, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/wsl-b1-orcad-host-transport

Conversation

@nwparker

@nwparker nwparker commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Stack: 1/2 → #27689

ELI5

The code that installs and runs Orca's remote helper (orcad) on another machine used to require an SSH connection object specifically. It now asks for a small interface describing only what it actually uses. Today the SSH connection is the only thing that fills that interface, so nothing behaves differently.

What Changed

  • Before/after for users: none. SSH workspaces deploy, activate, serve and clean up orcad exactly as before.
  • New OrcadHostTransport (src/main/ssh/orcad-host-transport.ts) and RemoteInstallTransport (src/main/ssh/remote-install-transport.ts) types list the members that orcad deploy/activation/serve/lifecycle code and the shared install, lock, GC and host-probe helpers call: exec, usesSystemSshTransport, getConnectGeneration, sftp, writeFile, uploadDirectory, getTarget.
  • 54 files: mostly parameter types narrowed from SshConnection to these interfaces. SshConnection satisfies them unchanged.
  • sshOrcadHostTransport(conn) adapts a connection by returning the connection itself.
  • Still SSH-specific on purpose: the managed tunnel files and the port-forward provider (the SSH reachability layer).

No RPC, wire-protocol or persisted-format change. Type-only.

Why

Prepares orcad to be deployed to hosts reached without SSH (for example, a WSL distro reached via a wsl.exe stdio channel) while keeping SSH behavior byte-for-byte the same. Narrowing to an interface is less risky than wrapping the connection in a new object: several caches and ownership checks key on connection identity, and a wrapper would silently break them.

Linked Issue

None — preparatory refactor.

Visual Proof

N/A — no behavior change (type-only refactor).

Testing

  • pnpm tc — pass

  • pnpm test src/main/ssh src/main/orcad src/main/ipc src/main/skills src/main/ai-vault src/main/wsl — 1089 files / 11022 tests passed

  • oxlint on changed files — clean

  • pnpm run check:code-quality:changed — passed

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below — existing tests cover the narrowed call sites; no runtime change to test.

AI Disclosure

Review

Start with orcad-ssh-host-transport.ts: the adapter returns the same SshConnection instance, so identity-keyed caches (remote context, wake dedupe) and tunnel ownership checks see the same object as before. Everything else is signature narrowing.

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

Security, cross-platform, SSH, mobile, backwards compatibility and performance: unaffected (no runtime change).

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)

The orcad deploy, activation, serving and lifecycle code took the concrete
SshConnection class. It now takes OrcadHostTransport: exactly the connection
members that code and the shared install/lock/GC/host-probe helpers it calls
use (exec, usesSystemSshTransport, getConnectGeneration, sftp, writeFile,
uploadDirectory, getTarget). The shared helpers narrow to the same surface
(RemoteInstallTransport). SshConnection implements it as is; the SSH adapter
returns the connection itself so identity-keyed caches and ownership checks
are unchanged.

The managed tunnel (port forward, stdio bridge provider, connection manager
ownership) stays on SshConnection: it is the SSH reachability layer.

Type-only; no runtime, wire or persisted-format change.
@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: a51101eb-7570-45c8-a5ea-323ebd33e8c3


📥 Commits

Reviewing files that changed from the base of the PR and between cfb63dc and 8ab4dd6.



📒 Files selected for processing (54)
  • src/main/ssh/orcad-activation-crash-recovery.test.ts
  • src/main/ssh/orcad-activation-record-store.ts
  • src/main/ssh/orcad-activation-transaction.test.ts
  • src/main/ssh/orcad-deployment-target.ts
  • src/main/ssh/orcad-fence-lost-classification.test.ts
  • src/main/ssh/orcad-host-transport.ts
  • src/main/ssh/orcad-managed-bound-port.test.ts
  • src/main/ssh/orcad-managed-bound-port.ts
  • src/main/ssh/orcad-managed-runtime-context.ts
  • src/main/ssh/orcad-managed-serving.ts
  • src/main/ssh/orcad-managed-wake.test.ts
  • src/main/ssh/orcad-remote-context.ts
  • src/main/ssh/orcad-remote-decommission.test.ts
  • src/main/ssh/orcad-remote-deploy.test.ts
  • src/main/ssh/orcad-remote-deploy.ts
  • src/main/ssh/orcad-remote-gc.test.ts
  • src/main/ssh/orcad-remote-gc.ts
  • src/main/ssh/orcad-remote-install-termination.test.ts
  • src/main/ssh/orcad-remote-install.ts
  • src/main/ssh/orcad-remote-node-runtime-promotion-lock.test.ts
  • src/main/ssh/orcad-remote-node-runtime-slow-hash.test.ts
  • src/main/ssh/orcad-remote-node-runtime-windows.test.ts
  • src/main/ssh/orcad-remote-node-runtime.ts
  • src/main/ssh/orcad-remote-preflight.ts
  • src/main/ssh/orcad-remote-primitives.test.ts
  • src/main/ssh/orcad-remote-rollback.test.ts
  • src/main/ssh/orcad-remote-rollback.ts
  • src/main/ssh/orcad-remote-runtime-control.ts
  • src/main/ssh/orcad-remote-windows-commands.test.ts
  • src/main/ssh/orcad-remote-windows-node.ts
  • src/main/ssh/orcad-runtime-deployment.ts
  • src/main/ssh/orcad-runtime-target.ts
  • src/main/ssh/orcad-ssh-host-transport.ts
  • src/main/ssh/orcad-state-mutation-exec.test.ts
  • src/main/ssh/orcad-state-mutation-timeout.test.ts
  • src/main/ssh/orcad-stdio-bridge.test.ts
  • src/main/ssh/orcad-stdio-bridge.ts
  • src/main/ssh/orcad-unreachable-setup-release.ts
  • src/main/ssh/orcad-windows-host-preparation.ts
  • src/main/ssh/remote-install-gc.ts
  • src/main/ssh/remote-install-previous-version.ts
  • src/main/ssh/remote-install-transport.ts
  • src/main/ssh/remote-node-runtime-store-gc.ts
  • src/main/ssh/remote-node-runtime-store-lock.ts
  • src/main/ssh/ssh-exec-stdin-file-transfer.ts
  • src/main/ssh/ssh-relay-gc-claim.ts
  • src/main/ssh/ssh-relay-gc-tombstone.ts
  • src/main/ssh/ssh-relay-host-exec.ts
  • src/main/ssh/ssh-relay-install-lock.ts
  • src/main/ssh/ssh-relay-install-transfers.ts
  • src/main/ssh/ssh-relay-native-deps-cache-gc.ts
  • src/main/ssh/ssh-relay-pinned-node.ts
  • src/main/ssh/ssh-relay-versioned-install.ts
  • src/main/ssh/ssh-remote-platform-detection.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

Walkthrough

The changes add RemoteInstallTransport and OrcadHostTransport contracts, plus an adapter for SSH connections. Remote-install and Orcad APIs now use the corresponding transport types. Orcad context-resolution entry points pass adapted connections. Tests update connection types and mock fixtures.



Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 8ab4d

No merge-blocking risk is identified; SSH workspace behavior is expected to remain unchanged.

Pre-merge checks | Passed 3 | Failed 1 | Inconclusive 1

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check Warning The description explains the change, rationale, scope, testing, and compatibility impact. However, it does not provide the required linked issue, and it does not confirm that the required build comman… Add a valid linked issue under “Linked Issue,” or provide the required maintainer justification for omitting one. Also report the result of pnpm build and update the checklist to match the actual verification results.
Docstring Coverage Inconclusive Docstring coverage is 30.26% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 76 functions across 50 files. (4 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check Passed The title clearly describes the main change: replacing SSH-specific Orcad deployment and serving dependencies with a host transport interface.

Full details: Docstring Coverage

Explanation

Docstring coverage is 30.26% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 76 functions across 50 files. (4 skipped: 4 over the file limit.)


Full details: Description check

Explanation

The description explains the change, rationale, scope, testing, and compatibility impact. However, it does not provide the required linked issue, and it does not confirm that the required build command passed.


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

@nwparker
nwparker merged commit 65d662e into main Oct 12, 2026
55 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