Relationships
↔ sibling #4970#4951 swamp workspace import silently takes a serve host's workspace offline when its folder or name is in the host's workspaces folder
Opened by zack · 11/20/2026· Shipped 11/21/2026
Problem
swamp workspace import <folder> --name <name> registers a repo folder under any free name with no warning, even when that folder or name belongs to a serve host's workspaces/ folder. Since swamp-club#4865 a serve host lists every registry entry, and a registry entry wins over a folder in workspaces/, so such an import silently takes a team's workspace offline.
Import already refuses both clashes once the host has registered its folders: a folder already registered is returned under its existing name (--name is ignored), and a taken name is refused with name_taken. The gap is a folder in workspaces/ that is not in the registry yet: the host is stopped or has not rescanned, the host folder predates swamp-club#4918, the host runs under another SWAMP_HOME, or the folder's entry was just removed with swamp workspace remove.
Two cases
swamp workspace import <host>/workspaces/gamma --name beta. The entrybetaholds the folder, so the host no longer serves it asgamma:/w/gammastops answering for its clients, andbetais listed as the operator's own, stopped.gammaremains only as a name with a wanted file.swamp workspace import /ext/alpha --name alphawhile<host>/workspaces/alphaexists unregistered. The name clashes, and the host starts neither repo until someone frees the name.
Neither loses data since swamp-club#4865 (delete is refused, a deleted wanted file the host cannot act on is dropped, and removal re-checks the folder last), but the workspace goes offline, and the only signal is an error in the host's log, which the person running import does not see.
Expected
Import warns, or refuses unless forced, when:
- the folder is
workspaces/<x>inside a serve host folder and the chosen name is notx; or - the chosen name is also a folder in a known serve host's
workspaces/.
Open question
Import has no way to know where hosts are today. Options: detect a host folder by layout (a host.yaml beside the workspaces/ that holds the folder), or have the host record its state where workspace commands can read it, which ties in with swamp-club#4920 and swamp-club#4921 (a host with no host folder). Decide alongside those.
Where to look
src/libswamp/workspace/workspace_store.ts(importWorkspace)design/surfaces/serve-workspaces.md, Names and foldersdesign/surfaces/workspace.md
Shipped
Click a lifecycle step above to view its details.