Private Exchange for server users

Server users browse and transfer files directly through the controller and execution host. Their laptop does not maintain an Exchange mirror or run an SSH/Unison transfer worker. The browser uses the existing Exchange modal; the TUI can browse, upload a selected local file, or download to a new local file.

Exchange is separate from a Folders attachment and the optional client-side Unison mirror. The controller and host can transfer files while the laptop is offline; local mirror synchronization resumes when its client reconnects. TUI and web use the same Project/workspace selection and ownership checks. See session folders and the feature overview.

A target is an owned workspace on an assigned execution host. The controller verifies the user's current sign-in, immutable workspace/repository ownership and host assignment. The host reauthorizes every durable file command before executing it. Users cannot list, read, upload, finish or cancel another user's transfers. Transfers are also bound to the originating user sign-in.

The controller derives the Exchange location from the verified tenant checkout. It never accepts a host filesystem root from a browser. Default workspaces on one host share their owner's private agent-interchange directory; different users have separate directories. Legacy operator Exchange paths remain available only to the canonical recovery operator.

File operations reuse the existing folder command queue, authenticated host channel and descriptor-relative Python driver. Reads and writes are bounded to 256 KiB per operation. Downloads detect changes to file identity/size/mtime between chunks. Uploads stage inside the reserved, hidden .devctl-exchange-staging directory and publish with an atomic no-replace operation. Existing files are never overwritten. The driver refuses symlinks, hardlinked file payloads and path traversal.

Repository-root and nested Exchange .gitignore rules apply alongside mandatory exclusions. Ignore policies are reread before publishing uploads. Unknown/limited directory totals are shown explicitly rather than as zero; recursive scans share a bounded time/entry budget. File content is removed from controller result records after consumption and excluded from persisted results.

The browser gateway forwards only reviewed Exchange routes using the mapped user's controller credential. It streams downloads and bounded upload chunks; no administrator credential is substituted. Native TUI file transfers use the same authenticated API, with local file descriptors for the user's selected input/output. A failed native download removes only its own partial output; an existing local file is preserved.

Cleanup and limits

API

The owner-authenticated controller routes are under /v1/server/exchange:

Browser routes remain /exchange/*, so existing modal navigation, file downloads and drag-and-drop uploads use the same interface.