Relationships
↔ sibling #4951#4970 Remove the serve host's host folder layout and --host-dir: the host always reads host.yaml from the config dir and serves the registry's workspaces
Opened by zack · 11/20/2026· Shipped 11/21/2026
Follow-up to swamp-club#4920 and swamp-club#4921.
Problem
swamp serve host runs in one of two layouts: a host folder (host.yaml beside a workspaces/ folder holding the state files and one repo per workspace, chosen with --host-dir or by running in that folder) and no host folder (<config dir>/host.yaml, state in <data dir>/host/). Since swamp-club#4919 and swamp-club#4865 the workspace registry decides what the host serves, not the folder, so the host folder layout no longer earns its cost:
- two layouts, chosen by
--host-dir, then the current folder, then the config dir; - two rules for whose a workspace is: the folder's place with a host folder, the wanted file's creator and folder without one;
- two places a workspace request creates a repo;
- the hidden
--host-no-folderflag the host passes its root; - a
workspaces/scan that registers folders the registry lacks, and the clashes that scan can produce (swamp-club#4951).
--host-dir also does not give an operator separate hosts: two host folders still share one registry, so each lists the other's workspaces.
Change
Remove the host folder layout entirely. swamp serve host always reads <config dir>/host.yaml and keeps its state in <data dir>/host/; its workspaces are the registry's entries, and a request creates a workspace where swamp workspace create would.
- Remove
--host-dirand the current-folder lookup inlocateHostYaml. - Remove
HostLayout.hostFolder,hostFolderLayoutandWORKSPACES_DIR. - Remove the
workspaces/scan and registration, andhostFolderClaimedBy. - Make the creator-and-folder wanted-file rule the only ownership rule.
- Remove the hidden
--host-no-folderserve flag; the root always behaves as it does with it today. - Relative paths in
host.yamlresolve from the config dir. - Update the command help,
design/surfaces/serve-workspaces.md(The host, Compatibility, the execution plan) and the tests.
Compatibility
None needed: the command is hidden. An existing host folder stops working. Its operator moves host.yaml to the config dir and imports each repo with swamp workspace import; the host's error with no host.yaml in the config dir should say where to put one.
Related
- swamp-club#4951: its clashes come from repos in a host's
workspaces/that the registry does not know yet. With no host folder there are none, so it should be closed with this change. - swamp-club#4967: its out-of-scope note about host folders goes away; its fix becomes the only ownership rule.
Where to look
src/serve/host/host_layout.ts(locateHostYaml,hostFolderLayout)src/cli/commands/serve_host.ts(--host-dir, help text)src/serve/host/workspace_roster.ts,src/libswamp/workspace/hosted_roster.ts(hostFolderClaimedBy, thehostFolderbranches)src/libswamp/hosted_workspace/create.ts,src/libswamp/hosted_workspace/deps.tssrc/serve/host/serve_process.ts,src/serve/host_root_workspaces.ts,src/cli/commands/serve.ts(--host-no-folder)src/serve/host/host_config.ts(state folder and root containment checks)design/surfaces/serve-workspaces.md
Shipped
Click a lifecycle step above to view its details.