Skip to content

refactor(managed-server): move the managed server's lifecycle into src/main/managed-server/lifecycle/ - #30343

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

nwparker merged 1 commit into
mainfrom
nwparker/r2-m4c-managed-server-lifecycle

Conversation

@nwparker

@nwparker nwparker commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 60 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​281 $\color{#cf222e}{\Huge{\mathbf{−}}}$​236 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​45
Prod 87 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​382 $\color{#cf222e}{\Huge{\mathbf{−}}}$​372 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10

ELI5

This is step three of moving the desktop side of the managed Orca server out of src/main/ssh. This step moves the code that runs a managed server once it is installed: tunnels, serving, wake and update, conversion, decommission and rollback. Its new home is src/main/managed-server/lifecycle/. Nothing the app does changes, and nothing on a host changes.

What Changed

  • Moved: 59 files go with git mv to src/main/managed-server/lifecycle/, keeping their names. They are the src/main/ssh files matching orcad-managed-*, orcad-runtime-*, orcad-stdio-bridge-*, orcad-decommission-* and orcad-rollback-*, plus their tests.
  • Rewritten references: imports and vi.mock paths in 85 importers across ssh, ipc, wsl and src/main. Path literals are updated in reliability-gates.jsonc, ci-shard-timings.json and both legacy-relay fence baselines, where the moved importer and tagged file are renamed in place.
  • Routing: two e2e route regexes (ssh.orcad-host-server around line 131 and ssh.orcad-journeys around line 251) now match managed-server/<sub>/ as well as ssh/. A script compared spec selection for every moved production file at its old and new path, and none differ.
  • Left in place for now:
    • orcad-runtime-maintenance, because open PR fix(orcad): refuse new terminals while an update stops the server (R32) #29834 edits it.
    • The 7 managed-server-* update-policy files. Moving them wraps the import lines in ssh-host-server-on-connect.ts and pushes it past the 300-line limit. They should move together with the ssh-host-server-* on-connect files in one later slice, so their imports stay in one folder.
  • Rename check: every moved file shows as a rename in git diff -M. The only edits inside moved files are ../ import depth.

Why

This follows round 2's folder plan (§4.2, M4, D8). It is the third of four M4 PRs; host-state is next.

Linked Issue

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

Visual Proof

N/A: a pure file move.

Testing

  • typecheck:ci passes.
  • Single-worker run of src/main/managed-server, src/main/ssh, src/main/wsl, src/main/orcad, ipc/orcad*, ipc/ssh*, ipc/runtime-environment*, ipc/managed-orcad*, ephemeral-vm*, startup, and the e2e routing, orcad scope and node-server config tests: 562 files, 5,845 tests pass. The exception is the 4 orcad-forked-child-paths cases, which fail on main on macOS too because of the /private/var tmpdir realpath.
  • The path-literal, legacy-relay fence and runtime-launcher-protocol ratchets pass.
  • The full local "static analysis and typecheck" job passes.
  • Codex review (gpt-6.1-sol, high) is clean.

…c/main/managed-server/lifecycle/

orcad-managed-*, orcad-runtime-*, orcad-stdio-bridge-*, orcad-decommission-* and orcad-rollback-*
leave src/main/ssh. git mv plus import and path-literal rewrites; two e2e route regexes learn the
new folder. orcad-runtime-maintenance stays for now because open #29834 edits it.
@coderabbitai

coderabbitai Bot commented Oct 18, 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: b385de52-2cf3-4a2c-8f8d-6ad16f3b41bc
📥 Commits

Reviewing files that changed from the base of the PR and between d382992 and a4dc4fd.

📒 Files selected for processing: 147
  • config/legacy-relay-compat-tags-baseline.txt
  • config/legacy-relay-importers-baseline.txt
  • config/scripts/ci-shard-timings.json
  • config/scripts/pr-e2e-route-contracts.test.mjs
  • config/scripts/pr-e2e-source-routing.mjs
  • config/scripts/vitest-sqlite-runtime-files.mjs
  • src/main/ephemeral-vm-runtime-environment-release.test.ts
  • src/main/ephemeral-vm-runtime-environment-release.ts
  • src/main/ipc/desktop-browser-bridge-wiring.test.ts
  • src/main/ipc/desktop-browser-bridge-wiring.ts
  • src/main/ipc/managed-orcad-actions.ts
  • src/main/ipc/orcad-delta-move-handlers.test.ts
  • src/main/ipc/orcad-delta-move-handlers.ts
  • src/main/ipc/orcad-runtime-conversion-handlers.test.ts
  • src/main/ipc/orcad-runtime-conversion-handlers.ts
  • src/main/ipc/orcad-runtime-lifecycle-handlers.test.ts
  • src/main/ipc/orcad-runtime-lifecycle-handlers.ts
  • src/main/ipc/orcad-runtime-maintenance-handlers.test.ts
  • src/main/ipc/runtime-environment-managed-tunnel.test.ts
  • src/main/ipc/runtime-environment-managed-tunnel.ts
  • src/main/ipc/ssh-app-shutdown.test.ts
  • src/main/ipc/ssh-host-launch-session-note.test.ts
  • src/main/ipc/ssh-host-launch-session-note.ts
  • src/main/ipc/ssh-host-server-on-connect-wiring.test.ts
  • src/main/ipc/ssh-host-server-on-connect-wiring.ts
  • src/main/ipc/ssh-host-sleep-reconnect.test.ts
  • src/main/ipc/ssh-host-sleep-reconnect.ts
  • src/main/ipc/ssh-shutdown-drain.ts
  • src/main/ipc/ssh-target-crud-handlers-ownership.test.ts
  • src/main/ipc/ssh-target-crud-handlers.ts
  • src/main/ipc/ssh.ts
  • src/main/managed-server/activation/orcad-activation-crash-recovery.test.ts
  • src/main/managed-server/activation/orcad-activation-recovery.ts
  • src/main/managed-server/activation/orcad-activation-transaction.ts
  • src/main/managed-server/install/orcad-remote-context.ts
  • src/main/managed-server/install/orcad-remote-decommission.ts
  • src/main/managed-server/install/orcad-remote-lifecycle-windows.test.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-windows-commands.test.ts
  • src/main/managed-server/lifecycle/orcad-decommission-recovery.ts
  • src/main/managed-server/lifecycle/orcad-decommission-released-peer-recovery.test.ts
  • src/main/managed-server/lifecycle/orcad-decommission-stop.ts
  • src/main/managed-server/lifecycle/orcad-decommission-transaction.test.ts
  • src/main/managed-server/lifecycle/orcad-decommission-transaction.ts
  • src/main/managed-server/lifecycle/orcad-managed-auto-update.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-auto-update.ts
  • src/main/managed-server/lifecycle/orcad-managed-bound-port.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-bound-port.ts
  • src/main/managed-server/lifecycle/orcad-managed-launch-session.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-launch-session.ts
  • src/main/managed-server/lifecycle/orcad-managed-lifecycle-test-fixture.ts
  • src/main/managed-server/lifecycle/orcad-managed-migration-status.ts
  • src/main/managed-server/lifecycle/orcad-managed-remote-stop.ts
  • src/main/managed-server/lifecycle/orcad-managed-runtime-context.ts
  • src/main/managed-server/lifecycle/orcad-managed-serving-verify.ts
  • src/main/managed-server/lifecycle/orcad-managed-serving.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-serving.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-active.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-bridge-port.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-identity-restart.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-identity.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-identity.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-manager.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-resume.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-serving.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-target.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-target.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-transport.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel-transport.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-tunnel.ts
  • src/main/managed-server/lifecycle/orcad-managed-update-deferrals.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-update-deferrals.ts
  • src/main/managed-server/lifecycle/orcad-managed-update-on-restore.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-update-on-restore.ts
  • src/main/managed-server/lifecycle/orcad-managed-version-gc.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-version-gc.ts
  • src/main/managed-server/lifecycle/orcad-managed-wake.test.ts
  • src/main/managed-server/lifecycle/orcad-managed-wake.ts
  • src/main/managed-server/lifecycle/orcad-rollback-terminal-barrier.ts
  • src/main/managed-server/lifecycle/orcad-rollback-transition.ts
  • src/main/managed-server/lifecycle/orcad-runtime-conversion-wiring.ts
  • src/main/managed-server/lifecycle/orcad-runtime-conversion.test.ts
  • src/main/managed-server/lifecycle/orcad-runtime-conversion.ts
  • src/main/managed-server/lifecycle/orcad-runtime-decommission.test.ts
  • src/main/managed-server/lifecycle/orcad-runtime-decommission.ts
  • src/main/managed-server/lifecycle/orcad-runtime-deployment.test.ts
  • src/main/managed-server/lifecycle/orcad-runtime-deployment.ts
  • src/main/managed-server/lifecycle/orcad-runtime-forget.test.ts
  • src/main/managed-server/lifecycle/orcad-runtime-status.ts
  • src/main/managed-server/lifecycle/orcad-runtime-target.test.ts
  • src/main/managed-server/lifecycle/orcad-runtime-target.ts
  • src/main/managed-server/lifecycle/orcad-stdio-bridge-listener.ts
  • src/main/managed-server/lifecycle/orcad-stdio-bridge-provider.test.ts
  • src/main/managed-server/lifecycle/orcad-stdio-bridge-provider.ts
  • src/main/managed-server/lifecycle/orcad-stdio-bridge-script.ts
  • src/main/managed-server/lifecycle/orcad-stdio-bridge-stream.ts
  • src/main/managed-server/lifecycle/orcad-stdio-bridge-test-channel.ts
  • src/main/ssh/hostile-host-test-support/ssh-hostile-host-managed-orcad.ts
  • src/main/ssh/legacy-relay/ssh-host-relay-census-for-target.test.ts
  • src/main/ssh/legacy-relay/ssh-host-relay-census-for-target.ts
  • src/main/ssh/managed-server-fence-recheck.test.ts
  • src/main/ssh/managed-server-serving-gate.ts
  • src/main/ssh/managed-server-update-check.test.ts
  • src/main/ssh/managed-server-update-check.ts
  • src/main/ssh/managed-server-update-deps.test.ts
  • src/main/ssh/managed-server-update-deps.ts
  • src/main/ssh/orcad-already-active-wake.ts
  • src/main/ssh/orcad-conversion-abandon.ts
  • src/main/ssh/orcad-migration-delta-move.test.ts
  • src/main/ssh/orcad-migration-delta-snapshot.test.ts
  • src/main/ssh/orcad-migration-repository-link.test.ts
  • src/main/ssh/orcad-migration-source-retention.test.ts
  • src/main/ssh/orcad-remote-deploy.ts
  • src/main/ssh/orcad-running-version-adoption.test.ts
  • src/main/ssh/orcad-running-version-adoption.ts
  • src/main/ssh/orcad-runtime-maintenance.test.ts
  • src/main/ssh/orcad-runtime-maintenance.ts
  • src/main/ssh/orcad-ssh-provisioning.test.ts
  • src/main/ssh/orcad-ssh-provisioning.ts
  • src/main/ssh/orcad-stdio-bridge.test.ts
  • src/main/ssh/orcad-stdio-bridge.ts
  • src/main/ssh/orcad-terminal-census-client.test.ts
  • src/main/ssh/orcad-terminal-census-client.ts
  • src/main/ssh/orcad-unreachable-setup-release.ts
  • src/main/ssh/orcad-unreachable-setup-stop.test.ts
  • src/main/ssh/orcad-windows-host-script.ts
  • src/main/ssh/orcad-windows-stdio-bridge-test-cell.ts
  • src/main/ssh/runtime-ssh-access.test.ts
  • src/main/ssh/runtime-ssh-access.ts
  • src/main/ssh/ssh-host-server-on-connect-stopped-elsewhere.test.ts
  • src/main/ssh/ssh-host-server-on-connect-telemetry.test.ts
  • src/main/ssh/ssh-host-server-on-connect.ts
  • src/main/wsl/wsl-host-server-stop.ts
  • src/main/wsl/wsl-orcad-bridge-test-child.ts
  • src/main/wsl/wsl-orcad-connection.test.ts
  • src/main/wsl/wsl-orcad-connection.ts
  • src/main/wsl/wsl-orcad-deploy.test.ts
  • src/main/wsl/wsl-orcad-deploy.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-pairing-identity.ts
  • src/main/wsl/wsl-orcad-stdio-bridge.test.ts
  • src/main/wsl/wsl-orcad-stdio-bridge.ts
  • src/main/wsl/wsl-orcad-watch.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.

📝 Walkthrough

OrCAD managed lifecycle modules now reside under src/main/managed-server/lifecycle, and related imports and test mocks point to that directory. CI timing and compatibility entries, SQLite test inclusion, and E2E routing configuration were updated for the new paths. The summaries report unchanged lifecycle logic, test expectations, and recorded durations.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to a4dc4

The lifecycle relocation appears mergeable after normal checks; no concrete behavior change requiring correction was established.

Pre-merge checks: Passed 3 · Failed 1 · Inconclusive 1

Failed Failed checks: 1 warning · 1 inconclusive

Check name Status Explanation Resolution
Description check Warning The description explains the scope, motivation, affected paths, exclusions, visual impact, and testing results. However, it does not provide the required linked issue and omits several template sectio… Add a valid linked issue under Linked Issue instead of N/A, unless the repository confirms the maintainer exception applies. Add the omitted template sections and complete the applicable checklist items.
Docstring Coverage Inconclusive Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 50 files. (95 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: moving the managed-server lifecycle into src/main/managed-server/lifecycle/.
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 explains the scope, motivation, affected paths, exclusions, visual impact, and testing results. However, it does not provide the required linked issue and omits several template sections, including Review, Agent skill upstream boundary, Notes, and Checklist.

Resolution

Add a valid linked issue under Linked Issue instead of N/A, unless the repository confirms the maintainer exception applies. Add the omitted template sections and complete the applicable checklist items.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 50 files. (95 skipped: 3 unsupported, 92 over the file limit.)

Resolution

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

  • Fix all pre-merge checks with AI
✨ 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.

@nwparker
nwparker merged commit 506aa03 into main Oct 18, 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