Repository navigation
refactor(managed-server): move the managed server's install and deploy code into src/main/managed-server/install/ - #30335
Conversation
…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.
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🔵 Low · up to
|
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:
f9dc2df7-f8ab-4828-b0cb-b65beb854cbb
📒 Files selected for processing: 192
.github/workflows/pr.yml.github/workflows/wsl-orcad-e2e.ymlconfig/reliability-gates.jsoncconfig/scripts/check-runtime-launcher-protocol-ratchet.mjsconfig/scripts/check-runtime-launcher-protocol-ratchet.test.mjsconfig/scripts/ci-shard-timings.jsonconfig/scripts/node-server-qualification.test.mjsconfig/scripts/orcad-e2e-change-scope.test.mjsconfig/scripts/pr-e2e-route-contracts.test.mjsconfig/scripts/pr-e2e-source-routing.mjsconfig/scripts/pr-package-test-paths.mjssrc/main/ai-vault/opencode-wsl-runtime-preparation.tssrc/main/managed-server/activation/orcad-activation-crash-recovery.test.tssrc/main/managed-server/activation/orcad-activation-fence-generation.test.tssrc/main/managed-server/activation/orcad-activation-fence-hold.test.tssrc/main/managed-server/activation/orcad-activation-fence-hold.tssrc/main/managed-server/activation/orcad-activation-lock.tssrc/main/managed-server/activation/orcad-activation-record-store.tssrc/main/managed-server/activation/orcad-activation-record.tssrc/main/managed-server/activation/orcad-activation-recovery.tssrc/main/managed-server/activation/orcad-activation-transaction-schema.tssrc/main/managed-server/activation/orcad-activation-transaction-store.tssrc/main/managed-server/activation/orcad-activation-transaction.test.tssrc/main/managed-server/install/orcad-remote-build-hash.integration.test.tssrc/main/managed-server/install/orcad-remote-build-hash.tssrc/main/managed-server/install/orcad-remote-context.tssrc/main/managed-server/install/orcad-remote-decommission.test.tssrc/main/managed-server/install/orcad-remote-decommission.tssrc/main/managed-server/install/orcad-remote-gc.test.tssrc/main/managed-server/install/orcad-remote-gc.tssrc/main/managed-server/install/orcad-remote-host-support.tssrc/main/managed-server/install/orcad-remote-install-termination.test.tssrc/main/managed-server/install/orcad-remote-install.tssrc/main/managed-server/install/orcad-remote-launch-file-modes.test.tssrc/main/managed-server/install/orcad-remote-launch-setsid.test.tssrc/main/managed-server/install/orcad-remote-launch-windows.tssrc/main/managed-server/install/orcad-remote-launch.test.tssrc/main/managed-server/install/orcad-remote-launch.tssrc/main/managed-server/install/orcad-remote-lifecycle-windows.test.tssrc/main/managed-server/install/orcad-remote-log-tail.test.tssrc/main/managed-server/install/orcad-remote-log-tail.tssrc/main/managed-server/install/orcad-remote-node-runtime-promotion-lock.test.tssrc/main/managed-server/install/orcad-remote-node-runtime-recorded-probe.test.tssrc/main/managed-server/install/orcad-remote-node-runtime-recorded-probe.tssrc/main/managed-server/install/orcad-remote-node-runtime-slow-hash.test.tssrc/main/managed-server/install/orcad-remote-node-runtime-windows.test.tssrc/main/managed-server/install/orcad-remote-node-runtime-windows.tssrc/main/managed-server/install/orcad-remote-node-runtime.test.tssrc/main/managed-server/install/orcad-remote-node-runtime.tssrc/main/managed-server/install/orcad-remote-preflight.tssrc/main/managed-server/install/orcad-remote-primitives.test.tssrc/main/managed-server/install/orcad-remote-process-control.tssrc/main/managed-server/install/orcad-remote-readiness-wait.test.tssrc/main/managed-server/install/orcad-remote-readiness-wait.tssrc/main/managed-server/install/orcad-remote-record-file.tssrc/main/managed-server/install/orcad-remote-rollback.test.tssrc/main/managed-server/install/orcad-remote-rollback.tssrc/main/managed-server/install/orcad-remote-runtime-control.test.tssrc/main/managed-server/install/orcad-remote-runtime-control.tssrc/main/managed-server/install/orcad-remote-runtime.test.tssrc/main/managed-server/install/orcad-remote-runtime.tssrc/main/managed-server/install/orcad-remote-shell-commands.integration.test.tssrc/main/managed-server/install/orcad-remote-windows-commands.test.tssrc/main/managed-server/install/orcad-remote-windows-decommission.test.tssrc/main/managed-server/install/orcad-remote-windows-node.tssrc/main/managed-server/install/orcad-remote-windows-scripts.test.tssrc/main/managed-server/install/remote-deploy-timing.tssrc/main/managed-server/install/remote-install-gc-claim-termination.test.tssrc/main/managed-server/install/remote-install-gc-claim.tssrc/main/managed-server/install/remote-install-gc-listing.test-fixture.tssrc/main/managed-server/install/remote-install-gc-termination.test.tssrc/main/managed-server/install/remote-install-gc-tombstone.tssrc/main/managed-server/install/remote-install-gc.tssrc/main/managed-server/install/remote-install-lock-commands.tssrc/main/managed-server/install/remote-install-lock-exited-owner.test.tssrc/main/managed-server/install/remote-install-lock-exited-owner.tssrc/main/managed-server/install/remote-install-lock-termination.test.tssrc/main/managed-server/install/remote-install-lock.test.tssrc/main/managed-server/install/remote-install-lock.tssrc/main/managed-server/install/remote-install-marker.tssrc/main/managed-server/install/remote-install-model.test.tssrc/main/managed-server/install/remote-install-model.tssrc/main/managed-server/install/remote-install-noisy-sftp-wire.test.tssrc/main/managed-server/install/remote-install-transfers-exec-fallback.test.tssrc/main/managed-server/install/remote-install-transfers.tssrc/main/managed-server/install/remote-install-transport.tssrc/main/managed-server/install/remote-node-runtime-store-gc.test.tssrc/main/managed-server/install/remote-node-runtime-store-gc.tssrc/main/managed-server/install/remote-node-runtime-store-inventory.tssrc/main/managed-server/install/remote-node-runtime-store-lock-host-release.test.tssrc/main/managed-server/install/remote-node-runtime-store-lock.tssrc/main/managed-server/install/remote-node-runtime-store-windows.test.tssrc/main/managed-server/install/remote-node-runtime-store-windows.tssrc/main/managed-server/install/remote-versioned-install-termination.test.tssrc/main/managed-server/install/remote-versioned-install.test.tssrc/main/managed-server/install/remote-versioned-install.tssrc/main/orcad/orcad-cross-runtime-daemon-adoption.integration.test.tssrc/main/orcad/orcad-host-unavailable.test.tssrc/main/orcad/orcad-stop-request-shutdown.integration.test.tssrc/main/ssh/hostile-host-test-support/ssh-hostile-host-managed-orcad.tssrc/main/ssh/legacy-relay/ssh-host-relay-windows-census.tssrc/main/ssh/legacy-relay/ssh-host-relay-windows-inventory.tssrc/main/ssh/orcad-active-readiness.tssrc/main/ssh/orcad-candidate-launch-verdict.tssrc/main/ssh/orcad-decommission-recovery.tssrc/main/ssh/orcad-deployment-target.tssrc/main/ssh/orcad-exited-own-fence-mutation-race.test.tssrc/main/ssh/orcad-exited-own-install-lock.test.tssrc/main/ssh/orcad-exited-own-lock.tssrc/main/ssh/orcad-fence-lost-classification.test.tssrc/main/ssh/orcad-gc-transaction-pins.tssrc/main/ssh/orcad-host-transport.tssrc/main/ssh/orcad-incumbent-recovery.tssrc/main/ssh/orcad-initial-activation-admission.tssrc/main/ssh/orcad-installed-activation.tssrc/main/ssh/orcad-interrupted-candidate-resume.tssrc/main/ssh/orcad-launch-ssh-session.test.tssrc/main/ssh/orcad-launch-ssh-session.tssrc/main/ssh/orcad-machine-home.test.tssrc/main/ssh/orcad-managed-auto-update.test.tssrc/main/ssh/orcad-managed-auto-update.tssrc/main/ssh/orcad-managed-bound-port.test.tssrc/main/ssh/orcad-managed-bound-port.tssrc/main/ssh/orcad-managed-launch-session.test.tssrc/main/ssh/orcad-managed-launch-session.tssrc/main/ssh/orcad-managed-remote-stop.tssrc/main/ssh/orcad-managed-runtime-context.tssrc/main/ssh/orcad-managed-serving.test.tssrc/main/ssh/orcad-managed-serving.tssrc/main/ssh/orcad-managed-tunnel-target.test.tssrc/main/ssh/orcad-managed-tunnel-target.tssrc/main/ssh/orcad-managed-version-gc.test.tssrc/main/ssh/orcad-managed-version-gc.tssrc/main/ssh/orcad-managed-wake.test.tssrc/main/ssh/orcad-managed-wake.tssrc/main/ssh/orcad-recovery-slot.tssrc/main/ssh/orcad-remote-deploy.test.tssrc/main/ssh/orcad-remote-deploy.tssrc/main/ssh/orcad-retained-fence-takeover.test.tssrc/main/ssh/orcad-rollback-transition.tssrc/main/ssh/orcad-running-version-adoption.test.tssrc/main/ssh/orcad-runtime-decommission.test.tssrc/main/ssh/orcad-runtime-decommission.tssrc/main/ssh/orcad-runtime-deployment.test.tssrc/main/ssh/orcad-runtime-deployment.tssrc/main/ssh/orcad-runtime-forget.test.tssrc/main/ssh/orcad-runtime-maintenance.test.tssrc/main/ssh/orcad-runtime-maintenance.tssrc/main/ssh/orcad-state-mutation-exec.test.tssrc/main/ssh/orcad-state-mutation-exec.tssrc/main/ssh/orcad-state-mutation-fence-heartbeat.test.tssrc/main/ssh/orcad-state-mutation-timeout.test.tssrc/main/ssh/orcad-state-snapshot.tssrc/main/ssh/orcad-stdio-bridge-listener.tssrc/main/ssh/orcad-stdio-bridge-provider.test.tssrc/main/ssh/orcad-stdio-bridge-provider.tssrc/main/ssh/orcad-stdio-bridge-test-channel.tssrc/main/ssh/orcad-stdio-bridge.test.tssrc/main/ssh/orcad-stdio-bridge.tssrc/main/ssh/orcad-transaction-incumbent.tssrc/main/ssh/orcad-unreachable-setup-release.tssrc/main/ssh/orcad-unreachable-setup-stop.test.tssrc/main/ssh/orcad-windows-host-lane.test.tssrc/main/ssh/orcad-windows-host-preparation.tssrc/main/ssh/orcad-windows-host-script.tssrc/main/ssh/orcad-windows-host-state-ops.tssrc/main/ssh/orcad-windows-stdio-bridge-test-cell.tssrc/main/ssh/remote-exec-closed-stdin.test.tssrc/main/ssh/remote-exec-command.tssrc/main/ssh/remote-host-answered-failure-producers.test.tssrc/main/ssh/remote-host-exec.tssrc/main/ssh/sftp-namespace-resolution.tssrc/main/ssh/sftp-stream-late-error.test.tssrc/main/ssh/ssh-exec-stdin-file-transfer.tssrc/main/ssh/ssh-remote-commands.test.tssrc/main/ssh/ssh-remote-commands.tssrc/main/ssh/ssh-remote-platform-detection.tssrc/main/ssh/ssh-remote-windows-command-line-limit.test.tssrc/main/wsl/wsl-command-channel.tssrc/main/wsl/wsl-command-loop-pool.tssrc/main/wsl/wsl-command-loop.tssrc/main/wsl/wsl-directory-upload.tssrc/main/wsl/wsl-host-server-stop.tssrc/main/wsl/wsl-orcad-deploy.test.tssrc/main/wsl/wsl-orcad-deploy.tssrc/main/wsl/wsl-orcad-host-transport.tssrc/main/wsl/wsl-orcad-incumbent.test.tssrc/main/wsl/wsl-orcad-incumbent.tssrc/main/wsl/wsl-orcad-instance-adoption.test.tssrc/main/wsl/wsl-orcad-instance-adoption.tssrc/main/wsl/wsl-orcad-watch.tssrc/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", |
There was a problem hiding this comment.
📐 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 | headRepository: 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.mjsRepository: 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]}')
PYRepository: 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.
| "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", |
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) intosrc/main/managed-server/install/. Nothing the app does changes, and nothing on a host changes.What Changed
git mvtosrc/main/managed-server/install/, keeping their names. They are thesrc/main/sshfiles matchingorcad-remote-*,remote-install-*,remote-node-runtime-store-*,remote-versioned-install*andremote-deploy-timing, plus their tests.vi.mockpaths in 116 importers acrossssh,wsl,orcad,ipcandai-vault;pr.yml,wsl-orcad-e2e.yml,pr-package-test-paths.mjs,check-runtime-launcher-protocol-ratchet.mjs,reliability-gates.jsoncandci-shard-timings.json.ssh.orcad-idle-exite2e route regex now also matchesmanaged-server/<sub>/orcad-…. I checked thatorcad-remote-launch.tsselects the same specs at its old and new paths. The host-lane workflows already includesrc/main/managed-server/**(from refactor(managed-server): move orcad activation into src/main/managed-server/activation/ #30320).orcad-remote-deployandorcad-remote-node-runtime-reportstay, because open PRs fix(orcad): refuse new terminals while an update stops the server (R32) #29834 and fix(orcad): name a missing shared library when the pinned Node runtime can't start #29829 edit them.managed-server-*update-policy files stay too; they go with lifecycle in M4c. Moving them here madessh-host-server-on-connect.ts's import lines wrap, which pushed the file past the 300-line limit. That will be handled when the host-server files move together.git diff -M. Edits inside them are only../import depth.Why
Round 2's folder plan (§4.2, M4; D8) wants
src/main/sshto 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.src/main/managed-server, all remainingsrc/main/ssh/orcad-*,ssh-host-server*,managed-server*, the hostile-host support,src/main/wsl,src/main/orcad,ai-vault, the touchedipctests, 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 4orcad-forked-child-pathscases, which also fail on main on macOS (/private/vartmpdir realpath).check-runtime-launcher-protocol-ratchet --base origin/main: OK. It sees the moved launcher files, and there is no protocol bump.