Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLIPublic
Assigneeszack

Relationships

#4921 A serve host with no host folder creates workspaces in the workspace location

Opened by zack · 11/19/2026· Shipped 11/20/2026

Last of six steps that merge a serve host's workspaces into the workspace registry and make the host folder optional. swamp-club#4865 lists the whole sequence. One PR. Depends on swamp-club#4920 (a host with no host folder).

Problem

A host with no host folder (swamp-club#4920) refuses workspace.create: it has no workspaces/ to make a repo in. Teams on such a host cannot make their own workspaces.

Without workspaces/, the host also has no way to tell a workspace a request created from one of the operator's own. Until now the folder's place told them apart (swamp-club#4865, Whose a workspace is).

Change

On a host with no host folder, workspace.create makes the repo where swamp workspace create would, and the host knows afterwards that a request made it.

Where the repo goes

  • At <location>/<name>. The location is the one set with swamp config set workspaces.dir, else <data dir>/workspaces. This is the registry's own rule (newWorkspaceLocation, checkNewWorkspaceFolder), under the same create lock.
  • The workspace is registered as one Swamp created, with no trust mark. It appears in swamp workspace list and on the swamp start page beside the user's own.
  • It starts suspended, with the caller as creator, as today.
  • A host with a host folder still creates in its workspaces/. Nothing changes there.

Whose a workspace is, with no host folder

  • A workspace is the host's own when a request created it at the folder the registry names for it. Grants on workspace:<pattern> reach it and workspace.delete removes its folder and its entry.
  • Any other is the operator's own, with the rules swamp-club#4865 gives those.
  • The expected way: the wanted file already names its folder (swamp-club#4865, A wanted file belongs to one folder). Create writes the folder it made. A workspace is the host's own only when its wanted file has a creator and names the entry's folder.

What must hold

  • The host never removes a folder a request did not create. That holds at every point a create or delete can stop, and beside a swamp workspace import, create or remove of the same name at any moment.
  • Every point a create can stop leaves either nothing, or a name that a delete can finish. That is today's rule for a create stopped between the wanted file and the rename.
  • Delete removes only the folder the wanted file records, and only while the registry entry still names that folder.

Create and delete

  • Create still sets the repo up in a hidden folder and renames it into place, so nothing lists a workspace before it is whole. The setup still runs as the swamp serve provision-workspace child.
  • Delete is the host's, as today: stop the serve and wait for it, rename the folder to a hidden name, remove it, remove the registry entry, remove the status file, and remove the wanted file last.
  • The hidden folders now sit in a location the user's own workspaces share. No name that is not the workspace's own hidden name is ever removed, and the registry's first read must pass over them.

Compatibility

  • A host with a host folder is untouched: same create, same delete, same place.
  • The registry file gains no field and no schema version.
  • No file format changes here: the wanted file's folder field comes with swamp-club#4865.

Decisions this issue makes

  • The order of create's steps. The expected order: set up in the hidden folder, write the wanted file with the folder, rename into place, register. A failure undoes the steps in reverse. The PR shows, step by step, what is left when create stops there and how a delete finishes it.
  • An import that takes the name while a create is running. The expected answer: the create fails with already_exists and removes only what it made. The imported folder is one of the operator's own throughout, because the wanted file names another folder.
  • A wanted file with a creator that an operator edits by hand. Removing the creator or the folder makes the workspace one of the operator's own, which is the safe direction. The PR says whether anything else can be edited into the host's own.

Done when

  • On a host with no host folder, swamp serve workspace create makes a folder in the workspace location and a registry entry. The workspace is listed as stopped, and a resume serves it at /w/<name>.
  • With workspaces.dir set, the folder is made there.
  • swamp serve workspace rm removes the folder, the entry and both files. A grant holder with admin on a matching pattern can do it.
  • A workspace made with swamp workspace create in the same location is refused by delete, and a hand-written deleted leaves its folder untouched.
  • A test stops create at each step, runs delete, and finds the name free and no folder left.
  • A test imports the same name at each step of a create. One of the two wins, and the imported folder is never removed or renamed.
  • A host with a host folder creates in workspaces/ as before.
  • The JSON written to the registry has only the keys it has today.
  • What the services return still names no host path.

Where to look

  • src/libswamp/hosted_workspace/create.ts and src/libswamp/hosted_workspace/deps.ts for create and its lock.
  • src/libswamp/workspace/workspace_store.ts (newWorkspaceLocation, checkNewWorkspaceFolder, createNewWorkspace, loadWorkspaceRegistry) for the location, the checks and the first read.
  • src/domain/serve/hosted_workspace.ts and src/infrastructure/persistence/hosted_workspace_file_repository.ts for the wanted file.
  • src/serve/host/workspace_reconciler.ts for the removal steps.
  • src/serve/handlers/workspace_handlers.ts for authorization.

Out of scope

  • Moving a host folder's existing workspaces into the workspace location.
  • A datastore chosen at creation.
  • Per-host quotas on created workspaces.
02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 8 MOREREVIEW+ 14 MOREPR_LINKED+ 2 MORESESSION_SUMMARIZED

Shipped

11/20/2026, 9:29:42 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
zack assigned zack11/20/2026, 7:58:52 PM

Sign in to post a ripple.