Skip to content

refactor(wsl): move the WSL guest bundle sources out of src/relay - #27174

Merged
OrcaWin merged 4 commits into
mainfrom
OrcaWin/relay-helper-relocation
Oct 10, 2026
Merged

OrcaWin merged 4 commits into
mainfrom
OrcaWin/relay-helper-relocation

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 130 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​287 $\color{#cf222e}{\Huge{\mathbf{−}}}$​151 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​136
Prod 133 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​156 $\color{#cf222e}{\Huge{\mathbf{−}}}$​150 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6

ELI5

The SSH relay (the small program Orca used to upload to SSH hosts) is about to be deleted, because SSH hosts now run Orca's managed server instead. Before it can be deleted, anything else that borrows code from the relay's folder has to stop borrowing it. This PR moves that borrowed code out. Nothing the user sees changes.

What Changed

  • Before: src/relay held the SSH relay and also the source of two small programs Orca runs inside WSL: the WSL hook relay (forwards agent hook events from a WSL distro to Orca) and the WSL browser network relay. The WSL hook relay reuses 46 relay modules (the message dispatcher, the wire protocol, the agent hook server, the plugin overlay). Desktop code also imported one type (PluginSources) from there.
  • After: those 48 source files, plus the 46 tests that cover only them, live in a new src/wsl-guest/ folder. Every importer, including the SSH relay itself, now imports from src/wsl-guest/ directly. No re-export shims or barrel files were added.
  • Every move is a pure git mv. The moved files' contents are unchanged, because src/wsl-guest sits at the same depth as src/relay. The built WSL hook relay, WSL browser network relay, relay, and relay AI vault service bundles are byte-identical to main's (esbuild output SHA-256 compared). The WSL bundle's version stamp is unchanged, so existing WSL guests are not redeployed.
  • New config/scripts/ssh-relay-import-boundary.test.mjs: fails if any non-test code outside src/relay imports it. It also pins the 28 relay tests that live elsewhere (for example the real-git parity tests in src/main/git). That list can only shrink, and the relay deletion PR empties it.
  • Supporting path updates: tsconfig includes, the relay build script's WSL entries, knip, reliability-gate and shard-timing paths, the process-host baseline, and CI routing. src/wsl-guest/ now triggers the same SSH, hook, and cross-host lanes src/relay/ did, because the relay still uses this code until it is deleted. The cross-version wire harness also extracts a release's src/wsl-guest when the release has one, because a release's relay imports it.
  • A small CI gate fix: the changed-lines code-quality gate is supposed to exempt existing lint debt in moved code, but it missed pure renames. git diff --name-only lists a rename under its new path only, so the old file's text was never read. Adding --no-renames fixes that, and a regression test covers it.

Why

The owner decided on 2026-10-10 to delete the SSH relay outright. Doing the moves first, in their own PR, keeps the deletion PR a plain removal that is easy to review, and lets this purely mechanical change merge on its own.

I considered placing the code under src/main/agent-hooks/, which would follow the precedent of other WSL guest entry files. But that changes every relative import inside 94 files, so the moves would no longer be pure renames. A sibling folder of src/relay keeps every moved file byte-for-byte identical.

Note: several files once thought to import from src/relay (worktree-add.ts, process-cwd.ts, ssh-types.ts, the runtime-RPC pairing files, push-gateway-session.ts, branch-mutation-handlers.ts) don't import it. They either import src/main/runtime/relay (the mobile/cloud Relay pairing service, a separate system that is untouched here), or they only mention a relay file in a comment. Those comments are updated.

Linked Issue

Part of the SSH relay retirement (Phase 6 of the Node runtime plan). No issue.

Visual Proof

N/A. No UI or behavior change; the built bundles are byte-identical.

Testing

  • pnpm tc (node, web, cli, process-host): pass

  • All 124 test files touched by the moves (src/wsl-guest/** and every relay/main test whose imports changed): 1194 passed

  • Boundary, CI routing, cross-version checkout, process-host import, builder config, and relay manifest tests: pass

  • node config/scripts/build-relay.mjs into a temp dir: builds all six relay platforms plus the WSL bundles

  • Bundle byte-identity against origin/main for wsl-agent-hook-relay, wsl-browser-network-relay, relay, ai-vault-service-entry

  • oxlint, oxfmt --check, pnpm run check:code-quality:changed, check:reliability-gates, check:max-lines-ratchet, check:process-host-imports: pass

  • I manually tested these changes locally

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

Review

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: no change. Cross-platform: no runtime change; Windows packaging still ships out/relay/wsl. SSH/remote: the relay and WSL bundles are byte-identical. Mobile: untouched. Backwards compatibility: no wire, layout, or version change. Performance: none.

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 10, 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: 166ff47f-dccc-43a6-81db-76dcb8243e54

📥 Commits

Reviewing files that changed from the base of the PR and between 49960ca7e679c49676e824be409918c4634977ad and d5d373e.


📒 Files selected for processing (263)
  • .github/workflows/ssh-hostile-hosts.yml
  • .github/workflows/ssh-windows-hosts.yml
  • config/knip.json
  • config/process-host-direct-import-baseline.txt
  • config/reliability-gates.jsonc
  • config/scripts/build-relay.mjs
  • config/scripts/check-changed-code-quality.mjs
  • config/scripts/check-changed-code-quality.test.mjs
  • config/scripts/ci-shard-timings.json
  • config/scripts/node-server-qualification.mjs
  • config/scripts/pr-code-change-scope.mjs
  • config/scripts/pr-e2e-gate-contract.test.mjs
  • config/scripts/pr-e2e-source-routing.mjs
  • config/scripts/relay-json-payload-benchmark.ts
  • config/scripts/relay-watcher-fault-harness.mjs
  • config/scripts/ssh-localhost-e2e-routing.test.mjs
  • config/scripts/ssh-relay-import-boundary.test.mjs
  • config/tsconfig.node.json
  • config/tsconfig.relay.json
  • docs/audits/ssh-file-metadata-retention/relay-fixture.mjs
  • docs/audits/ssh-file-metadata-retention/scenario.test.mjs
  • src/main/agent-hooks/manual-compact-hook-stream.test.ts
  • src/main/agent-hooks/opencode-plugin-settings.ts
  • src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts
  • src/main/agent-hooks/server-relayed-claude-cancel.test.ts
  • src/main/agent-hooks/server-tmux-wire.test.ts
  • src/main/agent-hooks/wsl-guest-plugin-install.ts
  • src/main/agent-hooks/wsl-hook-relay-deps.ts
  • src/main/agent-hooks/wsl-hook-relay-guest-install.ts
  • src/main/agent-hooks/wsl-hook-relay-manager.test.ts
  • src/main/agent-hooks/wsl-opencode-install-race.test.ts
  • src/main/agent-hooks/wsl-opencode-settings-lifetime.test.ts
  • src/main/agent-hooks/wsl-opencode-settings.test.ts
  • src/main/ai-vault-search/session-search-scope-entry-points.test.ts
  • src/main/ipc/worktrees/removal/worktree-archive-hook.ts
  • src/main/plugins/plugin-host-conformance.test.ts
  • src/main/providers/ssh-review-draft-context.test.ts
  • src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts
  • src/relay/agent-exec-disposal.test.ts
  • src/relay/agent-exec-handler-test-harness.ts
  • src/relay/agent-exec-handler.ts
  • src/relay/agent-hook-retired-pane-suppression.test.ts
  • src/relay/ai-vault-handler.test.ts
  • src/relay/ai-vault-handler.ts
  • src/relay/external-automations-handler.test.ts
  • src/relay/external-automations-handler.ts
  • src/relay/fs-file-stream-shutdown.test.ts
  • src/relay/fs-handler-file-range-dispatch.test.ts
  • src/relay/fs-handler-file-range.test.ts
  • src/relay/fs-handler-file-read.ts
  • src/relay/fs-handler-git-fallback.ts
  • src/relay/fs-handler-git-search.ts
  • src/relay/fs-handler-list-files-ignored.test.ts
  • src/relay/fs-handler-list-files-result-limit.test.ts
  • src/relay/fs-handler-list-files.ts
  • src/relay/fs-handler-ripgrep-fallback.test.ts
  • src/relay/fs-handler-stream.test.ts
  • src/relay/fs-handler-utils.ts
  • src/relay/fs-handler.test.ts
  • src/relay/fs-handler.ts
  • src/relay/fs-list-files-cancel.integration.test.ts
  • src/relay/fs-list-files-dispatch-test-harness.ts
  • src/relay/fs-list-files-fallback-chain.ts
  • src/relay/fs-list-files-large-response.integration.test.ts
  • src/relay/fs-markdown-document-listing.test.ts
  • src/relay/fs-search-cancellation.test.ts
  • src/relay/fs-stream-pty-echo-backpressure.integration.test.ts
  • src/relay/fs-stream-registry.ts
  • src/relay/git-handler-comparison-operations.ts
  • src/relay/git-handler-exec-operations.ts
  • src/relay/git-handler-fetch-operations.ts
  • src/relay/git-handler-object-diff-operations.ts
  • src/relay/git-handler-operation-context.ts
  • src/relay/git-handler-read-operations.ts
  • src/relay/git-handler-registration.ts
  • src/relay/git-handler-stage-worktree-scope.test.ts
  • src/relay/git-handler-sync-operations.ts
  • src/relay/git-handler-test-setup.ts
  • src/relay/git-handler-worktree-operations.ts
  • src/relay/git-handler.ts
  • src/relay/git-response-pty-echo-backpressure.integration.test.ts
  • src/relay/git-response-stream-ownership.test.ts
  • src/relay/git-response-stream-retention.test.ts
  • src/relay/git-response-stream-shutdown.test.ts
  • src/relay/git-response-stream.ts
  • src/relay/git-stdout-stream.ts
  • src/relay/integration.test.ts
  • src/relay/managed-hook-installer.test.ts
  • src/relay/managed-hook-installer.ts
  • src/relay/omp-fresh-launch-environment.test.ts
  • src/relay/opencode-hook-selection.test.ts
  • src/relay/plugin-host-call-handler.ts
  • src/relay/port-scan-handler.test.ts
  • src/relay/port-scan-handler.ts
  • src/relay/pty-handler-output-drain-differential.test.ts
  • src/relay/pty-handler-output-streaming.test.ts
  • src/relay/pty-handler-owner-inventory-clone-budget.test.ts
  • src/relay/pty-handler-shell-recovery.test.ts
  • src/relay/pty-handler-source-publication.test.ts
  • src/relay/pty-handler-spawn-admission.test.ts
  • src/relay/pty-handler-test-harness.ts
  • src/relay/pty-handler.ts
  • src/relay/relay-agent-hook-runtime.ts
  • src/relay/relay-bundled-ripgrep.ts
  • src/relay/relay-client-resync-marker.ts
  • src/relay/relay-connect-channel.ts
  • src/relay/relay-filesystem-watch-registry.test.ts
  • src/relay/relay-filesystem-watch-registry.ts
  • src/relay/relay-grace-lifecycle.test.ts
  • src/relay/relay-grace-lifecycle.ts
  • src/relay/relay-handshake-roundtrip.test.ts
  • src/relay/relay-handshake.ts
  • src/relay/relay-orca-cli-channel.ts
  • src/relay/relay-oversized-notification-survival.test.ts
  • src/relay/relay-primary-channel.ts
  • src/relay/relay-pty-consumer-owner-displacement.test.ts
  • src/relay/relay-pty-publication-admission.test.ts
  • src/relay/relay-pty-source-activation.ts
  • src/relay/relay-pty-source-cancellation-exit.test.ts
  • src/relay/relay-pty-source-exit-publication.test.ts
  • src/relay/relay-pty-source-exit-publication.ts
  • src/relay/relay-pty-source-output.ts
  • src/relay/relay-pty-source-publication.test.ts
  • src/relay/relay-pty-source-publication.ts
  • src/relay/relay-pty-source-recovery-completion.test.ts
  • src/relay/relay-pty-source-recovery-completion.ts
  • src/relay/relay-pty-source-recovery-interleavings.test.ts
  • src/relay/relay-pty-source-recovery-window.test.ts
  • src/relay/relay-pty-source-restore-retry.test.ts
  • src/relay/relay-pty-source-send-scheduler.test.ts
  • src/relay/relay-pty-source-send-scheduler.ts
  • src/relay/relay-pty-source-superseded-activation.test.ts
  • src/relay/relay-reconnect-listener-credential-gate.test.ts
  • src/relay/relay-reconnect-listener-peer-end.test.ts
  • src/relay/relay-reconnect-listener-peer-write-error.test.ts
  • src/relay/relay-reconnect-listener.ts
  • src/relay/relay-runtime-services.ts
  • src/relay/relay-stream-ack-window.ts
  • src/relay/relay-watch-root-capacity.test.ts
  • src/relay/relay-watcher-event-emitter.test.ts
  • src/relay/relay-watcher-event-emitter.ts
  • src/relay/relay-watcher-frame-chunking.test.ts
  • src/relay/relay-watcher-parent-removal.test.ts
  • src/relay/relay-watcher-pending-setup-waiters.test.ts
  • src/relay/relay-watcher-removal-fence.ts
  • src/relay/relay-watcher-setup-wait.ts
  • src/relay/relay-watcher-shared-byte-index.test.ts
  • src/relay/relay-watcher-shutdown.test.ts
  • src/relay/relay-watcher-terminal-notifier.ts
  • src/relay/relay-windows-path-ripgrep.test.ts
  • src/relay/remote-artifact-cli-forwarding.ts
  • src/relay/remote-artifact-cli-input.test.ts
  • src/relay/remote-artifact-cli-input.ts
  • src/relay/session-search-transport.test.ts
  • src/relay/skill-install-handler.test.ts
  • src/relay/skill-install-handler.ts
  • src/relay/ssh-pty-consumer-session-adapter.test.ts
  • src/relay/ssh-pty-consumer-session-adapter.ts
  • src/relay/ssh-pty-open-client-request.ts
  • src/relay/subprocess-test-utils.ts
  • src/relay/windows-port-scan.test.ts
  • src/relay/windows-port-scan.ts
  • src/relay/workspace-session-handler.test.ts
  • src/relay/workspace-session-handler.ts
  • src/relay/workspace-snapshot-publication.test.ts
  • src/relay/workspace-snapshot-publication.ts
  • src/relay/workspace-space-scan-du-capacity.test.ts
  • src/relay/workspace-space-scan.test.ts
  • src/relay/workspace-space-scan.ts
  • src/shared/agent-hook-relay.ts
  • src/wsl-guest/agent-hook-cached-pane-status.ts
  • src/wsl-guest/agent-hook-canonical-status.test.ts
  • src/wsl-guest/agent-hook-canonical-status.ts
  • src/wsl-guest/agent-hook-endpoint-coordinates.ts
  • src/wsl-guest/agent-hook-envelope-build.ts
  • src/wsl-guest/agent-hook-envelope-publication.test.ts
  • src/wsl-guest/agent-hook-envelope-publication.ts
  • src/wsl-guest/agent-hook-event-admission.ts
  • src/wsl-guest/agent-hook-integration.test.ts
  • src/wsl-guest/agent-hook-interrupt-reconciliation.test.ts
  • src/wsl-guest/agent-hook-interrupt-reconciliation.ts
  • src/wsl-guest/agent-hook-opencode-tui-identity.test.ts
  • src/wsl-guest/agent-hook-request.ts
  • src/wsl-guest/agent-hook-result-retry-scheduler.ts
  • src/wsl-guest/agent-hook-server-claude-owed-notification-expiry.test.ts
  • src/wsl-guest/agent-hook-server-codex-subagent-transcript.test.ts
  • src/wsl-guest/agent-hook-server-codex-turn-interruption.test.ts
  • src/wsl-guest/agent-hook-server-contract.ts
  • src/wsl-guest/agent-hook-server.test.ts
  • src/wsl-guest/agent-hook-server.ts
  • src/wsl-guest/agent-hook-spool-ingest.ts
  • src/wsl-guest/claude-terminal-interrupt-status.ts
  • src/wsl-guest/client-request-aborts.ts
  • src/wsl-guest/dispatcher-bulk-admission.test.ts
  • src/wsl-guest/dispatcher-bulk-failed-admission.test.ts
  • src/wsl-guest/dispatcher-bulk-retirement-admission.test.ts
  • src/wsl-guest/dispatcher-bulk-write-test-harness.ts
  • src/wsl-guest/dispatcher-capacity-degradation.test.ts
  • src/wsl-guest/dispatcher-capacity-signals.ts
  • src/wsl-guest/dispatcher-client-close-cause.test.ts
  • src/wsl-guest/dispatcher-client-lifecycle.ts
  • src/wsl-guest/dispatcher-client-state.ts
  • src/wsl-guest/dispatcher-client-writer.test.ts
  • src/wsl-guest/dispatcher-client-writer.ts
  • src/wsl-guest/dispatcher-contract.ts
  • src/wsl-guest/dispatcher-frame-codec.ts
  • src/wsl-guest/dispatcher-frame-guard-regressions.test.ts
  • src/wsl-guest/dispatcher-json-payload.test.ts
  • src/wsl-guest/dispatcher-notification-ownership.test.ts
  • src/wsl-guest/dispatcher-notification-publication.ts
  • src/wsl-guest/dispatcher-per-connection-state-baseline.test.ts
  • src/wsl-guest/dispatcher-producer-capacity.ts
  • src/wsl-guest/dispatcher-producer-transport.ts
  • src/wsl-guest/dispatcher-pty-publication.ts
  • src/wsl-guest/dispatcher-rpc-cancel-id-coercion.test.ts
  • src/wsl-guest/dispatcher-rpc-routing.ts
  • src/wsl-guest/dispatcher-silent-client-reaper.test.ts
  • src/wsl-guest/dispatcher-structured-error.test.ts
  • src/wsl-guest/dispatcher-timeout.test.ts
  • src/wsl-guest/dispatcher-writer-admission.test.ts
  • src/wsl-guest/dispatcher-writer-admission.ts
  • src/wsl-guest/dispatcher-writer-drain-arm.ts
  • src/wsl-guest/dispatcher-writer-lane-scheduler.ts
  • src/wsl-guest/dispatcher-writer-sink.ts
  • src/wsl-guest/dispatcher.test.ts
  • src/wsl-guest/dispatcher.ts
  • src/wsl-guest/filesystem-capacity-error-wire.test.ts
  • src/wsl-guest/legacy-relay-publication-ledger.test.ts
  • src/wsl-guest/legacy-relay-publication-ledger.ts
  • src/wsl-guest/omp-config-root.test.ts
  • src/wsl-guest/omp-status-extension.ts
  • src/wsl-guest/opencode-canonical-config.ts
  • src/wsl-guest/opencode-overlay-mirror.ts
  • src/wsl-guest/opencode-startup-prompt-install.test.ts
  • src/wsl-guest/plugin-overlay-env.test.ts
  • src/wsl-guest/plugin-overlay-env.ts
  • src/wsl-guest/plugin-overlay.test.ts
  • src/wsl-guest/plugin-overlay.ts
  • src/wsl-guest/plugin-source-limit.test.ts
  • src/wsl-guest/plugin-source-limit.ts
  • src/wsl-guest/preflight-handler.test.ts
  • src/wsl-guest/preflight-handler.ts
  • src/wsl-guest/protocol-backpressure.test.ts
  • src/wsl-guest/protocol-handshake.test.ts
  • src/wsl-guest/protocol-json-payload.test.ts
  • src/wsl-guest/protocol.ts
  • src/wsl-guest/relay-agent-presence.test.ts
  • src/wsl-guest/relay-agent-presence.ts
  • src/wsl-guest/relay-command-env.test.ts
  • src/wsl-guest/relay-command-env.ts
  • src/wsl-guest/relay-frame-decoder.ts
  • src/wsl-guest/relay-hot-path-operation-counts.test.ts
  • src/wsl-guest/relay-tmux-hook-owner.ts
  • src/wsl-guest/wsl-agent-hook-relay.test.ts
  • src/wsl-guest/wsl-agent-hook-relay.ts
  • src/wsl-guest/wsl-browser-network-relay.ts
  • src/wsl-guest/wsl-hook-fs-bridge.test.ts
  • src/wsl-guest/wsl-hook-fs-bridge.ts
  • src/wsl-guest/wsl-install-plugins-handler.test.ts
  • src/wsl-guest/wsl-install-plugins-handler.ts
  • tests/e2e/cross-version-wire/release-checkout-tree.ts
  • tests/e2e/cross-version-wire/release-checkout-tree.unit.test.ts
  • tests/tools/omp-config-root-relay-shell.test.mjs

💤 Files with no reviewable changes (90)
  • src/wsl-guest/dispatcher-capacity-degradation.test.ts
  • src/wsl-guest/dispatcher-bulk-failed-admission.test.ts
  • src/wsl-guest/agent-hook-server-codex-subagent-transcript.test.ts
  • src/wsl-guest/dispatcher-contract.ts
  • src/wsl-guest/legacy-relay-publication-ledger.test.ts
  • src/wsl-guest/dispatcher-timeout.test.ts
  • src/wsl-guest/dispatcher-bulk-retirement-admission.test.ts
  • src/wsl-guest/relay-agent-presence.ts
  • src/wsl-guest/wsl-hook-fs-bridge.test.ts
  • src/wsl-guest/relay-tmux-hook-owner.ts
  • src/wsl-guest/agent-hook-request.ts
  • src/wsl-guest/dispatcher-bulk-admission.test.ts
  • src/wsl-guest/plugin-overlay.test.ts
  • src/wsl-guest/agent-hook-canonical-status.ts
  • src/wsl-guest/protocol-handshake.test.ts
  • src/wsl-guest/agent-hook-endpoint-coordinates.ts
  • src/wsl-guest/relay-command-env.test.ts
  • src/wsl-guest/agent-hook-cached-pane-status.ts
  • src/wsl-guest/dispatcher-client-writer.test.ts
  • src/wsl-guest/agent-hook-server-contract.ts
  • src/wsl-guest/protocol-backpressure.test.ts
  • src/wsl-guest/dispatcher-pty-publication.ts
  • src/wsl-guest/agent-hook-envelope-build.ts
  • src/wsl-guest/dispatcher-silent-client-reaper.test.ts
  • src/wsl-guest/dispatcher-rpc-routing.ts
  • src/wsl-guest/dispatcher.ts
  • src/wsl-guest/agent-hook-interrupt-reconciliation.ts
  • src/wsl-guest/opencode-startup-prompt-install.test.ts
  • src/wsl-guest/agent-hook-server-codex-turn-interruption.test.ts
  • src/wsl-guest/dispatcher-notification-ownership.test.ts
  • src/wsl-guest/agent-hook-envelope-publication.ts
  • src/wsl-guest/dispatcher-client-state.ts
  • src/wsl-guest/protocol-json-payload.test.ts
  • src/wsl-guest/dispatcher-capacity-signals.ts
  • src/wsl-guest/plugin-overlay.ts
  • src/wsl-guest/dispatcher-notification-publication.ts
  • src/wsl-guest/client-request-aborts.ts
  • src/wsl-guest/filesystem-capacity-error-wire.test.ts
  • src/wsl-guest/protocol.ts
  • src/wsl-guest/dispatcher-frame-guard-regressions.test.ts
  • src/wsl-guest/dispatcher.test.ts
  • src/wsl-guest/plugin-source-limit.test.ts
  • src/wsl-guest/dispatcher-structured-error.test.ts
  • src/wsl-guest/plugin-source-limit.ts
  • src/wsl-guest/plugin-overlay-env.test.ts
  • src/wsl-guest/dispatcher-client-lifecycle.ts
  • src/wsl-guest/agent-hook-canonical-status.test.ts
  • src/wsl-guest/agent-hook-integration.test.ts
  • src/wsl-guest/preflight-handler.ts
  • src/wsl-guest/dispatcher-writer-admission.ts
  • src/wsl-guest/dispatcher-json-payload.test.ts
  • src/wsl-guest/agent-hook-event-admission.ts
  • src/wsl-guest/wsl-agent-hook-relay.test.ts
  • src/wsl-guest/dispatcher-writer-admission.test.ts
  • src/wsl-guest/wsl-agent-hook-relay.ts
  • src/wsl-guest/wsl-browser-network-relay.ts
  • src/wsl-guest/dispatcher-frame-codec.ts
  • src/wsl-guest/agent-hook-opencode-tui-identity.test.ts
  • src/wsl-guest/relay-hot-path-operation-counts.test.ts
  • src/wsl-guest/agent-hook-envelope-publication.test.ts
  • src/wsl-guest/agent-hook-server-claude-owed-notification-expiry.test.ts
  • src/wsl-guest/opencode-overlay-mirror.ts
  • src/wsl-guest/opencode-canonical-config.ts
  • src/wsl-guest/preflight-handler.test.ts
  • src/wsl-guest/wsl-install-plugins-handler.test.ts
  • src/wsl-guest/wsl-hook-fs-bridge.ts
  • src/wsl-guest/omp-config-root.test.ts
  • src/wsl-guest/claude-terminal-interrupt-status.ts
  • src/wsl-guest/plugin-overlay-env.ts
  • src/wsl-guest/dispatcher-per-connection-state-baseline.test.ts
  • src/wsl-guest/relay-agent-presence.test.ts
  • src/wsl-guest/agent-hook-server.test.ts
  • src/wsl-guest/agent-hook-result-retry-scheduler.ts
  • src/wsl-guest/dispatcher-client-close-cause.test.ts
  • src/wsl-guest/legacy-relay-publication-ledger.ts
  • src/wsl-guest/dispatcher-writer-lane-scheduler.ts
  • src/wsl-guest/agent-hook-interrupt-reconciliation.test.ts
  • src/wsl-guest/dispatcher-rpc-cancel-id-coercion.test.ts
  • src/wsl-guest/dispatcher-producer-capacity.ts
  • src/wsl-guest/agent-hook-server.ts
  • src/wsl-guest/dispatcher-writer-sink.ts
  • src/wsl-guest/dispatcher-bulk-write-test-harness.ts
  • src/wsl-guest/relay-command-env.ts
  • src/wsl-guest/dispatcher-client-writer.ts
  • src/wsl-guest/dispatcher-producer-transport.ts
  • src/wsl-guest/relay-frame-decoder.ts
  • src/wsl-guest/omp-status-extension.ts
  • src/wsl-guest/dispatcher-writer-drain-arm.ts
  • src/wsl-guest/agent-hook-spool-ingest.ts
  • src/wsl-guest/wsl-install-plugins-handler.ts

🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/ipc/worktrees/removal/worktree-archive-hook.ts
  • src/shared/agent-hook-relay.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

Relay-related source files move from src/relay to src/wsl-guest, and imports across production code, tests, and tooling point to the new location. Build and TypeScript configuration, CI path selection, reliability gates, test timings, and release archive handling are updated for the relocated files. A renamed-file baseline check and a relay import-boundary test are also added.


Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to d5d37

The source move appears mergeable with owner awareness, but the new boundary test may miss escaped imports into the relay tree.

Pre-merge checks | Passed 4 | Inconclusive 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 50 files. (123 skipped… 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 describes the main change: moving WSL guest bundle sources out of src/relay.
Description check Passed The description is detailed and covers the required explanation, scope, rationale, testing, visual proof, review notes, and checklist. It also explains that the remaining unchecked commands will be co…
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: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 50 files. (123 skipped: 8 unsupported, 115 over the file limit.)


✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR



🛠️ Fix failing CI checks 💡
  • 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b52763a4-9bab-4d2b-b2a0-aa05f53e2785
📥 Commits

Reviewing files that changed from the base of the PR and between f307391 and 80f30bf4191e2097dd43edd2fea3924c2505cda1.

📒 Files selected for processing (263)
  • .github/workflows/ssh-hostile-hosts.yml
  • .github/workflows/ssh-windows-hosts.yml
  • config/knip.json
  • config/process-host-direct-import-baseline.txt
  • config/reliability-gates.jsonc
  • config/scripts/build-relay.mjs
  • config/scripts/check-changed-code-quality.mjs
  • config/scripts/check-changed-code-quality.test.mjs
  • config/scripts/ci-shard-timings.json
  • config/scripts/node-server-qualification.mjs
  • config/scripts/pr-code-change-scope.mjs
  • config/scripts/pr-e2e-gate-contract.test.mjs
  • config/scripts/pr-e2e-source-routing.mjs
  • config/scripts/relay-json-payload-benchmark.ts
  • config/scripts/relay-watcher-fault-harness.mjs
  • config/scripts/ssh-localhost-e2e-routing.test.mjs
  • config/scripts/ssh-relay-import-boundary.test.mjs
  • config/tsconfig.node.json
  • config/tsconfig.relay.json
  • docs/audits/ssh-file-metadata-retention/relay-fixture.mjs
  • docs/audits/ssh-file-metadata-retention/scenario.test.mjs
  • src/main/agent-hooks/manual-compact-hook-stream.test.ts
  • src/main/agent-hooks/opencode-plugin-settings.ts
  • src/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.ts
  • src/main/agent-hooks/server-relayed-claude-cancel.test.ts
  • src/main/agent-hooks/server-tmux-wire.test.ts
  • src/main/agent-hooks/wsl-guest-plugin-install.ts
  • src/main/agent-hooks/wsl-hook-relay-deps.ts
  • src/main/agent-hooks/wsl-hook-relay-guest-install.ts
  • src/main/agent-hooks/wsl-hook-relay-manager.test.ts
  • src/main/agent-hooks/wsl-opencode-install-race.test.ts
  • src/main/agent-hooks/wsl-opencode-settings-lifetime.test.ts
  • src/main/agent-hooks/wsl-opencode-settings.test.ts
  • src/main/ai-vault-search/session-search-scope-entry-points.test.ts
  • src/main/ipc/worktrees/removal/worktree-archive-hook.ts
  • src/main/plugins/plugin-host-conformance.test.ts
  • src/main/providers/ssh-review-draft-context.test.ts
  • src/main/ssh/ssh-relay-session-agent-hooks.integration.test.ts
  • src/relay/agent-exec-disposal.test.ts
  • src/relay/agent-exec-handler-test-harness.ts
  • src/relay/agent-exec-handler.ts
  • src/relay/agent-hook-retired-pane-suppression.test.ts
  • src/relay/ai-vault-handler.test.ts
  • src/relay/ai-vault-handler.ts
  • src/relay/external-automations-handler.test.ts
  • src/relay/external-automations-handler.ts
  • src/relay/fs-file-stream-shutdown.test.ts
  • src/relay/fs-handler-file-range-dispatch.test.ts
  • src/relay/fs-handler-file-range.test.ts
  • src/relay/fs-handler-file-read.ts
  • src/relay/fs-handler-git-fallback.ts
  • src/relay/fs-handler-git-search.ts
  • src/relay/fs-handler-list-files-ignored.test.ts
  • src/relay/fs-handler-list-files-result-limit.test.ts
  • src/relay/fs-handler-list-files.ts
  • src/relay/fs-handler-ripgrep-fallback.test.ts
  • src/relay/fs-handler-stream.test.ts
  • src/relay/fs-handler-utils.ts
  • src/relay/fs-handler.test.ts
  • src/relay/fs-handler.ts
  • src/relay/fs-list-files-cancel.integration.test.ts
  • src/relay/fs-list-files-dispatch-test-harness.ts
  • src/relay/fs-list-files-fallback-chain.ts
  • src/relay/fs-list-files-large-response.integration.test.ts
  • src/relay/fs-markdown-document-listing.test.ts
  • src/relay/fs-search-cancellation.test.ts
  • src/relay/fs-stream-pty-echo-backpressure.integration.test.ts
  • src/relay/fs-stream-registry.ts
  • src/relay/git-handler-comparison-operations.ts
  • src/relay/git-handler-exec-operations.ts
  • src/relay/git-handler-fetch-operations.ts
  • src/relay/git-handler-object-diff-operations.ts
  • src/relay/git-handler-operation-context.ts
  • src/relay/git-handler-read-operations.ts
  • src/relay/git-handler-registration.ts
  • src/relay/git-handler-stage-worktree-scope.test.ts
  • src/relay/git-handler-sync-operations.ts
  • src/relay/git-handler-test-setup.ts
  • src/relay/git-handler-worktree-operations.ts
  • src/relay/git-handler.ts
  • src/relay/git-response-pty-echo-backpressure.integration.test.ts
  • src/relay/git-response-stream-ownership.test.ts
  • src/relay/git-response-stream-retention.test.ts
  • src/relay/git-response-stream-shutdown.test.ts
  • src/relay/git-response-stream.ts
  • src/relay/git-stdout-stream.ts
  • src/relay/integration.test.ts
  • src/relay/managed-hook-installer.test.ts
  • src/relay/managed-hook-installer.ts
  • src/relay/omp-fresh-launch-environment.test.ts
  • src/relay/opencode-hook-selection.test.ts
  • src/relay/plugin-host-call-handler.ts
  • src/relay/port-scan-handler.test.ts
  • src/relay/port-scan-handler.ts
  • src/relay/pty-handler-output-drain-differential.test.ts
  • src/relay/pty-handler-output-streaming.test.ts
  • src/relay/pty-handler-owner-inventory-clone-budget.test.ts
  • src/relay/pty-handler-shell-recovery.test.ts
  • src/relay/pty-handler-source-publication.test.ts
  • src/relay/pty-handler-spawn-admission.test.ts
  • src/relay/pty-handler-test-harness.ts
  • src/relay/pty-handler.ts
  • src/relay/relay-agent-hook-runtime.ts
  • src/relay/relay-bundled-ripgrep.ts
  • src/relay/relay-client-resync-marker.ts
  • src/relay/relay-connect-channel.ts
  • src/relay/relay-filesystem-watch-registry.test.ts
  • src/relay/relay-filesystem-watch-registry.ts
  • src/relay/relay-grace-lifecycle.test.ts
  • src/relay/relay-grace-lifecycle.ts
  • src/relay/relay-handshake-roundtrip.test.ts
  • src/relay/relay-handshake.ts
  • src/relay/relay-orca-cli-channel.ts
  • src/relay/relay-oversized-notification-survival.test.ts
  • src/relay/relay-primary-channel.ts
  • src/relay/relay-pty-consumer-owner-displacement.test.ts
  • src/relay/relay-pty-publication-admission.test.ts
  • src/relay/relay-pty-source-activation.ts
  • src/relay/relay-pty-source-cancellation-exit.test.ts
  • src/relay/relay-pty-source-exit-publication.test.ts
  • src/relay/relay-pty-source-exit-publication.ts
  • src/relay/relay-pty-source-output.ts
  • src/relay/relay-pty-source-publication.test.ts
  • src/relay/relay-pty-source-publication.ts
  • src/relay/relay-pty-source-recovery-completion.test.ts
  • src/relay/relay-pty-source-recovery-completion.ts
  • src/relay/relay-pty-source-recovery-interleavings.test.ts
  • src/relay/relay-pty-source-recovery-window.test.ts
  • src/relay/relay-pty-source-restore-retry.test.ts
  • src/relay/relay-pty-source-send-scheduler.test.ts
  • src/relay/relay-pty-source-send-scheduler.ts
  • src/relay/relay-pty-source-superseded-activation.test.ts
  • src/relay/relay-reconnect-listener-credential-gate.test.ts
  • src/relay/relay-reconnect-listener-peer-end.test.ts
  • src/relay/relay-reconnect-listener-peer-write-error.test.ts
  • src/relay/relay-reconnect-listener.ts
  • src/relay/relay-runtime-services.ts
  • src/relay/relay-stream-ack-window.ts
  • src/relay/relay-watch-root-capacity.test.ts
  • src/relay/relay-watcher-event-emitter.test.ts
  • src/relay/relay-watcher-event-emitter.ts
  • src/relay/relay-watcher-frame-chunking.test.ts
  • src/relay/relay-watcher-parent-removal.test.ts
  • src/relay/relay-watcher-pending-setup-waiters.test.ts
  • src/relay/relay-watcher-removal-fence.ts
  • src/relay/relay-watcher-setup-wait.ts
  • src/relay/relay-watcher-shared-byte-index.test.ts
  • src/relay/relay-watcher-shutdown.test.ts
  • src/relay/relay-watcher-terminal-notifier.ts
  • src/relay/relay-windows-path-ripgrep.test.ts
  • src/relay/remote-artifact-cli-forwarding.ts
  • src/relay/remote-artifact-cli-input.test.ts
  • src/relay/remote-artifact-cli-input.ts
  • src/relay/session-search-transport.test.ts
  • src/relay/skill-install-handler.test.ts
  • src/relay/skill-install-handler.ts
  • src/relay/ssh-pty-consumer-session-adapter.test.ts
  • src/relay/ssh-pty-consumer-session-adapter.ts
  • src/relay/ssh-pty-open-client-request.ts
  • src/relay/subprocess-test-utils.ts
  • src/relay/windows-port-scan.test.ts
  • src/relay/windows-port-scan.ts
  • src/relay/workspace-session-handler.test.ts
  • src/relay/workspace-session-handler.ts
  • src/relay/workspace-snapshot-publication.test.ts
  • src/relay/workspace-snapshot-publication.ts
  • src/relay/workspace-space-scan-du-capacity.test.ts
  • src/relay/workspace-space-scan.test.ts
  • src/relay/workspace-space-scan.ts
  • src/shared/agent-hook-relay.ts
  • src/wsl-guest/agent-hook-cached-pane-status.ts
  • src/wsl-guest/agent-hook-canonical-status.test.ts
  • src/wsl-guest/agent-hook-canonical-status.ts
  • src/wsl-guest/agent-hook-endpoint-coordinates.ts
  • src/wsl-guest/agent-hook-envelope-build.ts
  • src/wsl-guest/agent-hook-envelope-publication.test.ts
  • src/wsl-guest/agent-hook-envelope-publication.ts
  • src/wsl-guest/agent-hook-event-admission.ts
  • src/wsl-guest/agent-hook-integration.test.ts
  • src/wsl-guest/agent-hook-interrupt-reconciliation.test.ts
  • src/wsl-guest/agent-hook-interrupt-reconciliation.ts
  • src/wsl-guest/agent-hook-opencode-tui-identity.test.ts
  • src/wsl-guest/agent-hook-request.ts
  • src/wsl-guest/agent-hook-result-retry-scheduler.ts
  • src/wsl-guest/agent-hook-server-claude-owed-notification-expiry.test.ts
  • src/wsl-guest/agent-hook-server-codex-subagent-transcript.test.ts
  • src/wsl-guest/agent-hook-server-codex-turn-interruption.test.ts
  • src/wsl-guest/agent-hook-server-contract.ts
  • src/wsl-guest/agent-hook-server.test.ts
  • src/wsl-guest/agent-hook-server.ts
  • src/wsl-guest/agent-hook-spool-ingest.ts
  • src/wsl-guest/claude-terminal-interrupt-status.ts
  • src/wsl-guest/client-request-aborts.ts
  • src/wsl-guest/dispatcher-bulk-admission.test.ts
  • src/wsl-guest/dispatcher-bulk-failed-admission.test.ts
  • src/wsl-guest/dispatcher-bulk-retirement-admission.test.ts
  • src/wsl-guest/dispatcher-bulk-write-test-harness.ts
  • src/wsl-guest/dispatcher-capacity-degradation.test.ts
  • src/wsl-guest/dispatcher-capacity-signals.ts
  • src/wsl-guest/dispatcher-client-close-cause.test.ts
  • src/wsl-guest/dispatcher-client-lifecycle.ts
  • src/wsl-guest/dispatcher-client-state.ts
  • src/wsl-guest/dispatcher-client-writer.test.ts
  • src/wsl-guest/dispatcher-client-writer.ts
  • src/wsl-guest/dispatcher-contract.ts
  • src/wsl-guest/dispatcher-frame-codec.ts
  • src/wsl-guest/dispatcher-frame-guard-regressions.test.ts
  • src/wsl-guest/dispatcher-json-payload.test.ts
  • src/wsl-guest/dispatcher-notification-ownership.test.ts
  • src/wsl-guest/dispatcher-notification-publication.ts
  • src/wsl-guest/dispatcher-per-connection-state-baseline.test.ts
  • src/wsl-guest/dispatcher-producer-capacity.ts
  • src/wsl-guest/dispatcher-producer-transport.ts
  • src/wsl-guest/dispatcher-pty-publication.ts
  • src/wsl-guest/dispatcher-rpc-cancel-id-coercion.test.ts
  • src/wsl-guest/dispatcher-rpc-routing.ts
  • src/wsl-guest/dispatcher-silent-client-reaper.test.ts
  • src/wsl-guest/dispatcher-structured-error.test.ts
  • src/wsl-guest/dispatcher-timeout.test.ts
  • src/wsl-guest/dispatcher-writer-admission.test.ts
  • src/wsl-guest/dispatcher-writer-admission.ts
  • src/wsl-guest/dispatcher-writer-drain-arm.ts
  • src/wsl-guest/dispatcher-writer-lane-scheduler.ts
  • src/wsl-guest/dispatcher-writer-sink.ts
  • src/wsl-guest/dispatcher.test.ts
  • src/wsl-guest/dispatcher.ts
  • src/wsl-guest/filesystem-capacity-error-wire.test.ts
  • src/wsl-guest/legacy-relay-publication-ledger.test.ts
  • src/wsl-guest/legacy-relay-publication-ledger.ts
  • src/wsl-guest/omp-config-root.test.ts
  • src/wsl-guest/omp-status-extension.ts
  • src/wsl-guest/opencode-canonical-config.ts
  • src/wsl-guest/opencode-overlay-mirror.ts
  • src/wsl-guest/opencode-startup-prompt-install.test.ts
  • src/wsl-guest/plugin-overlay-env.test.ts
  • src/wsl-guest/plugin-overlay-env.ts
  • src/wsl-guest/plugin-overlay.test.ts
  • src/wsl-guest/plugin-overlay.ts
  • src/wsl-guest/plugin-source-limit.test.ts
  • src/wsl-guest/plugin-source-limit.ts
  • src/wsl-guest/preflight-handler.test.ts
  • src/wsl-guest/preflight-handler.ts
  • src/wsl-guest/protocol-backpressure.test.ts
  • src/wsl-guest/protocol-handshake.test.ts
  • src/wsl-guest/protocol-json-payload.test.ts
  • src/wsl-guest/protocol.ts
  • src/wsl-guest/relay-agent-presence.test.ts
  • src/wsl-guest/relay-agent-presence.ts
  • src/wsl-guest/relay-command-env.test.ts
  • src/wsl-guest/relay-command-env.ts
  • src/wsl-guest/relay-frame-decoder.ts
  • src/wsl-guest/relay-hot-path-operation-counts.test.ts
  • src/wsl-guest/relay-tmux-hook-owner.ts
  • src/wsl-guest/wsl-agent-hook-relay.test.ts
  • src/wsl-guest/wsl-agent-hook-relay.ts
  • src/wsl-guest/wsl-browser-network-relay.ts
  • src/wsl-guest/wsl-hook-fs-bridge.test.ts
  • src/wsl-guest/wsl-hook-fs-bridge.ts
  • src/wsl-guest/wsl-install-plugins-handler.test.ts
  • src/wsl-guest/wsl-install-plugins-handler.ts
  • tests/e2e/cross-version-wire/release-checkout-tree.ts
  • tests/e2e/cross-version-wire/release-checkout-tree.unit.test.ts
  • tests/tools/omp-config-root-relay-shell.test.mjs

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

Comment on lines +42 to +68
function importsRelay(file, contents) {
return collectModuleSpecifiers(file, contents).some((specifier) => {
if (!specifier.startsWith('.')) {
return false
}
const target = path.posix.normalize(path.posix.join(path.posix.dirname(file), specifier))
return target === RELAY_SOURCE || target.startsWith(`${RELAY_SOURCE}/`)
})
}

it('keeps everything outside the SSH relay from importing it', () => {
const importers = globSync(
['src', 'config', 'tests', 'mobile/src', 'mobile/app', 'mobile/scripts'].map(
(directory) => `${directory}/**/*.{ts,tsx,mts,cts,js,mjs,cjs}`
),
{
cwd: ROOT,
exclude: [`${RELAY_SOURCE}/**`, '**/node_modules/**', '**/dist/**', '**/out/**']
}
)
.map((file) => file.replaceAll('\\', '/'))
.filter((file) => importsRelay(file, readFileSync(path.join(ROOT, file), 'utf8')))
.sort()

expect(importers.filter((file) => !isTestOnlySourcePath(file))).toEqual([])
expect(importers).toEqual(RELAY_TEST_IMPORTERS)
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '1,110p' config/scripts/ssh-relay-import-boundary.test.mjs
rg -n 'alias|paths|src/relay/' config/tsconfig.node.json config/tsconfig.relay.json config/scripts/ssh-relay-import-boundary.test.mjs

Repository: stablyai/orca

Length of output: 3658


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- scanner ---'
sed -n '1,240p' config/scripts/static-module-specifiers.mjs
printf '%s\n' '--- config files ---'
rg --files -g 'tsconfig*.json' -g 'jsconfig*.json' -g 'package.json' -g 'vite.config.*' -g 'vitest.config.*' -g 'webpack.config.*' -g 'babel.config.*' -g 'esbuild.*' | sort
printf '%s\n' '--- resolution declarations ---'
python3 - <<'PY'
from pathlib import Path
roots = [Path('config'), Path('src'), Path('tests'), Path('mobile')]
names = {'package.json','tsconfig.json','tsconfig.node.json','tsconfig.relay.json','jsconfig.json'}
for p in [x for root in roots for x in root.rglob('*') if x.is_file() and (x.name in names or 'config' in x.name.lower())]:
    try: text = p.read_text()
    except Exception: continue
    for i,line in enumerate(text.splitlines(),1):
        low=line.lower()
        if any(k in low for k in ('baseurl','paths','alias','importmap','imports','exports')) or 'src/relay' in line:
            print(f'{p}:{i}:{line}')
PY
printf '%s\n' '--- references outside src/relay ---'
rg -n --glob '!src/relay/**' --glob '!node_modules/**' --glob '!dist/**' --glob '!out/**' 'src/relay|import[[:space:]]*\(|require[[:space:]]*\(' src config tests mobile 2>/dev/null | sed -n '1,360p'
printf '%s\n' '--- boundary test history/diff ---'
git diff f307391637b53a0e05fe357f4942ac2718ada767 80f30bf4191e2097dd43edd2fea3924c2505cda1 -- config/scripts/ssh-relay-import-boundary.test.mjs

Repository: stablyai/orca

Length of output: 42164


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- scanner ---'
sed -n '1,240p' config/scripts/static-module-specifiers.mjs
printf '%s\n' '--- config files ---'
rg --files -g 'tsconfig*.json' -g 'jsconfig*.json' -g 'package.json' -g 'vite.config.*' -g 'vitest.config.*' -g 'webpack.config.*' -g 'babel.config.*' -g 'esbuild.*' | sort
printf '%s\n' '--- resolution declarations ---'
python3 - <<'PY'
from pathlib import Path
roots = [Path('config'), Path('src'), Path('tests'), Path('mobile')]
names = {'package.json','tsconfig.json','tsconfig.node.json','tsconfig.relay.json','jsconfig.json'}
for root in roots:
    for p in root.rglob('*'):
        if not p.is_file() or (p.name not in names and 'config' not in p.name.lower()):
            continue
        try:
            text = p.read_text()
        except Exception:
            continue
        for i, line in enumerate(text.splitlines(), 1):
            low = line.lower()
            if any(k in low for k in ('baseurl','paths','alias','importmap','imports','exports')) or 'src/relay' in line:
                print(f'{p}:{i}:{line}')
PY
printf '%s\n' '--- references outside src/relay ---'
rg -n --glob '!src/relay/**' --glob '!node_modules/**' --glob '!dist/**' --glob '!out/**' 'src/relay|import[[:space:]]*\(|require[[:space:]]*\(' src config tests mobile 2>/dev/null | sed -n '1,360p'
printf '%s\n' '--- boundary test diff ---'
git diff f307391637b53a0e05fe357f4942ac2718ada767 80f30bf4191e2097dd43edd2fea3924c2505cda1 -- config/scripts/ssh-relay-import-boundary.test.mjs

Repository: stablyai/orca

Length of output: 41517


🏁 Script executed:

sed -n '1,240p' config/scripts/static-module-specifiers.mjs
printf '%s\n' '--- config files ---'
rg --files -g 'tsconfig*.json' -g 'jsconfig*.json' -g 'package.json' -g 'vite.config.*' -g 'vitest.config.*' -g 'webpack.config.*' -g 'babel.config.*' -g 'esbuild.*' | sort
printf '%s\n' '--- resolution and relay references ---'
rg -n --glob '!node_modules/**' --glob '!dist/**' --glob '!out/**' 'baseUrl|paths|alias|importMap|imports|exports|src/relay|import[[:space:]]*\\(|require[[:space:]]*\\(' config package.json src tests mobile 2>/dev/null | sed -n '1,420p'
printf '%s\n' '--- boundary test diff ---'
git diff f307391637b53a0e05fe357f4942ac2718ada767 80f30bf4191e2097dd43edd2fea3924c2505cda1 -- config/scripts/ssh-relay-import-boundary.test.mjs

Repository: stablyai/orca

Length of output: 14183


🏁 Script executed:

set -o pipefail
sed -n '1,240p' config/scripts/static-module-specifiers.mjs
printf '%s\n' '--- config files ---'
rg --files -g 'tsconfig*.json' -g 'jsconfig*.json' -g 'package.json' -g 'vite.config.*' -g 'vitest.config.*' -g 'webpack.config.*' -g 'babel.config.*' -g 'esbuild.*' | sort
printf '%s\n' '--- resolution and relay references ---'
rg -n --glob '!node_modules/**' --glob '!dist/**' --glob '!out/**' 'baseUrl|paths|alias|importMap|imports|exports|src/relay|import[[:space:]]*\(|require[[:space:]]*\(' config package.json src tests mobile 2>/dev/null | sed -n '1,420p'
printf '%s\n' '--- boundary test diff ---'
git diff f307391637b53a0e05fe357f4942ac2718ada767 80f30bf4191e2097dd43edd2fea3924c2505cda1 -- config/scripts/ssh-relay-import-boundary.test.mjs

Repository: stablyai/orca

Length of output: 45667


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- scanner remainder ---'
sed -n '220,380p' config/scripts/static-module-specifiers.mjs
printf '%s\n' '--- test-only classifier ---'
sed -n '1,220p' config/scripts/test-only-source-path.mjs
printf '%s\n' '--- relay benchmark ---'
sed -n '1,150p' config/scripts/pty-source-ack-boundary-benchmark.mjs
printf '%s\n' '--- benchmark references ---'
rg -n -F --glob '!node_modules/**' --glob '!dist/**' --glob '!out/**' 'pty-source-ack-boundary-benchmark' package.json config src tests mobile
rg -n -F --glob '!node_modules/**' --glob '!dist/**' --glob '!out/**' 'pty-source-sent-boundaries' package.json config src tests mobile
rg -n -F --glob '!node_modules/**' --glob '!dist/**' --glob '!out/**' 'jiti.import' package.json config src tests mobile
printf '%s\n' '--- alias/path definitions ---'
sed -n '1,100p' config/tsconfig.web.json
sed -n '1,90p' config/tsconfig.e2e.json
sed -n '1,100p' config/vitest.config.ts
sed -n '1,130p' config/scripts/workspace-source-exports.mjs
sed -n '1,80p' tsconfig.json

Repository: stablyai/orca

Length of output: 18488


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- package scripts and benchmark conventions ---'
python3 - <<'PY'
import json
from pathlib import Path
p = Path('package.json')
data = json.loads(p.read_text())
for key, value in data.get('scripts', {}).items():
    if 'benchmark' in key.lower() or 'pty-source' in value or 'relay' in value.lower():
        print(f'{key}: {value}')
PY
rg -n -i --glob '!node_modules/**' --glob '!dist/**' --glob '!out/**' 'config/scripts/[^[:space:]`"\x27]*benchmark|node .*benchmark|benchmark scripts|benchmarks' README.md docs .github package.json config 2>/dev/null | sed -n '1,220p'
printf '%s\n' '--- benchmark file mode and tracked status ---'
git ls-files --stage -- config/scripts/pty-source-ack-boundary-benchmark.mjs
git status --short --untracked-files=no

Repository: stablyai/orca

Length of output: 4367


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- package scripts and benchmark conventions ---'
python3 - <<'PY'
import json
from pathlib import Path
data = json.loads(Path('package.json').read_text())
for key, value in data.get('scripts', {}).items():
    if 'benchmark' in key.lower() or 'pty-source' in value or 'relay' in value.lower():
        print(f'{key}: {value}')
PY
rg -n -i --glob '!node_modules/**' --glob '!dist/**' --glob '!out/**' 'benchmark scripts|benchmarks|pty-source-ack-boundary-benchmark' README.md docs .github package.json config 2>/dev/null | sed -n '1,220p'
printf '%s\n' '--- benchmark file mode and tracked status ---'
git ls-files --stage -- config/scripts/pty-source-ack-boundary-benchmark.mjs
git status --short --untracked-files=no

Repository: stablyai/orca

Length of output: 2760


Cover jiti.import in the relay boundary scan.

config/scripts/pty-source-ack-boundary-benchmark.mjs is a non-test Node script that loads src/relay through jiti.import. collectModuleSpecifiers does not collect this loader call, so the boundary test can miss this prohibited importer. Extend the scanner for the repository's createJiti(...).import(...) form, then remove or relocate the benchmark dependency so the boundary passes.

Suggested fix
diff --git a/config/scripts/static-module-specifiers.mjs b/config/scripts/static-module-specifiers.mjs
@@
   const processes = new Set(['process'])
   const builtinLoaders = new Set()
+  const jitiFactories = new Set()
+  const jitiInstances = new Set()
@@
     for (const element of named && ts.isNamedImports(named) ? named.elements : []) {
       const imported = (element.propertyName ?? element.name).text
+      if (module === 'jiti' && imported === 'createJiti') {
+        jitiFactories.add(element.name.text)
+      }
@@
   function isLoader(node) {
@@
   }
+  function isJitiInstance(node) {
+    node = unwrap(node)
+    return ts.isIdentifier(node) && jitiInstances.has(node.text)
+  }
@@
       bind(processes, name, isProcess(initializer))
       bind(builtinLoaders, name, isBuiltinLoader(initializer))
+      bind(
+        jitiInstances,
+        name,
+        ts.isCallExpression(initializer) &&
+          ts.isIdentifier(initializer.expression) &&
+          jitiFactories.has(initializer.expression.text)
+      )
@@
         callee.kind === ts.SyntaxKind.ImportKeyword ||
         isLoader(callee) ||
         isBuiltinLoader(callee) ||
+        (propertyName(callee) === 'import' && isJitiInstance(callee.expression)) ||
         (propertyName(callee) === 'resolve' && isLoader(callee.expression))

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a4e12b36-115d-404d-ab1f-66171315adae
📥 Commits

Reviewing files that changed from the base of the PR and between 80f30bf4191e2097dd43edd2fea3924c2505cda1 and 49960ca7e679c49676e824be409918c4634977ad.

📒 Files selected for processing (1)
  • config/scripts/ssh-relay-import-boundary.test.mjs

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

Comment on lines +44 to +45
if (!contents.includes('relay')) {
return false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 10 'function literalString|const literalString|literalString\s*=' \
  config/scripts/static-module-specifiers.mjs
rg -n -C 8 'importsRelay|relay' \
  config/scripts/ssh-relay-import-boundary.test.mjs

Repository: stablyai/orca

Length of output: 4061


🏁 Script executed:

set -euo pipefail
printf '%s\n' '--- collector references and declaration ---'
rg -n -C 12 'collectModuleSpecifiers|literalString\(' config/scripts/static-module-specifiers.mjs config/scripts --glob '*.{mjs,js,ts,mts,cts}' || test "$?" -eq 1
printf '%s\n' '--- relevant tests and TypeScript version declarations ---'
rg -n -C 8 'static-module-specifiers|collectModuleSpecifiers|\\\\u0061|escaped|StringLiteral' config package.json pnpm-lock.yaml --glob '*.{mjs,js,ts,mts,cts,json,yaml,yml}' || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 41592


🏁 Script executed:

set -euo pipefail
printf '%s\n' '--- collector escape-decoding tests ---'
rg -n -C 12 -F -- 'node:child_process' config --glob '*.{mjs,js,ts,mts,cts}'
printf '%s\n' '--- boundary test ---'
nl -ba config/scripts/ssh-relay-import-boundary.test.mjs | sed -n '40,75p'
printf '%s\n' '--- relevant collector implementation ---'
nl -ba config/scripts/static-module-specifiers.mjs | sed -n '70,80p;110,130p'

Repository: stablyai/orca

Length of output: 45661


🏁 Script executed:

set -euo pipefail
printf '%s\n' '--- collector escape-decoding tests ---'
rg -n -C 10 --glob 'static-module-specifiers*' -F -- 'node:child_process' config/scripts
printf '%s\n' '--- boundary test ---'
nl -ba config/scripts/ssh-relay-import-boundary.test.mjs | sed -n '40,75p'
printf '%s\n' '--- relevant collector implementation ---'
nl -ba config/scripts/static-module-specifiers.mjs | sed -n '70,80p;110,130p'

Repository: stablyai/orca

Length of output: 15296


Preserve escaped relay paths in the boundary scan.

collectModuleSpecifiers uses decoded string-literal values, but importsRelay checks only the raw source text first. An import such as import '../rel\u0061y/handler.js' can therefore bypass the boundary check.

Add an escaped-specifier regression case and update the prefilter to recognize escaped relay text.

@OrcaWin
OrcaWin force-pushed the OrcaWin/relay-helper-relocation branch 2 times, most recently from 76ed3b9 to 95d0444 Compare October 10, 2026 08:40
m4air added 4 commits October 10, 2026 02:13
The WSL hook relay and WSL browser network relay are built from src/relay but are
not part of the SSH relay. Move them, and the 46 relay modules the hook relay
bundles, to src/wsl-guest so the SSH relay can be deleted on its own. Pure
renames; the built bundles are byte-identical.

Adds a boundary test so nothing outside src/relay imports it except relay tests.
@OrcaWin
OrcaWin force-pushed the OrcaWin/relay-helper-relocation branch from 95d0444 to d5d373e Compare October 10, 2026 09:14
@OrcaWin
OrcaWin merged commit 31b2b17 into main Oct 10, 2026
94 of 96 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