Relationships
#2955 A nested structural swamp spawned by swamp serve skips every lock serve holds, including other runs' locks
Opened by hammz · 10/2/2026· Shipped 10/2/2026
Problem
waitForPerModelLocks (src/cli/repo_context.ts) skips any per-model lock file whose pid matches the parent marker (SWAMP_LOCK_HOLDER_PID, plus the ancestor list being added for swamp-club#2659). The marker identifies a process, not a run.
A long-lived swamp serve runs several workflow and model runs concurrently, and every lock they take carries serve's pid. When run A's shell step spawns a nested structural swamp command (for example swamp data gc), that child skips all of serve's locks: run A's own lock (intended, to avoid deadlock) and also run B's lock (not intended). The child can then do structural work while run B is mid-write to its model data, which is exactly the race the symmetric drain exists to prevent (design/enablers/datastores.md, Lock Lifecycle).
The same applies to two parallel steps within one swamp workflow run on the CLI: a nested structural child of step A skips step B's lock.
This predates swamp-club#2659 and is not changed by it. Found during that issue's adversarial plan review (ADV-4).
Expected
A nested swamp skips only the locks held on behalf of the run (or step) that spawned it. One direction: record a run or step identifier in the lock file and hand that identifier down to the child, instead of matching on the pid alone.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.