Repository navigation
refactor(wsl): move the WSL guest bundle sources out of src/relay - #27174
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🔵 Low · up to The source move appears mergeable with owner awareness, but the new boundary test may miss escaped imports into the relay tree. Pre-merge checks |
|
There was a problem hiding this comment.
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.ymlconfig/knip.jsonconfig/process-host-direct-import-baseline.txtconfig/reliability-gates.jsoncconfig/scripts/build-relay.mjsconfig/scripts/check-changed-code-quality.mjsconfig/scripts/check-changed-code-quality.test.mjsconfig/scripts/ci-shard-timings.jsonconfig/scripts/node-server-qualification.mjsconfig/scripts/pr-code-change-scope.mjsconfig/scripts/pr-e2e-gate-contract.test.mjsconfig/scripts/pr-e2e-source-routing.mjsconfig/scripts/relay-json-payload-benchmark.tsconfig/scripts/relay-watcher-fault-harness.mjsconfig/scripts/ssh-localhost-e2e-routing.test.mjsconfig/scripts/ssh-relay-import-boundary.test.mjsconfig/tsconfig.node.jsonconfig/tsconfig.relay.jsondocs/audits/ssh-file-metadata-retention/relay-fixture.mjsdocs/audits/ssh-file-metadata-retention/scenario.test.mjssrc/main/agent-hooks/manual-compact-hook-stream.test.tssrc/main/agent-hooks/opencode-plugin-settings.tssrc/main/agent-hooks/server-claude-task-wakeup-lifecycle.test.tssrc/main/agent-hooks/server-relayed-claude-cancel.test.tssrc/main/agent-hooks/server-tmux-wire.test.tssrc/main/agent-hooks/wsl-guest-plugin-install.tssrc/main/agent-hooks/wsl-hook-relay-deps.tssrc/main/agent-hooks/wsl-hook-relay-guest-install.tssrc/main/agent-hooks/wsl-hook-relay-manager.test.tssrc/main/agent-hooks/wsl-opencode-install-race.test.tssrc/main/agent-hooks/wsl-opencode-settings-lifetime.test.tssrc/main/agent-hooks/wsl-opencode-settings.test.tssrc/main/ai-vault-search/session-search-scope-entry-points.test.tssrc/main/ipc/worktrees/removal/worktree-archive-hook.tssrc/main/plugins/plugin-host-conformance.test.tssrc/main/providers/ssh-review-draft-context.test.tssrc/main/ssh/ssh-relay-session-agent-hooks.integration.test.tssrc/relay/agent-exec-disposal.test.tssrc/relay/agent-exec-handler-test-harness.tssrc/relay/agent-exec-handler.tssrc/relay/agent-hook-retired-pane-suppression.test.tssrc/relay/ai-vault-handler.test.tssrc/relay/ai-vault-handler.tssrc/relay/external-automations-handler.test.tssrc/relay/external-automations-handler.tssrc/relay/fs-file-stream-shutdown.test.tssrc/relay/fs-handler-file-range-dispatch.test.tssrc/relay/fs-handler-file-range.test.tssrc/relay/fs-handler-file-read.tssrc/relay/fs-handler-git-fallback.tssrc/relay/fs-handler-git-search.tssrc/relay/fs-handler-list-files-ignored.test.tssrc/relay/fs-handler-list-files-result-limit.test.tssrc/relay/fs-handler-list-files.tssrc/relay/fs-handler-ripgrep-fallback.test.tssrc/relay/fs-handler-stream.test.tssrc/relay/fs-handler-utils.tssrc/relay/fs-handler.test.tssrc/relay/fs-handler.tssrc/relay/fs-list-files-cancel.integration.test.tssrc/relay/fs-list-files-dispatch-test-harness.tssrc/relay/fs-list-files-fallback-chain.tssrc/relay/fs-list-files-large-response.integration.test.tssrc/relay/fs-markdown-document-listing.test.tssrc/relay/fs-search-cancellation.test.tssrc/relay/fs-stream-pty-echo-backpressure.integration.test.tssrc/relay/fs-stream-registry.tssrc/relay/git-handler-comparison-operations.tssrc/relay/git-handler-exec-operations.tssrc/relay/git-handler-fetch-operations.tssrc/relay/git-handler-object-diff-operations.tssrc/relay/git-handler-operation-context.tssrc/relay/git-handler-read-operations.tssrc/relay/git-handler-registration.tssrc/relay/git-handler-stage-worktree-scope.test.tssrc/relay/git-handler-sync-operations.tssrc/relay/git-handler-test-setup.tssrc/relay/git-handler-worktree-operations.tssrc/relay/git-handler.tssrc/relay/git-response-pty-echo-backpressure.integration.test.tssrc/relay/git-response-stream-ownership.test.tssrc/relay/git-response-stream-retention.test.tssrc/relay/git-response-stream-shutdown.test.tssrc/relay/git-response-stream.tssrc/relay/git-stdout-stream.tssrc/relay/integration.test.tssrc/relay/managed-hook-installer.test.tssrc/relay/managed-hook-installer.tssrc/relay/omp-fresh-launch-environment.test.tssrc/relay/opencode-hook-selection.test.tssrc/relay/plugin-host-call-handler.tssrc/relay/port-scan-handler.test.tssrc/relay/port-scan-handler.tssrc/relay/pty-handler-output-drain-differential.test.tssrc/relay/pty-handler-output-streaming.test.tssrc/relay/pty-handler-owner-inventory-clone-budget.test.tssrc/relay/pty-handler-shell-recovery.test.tssrc/relay/pty-handler-source-publication.test.tssrc/relay/pty-handler-spawn-admission.test.tssrc/relay/pty-handler-test-harness.tssrc/relay/pty-handler.tssrc/relay/relay-agent-hook-runtime.tssrc/relay/relay-bundled-ripgrep.tssrc/relay/relay-client-resync-marker.tssrc/relay/relay-connect-channel.tssrc/relay/relay-filesystem-watch-registry.test.tssrc/relay/relay-filesystem-watch-registry.tssrc/relay/relay-grace-lifecycle.test.tssrc/relay/relay-grace-lifecycle.tssrc/relay/relay-handshake-roundtrip.test.tssrc/relay/relay-handshake.tssrc/relay/relay-orca-cli-channel.tssrc/relay/relay-oversized-notification-survival.test.tssrc/relay/relay-primary-channel.tssrc/relay/relay-pty-consumer-owner-displacement.test.tssrc/relay/relay-pty-publication-admission.test.tssrc/relay/relay-pty-source-activation.tssrc/relay/relay-pty-source-cancellation-exit.test.tssrc/relay/relay-pty-source-exit-publication.test.tssrc/relay/relay-pty-source-exit-publication.tssrc/relay/relay-pty-source-output.tssrc/relay/relay-pty-source-publication.test.tssrc/relay/relay-pty-source-publication.tssrc/relay/relay-pty-source-recovery-completion.test.tssrc/relay/relay-pty-source-recovery-completion.tssrc/relay/relay-pty-source-recovery-interleavings.test.tssrc/relay/relay-pty-source-recovery-window.test.tssrc/relay/relay-pty-source-restore-retry.test.tssrc/relay/relay-pty-source-send-scheduler.test.tssrc/relay/relay-pty-source-send-scheduler.tssrc/relay/relay-pty-source-superseded-activation.test.tssrc/relay/relay-reconnect-listener-credential-gate.test.tssrc/relay/relay-reconnect-listener-peer-end.test.tssrc/relay/relay-reconnect-listener-peer-write-error.test.tssrc/relay/relay-reconnect-listener.tssrc/relay/relay-runtime-services.tssrc/relay/relay-stream-ack-window.tssrc/relay/relay-watch-root-capacity.test.tssrc/relay/relay-watcher-event-emitter.test.tssrc/relay/relay-watcher-event-emitter.tssrc/relay/relay-watcher-frame-chunking.test.tssrc/relay/relay-watcher-parent-removal.test.tssrc/relay/relay-watcher-pending-setup-waiters.test.tssrc/relay/relay-watcher-removal-fence.tssrc/relay/relay-watcher-setup-wait.tssrc/relay/relay-watcher-shared-byte-index.test.tssrc/relay/relay-watcher-shutdown.test.tssrc/relay/relay-watcher-terminal-notifier.tssrc/relay/relay-windows-path-ripgrep.test.tssrc/relay/remote-artifact-cli-forwarding.tssrc/relay/remote-artifact-cli-input.test.tssrc/relay/remote-artifact-cli-input.tssrc/relay/session-search-transport.test.tssrc/relay/skill-install-handler.test.tssrc/relay/skill-install-handler.tssrc/relay/ssh-pty-consumer-session-adapter.test.tssrc/relay/ssh-pty-consumer-session-adapter.tssrc/relay/ssh-pty-open-client-request.tssrc/relay/subprocess-test-utils.tssrc/relay/windows-port-scan.test.tssrc/relay/windows-port-scan.tssrc/relay/workspace-session-handler.test.tssrc/relay/workspace-session-handler.tssrc/relay/workspace-snapshot-publication.test.tssrc/relay/workspace-snapshot-publication.tssrc/relay/workspace-space-scan-du-capacity.test.tssrc/relay/workspace-space-scan.test.tssrc/relay/workspace-space-scan.tssrc/shared/agent-hook-relay.tssrc/wsl-guest/agent-hook-cached-pane-status.tssrc/wsl-guest/agent-hook-canonical-status.test.tssrc/wsl-guest/agent-hook-canonical-status.tssrc/wsl-guest/agent-hook-endpoint-coordinates.tssrc/wsl-guest/agent-hook-envelope-build.tssrc/wsl-guest/agent-hook-envelope-publication.test.tssrc/wsl-guest/agent-hook-envelope-publication.tssrc/wsl-guest/agent-hook-event-admission.tssrc/wsl-guest/agent-hook-integration.test.tssrc/wsl-guest/agent-hook-interrupt-reconciliation.test.tssrc/wsl-guest/agent-hook-interrupt-reconciliation.tssrc/wsl-guest/agent-hook-opencode-tui-identity.test.tssrc/wsl-guest/agent-hook-request.tssrc/wsl-guest/agent-hook-result-retry-scheduler.tssrc/wsl-guest/agent-hook-server-claude-owed-notification-expiry.test.tssrc/wsl-guest/agent-hook-server-codex-subagent-transcript.test.tssrc/wsl-guest/agent-hook-server-codex-turn-interruption.test.tssrc/wsl-guest/agent-hook-server-contract.tssrc/wsl-guest/agent-hook-server.test.tssrc/wsl-guest/agent-hook-server.tssrc/wsl-guest/agent-hook-spool-ingest.tssrc/wsl-guest/claude-terminal-interrupt-status.tssrc/wsl-guest/client-request-aborts.tssrc/wsl-guest/dispatcher-bulk-admission.test.tssrc/wsl-guest/dispatcher-bulk-failed-admission.test.tssrc/wsl-guest/dispatcher-bulk-retirement-admission.test.tssrc/wsl-guest/dispatcher-bulk-write-test-harness.tssrc/wsl-guest/dispatcher-capacity-degradation.test.tssrc/wsl-guest/dispatcher-capacity-signals.tssrc/wsl-guest/dispatcher-client-close-cause.test.tssrc/wsl-guest/dispatcher-client-lifecycle.tssrc/wsl-guest/dispatcher-client-state.tssrc/wsl-guest/dispatcher-client-writer.test.tssrc/wsl-guest/dispatcher-client-writer.tssrc/wsl-guest/dispatcher-contract.tssrc/wsl-guest/dispatcher-frame-codec.tssrc/wsl-guest/dispatcher-frame-guard-regressions.test.tssrc/wsl-guest/dispatcher-json-payload.test.tssrc/wsl-guest/dispatcher-notification-ownership.test.tssrc/wsl-guest/dispatcher-notification-publication.tssrc/wsl-guest/dispatcher-per-connection-state-baseline.test.tssrc/wsl-guest/dispatcher-producer-capacity.tssrc/wsl-guest/dispatcher-producer-transport.tssrc/wsl-guest/dispatcher-pty-publication.tssrc/wsl-guest/dispatcher-rpc-cancel-id-coercion.test.tssrc/wsl-guest/dispatcher-rpc-routing.tssrc/wsl-guest/dispatcher-silent-client-reaper.test.tssrc/wsl-guest/dispatcher-structured-error.test.tssrc/wsl-guest/dispatcher-timeout.test.tssrc/wsl-guest/dispatcher-writer-admission.test.tssrc/wsl-guest/dispatcher-writer-admission.tssrc/wsl-guest/dispatcher-writer-drain-arm.tssrc/wsl-guest/dispatcher-writer-lane-scheduler.tssrc/wsl-guest/dispatcher-writer-sink.tssrc/wsl-guest/dispatcher.test.tssrc/wsl-guest/dispatcher.tssrc/wsl-guest/filesystem-capacity-error-wire.test.tssrc/wsl-guest/legacy-relay-publication-ledger.test.tssrc/wsl-guest/legacy-relay-publication-ledger.tssrc/wsl-guest/omp-config-root.test.tssrc/wsl-guest/omp-status-extension.tssrc/wsl-guest/opencode-canonical-config.tssrc/wsl-guest/opencode-overlay-mirror.tssrc/wsl-guest/opencode-startup-prompt-install.test.tssrc/wsl-guest/plugin-overlay-env.test.tssrc/wsl-guest/plugin-overlay-env.tssrc/wsl-guest/plugin-overlay.test.tssrc/wsl-guest/plugin-overlay.tssrc/wsl-guest/plugin-source-limit.test.tssrc/wsl-guest/plugin-source-limit.tssrc/wsl-guest/preflight-handler.test.tssrc/wsl-guest/preflight-handler.tssrc/wsl-guest/protocol-backpressure.test.tssrc/wsl-guest/protocol-handshake.test.tssrc/wsl-guest/protocol-json-payload.test.tssrc/wsl-guest/protocol.tssrc/wsl-guest/relay-agent-presence.test.tssrc/wsl-guest/relay-agent-presence.tssrc/wsl-guest/relay-command-env.test.tssrc/wsl-guest/relay-command-env.tssrc/wsl-guest/relay-frame-decoder.tssrc/wsl-guest/relay-hot-path-operation-counts.test.tssrc/wsl-guest/relay-tmux-hook-owner.tssrc/wsl-guest/wsl-agent-hook-relay.test.tssrc/wsl-guest/wsl-agent-hook-relay.tssrc/wsl-guest/wsl-browser-network-relay.tssrc/wsl-guest/wsl-hook-fs-bridge.test.tssrc/wsl-guest/wsl-hook-fs-bridge.tssrc/wsl-guest/wsl-install-plugins-handler.test.tssrc/wsl-guest/wsl-install-plugins-handler.tstests/e2e/cross-version-wire/release-checkout-tree.tstests/e2e/cross-version-wire/release-checkout-tree.unit.test.tstests/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.
| 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) | ||
| }) |
There was a problem hiding this comment.
🎯 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.mjsRepository: 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.mjsRepository: 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.mjsRepository: 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.mjsRepository: 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.mjsRepository: 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.jsonRepository: 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=noRepository: 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=noRepository: 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))There was a problem hiding this comment.
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.
| if (!contents.includes('relay')) { | ||
| return false |
There was a problem hiding this comment.
🎯 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.mjsRepository: 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 1Repository: 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.
76ed3b9 to
95d0444
Compare
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.
95d0444 to
d5d373e
Compare
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
src/relayheld 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.src/wsl-guest/folder. Every importer, including the SSH relay itself, now imports fromsrc/wsl-guest/directly. No re-export shims or barrel files were added.git mv. The moved files' contents are unchanged, becausesrc/wsl-guestsits at the same depth assrc/relay. The built WSL hook relay, WSL browser network relay, relay, and relay AI vault service bundles are byte-identical tomain's (esbuild output SHA-256 compared). The WSL bundle's version stamp is unchanged, so existing WSL guests are not redeployed.config/scripts/ssh-relay-import-boundary.test.mjs: fails if any non-test code outsidesrc/relayimports it. It also pins the 28 relay tests that live elsewhere (for example the real-git parity tests insrc/main/git). That list can only shrink, and the relay deletion PR empties it.src/wsl-guest/now triggers the same SSH, hook, and cross-host lanessrc/relay/did, because the relay still uses this code until it is deleted. The cross-version wire harness also extracts a release'ssrc/wsl-guestwhen the release has one, because a release's relay imports it.git diff --name-onlylists a rename under its new path only, so the old file's text was never read. Adding--no-renamesfixes 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 ofsrc/relaykeeps 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 importsrc/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): passAll 124 test files touched by the moves (
src/wsl-guest/**and every relay/main test whose imports changed): 1194 passedBoundary, CI routing, cross-version checkout, process-host import, builder config, and relay manifest tests: pass
node config/scripts/build-relay.mjsinto a temp dir: builds all six relay platforms plus the WSL bundlesBundle byte-identity against
origin/mainforwsl-agent-hook-relay,wsl-browser-network-relay,relay,ai-vault-service-entryoxlint,oxfmt --check,pnpm run check:code-quality:changed,check:reliability-gates,check:max-lines-ratchet,check:process-host-imports: passI manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
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
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)