← Back to list
01Issue
FeatureClosedUATPublic
AssigneesNone
Relationships
#630 Remote execution: UAT coverage for tokens, enrollment, and dispatch
Opened by adam · 6/11/2026
Remote execution shipped in swamp-club#535 (PR #1547) with unit and integration tests, but there is no user-acceptance test suite that exercises the feature the way an operator would — real processes, real sockets, real restarts. This issue records the UAT scenarios that need writing.
Scope of changes
A UAT suite (scripted scenarios runnable against a built swamp binary, orchestrator and workers as separate OS processes) covering the scenarios below. Each scenario should assert on user-visible surfaces: CLI output (both log and --json modes), swamp worker list / swamp worker token list state, and workflow run results — not on internals.
UAT scenarios needed
Token lifecycle
- Mint —
swamp worker token createprints the<name>.<secret>credential exactly once; plaintext never appears inswamp dataoutput or on disk outside the vault. - Duplicate name — minting the same token name twice fails with the documented error.
- List states —
swamp worker token listshowsunusedafter mint,enrolledafter first connect with the bound machine id,expiredpast the lifetime,revokedafter revoke. - Revoke — a revoked token cannot enroll; revoking twice is idempotent.
Enrollment & machine binding
- Happy path — worker connects, enrolls, shows
idleandconnectedinswamp worker list; labels/platform/arch recorded. - Restart survival — worker with
--cache-diris killed and restarted; it re-enrolls on the same token as the same pool member. Repeat across a simulated reboot (fresh process tree). - Temp cache dir caveat — worker WITHOUT
--cache-diris restarted; re-enrollment is rejected (already bound to another machine) and the worker process exits permanently rather than retry-looping. - Second machine rejected — same token from a different machine (or different cache dir) while the first is enrolled: rejected, first worker unaffected.
- Concurrent duplicate — second live connection presenting the same token while the first is connected: rejected with
already_connected. - Version lockstep — a worker binary with a different protocol version is rejected at enrollment with
protocol_mismatchand stops cleanly.
Expiry enforcement
- Hard deadline while connected — mint a short-lived token, connect, wait past expiry: orchestrator disconnects the worker, the reconnect attempt fails with
expired, the worker process stops, the pool entry is removed after the grace window, andtoken listshowsexpired. - Expired before first use — an unused token past its lifetime cannot enroll.
- Expiry while disconnected — worker drops, token expires during the grace window, reconnect is rejected.
Reconnection & failure semantics
- Socket blip — kill the network path (not the process); worker reconnects within the grace window as the same pool member; a queued step then dispatches to it.
- Worker death mid-step, no writes — kill the worker during a read-only step: the step re-dispatches (to a reconnected or another matching worker) and the run succeeds.
- Worker death mid-step, after a write — kill the worker after the step persisted data: the run fails with the documented write-then-fail behavior and partial data is visible/inspectable.
- Cancellation — cancel a workflow with a step in flight on a worker: the dispatch is cooperatively cancelled, the worker returns to
idle, no orphaned lease remains.
Dispatch & scheduling
- Label selection — steps with
labels:selectors dispatch only to matching workers; with no match the step queues and dispatches when a matching worker enrolls. - Direct targeting —
target:by worker name and by instance uuid. - Serialization — two steps placed on one worker run serially; a busy worker is not double-dispatched.
- Fan-out — a matrix/expanded workflow spreads steps across multiple enrolled workers and all outputs land in the datastore with correct versions.
Data, secrets, and environment
- Capability proxying — a placed step reads prior step data, queries with CEL, and writes outputs; results identical to local execution.
- Bundle shipping — a step using a pulled extension runs on a worker with no local extensions; second dispatch hits the worker bundle cache (assert via timing or logs).
- Secrets stay home — a step resolving a vault secret succeeds; the secret value never appears in the worker cache directory or worker logs.
- Environment snapshot scoping — orchestrator env vars are visible to the method during the step and gone from the worker process after it completes.
- Large artifacts — a step producing a multi-hundred-MB file output streams through the data plane and round-trips intact (checksum).
Operability & UX
- JSON mode parity — every
swamp worker *command produces valid, documented JSON with--jsonand human-readable output without. swamp serve --server— workflows and methods run through a server end-to-end.- TLS — worker connects over
wss://; a wrong/self-signed certificate is rejected unless pinned/trusted as documented. - Cross-platform workers — scenarios 5–7 pass with workers on Linux, macOS, and Windows (path handling for the cache directory and machine-id file).
Acceptance criteria
- Each scenario is automated and runnable against a release binary in CI or a bench environment, with orchestrator and workers as separate processes.
- Scenarios assert on user-visible behavior (CLI output, pool/token state, run results), not internal APIs.
- A coverage map ties each scenario above to its script so gaps stay visible.
02Bog Flow
Closed
No activity in this phase yet.
03Sludge Pulse