Skip to content

refactor(ssh): one pinned-runtime host target - #27709

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-2-1
Oct 12, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-2-1

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​54 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1530 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1476
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​90 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1303 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1213

ELI5

When Orca still had its old SSH "relay", it tried several ways to run its own copy of Node.js on a remote host and fell back step by step (a "ladder"). The relay is gone, but the ladder code stayed behind. Nothing calls it any more. This PR deletes it and keeps the two small pieces that are still used.

What Changed

Nothing changes for users. This removes code nothing runs.

  • Deleted (no production caller since the relay was removed): ssh-relay-runtime-resolution.ts, ssh-relay-runtime-ladder.ts, ssh-relay-runtime-self-test.ts, ssh-relay-pinned-node.ts, ssh-relay-pinned-refusal-cache.ts, ssh-remote-runtime-telemetry.ts, shared/relay-runtime-self-test-report.ts, plus their tests (ladder, never-worse, resolution, self-test, pinned-node and its integration test, telemetry).
  • Kept and moved into src/main/ssh/pinned-runtime-host-target.ts (about 70 lines):
    • pinnedRuntimeTargetForHost. Managed orcad deploy uses it to pick the host's own Node runtime, or the glibc 2.17 build on older glibc.
    • nodeRuntimeStorePins, renamed from relayRuntimeStorePins. Orcad version cleanup uses it so it never deletes a runtime another copy still runs.
    • isGlibcBelow and PINNED_NODE_GLIBC_FLOOR, which the WSL guest runtime also uses.
  • pick and durationBucket now live inside ssh-host-server-telemetry.ts, which is their only remaining user.
  • ssh-relay-answered-failure-producers.test.ts no longer asserts the relay's refusal classifier. It asserts the exit status instead.

Kept on purpose, per the design: the persisted SshTarget.remoteRuntime / remoteRuntimeResolution fields and their types still load and save unchanged, so older profiles and downgrades still work. The ssh_remote_runtime_resolved telemetry schema stays registered but nothing sends it any more. The ssh-types constants are pruned in the next PR (2.2).

Net lines: production −1,213 (+90/−1,303), tests −1,476 (+54/−1,530).

Why

New SSH work no longer has to step around about 2,700 lines of unreachable ladder, self-test and refusal-cache code. Folding the live pieces into one small module with a plain name stops later cleanups from deleting them by mistake. The alternative was to leave the files in place and delete only the dead functions. That would keep the misleading relay names on code that is still live.

Linked Issue

Phase 3.99 cleanup (maintainer PR, no issue).

Visual Proof

N/A: no UI or behaviour change.

Testing

  • Characterization first: the new pinned-runtime-host-target.test.ts assertions were run against the old ssh-relay-runtime-ladder.ts / ssh-relay-pinned-node.ts before the move (3/3 passed), then against the new module.

  • Dead-code proof: searched every deleted module path and exported symbol across src, config, tests and mobile, including the @ts-nocheck files and vi.mock strings. No users remain outside the deleted files. The only hits left are two path-classification fixture tests (test-only-source-path, check-runtime-electron-ratchet) that build their own temporary files, plus stale ci-shard-timings.json entries.

  • pnpm tc, build:electron-vite, build:orcad and build:cli pass. pnpm lint passes, so ratchets are at or below baseline. check:code-quality:changed reports 0 findings.

  • Focused tests pass: pinned-runtime-host-target, orcad-runtime-target, orcad-managed-version-gc, wsl-pinned-runtime, ssh-host-server-telemetry, ssh-host-server-on-connect-telemetry, ssh-relay-answered-failure-producers and packaged-orcad-template (8 files, 50 tests).

  • I manually tested these changes locally

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

Review

P0/P1 review: a self review plus an independent codex reviewer (read-only). Neither found anything.

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, Windows, Linux and macOS: no runtime change.
  • SSH: the managed orcad runtime choice and version GC pins behave exactly as before. Nothing a paired client and host exchange changes.
  • Mobile: untouched.
  • Backwards compatibility: persisted relay-era fields still load and save as before.

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)

@OrcaWin
OrcaWin marked this pull request as ready for review October 12, 2026 02:05
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 43d7fdbb-c39a-40da-acfd-3f00de2c42ca

📥 Commits

Reviewing files that changed from the base of the PR and between 9fd181ad512a6920c52de051447ec2ddddef70d0 and 7d65b36.


📒 Files selected for processing (22)
  • config/scripts/packaged-orcad-template.cjs
  • src/main/ssh/orcad-managed-version-gc.ts
  • src/main/ssh/orcad-runtime-target.ts
  • src/main/ssh/pinned-runtime-host-target.test.ts
  • src/main/ssh/pinned-runtime-host-target.ts
  • src/main/ssh/ssh-host-server-telemetry.ts
  • src/main/ssh/ssh-relay-answered-failure-producers.test.ts
  • src/main/ssh/ssh-relay-pinned-node.integration.test.ts
  • src/main/ssh/ssh-relay-pinned-node.test.ts
  • src/main/ssh/ssh-relay-pinned-node.ts
  • src/main/ssh/ssh-relay-pinned-refusal-cache.ts
  • src/main/ssh/ssh-relay-runtime-ladder.test.ts
  • src/main/ssh/ssh-relay-runtime-ladder.ts
  • src/main/ssh/ssh-relay-runtime-never-worse.test.ts
  • src/main/ssh/ssh-relay-runtime-resolution.test.ts
  • src/main/ssh/ssh-relay-runtime-resolution.ts
  • src/main/ssh/ssh-relay-runtime-self-test.test.ts
  • src/main/ssh/ssh-relay-runtime-self-test.ts
  • src/main/ssh/ssh-remote-runtime-telemetry.test.ts
  • src/main/ssh/ssh-remote-runtime-telemetry.ts
  • src/main/wsl/wsl-pinned-runtime.ts
  • src/shared/relay-runtime-self-test-report.ts

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: 57588722-50d7-4c49-829b-2652d353d2c8


📥 Commits

Reviewing files that changed from the base of the PR and between 65d662e and 9fd181ad512a6920c52de051447ec2ddddef70d0.



📒 Files selected for processing (22)
  • config/scripts/packaged-orcad-template.cjs
  • src/main/ssh/orcad-managed-version-gc.ts
  • src/main/ssh/orcad-runtime-target.ts
  • src/main/ssh/pinned-runtime-host-target.test.ts
  • src/main/ssh/pinned-runtime-host-target.ts
  • src/main/ssh/ssh-host-server-telemetry.ts
  • src/main/ssh/ssh-relay-answered-failure-producers.test.ts
  • src/main/ssh/ssh-relay-pinned-node.integration.test.ts
  • src/main/ssh/ssh-relay-pinned-node.test.ts
  • src/main/ssh/ssh-relay-pinned-node.ts
  • src/main/ssh/ssh-relay-pinned-refusal-cache.ts
  • src/main/ssh/ssh-relay-runtime-ladder.test.ts
  • src/main/ssh/ssh-relay-runtime-ladder.ts
  • src/main/ssh/ssh-relay-runtime-never-worse.test.ts
  • src/main/ssh/ssh-relay-runtime-resolution.test.ts
  • src/main/ssh/ssh-relay-runtime-resolution.ts
  • src/main/ssh/ssh-relay-runtime-self-test.test.ts
  • src/main/ssh/ssh-relay-runtime-self-test.ts
  • src/main/ssh/ssh-remote-runtime-telemetry.test.ts
  • src/main/ssh/ssh-remote-runtime-telemetry.ts
  • src/main/wsl/wsl-pinned-runtime.ts
  • src/shared/relay-runtime-self-test-report.ts


💤 Files with no reviewable changes (15)
  • src/main/ssh/ssh-remote-runtime-telemetry.test.ts
  • config/scripts/packaged-orcad-template.cjs
  • src/main/ssh/ssh-relay-pinned-node.integration.test.ts
  • src/main/ssh/ssh-relay-runtime-never-worse.test.ts
  • src/main/ssh/ssh-remote-runtime-telemetry.ts
  • src/main/ssh/ssh-relay-runtime-self-test.ts
  • src/main/ssh/ssh-relay-runtime-self-test.test.ts
  • src/main/ssh/ssh-relay-runtime-ladder.test.ts
  • src/main/ssh/ssh-relay-runtime-resolution.test.ts
  • src/shared/relay-runtime-self-test-report.ts
  • src/main/ssh/ssh-relay-pinned-node.test.ts
  • src/main/ssh/ssh-relay-runtime-resolution.ts
  • src/main/ssh/ssh-relay-runtime-ladder.ts
  • src/main/ssh/ssh-relay-pinned-refusal-cache.ts
  • src/main/ssh/ssh-relay-pinned-node.ts


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




📝 Walkthrough
📝 Walkthrough

Walkthrough

The change adds host-based pinned runtime selection using glibc facts, compatibility-runtime rules, and executable-hash pins. The resolver, managed-version garbage collector, and WSL module now use the new host-target module. The change also removes relay pinned-runtime planning, ladder, refusal-cache, resolution, self-test, and telemetry modules with their tests. Remaining telemetry helpers are local, and answered-failure tests check expected exit statuses.



Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 9fd18

The runtime restructuring appears mergeable after normal checks. No current user-facing failure was established.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: consolidating SSH pinned-runtime host targeting while removing obsolete relay-runtime code.
Description check Passed The description is complete and relevant. It explains the user impact, deleted and retained code, rationale, compatibility considerations, linked-issue exception for a maintainer PR, visual-proof stat…
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.



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


⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch OrcaWin/p399-2-1



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

The relay runtime ladder (rungs A/B/C/legacy/D, its self-test, refusal
cache, per-host decision store and its telemetry) lost its only caller
when the relay was deleted. Two pieces were still live: picking the Node
runtime a host can run by glibc (managed orcad deploy, WSL guest
runtime) and the runtime-store pins orcad version GC keeps. Those move
to pinned-runtime-host-target.ts; pick/durationBucket move into
ssh-host-server-telemetry.ts, their only remaining user.
@OrcaWin
OrcaWin merged commit 3a52598 into main Oct 12, 2026
57 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