Relationships
#4864 Enrollment-token methods run from a workflow step in serve bypass the gateway's token write ordering
Opened by zack · 11/18/2026· Shipped 11/18/2026
Found while triaging #4861.
design/enablers/remote-execution.md (Enrollment tokens) says the orchestrator serializes all token transitions in memory and is the only writer of the swamp/enrollment-token behavior. WorkerGateway runs redeem, rotate, expire and rebind on its transition tail, and the serve revoke handler wraps its record write in WorkerGateway.serializeTokenWrite so a concurrent redeem or rotate cannot write over it.
A workflow step (or a model method run in serve) that calls rotate, revoke, rebind or prune_bindings on a swamp/enrollment-token behavior goes through the generic method execution path instead and writes the token record outside that tail. Nothing orders it against an enrollment that is redeeming on the same token, so one of the two writes can be lost. For example, a redeem that read the record before a step's rotate wrote it then writes the old mint back with its new binding. The rotation is lost, but its vault key exists and the dropped predecessor's key has already been deleted.
Not reproduced; found by reading src/serve/worker_gateway.ts (serializeTokenWrite, recordTransition) and src/serve/handlers/admin_handlers.ts (handleWorkerTokenRevoke) against the workflow step path in src/domain/models/method_execution_service.ts.
Expected: in-serve runs of enrollment-token methods are ordered on the gateway's token tail, or refused there.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.