HubArbiter
autogen.beta.network.hub.arbiter.HubArbiter #
Bases: Protocol
Decision-making Protocol the hub consults before committing.
Implementations replace the default :class:RuleBasedArbiter via :meth:Hub.register_arbiter. Only one arbiter is active at a time; the most recent registration wins.
Methods may inspect any state passed in but should not mutate hub state — they are decisions, not side-effecting work.
authorize_send async #
Gate post_envelope before the WAL append.
Checks rule-based outbound access (access.outbound_to) plus delegation depth (limits.delegation_depth). Inbox capacity is handled separately by :meth:authorize_inbox because it depends on per-recipient hub-internal counters.
Source code in autogen/beta/network/hub/arbiter.py
authorize_inbox async #
Gate post_envelope per-recipient against inbox capacity.
Hub iterates the resolved audience, calling this once per recipient with their current pending count. Returning Deny (with error=InboxFull by default) short-circuits the send.
Source code in autogen/beta/network/hub/arbiter.py
authorize_dispatch async #
Gate per-recipient dispatch (inbound access).
Called for every notify frame the hub is about to send. Returning Deny causes the hub to silently skip this recipient (the rest of the audience still gets delivery).
Source code in autogen/beta/network/hub/arbiter.py
authorize_channel_open async #
authorize_channel_open(manifest, creator, creator_rule, invitees, invitee_rules, active_creator_channels)
Gate create_channel before any persistence.
Default impl checks each invitee's access.inbound_from against the creator's name, plus the creator's limits.max_concurrent_channels against the running count.
Source code in autogen/beta/network/hub/arbiter.py
authorize_register async #
resolve_unknown_audience async #
Federation hook for audience members the hub doesn't know.
Default impl returns None (drop unknown ids, current single-hub behavior). A federated arbiter returns a (possibly empty) list of agent_ids the envelope should be re-delivered to instead — typically the local proxy id of a remote peer.