🔐 Connection attempt state and cancellation
Rust owns the transient state shown by Settings → select an alias → Connect selected host. Selecting/browsing an alias and starting the app do not connect. Saved host metadata remains in the existing preferences store; connection state, diagnostics, tokens and durations are never persisted.
The seven states are disconnected, resolving, connecting, probing, ready, degraded and error. Each attempt has a random session ID and a checked, increasing u32 backend generation. These pre-Docker tokens are distinct from resource SessionScope: they confer no Docker, management or terminal permission, and contain no invented daemon identity.
A connect traverses native ssh -G resolution (5-second deadline), strict noninteractive authentication and owned master setup (30-second overall deadline), then the capability driver. The Docker capability driver now probes context/versions/daemon identity/Linux access and Compose within 30 seconds. Accepted Linux capability results reach ready; failures remain degraded with a static diagnosis and bounded partial metadata. The strict preflight and owned master setup precede an inert marker on the selected transport; a non-255 SSH exit with a failed/missing marker is reported as remote-command failure. Exit 255 remains ambiguous and is classified conservatively. Presence of a jump/proxy is shown; stderr does not establish which hop failed.
The coordinator retains one selected attempt and at most three stage-duration entries. Its nonqueuing control lock rejects overlapping control operations with a resource-limit error. A repeated connect for the same active/ready selection returns the existing attempt. Explicit retries after error/degraded or selecting a different host create a fresh generation. The current increment permits one selected live attempt; saved-host inventory/multiple owned sessions are later integration work.
Before cancel/switch, Rust invalidates the generation, then signals and joins the prior worker. Dropping its stage future cancels the Runner job. The driver waits for all runner slots to become idle, retaining the native diagnostic permit until owned SSH children are reaped. Old completions cannot update a different token; stale disconnect requests cannot stop a newer attempt. Normal workspace mode switching uses the same permit and refuses while a selected native session or its cleanup is active, then invalidates idle connection state. No disconnected attempt automatically reconnects.
The renderer polls the exact token with one request at a time and a 200 ms interval during active stages and one second while a transport remains live. It validates response selection/generation, bounded durations and diagnostic enums. Component lifetime/request sequencing rejects late replies. Selection changes and leaving Settings cancel the exact owned token. A late start response after unmount is also explicitly cancelled, without addressing a newer session. Poll failure is visible and stops polling; there is no automatic connect retry.
Diagnostics are static enums plus stage and completed duration (monotonic elapsed milliseconds). No raw SSH output, configuration contents, keys or transcripts are persisted or sent through this state API. A cancelled incomplete stage does not gain a fabricated completion duration.
Verification covers controlled slow resolution, duplicate clicks, cancellation, host switch during probe, successful ready→disconnect, explicit retries and remote-command failure. The actual native stage driver is additionally run against the disposable SSH lab: known host without a daemon→degraded, missing jump identity→authentication error, and a fixture key with a forced failing command→remote-command error. Browser tests exercise delayed old responses in all six sizes/themes. These are separate forms of evidence, not a claim of native GUI interaction or macOS execution.
Owned multiplex transport adds channel reuse, visible fallback, connection-loss observation, idle bounds and native shutdown cleanup.
Docker executable/context/sudo choices are captured in the attempt identity. A change invalidates the old generation even for the same alias; transient capability reports are never persisted. Native Ready state was verified via real SSH/CLI with an explicitly synthetic Docker API, not real Engine readiness.
Prompt 017 binds saved attempts to a stable HostId and carries the effective resolved destination/route in transient snapshots. Inventory validates that owner against the saved target, preserves selection after errors and observes state across routes. Metadata/target changes have separate cleanup behavior; no resource SessionScope is issued yet.