Relationships
#5025 docs: fan-out as one general capability in the swamp CLI repo: a README section on running jobs across hosts, consolidated design docs, and quoted lane and gate names
Opened by stack72 · 11/23/2026
Context
Fan-out shipped over six PRs: #4379, #4506, #4516, #4527, #4531 and #4541. It has end-to-end coverage in swamp-uat#978. A workflow can send one job to every host running a swamp worker whose labels match, as one lane per host, with rollout batches, an error budget, approval gates, and resume of the planned set.
Each PR updated the design docs for its own slice, so the in-repo documentation now describes the feature piecemeal:
design/primitives/workflows.md("Fan-out Jobs (fanOut)", ~63 mentions)design/enablers/remote-execution.md("Fan-out jobs and lanes")
The README never mentions workers or running jobs across hosts. This issue makes the documentation that ships with the swamp CLI repo describe fan-out as one general capability. The goal is "fan a job out across the hosts that run swamp workers", not patching.
Out of scope:
- The swamp skill and
workflow history get, which are #5021 - The external manual
Links:
- Design: https://claude.ai/artifact/WbnKGvQcuJdo6jQBbezDxz
- Work plan: https://claude.ai/artifact/CTfkUbRmw6JxccPyyVhY9H#w-surfaces
- Related: #3824
What changes
1. README: running jobs across hosts
Add a short section that shows the model:
- One
swamp serveas the orchestrator, with aswamp workeron each host that connects out to it. There's no inbound port on the hosts, and the hosts hold no state or credentials. - A minimal end-to-end example:
- mint a worker token
swamp worker daemonon a host with labels and a stable--cache-dir- a workflow with a
fanOutjob onlabels: { role: web }that pushes a config file and asserts a health check per host swamp workflow run --server
- Links to the design docs and the skill for everything else.
2. Consolidate the design docs
design/primitives/workflows.md: make "Fan-out Jobs (fanOut)" read as one section, in this order:
- What it is, and when to use it versus a single placed step or
forEach - The field and its validation
- Membership and dispositions
- Lanes,
self.workerand per-worker instances - The offline policy and
minWorkers rollout: batches, the error budget, held lanes, halts- Approval gates
- Resume, retry,
--fromand recover - Output events
- Run-record fields and what the judge freezes
- Known limits
Keep every rule that is there today. Each PR's additions should become part of the right subsection, not be appended per release. Remove anything a later PR made untrue, for example the "next release" refusals that #4516 and #4531 lifted.
design/enablers/remote-execution.md: keep the scheduling and dispatch side ("Fan-out jobs and lanes", pool reading, pinning, eligibility) consistent with workflows.md. Link between the two docs rather than repeating.
Both docs:
- One glossary for the terms: plan, member, disposition, lane, batch, error budget, held, halt, gate. Use it the same way everywhere.
- Generic examples: a config push, a certificate rotation, a staged package update.
Running jobs that restart hosts. Add a short operational note:
- A step that restarts its host must schedule the restart and return, because a worker drop after a write fails the lane.
- The worker should run as a daemon with a stable
--cache-dir, so it re-enrols as the same machine. - Size the lane's
queueTimeoutfor the restart. - Assert the post-restart state in a later lane step.
3. Quoting lane and gate names
Lane steps and gates are named with brackets (apply[web-01], patch[approve-plan]). zsh treats [...] as a glob, so swamp workflow approve deploy patch[approve-plan] fails with "no matches found" in zsh, and --from apply[web-01] behaves the same way. Wherever the docs show these names on a command line, quote them, and say why once. The help examples of swamp workflow approve and workflow resume --from should show a quoted bracketed name.
4. Environment and workspaces
dispatch-env-allow. The README section and the consolidated design docs say plainly that a dispatch ships serve's environment minus the denylist unlessdispatch-env-allowis set (shipped in PR #2871, #2760, #2791), and that fan-out sends it to every matching host. Recommend setting it before fanning out to hosts, and say each hosted workspace sets its own in itsserve.yaml. Checkdesign/enablers/remote-execution.md's "Whole-environment dispatch" known limit, which reads as if no scoping exists, and correct it to "a serve-wide allowlist exists; per-label or per-token scoping does not".Workspaces. Add a short "Fan-out and serve workspaces" part to the fan-out section, cross-linked with
design/surfaces/serve-workspaces.md. Cover:- a fan-out job reaches only its own workspace's workers
- workers connect to
<host>/w/<name>with a token minted by that workspace - a machine serving two workspaces runs two workers
- no shared pool or multi-host workspace yet
The README example can stay on a plain serve, with one sentence pointing at workspaces. swamp-uat#1002 covers fan-out inside a hosted workspace.
Blocked by
- None.
Done when
- README: it has the running-jobs-across-hosts section, and its example workflow validates with
swamp workflow validateon the current binary. - Design docs: both have one coherent fan-out section each, with no stale "arrives in a later release" text. Every behaviour described matches main. Spot-check against the fleet harness tests and swamp-uat#978's journeys.
- Quoting: bracketed names are quoted in every command example.
swamp workflow approve --helpshows a quoted gate name. - Formatting:
deno fmtleavesdesign/andREADME.mdunchanged. A docs-only PR runs no release build, so ship it from releasing.
Open
No activity in this phase yet.
Sign in to post a ripple.