Repository navigation
Conversation
…rcad deployment links by kind
Contributor
Author
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
Later in this plan, Orca will run its server inside a WSL distro, the same way it already does on SSH hosts. Orca needs somewhere to remember "this server lives in distro X". This PR adds that place: a new file that older Orca versions never open, so going back to an older version can't hide or break any servers. Nothing creates these records yet, so users see no change.
What Changed
orca-wsl-host-deployments.json(src/shared/wsl-host-deployment-store.ts). Each record looks like{ kind: 'wsl', environmentId, distro, distroId?, localPort, remotePort, createdAt }.distrois the name passed towsl.exe -d.distroIdis the optional registration GUID fromHKCU\...\Lxss. A name is case-insensitive and can be reused by a different install, while the GUID changes after an unregister or an export/import, so later steps can tell "same name, different distro" apart. Running state (the holder pid and similar) is not saved here.kind, a corrupt entry, or two records for one server) is kept on disk exactly as written, and the server it belongs to is hidden. A write replaces only the one record it targets and copies every other record through unchanged and in place, including fields a newer build added. If the whole file is corrupt, the read fails closed, the same as the sidecar. Writes are atomic and durable (writeSecureJsonFileWithinLimit(..., { durable: true })).OrcadDeploymentLinkis nowOrcadSshDeploymentLink | { kind: 'wsl', ... }. On SSH linkskindis optional and is never written, because the sidecar still saves SSH links with the SSH-only schema. Code that needs SSH fields goes throughgetOrcadSshDeployment(). The SSH lifecycle code now takesOrcadSshDeploymentLink, so the compiler stops a WSL link from reaching SSH-only code.connectionDependencystays'ssh-tunnel' | undefined. A WSL server's dependency is thekind: 'wsl'record in the new file. It is never written toorca-environments.json, because older builds would reject the value there.managed-orcad-execution-host.tsmerges rows only for SSH links. A WSL server stays its ownruntime:<id>row, even next to an SSH host that has the same name.resolveSshWorkspaceBrowserRouteEligibilityreturnsnullfor a WSL deployment. That page then goes out through the paired server's own network tunnel, which runs over thewsl.exebridge. It does not use WSL's localhost forwarding, which can refuse connections and depends on the networking mode (design decision D2).readEnvironmentStoreadds the WSL record to the server's data after the sidecar's. A WSL record is ignored with a warning if it conflicts with SSH state, or if itslocalPortdoesn't match the pairing (for example, after an older build re-paired the server).Why
orca-environments.jsonif any record is unknown, so puttingkind: 'wsl'records in that file would make every server disappear after a downgrade. Those builds never open the new file. We can fold it into the main store once the oldest supported desktop includes fix(runtime): keep remote servers usable when one saved record can't be read #27685.connectionDependency. Widening the in-memory type would have madeKnownRuntimeEnvironmentstop being a validPersistedRuntimeEnvironment. Every write path would then need a strip step, and one missed strip would put the new value into the file older builds read.Compatibility (persisted data and wire):
Linked Issue
None. This is step C2 of the WSL-via-orcad plan (
docs/design/wsl-via-orcad.md, decision D9; implementation tracker row C2, open decision 1).Visual Proof
N/A. This change adds types and storage only, with no UI, and nothing writes WSL records yet.
Testing
src/shared/wsl-host-deployment-store.test.ts:orca-environments.jsonand the sidecar byte-identical through a read and a rewrite, the sidecar never containskind, and no WSL file is created.markEnvironmentUsedkeeps the WSL link.kind, a WSL record with an extra future field, a corrupt record, and one with no id. Records are upserted and removed around them. An unreadable record hides its server and refuses to be replaced. Duplicate records count as unreadable. A corrupt file fails closed.Gates run locally:
pnpm tc; tests forsrc/shared/runtime-environment*,managed-orcad*,execution-host*,ssh-workspace-browser-route*,src/main/ssh,src/main/ipc, mobile relay and settings (1 timing test failed under the full parallel run and passes when run alone);oxlint; the anti-slop config;check:code-quality:changed;audit:code-quality:nativeandtype-aware; React Doctor; the max-lines, ts-nocheck, runtime-electron, focus-read and layout-writer ratchets; compat-boundary and process-host imports; reliability gates;pnpm format. knip reports none of the new exports.AI Disclosure
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)