Pure domain state transformations for cluster membership.
All functions in this module are pure — they take state and return new state with no side effects. This keeps the core business logic (scopes, roles, generations) testable and independent of GenServer or ETS.
Summary
Functions
Marks a node as known in a scope.
Adds roles to a scope, returning updated state and the roles that were actually new (not already present).
Adds a scope to the state, initialising all per-scope maps.
Returns true if the scope exists in the state.
Returns a new empty state.
Updates the remote generation for a node in a scope.
Removes a node from the known set in a scope.
Removes a node from all known-node sets across all scopes.
Removes a node's remote generation from all scopes.
Removes roles from a scope, returning updated state and the roles that were actually removed (existed in the set).
Removes a scope and all its data from the state.
Types
Functions
Marks a node as known in a scope.
Adds roles to a scope, returning updated state and the roles that were actually new (not already present).
Adds a scope to the state, initialising all per-scope maps.
Returns true if the scope exists in the state.
@spec new() :: t()
Returns a new empty state.
Updates the remote generation for a node in a scope.
Removes a node from the known set in a scope.
Removes a node from all known-node sets across all scopes.
Removes a node's remote generation from all scopes.
Removes roles from a scope, returning updated state and the roles that were actually removed (existed in the set).
Removes a scope and all its data from the state.