start

abstract suspend fun start(memberName: String? = null, deviceId: String? = null, admission: HostAdmission): Room

HOST-ONLY. Close the lobby and begin the session: run the freeze/ack round, then adopt the seam as us.tractat.kuilt.session.SessionRole.Host. Retries internally while membership churns and while a live member has not acknowledged; returns the admitted Room once every member has.

There is no overall bound. A member whose lobby is open with nothing waiting in it answers this peer's pings and never acknowledges, so this keeps retrying until that member calls leave, goes silent, or this call is cancelled. An app that wants a limit sets its own.

deviceId is accepted for symmetry with awaitRoom, since a peer does not know its role until the election settles. A host sends no Hello, so a host's room ignores it, as us.tractat.kuilt.session.SeamRoomFactory.adopt does.

admission decides who the adopted room lets in, as it does for us.tractat.kuilt.session.RoomFactory.host. It is asked here, on the call only the elected host makes, so a member waiting in awaitRoom never supplies a policy it would not use.

Throws

if deviceId could not be signed into a key proof (an unpaired surrogate, or UTF-8 longer than 65 535 bytes), before the election runs. Checked here too, though a host sends no proof, so a value is refused the same whichever role it lands.

if this peer is not currently host.

if the underlying seam tears mid-election, or a member drains away or goes silent (co-electors permanently gone). Terminal and retryable.