Repository navigation
feat(wsl-mover): terminal gate, last-folder capture and exit proof for a WSL move (D1b-5b) - #28606
Conversation
|
Warning Review limit reachedYou'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 1 minute. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
38d1801 to
0090374
Compare
… anything (D1b-5b)
…s restore (D1b-5b)
…lso checks recorded pane sessions (D1b-5b)
…refuses an incomplete census (D1b-5b)
0090374 to
7e98ad7
Compare
ELI5
Before Orca moves a WSL project onto the WSL host, it has to pause the project's terminals and reopen them on the host. This PR adds the three checks that make that safe:
Nothing calls these checks yet; the move flow wires them in later.
What Changed
This is step D1b-5b of the lossless WSL project mover. It is independent of D1b-5a (#28536). All three modules are pure and live in
src/main/persistence/moving-wsl-projects/.wsl-move-terminal-gate.ts). Every pane in scope either passes or blocks the move. A blocked pane comes with the actions that would unblock it: wait, end, skip the project, or clear scrollback. Nothing is ended automatically. A pane blocks when:working,waitingandblockedstates, because some providers (Copilot, Pi, Freebuff) report an approval or question asblocked.wsl-move-restore-hints.ts). Each paused pane's last folder is read from the daemon's checkpoint and converted to its Linux path. A pane's folder is kept nowhere else.wsl-move-exit-proof.ts). Before commit, this proves that no session of a moved workspace is alive on this computer's terminal daemon. It returnsexited,live(with session ids) orunverifiable.unverifiable, neverexited.\\wsl$and\\wsl.localhost) and distro-name case are matched as the same workspace. Sessions are also matched by the exact ids the panes recorded, which covers older session ids.Why
The owner decided that a move pauses and restores terminals rather than bridging live ones. That is only lossless if nothing that matters is running and every pane's folder survives the move. The terminal gate refuses anything it can't restore, and the exit proof makes sure no terminal still writes to the old location after the move.
Ending busy terminals automatically was rejected because it loses work silently. Truncating scrollback to fit the transfer was rejected for the same reason.
Linked Issue
N/A (maintainer; tracked in the WSL-via-orcad implementation tracker, step D1b-5).
Visual Proof
N/A: pure main-process logic with no UI and no callers yet.
Testing
85 unit tests in
src/main/persistence/moving-wsl-projects/. They cover:Lint, oxfmt and
pnpm tc:nodeare clean. An adversarial review found one HIGH (blockeddoesn't mean failed), three MEDIUM and four LOW findings. All of them are fixed except one LOW: mapping aC:\checkpoint folder to/mnt/cis left out, because a distro's automount root can differ. It fails safe: the pane opens at its workspace root.AI Disclosure
Review
Agent skill upstream boundary
Notes
The feature stays behind the internal WSL host gate, and nothing here is called yet. There is no SSH or wire change. The SSH mover keeps its own terminal rules.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)