Relationships
#4967 A host-created workspace's wanted file records the repo it was made for, so a new repo at the same path is never the host's own
Opened by zack · 11/20/2026· Shipped 11/20/2026
Follow-up to swamp-club#4921.
Problem
On a serve host with no host folder, a workspace is the host's own when its wanted file has a creator and names the registry entry's folder. Nothing ties the wanted file to the repo it was written for.
With the host stopped, an operator runs swamp workspace remove on a host-created workspace, deletes its folder by hand, and makes a new repo of the same name at the same path (swamp workspace create, or an import). The host's wanted file for the old workspace is still there, since only a running host drops it when the entry leaves the registry. On restart the stale file names the new entry's folder, so the new repo counts as the host's own: grants on workspace patterns reach it, and a delete request removes its folder. That breaks the rule that the host never removes a folder a request did not create.
Change
Record an identity of the repo in the wanted file at create, for example the repoId from the repo's .swamp.yaml, and make a workspace the host's own only when that identity still matches the folder's. A wanted file without it, or one that no longer matches, leaves the workspace the operator's own.
Compatibility
The wanted file gains an optional field. A wanted file written before it has none, so a workspace a no-host-folder host created before this change would become the operator's own unless the field is backfilled at the host's first start while the entry, the folder and the creator still agree. The issue should decide that.
Out of scope
Hosts with a host folder, where the folder's place decides.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.