owner

fun owner(taskId: TaskId): PeerId?

Returns the peer that owns taskId under the current roster, or null if the roster is empty.

The owner is the first peer clockwise of hash(taskId) on the ring. Deterministic: same roster + same seed → same result for every peer in the session.


fun owner(taskId: TaskId, eligible: Set<PeerId>): PeerId?

Returns the owner of taskId restricted to the eligible subset of the roster, or null if no ring peer is eligible.

This is the H8 location-eligibility hook (design §14.6): consistent-hashing over only the eligible peers is identical to walking the full ring and returning the first clockwise peer that is in eligible — removing a peer from a consistent-hash ring is exactly "skip its virtual nodes." Passing an eligible set that contains the whole roster therefore reproduces owner bit-for-bit, so the no-affinity path is unchanged.

Deterministic: the same ring + same eligible set → same result on every peer. Callers derive eligible by filtering the roster with a task's Affinity against each peer's advertised CapSet; every peer computes the same eligible set from the same convergent capability view.