Skip to content

refactor(managed-server): move the managed server's install and deploy code into src/main/managed-server/install/ - #30335

Merged
nwparker merged 1 commit into
mainfrom
nwparker/r2-m4b-managed-server-install
Oct 18, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/r2-m4b-managed-server-install

Conversation

@nwparker

@nwparker nwparker commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 81 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​363 $\color{#cf222e}{\Huge{\mathbf{−}}}$​309 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​54
Prod 111 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​480 $\color{#cf222e}{\Huge{\mathbf{−}}}$​388 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​92

ELI5

This is the second step in moving the desktop side of the managed Orca server out of src/main/ssh. It moves the code that installs and deploys orcad on a host (uploads, install locks, runtime store, launch, garbage collection) into src/main/managed-server/install/. Nothing the app does changes, and nothing on a host changes.

What Changed

  • Moved: 73 files go with git mv to src/main/managed-server/install/, keeping their names. They are the src/main/ssh files matching orcad-remote-*, remote-install-*, remote-node-runtime-store-*, remote-versioned-install* and remote-deploy-timing, plus their tests.
  • Rewritten references:
    • imports and vi.mock paths in 116 importers across ssh, wsl, orcad, ipc and ai-vault;
    • path literals in pr.yml, wsl-orcad-e2e.yml, pr-package-test-paths.mjs, check-runtime-launcher-protocol-ratchet.mjs, reliability-gates.jsonc and ci-shard-timings.json.
  • Routing. The ssh.orcad-idle-exit e2e route regex now also matches managed-server/<sub>/orcad-…. I checked that orcad-remote-launch.ts selects the same specs at its old and new paths. The host-lane workflows already include src/main/managed-server/** (from refactor(managed-server): move orcad activation into src/main/managed-server/activation/ #30320).
  • Left in place, for now:
  • Rename check: every moved file shows up as a rename in git diff -M. Edits inside them are only ../ import depth.

Why

Round 2's folder plan (§4.2, M4; D8) wants src/main/ssh to be SSH transport only, with the managed server in its own folder. This is the second of four M4 PRs.

Linked Issue

N/A (SSH hardening round 2, S11/M4).

Visual Proof

N/A: a pure file move.

Testing

  • typecheck:ci: clean.
  • Single-worker run of src/main/managed-server, all remaining src/main/ssh/orcad-*, ssh-host-server*, managed-server*, the hostile-host support, src/main/wsl, src/main/orcad, ai-vault, the touched ipc tests, and the launcher-protocol, node-server, orcad e2e scope, route-contract and package-test-path config tests: 475 files, 4,599 tests pass. The exception is the 4 orcad-forked-child-paths cases, which also fail on main on macOS (/private/var tmpdir realpath).
  • check-runtime-launcher-protocol-ratchet --base origin/main: OK. It sees the moved launcher files, and there is no protocol bump.
  • Full local "static analysis and typecheck" job, including the path-literal and legacy-relay fence ratchets: clean.
  • Codex review (gpt-6.1-sol, high): clean.

…y code into src/main/managed-server/install/

orcad-remote-*, remote-install-*, remote-node-runtime-store-*, remote-versioned-install and
remote-deploy-timing leave src/main/ssh. git mv plus import and path-literal rewrites; one e2e route
regex learns the new folder. orcad-remote-deploy and orcad-remote-node-runtime-report stay for now
because open PRs #29834 and #29829 edit them.
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

The change updates imports and test mocks to reflect remote installation and ORCAD runtime modules under managed-server/install. It also updates workflow filters, test commands, routing rules, reliability references, and CI timing keys to use the new paths. The described runtime logic and test assertions remain unchanged.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 1dee8

This is a behavior-preserving file relocation. The one remaining issue is metadata only: historical reliability evidence records should keep their original commands and use currentCommand for the new path. It does not affect runtime behavior.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 50 files. (140 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: moving managed-server install and deploy code into the new directory.
Description check Passed The description is mostly complete. It includes the ELI5 summary, changed files and paths, rationale, linked-issue context, visual-proof status, and detailed testing results. Some optional or maintain…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is mostly complete. It includes the ELI5 summary, changed files and paths, rationale, linked-issue context, visual-proof status, and detailed testing results. Some optional or maintainer-oriented template sections, such as AI Disclosure, Review, Notes, and the final Checklist, are not included.

Full details: Docstring Coverage

Explanation

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

Resolution

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

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@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: f9dc2df7-f8ab-4828-b0cb-b65beb854cbb
📥 Commits

Reviewing files that changed from the base of the PR and between 50c06d5 and 1dee8fa.

📒 Files selected for processing: 192
  • .github/workflows/pr.yml
  • .github/workflows/wsl-orcad-e2e.yml
  • config/reliability-gates.jsonc
  • config/scripts/check-runtime-launcher-protocol-ratchet.mjs
  • config/scripts/check-runtime-launcher-protocol-ratchet.test.mjs
  • config/scripts/ci-shard-timings.json
  • config/scripts/node-server-qualification.test.mjs
  • config/scripts/orcad-e2e-change-scope.test.mjs
  • config/scripts/pr-e2e-route-contracts.test.mjs
  • config/scripts/pr-e2e-source-routing.mjs
  • config/scripts/pr-package-test-paths.mjs
  • src/main/ai-vault/opencode-wsl-runtime-preparation.ts
  • src/main/managed-server/activation/orcad-activation-crash-recovery.test.ts
  • src/main/managed-server/activation/orcad-activation-fence-generation.test.ts
  • src/main/managed-server/activation/orcad-activation-fence-hold.test.ts
  • src/main/managed-server/activation/orcad-activation-fence-hold.ts
  • src/main/managed-server/activation/orcad-activation-lock.ts
  • src/main/managed-server/activation/orcad-activation-record-store.ts
  • src/main/managed-server/activation/orcad-activation-record.ts
  • src/main/managed-server/activation/orcad-activation-recovery.ts
  • src/main/managed-server/activation/orcad-activation-transaction-schema.ts
  • src/main/managed-server/activation/orcad-activation-transaction-store.ts
  • src/main/managed-server/activation/orcad-activation-transaction.test.ts
  • src/main/managed-server/install/orcad-remote-build-hash.integration.test.ts
  • src/main/managed-server/install/orcad-remote-build-hash.ts
  • src/main/managed-server/install/orcad-remote-context.ts
  • src/main/managed-server/install/orcad-remote-decommission.test.ts
  • src/main/managed-server/install/orcad-remote-decommission.ts
  • src/main/managed-server/install/orcad-remote-gc.test.ts
  • src/main/managed-server/install/orcad-remote-gc.ts
  • src/main/managed-server/install/orcad-remote-host-support.ts
  • src/main/managed-server/install/orcad-remote-install-termination.test.ts
  • src/main/managed-server/install/orcad-remote-install.ts
  • src/main/managed-server/install/orcad-remote-launch-file-modes.test.ts
  • src/main/managed-server/install/orcad-remote-launch-setsid.test.ts
  • src/main/managed-server/install/orcad-remote-launch-windows.ts
  • src/main/managed-server/install/orcad-remote-launch.test.ts
  • src/main/managed-server/install/orcad-remote-launch.ts
  • src/main/managed-server/install/orcad-remote-lifecycle-windows.test.ts
  • src/main/managed-server/install/orcad-remote-log-tail.test.ts
  • src/main/managed-server/install/orcad-remote-log-tail.ts
  • src/main/managed-server/install/orcad-remote-node-runtime-promotion-lock.test.ts
  • src/main/managed-server/install/orcad-remote-node-runtime-recorded-probe.test.ts
  • src/main/managed-server/install/orcad-remote-node-runtime-recorded-probe.ts
  • src/main/managed-server/install/orcad-remote-node-runtime-slow-hash.test.ts
  • src/main/managed-server/install/orcad-remote-node-runtime-windows.test.ts
  • src/main/managed-server/install/orcad-remote-node-runtime-windows.ts
  • src/main/managed-server/install/orcad-remote-node-runtime.test.ts
  • src/main/managed-server/install/orcad-remote-node-runtime.ts
  • src/main/managed-server/install/orcad-remote-preflight.ts
  • src/main/managed-server/install/orcad-remote-primitives.test.ts
  • src/main/managed-server/install/orcad-remote-process-control.ts
  • src/main/managed-server/install/orcad-remote-readiness-wait.test.ts
  • src/main/managed-server/install/orcad-remote-readiness-wait.ts
  • src/main/managed-server/install/orcad-remote-record-file.ts
  • src/main/managed-server/install/orcad-remote-rollback.test.ts
  • src/main/managed-server/install/orcad-remote-rollback.ts
  • src/main/managed-server/install/orcad-remote-runtime-control.test.ts
  • src/main/managed-server/install/orcad-remote-runtime-control.ts
  • src/main/managed-server/install/orcad-remote-runtime.test.ts
  • src/main/managed-server/install/orcad-remote-runtime.ts
  • src/main/managed-server/install/orcad-remote-shell-commands.integration.test.ts
  • src/main/managed-server/install/orcad-remote-windows-commands.test.ts
  • src/main/managed-server/install/orcad-remote-windows-decommission.test.ts
  • src/main/managed-server/install/orcad-remote-windows-node.ts
  • src/main/managed-server/install/orcad-remote-windows-scripts.test.ts
  • src/main/managed-server/install/remote-deploy-timing.ts
  • src/main/managed-server/install/remote-install-gc-claim-termination.test.ts
  • src/main/managed-server/install/remote-install-gc-claim.ts
  • src/main/managed-server/install/remote-install-gc-listing.test-fixture.ts
  • src/main/managed-server/install/remote-install-gc-termination.test.ts
  • src/main/managed-server/install/remote-install-gc-tombstone.ts
  • src/main/managed-server/install/remote-install-gc.ts
  • src/main/managed-server/install/remote-install-lock-commands.ts
  • src/main/managed-server/install/remote-install-lock-exited-owner.test.ts
  • src/main/managed-server/install/remote-install-lock-exited-owner.ts
  • src/main/managed-server/install/remote-install-lock-termination.test.ts
  • src/main/managed-server/install/remote-install-lock.test.ts
  • src/main/managed-server/install/remote-install-lock.ts
  • src/main/managed-server/install/remote-install-marker.ts
  • src/main/managed-server/install/remote-install-model.test.ts
  • src/main/managed-server/install/remote-install-model.ts
  • src/main/managed-server/install/remote-install-noisy-sftp-wire.test.ts
  • src/main/managed-server/install/remote-install-transfers-exec-fallback.test.ts
  • src/main/managed-server/install/remote-install-transfers.ts
  • src/main/managed-server/install/remote-install-transport.ts
  • src/main/managed-server/install/remote-node-runtime-store-gc.test.ts
  • src/main/managed-server/install/remote-node-runtime-store-gc.ts
  • src/main/managed-server/install/remote-node-runtime-store-inventory.ts
  • src/main/managed-server/install/remote-node-runtime-store-lock-host-release.test.ts
  • src/main/managed-server/install/remote-node-runtime-store-lock.ts
  • src/main/managed-server/install/remote-node-runtime-store-windows.test.ts
  • src/main/managed-server/install/remote-node-runtime-store-windows.ts
  • src/main/managed-server/install/remote-versioned-install-termination.test.ts
  • src/main/managed-server/install/remote-versioned-install.test.ts
  • src/main/managed-server/install/remote-versioned-install.ts
  • src/main/orcad/orcad-cross-runtime-daemon-adoption.integration.test.ts
  • src/main/orcad/orcad-host-unavailable.test.ts
  • src/main/orcad/orcad-stop-request-shutdown.integration.test.ts
  • src/main/ssh/hostile-host-test-support/ssh-hostile-host-managed-orcad.ts
  • src/main/ssh/legacy-relay/ssh-host-relay-windows-census.ts
  • src/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.ts
  • src/main/ssh/orcad-active-readiness.ts
  • src/main/ssh/orcad-candidate-launch-verdict.ts
  • src/main/ssh/orcad-decommission-recovery.ts
  • src/main/ssh/orcad-deployment-target.ts
  • src/main/ssh/orcad-exited-own-fence-mutation-race.test.ts
  • src/main/ssh/orcad-exited-own-install-lock.test.ts
  • src/main/ssh/orcad-exited-own-lock.ts
  • src/main/ssh/orcad-fence-lost-classification.test.ts
  • src/main/ssh/orcad-gc-transaction-pins.ts
  • src/main/ssh/orcad-host-transport.ts
  • src/main/ssh/orcad-incumbent-recovery.ts
  • src/main/ssh/orcad-initial-activation-admission.ts
  • src/main/ssh/orcad-installed-activation.ts
  • src/main/ssh/orcad-interrupted-candidate-resume.ts
  • src/main/ssh/orcad-launch-ssh-session.test.ts
  • src/main/ssh/orcad-launch-ssh-session.ts
  • src/main/ssh/orcad-machine-home.test.ts
  • src/main/ssh/orcad-managed-auto-update.test.ts
  • src/main/ssh/orcad-managed-auto-update.ts
  • src/main/ssh/orcad-managed-bound-port.test.ts
  • src/main/ssh/orcad-managed-bound-port.ts
  • src/main/ssh/orcad-managed-launch-session.test.ts
  • src/main/ssh/orcad-managed-launch-session.ts
  • src/main/ssh/orcad-managed-remote-stop.ts
  • src/main/ssh/orcad-managed-runtime-context.ts
  • src/main/ssh/orcad-managed-serving.test.ts
  • src/main/ssh/orcad-managed-serving.ts
  • src/main/ssh/orcad-managed-tunnel-target.test.ts
  • src/main/ssh/orcad-managed-tunnel-target.ts
  • src/main/ssh/orcad-managed-version-gc.test.ts
  • src/main/ssh/orcad-managed-version-gc.ts
  • src/main/ssh/orcad-managed-wake.test.ts
  • src/main/ssh/orcad-managed-wake.ts
  • src/main/ssh/orcad-recovery-slot.ts
  • src/main/ssh/orcad-remote-deploy.test.ts
  • src/main/ssh/orcad-remote-deploy.ts
  • src/main/ssh/orcad-retained-fence-takeover.test.ts
  • src/main/ssh/orcad-rollback-transition.ts
  • src/main/ssh/orcad-running-version-adoption.test.ts
  • src/main/ssh/orcad-runtime-decommission.test.ts
  • src/main/ssh/orcad-runtime-decommission.ts
  • src/main/ssh/orcad-runtime-deployment.test.ts
  • src/main/ssh/orcad-runtime-deployment.ts
  • src/main/ssh/orcad-runtime-forget.test.ts
  • src/main/ssh/orcad-runtime-maintenance.test.ts
  • src/main/ssh/orcad-runtime-maintenance.ts
  • src/main/ssh/orcad-state-mutation-exec.test.ts
  • src/main/ssh/orcad-state-mutation-exec.ts
  • src/main/ssh/orcad-state-mutation-fence-heartbeat.test.ts
  • src/main/ssh/orcad-state-mutation-timeout.test.ts
  • src/main/ssh/orcad-state-snapshot.ts
  • src/main/ssh/orcad-stdio-bridge-listener.ts
  • src/main/ssh/orcad-stdio-bridge-provider.test.ts
  • src/main/ssh/orcad-stdio-bridge-provider.ts
  • src/main/ssh/orcad-stdio-bridge-test-channel.ts
  • src/main/ssh/orcad-stdio-bridge.test.ts
  • src/main/ssh/orcad-stdio-bridge.ts
  • src/main/ssh/orcad-transaction-incumbent.ts
  • src/main/ssh/orcad-unreachable-setup-release.ts
  • src/main/ssh/orcad-unreachable-setup-stop.test.ts
  • src/main/ssh/orcad-windows-host-lane.test.ts
  • src/main/ssh/orcad-windows-host-preparation.ts
  • src/main/ssh/orcad-windows-host-script.ts
  • src/main/ssh/orcad-windows-host-state-ops.ts
  • src/main/ssh/orcad-windows-stdio-bridge-test-cell.ts
  • src/main/ssh/remote-exec-closed-stdin.test.ts
  • src/main/ssh/remote-exec-command.ts
  • src/main/ssh/remote-host-answered-failure-producers.test.ts
  • src/main/ssh/remote-host-exec.ts
  • src/main/ssh/sftp-namespace-resolution.ts
  • src/main/ssh/sftp-stream-late-error.test.ts
  • src/main/ssh/ssh-exec-stdin-file-transfer.ts
  • src/main/ssh/ssh-remote-commands.test.ts
  • src/main/ssh/ssh-remote-commands.ts
  • src/main/ssh/ssh-remote-platform-detection.ts
  • src/main/ssh/ssh-remote-windows-command-line-limit.test.ts
  • src/main/wsl/wsl-command-channel.ts
  • src/main/wsl/wsl-command-loop-pool.ts
  • src/main/wsl/wsl-command-loop.ts
  • src/main/wsl/wsl-directory-upload.ts
  • src/main/wsl/wsl-host-server-stop.ts
  • src/main/wsl/wsl-orcad-deploy.test.ts
  • src/main/wsl/wsl-orcad-deploy.ts
  • src/main/wsl/wsl-orcad-host-transport.ts
  • src/main/wsl/wsl-orcad-incumbent.test.ts
  • src/main/wsl/wsl-orcad-incumbent.ts
  • src/main/wsl/wsl-orcad-instance-adoption.test.ts
  • src/main/wsl/wsl-orcad-instance-adoption.ts
  • src/main/wsl/wsl-orcad-watch.ts
  • src/main/wsl/wsl-pinned-runtime.ts

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

"runner": "local",
"platform": "macos",
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ssh/remote-versioned-install.test.ts config/scripts/package-electron-runtime-contract.test.mjs",
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/managed-server/install/remote-versioned-install.test.ts config/scripts/package-electron-runtime-contract.test.mjs",

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

sed -n '18450,18470p' config/reliability-gates.jsonc
rg -n 'command|existsSync|evidence' config/scripts/check-reliability-gates.mjs | head -80
rg -n 'currentCommand' config | head

Repository: stablyai/orca

Length of output: 10075


🏁 Script executed:

printf '%s\n' '--- affected evidence records ---'
sed -n '18452,18472p' config/reliability-gates.jsonc
sed -n '18506,18526p' config/reliability-gates.jsonc
sed -n '18560,18580p' config/reliability-gates.jsonc
printf '%s\n' '--- gate commands and nearby identifiers ---'
sed -n '18395,18425p' config/reliability-gates.jsonc
sed -n '18480,18505p' config/reliability-gates.jsonc
sed -n '18534,18559p' config/reliability-gates.jsonc
printf '%s\n' '--- checker implementation ---'
sed -n '75,215p' config/scripts/check-reliability-gates.mjs

Repository: stablyai/orca

Length of output: 21492


🏁 Script executed:

rg -n -F -- 'src/main/managed-server/install/remote-versioned-install.test.ts' config/reliability-gates.jsonc
printf '%s\n' '--- owning gate context ---'
python3 - <<'PY'
from pathlib import Path
p = Path('config/reliability-gates.jsonc')
lines = p.read_text().splitlines()
hits = [i for i, line in enumerate(lines) if 'src/main/managed-server/install/remote-versioned-install.test.ts' in line]
for hit in hits:
    start = max(0, hit - 45)
    end = min(len(lines), hit + 8)
    print(f'--- lines {start + 1}-{end} ---')
    for n in range(start, end):
        print(f'{n + 1}: {lines[n]}')
PY

Repository: stablyai/orca

Length of output: 41379


Preserve historical commands and add currentCommand.

The gate declares the relocated command. Keep the original src/main/ssh command in each July 13 evidence record, and add currentCommand with the new path. The checker matches currentCommand to a declared gate command.

Suggested fix
-          "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/managed-server/install/remote-versioned-install.test.ts config/scripts/package-electron-runtime-contract.test.mjs",
+          "command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ssh/remote-versioned-install.test.ts config/scripts/package-electron-runtime-contract.test.mjs",
+          "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/managed-server/install/remote-versioned-install.test.ts config/scripts/package-electron-runtime-contract.test.mjs",

Apply this change at lines 18460, 18514, and 18568.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/managed-server/install/remote-versioned-install.test.ts config/scripts/package-electron-runtime-contract.test.mjs",
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ssh/remote-versioned-install.test.ts config/scripts/package-electron-runtime-contract.test.mjs",
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/managed-server/install/remote-versioned-install.test.ts config/scripts/package-electron-runtime-contract.test.mjs",

@nwparker
nwparker merged commit d382992 into main Oct 18, 2026
68 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