Repository navigation
Conversation
8 of 9 tasks
…duction gate facts and journaled restore folders One entry point (and preview/start/cancel/listUnfinished IPC for D1b-9) plans the move, gates terminals on the hook server's agent status, the close-tab process probe, running automation runs and live dispatches, pauses and proves exit, stages, sends blobs, commits only from blobs-transferred (#29825), and finishes on the desktop. Any failure resets to zero or goes forward when the host committed. Restore folders and the automations to turn back on are kept in the journal; the host turns those automations back on after commit, retried until it confirms. A real-PTY test pauses daemon shells, and runs on a real distro in the WSL orcad lane.
nwparker
force-pushed
the
nwparker/wsl-mover-d1b-8-retain-reconcile
branch
from
October 21, 2026 07:46
e0640d7 to
b9722fe
Compare
nwparker
force-pushed
the
nwparker/wsl-mover-d1b-driver
branch
from
October 21, 2026 07:46
528cfab to
b5cb7b5
Compare
11 of 12 tasks
3 tasks done
8 of 9 tasks
Contributor
Author
|
Contained in the dark landing PR #34059 (its head commit is an ancestor of the landing branch). Closing in favour of it; branch kept. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Orca can already do each step of "move my WSL projects to the WSL host" on its own: pause the terminals, write down where the move is, copy the saved state, switch over, and keep the old copy as a safety net. No code ran those steps in order yet. This PR adds the one piece that does, and gives the move dialog (D1b-9) a single call to start it and follow it.
What Changed
Before: the move existed only as parts. Every test fed those parts made-up facts, such as "this terminal is idle" or "no automation is running". The folder each paused terminal was in was kept only in memory, so a crash lost it.
After: one call in main runs the whole move.
wslMove:previewshows what would move and what blocks it;wslMove:startruns it. The steps, in order:planWslMove: a first move, or a delta that takes only new projects. Only one move per distro runs at a time.orchestration.db. Anything busy is returned as a blocker, and nothing is ended to make progress.blobs-transferred, as fix(wsl-mover): reset an interrupted move to zero, or finish it once the host proves a commit #29825 requires.retained.Failures. Any failure calls #29825's
resetWslMoveToZero. Before the commit, that puts everything back. If the host did commit and only the reply was lost, the move goes forward instead. If the host can't answer, the projects stay read-only and the result says so. A new move first settles one that an interruption left short of commit.Restore folders in the record. The
quiescedrecord now carriesterminalRestoreHints(optional, written once, invalid values read as absent). The restore-folder file is built from the record, so a crash after the pause no longer loses them.Automations. A move can only carry automations switched off. The ones that were on here are listed in the record (
automationsToReenable), and after the commit a tracked step (host-automations) asks the host to switch them back on. It skips any the user deleted, switched on, or edited on the host since the move (the row'supdatedAtno longer matches what was moved). If the host refuses or can't be reached, the result lists them as still off (automationsPending) andwslMove:listUnfinishedreturns them for the UI. The step retries in the same run with backoff and again at every startup, and the move doesn't finish until the host confirms. They are never left off without saying so.Snapshot. Built with #31414's
exportWslMoveManifest, which lies under this PR in the stack. If the snapshot can't carry some of a project's state, the move refuses (wsl_move_export_incomplete) rather than moving without it.Window reload. The rewrite happens under the open window, so a successful move returns
reloadRequired: true. The dialog must then reload through the restart-preparation path (requestLazyChunkRecoveryReload), which backs up unsaved editors and lands the session checkpoint first. Main never does a bare reload.IPC contract (for D1b-9)
wslMove:preview{distro, repoIds?, folderWorkspaceIds?}{outcome:'ready', repoIds, folderWorkspaceIds, changed, heldByHost, refused, blockers[]}or a refusalwslMove:start{outcome:'moved', migrationId, phase, reloadRequired: true, automationsPending?},{outcome:'reset'}(nothing moved),{outcome:'waiting-for-host'}, or a refusalwslMove:canceldistrotrueif a run was stopped (allowed until the commit request)wslMove:listUnfinishedwslMove:progress(event){distro, step: preparing | pausing-terminals | copying | switching | finishing | done, migrationId?, phase?, bytesSent?, bytesTotal?}Refusal codes:
wsl_move_unavailable(gate off, wrong window, malformed request),wsl_move_already_running,wsl_move_already_in_flight,wsl_move_nothing_new,wsl_move_host_unavailable,wsl_move_host_update_required,wsl_move_terminals_blocked(+blockers),wsl_move_export_incomplete(+reasons),wsl_move_manifest_too_large(+message, the text from #29825's first journal write),wsl_move_pause_failed(+detail),wsl_move_scope_changed(plan again),wsl_move_cancelled,wsl_move_finished_earlier_move(an interrupted, host-committed move was finished first: reload as forreloadRequired, then start again).Why
wsl-move-driver-ports.ts). Production wiring is one file, and tests swap in a fake world with failure points (the test(wsl-mover): crash a WSL move at every step and prove it ends at zero or fully moved #29826 pattern). The driver reuses the existing journal, fence, quiesce, exit proof, hints capture, blob coordinator, durable stage/commit helper, reset, desktop rewrite and retention, and adds no parallel versions.Linked Issue
Internal (WSL via orcad tracker, D1b driver wiring: the D1b-5 deferred items).
Visual Proof
N/A: main-process and IPC only; the UI is D1b-9.
Testing
wsl-move-driver.test.ts(fake host with failure points):retained.automationsPending, and the step retries after restart and with backoff in the same run.wsl-move-real-pause.test.ts: real shells on node-pty in a real in-process daemon. Sleep ends them, the daemon's census proves the exit, the journal holds each pane's folder from the daemon's checkpoint, and a new real shell opened there prints it. A pane another client still runs refuses the move and lifts the fence. On Windows it runs in the WSL orcad lane against a real distro through UNC paths (new step "WSL move: pause real distro terminals").wsl-host-automation-enable.test.ts: only automations untouched since the move are switched back on, and a refusal stays pending and retries.wsl-move-gate-facts.test.ts: maps hook status, the probe, runs and dispatches to gate verdicts (a stale agent row can't vouch for a dev server; an unknown scrollback size blocks).wsl-move-driver-handlers.test.ts: with the gate off, nothing is built or run; another window and a malformed request are refused.pnpm tc, the touched suites,check:code-quality:changed, and every ratchet, with no baseline changes.Review
An adversarial review (crash safety, data loss, gate leaks) ran before opening. It found no gate leaks. Fixed in this PR:
Left as residuals:
Notes
Shared paths this touches (outside the gated mover folder):
src/main/runtime/orca-runtime-migration-catalog.ts: a new read-onlylistWslMoveLiveTerminals.src/main/ipc/register-core-handlers/register-core-handlers.ts: passes the driver deps.src/main/startup/main-process-ready-foundation.ts: registers thehost-automationsstore and schedules the gated retry.src/main/ipc/wsl-host-automation-enable.ts: new; the host callsautomation.showandautomation.update.src/preload/api/wsl-move-bridge.tsandsrc/renderer/src/web/web-preload-api.ts: new bridge calls; the web build refuses them.src/shared/wsl-move/wsl-move-cutover.ts: two optional journal fields.src/main/persistence/moving-wsl-projects/wsl-move-delta-plan.ts(D1b-8's file): an optionalautomationsToReenablearg onjournalWslMove..github/workflows/wsl-orcad-e2e.yml: one lane step and one path.Other notes:
folder:<id>workspaces.@orca/process-host, and WSL argv only throughbuildWslExecArgs(in the lane test).client-rewrittenin production until 7f-2 flipsWSL_MOVE_DESKTOP_REWRITE_REGISTRY_COMPLETE. Until then a committed move stays in its rewrite phase, which is expected.Agent skill upstream boundary
Checklist
N/Afor visuals, with reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (typecheck, touched tests, changed-code quality and ratchets pass locally; CI covers the rest)