Skip to main content

Module cluster_stream

Module cluster_stream 

Source
Expand description

WS3 cluster topology/ownership subscription serving. WS3 cluster subscription: deploy-gated snapshot + live-delta forward loop.

This is the cluster-channel counterpart to [super::socket]’s workflow forward loop. It is a NEW ARM on the existing single subscription frame of /events/stream (the socket stays one-subscription-per-socket; there is no multiplexing layer). A client that wants both the workflow stream and the cluster stream opens two /events/stream sockets.

§Authorization: deploy-scope only (strict)

Cluster topology is deployment-wide: peer names, shard ownership, worker identities across every namespace. Exposing that to any single-namespace tenant is a cross-tenant topology leak. So the cluster channel requires the caller’s deploy grant ([CallerIdentity::deploy_granted]) — the same deployment-wide grant the deploy API uses — and nothing less. A caller without it receives exactly one terminal namespace_denied frame then close, byte-identical to the workflow path’s rejection shape (no existence leak).

Because the gate is a pure deploy-grant check it needs no engine handle (it reads supervisor/registry/store state, never a namespace engine), sidestepping the guard.scope(...).engine()? requirement the workflow path has.

Functions§

serve_cluster_socket
Serve a cluster subscription on an already-upgraded socket.