Repository navigation
fix(ssh): a missing relay inventory never proves terminals exited, and the Windows census covers every desktop's relays - #25611
Merged
Conversation
…d the Windows census covers every desktop's relays - The migration terminal gate returned `exited` whenever this desktop held no unresolved lease, even when the current relay or the earlier relays could not be asked. A failed or incomplete inventory is now `unverifiable` regardless of local leases. With no relay session at all the gate asks for a host census (`needsHostCensus`) instead of reading the silence as exit; the connect, conversion and delta move pass that census in, and the connect hands its own census result to the conversion it starts. A census that cannot list endpoints (`unenumerable`) is unverifiable too. - The Windows connect-time census derived pipe names from this desktop's target id only, so another desktop's relay on the same account was never probed. It now lists every `orca-relay-*` pipe on the machine and maps each to the relay instance that owns it through that instance's credential file or active-pipe marker, asking each with its own credential. A pipe no version directory accounts for is unverifiable unless the host proves it another account's (or gone), and an inventory that could not be read is unverifiable.
OrcaWin
force-pushed
the
OrcaWin/node-rt-p3-astra3-census
branch
from
October 5, 2026 15:14
c22d8e3 to
4f9367a
Compare
Contributor
There was a problem hiding this comment.
Important
One missed caller: assessOrcadMigrationTerminals now treats a ListRelayPtyIds without previous as "the earlier relays could not be asked", and the Windows host-lane cell still passes a bare lister and asserts exited. Details inline.
Reviewed changes
- A missing inventory is never
exited(finding 3). The gate no longer short-circuits onunresolved.length === 0before checking the relay listings: anullcurrent or earlier listing isunverifiablewhatever the lease count. With no relay session, a newwithoutRelaySession()blocks asneedsHostCensusunless acensusHostproves the host's endpointsnone/idle. - Host-census fallback plumbed through conversion.
HostRelayTerminalProof/censusHostnow reachorcad-runtime-conversion,orcad-migration-delta-move, the move handler, andconversionCollaborators;relayTerminalsOnConnectalways supplies a lazy census wrapper and the connect hands its own verdict toconvertashostProofso no second census runs. - Windows census covers every desktop (finding 4).
censusWindowsHostRelaysenumerates every\\.\pipe\orca-relay-<20hex>on the machine and maps each to its owning instance through that directory's*.credentialfiles and.windows-active-pipe-*markers, bridging with the owner's own credential; unmapped pipes stayunverifiableunless the host proves them another account's (EACCES/EPERM) or gone (ENOENT). The cap moved from version directories to 32 pipes. - Docs.
docs/reference/ssh-execution-boundary.mddescribes both rules.
ℹ️ Nitpicks
needsHostCensus: trueis declared and set on theunverifiableverdict but read nowhere in production code (only the type declaration and one test assert it). Either consume it or drop it.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes (incremental since c22d8e3c75)
- Windows host-lane cell now supplies the earlier-relay lister.
orcad-windows-relay-terminal-gate-test-cell.tsstarts this deploy's previous-relay census (startPreviousRelayCensus(conn, targetId, deployed)), wraps itspty.listProcesseslister withprevious: () => listPreviousRelayPtyIds(targetId), and clears the census infinally. With no earlier endpoints the census is complete and empty, so the gate provesexitedafter the PTY is shut down — the bare-lister case from the previous review is resolved.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
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
Before Orca converts an SSH host to a managed server, it has to be sure no terminal is still running on the host's old relays. If one is, converting would strand it. Two gaps let a running terminal slip through:
Now Orca converts only when it has actually confirmed that nothing runs.
What Changed
1. A missing inventory is never "exited" (Astra-3 finding 3, high).
assessOrcadMigrationTerminalsreturnedexitedas soon as this desktop had no detached or expired lease, before checking whether the current or earlier relays had answered. A failed listing plus no leases meant "exited". The delta move and the conversion acted on that, and the later fence only checks local leases.unverifiablewhatever the lease count.unverifiablewithneedsHostCensus, or takes a host census, which must prove the endpoints idle.convert(target, hostProof)). The explicit conversion and the delta move run the same host census themselves (censusHostRelayTerminalsFor).unenumerable) now maps tounverifiable, not to exit.2. The Windows census covers every desktop's relays (Astra-3 finding 4, medium).
censusWindowsHostRelaysderived the two pipe names per version directory from this desktop's target id. Another desktop's relay on the same Windows account has a different target id, so it was never probed.orca-relay-*pipe on the machine (\\.\pipe\). It maps each pipe to the relay instance that owns it through that instance's<sock>.credentialfile or.windows-active-pipe-<sock>marker in its version directory (ssh-host-relay-windows-inventory.ts), and asks each instance through its own bridge with its own credential.EACCES/EPERM) or is already gone (ENOENT).docs/reference/ssh-execution-boundary.mddescribes both rules.Why
The execution-boundary rule is that losing contact is never evidence of exit. "Nothing leased here" says nothing about terminals another desktop or the CLI started, so only an inventory that actually answered can prove the host is idle.
Separating "needs a host census" from "authoritative empty" keeps a connect with no session able to convert after its census proves the host idle, instead of either trusting silence or never converting.
For Windows, the machine's pipe table is the only complete list. Each relay instance already writes its credential and pipe marker next to its version directory, which is enough to find the right credential for each pipe without knowing other desktops' target ids.
Linked Issue
Fixes #
Astra review 3, findings 3 and 4.
Visual Proof
N/A: no UI change. Hosts with unproven relay terminals stay on the relay, as the status already reports.
Testing
Gate:
unverifiable;Connect: an
unenumerablecensus is unverifiable. A session whose current or earlier relay can't answer is unverifiable with no leases, and the host isn't asked.Conversion: with no session, it converts only on a host census proving idle, and refuses on live or missing proof.
Windows census:
Inventory script: it runs on the host's Node against a temporary directory, and the parser rejects incomplete inventories.
Existing move, delta-move and conversion harnesses now give their host census explicitly.
src/main/ssh, the SSH and orcad IPC suites, the cross-version wire suite,pnpm tc:nodeand the changed-code quality gate pass locally.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)