Skip to main content
← Back to list
01Issue
FeatureOpenSwamp CLIPublic
AssigneesNone

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:

What changes

1. README: running jobs across hosts

Add a short section that shows the model:

  • One swamp serve as the orchestrator, with a swamp worker on 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:
    1. mint a worker token
    2. swamp worker daemon on a host with labels and a stable --cache-dir
    3. a workflow with a fanOut job on labels: { role: web } that pushes a config file and asserts a health check per host
    4. 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:

  1. What it is, and when to use it versus a single placed step or forEach
  2. The field and its validation
  3. Membership and dispositions
  4. Lanes, self.worker and per-worker instances
  5. The offline policy and minWorkers
  6. rollout: batches, the error budget, held lanes, halts
  7. Approval gates
  8. Resume, retry, --from and recover
  9. Output events
  10. Run-record fields and what the judge freezes
  11. 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 queueTimeout for 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 unless dispatch-env-allow is 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 its serve.yaml. Check design/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 validate on 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 --help shows a quoted gate name.
  • Formatting: deno fmt leaves design/ and README.md unchanged. A docs-only PR runs no release build, so ship it from releasing.
02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

11/23/2026, 7:44:51 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.