Repository navigation
API Reference parrot.integrations.liveavatar.broadcast.registry
Broadcast registry contract and in-memory reference implementation (FEAT-537).
Implements spec §2 "Ownership, admission and cleanup" and "Moderation and
exclusive speaking floor" as a storage-agnostic contract, plus the
in-memory implementation that defines the reference semantics
:class:RedisBroadcastRegistry (TASK-2953) must reproduce and that every
deterministic unit test runs against.
The registry owns state and arbitration only. It never holds PCM, tokens,
AWS credentials, LiveAvatar access tokens or live SDK objects, and it never
talks to LiveKit — removing a participant from a room is the caller's job, and
the registry deliberately reports an expiry rather than releasing a seat behind
the caller's back (fail closed; see :meth:BroadcastRegistry.expire).
Three invariants hold at every await point:
- pending + active + tombstoned reservations never exceed
max_viewers; - there is exactly one
moderator_lease_idwhile any lease remains; - there is at most one
speaker_lease_id, and it isNonefor the whole duration of a floor switch.
Outcome of a seat reservation.
Unpacks as the (lease, is_first) tuple the caller needs: is_first
is True for exactly one admission per broadcast — the one that elected
the moderator — and tells the caller to run claim_owner plus producer
startup once.
Attributes:
| Attribute | Type | Description |
|---|---|---|
lease |
ViewerLease |
The reserved :class:ViewerLease. |
is_first |
bool |
Whether this admission elected the moderator. |
Storage-agnostic broadcast state, admission and moderation contract.
Implementations must be safe to call concurrently from multiple tasks and,
for the Redis implementation, from multiple worker processes. Every
mutating method takes an optional now so a distributed implementation
can pass authoritative server time and tests can inject a fake clock.
Persist a new pending broadcast.
create(descriptor: BroadcastDescriptor) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
descriptor |
BroadcastDescriptor |
Fully-formed pending descriptor. |
Returns: BroadcastDescriptor — The stored descriptor.
Raises:
-
BroadcastError— If the broadcast id already exists.
Return a descriptor, or None when unknown or out of tenant scope.
get(tenant_id: str, broadcast_id: str) -> Optional[BroadcastDescriptor]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
Returns: Optional[BroadcastDescriptor]
Move the broadcast to new_state, fenced by the ownership epoch.
transition(tenant_id: str, broadcast_id: str, new_state: BroadcastState, *, output_epoch: Optional[int] = None, reason: Optional[BroadcastReason] = None, expected_owner_epoch: int) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
Tenant scope. | |
broadcast_id |
str |
Broadcast to transition. | |
new_state |
BroadcastState |
Target state. audio_only → avatar is not legal. |
|
output_epoch |
Optional[int] |
None |
New monotonic output generation, when cutting over. |
reason |
Optional[BroadcastReason] |
None |
Sanitized reason to record. |
expected_owner_epoch |
int |
Ownership generation the caller believes it holds; a mismatch means it was fenced. |
Returns: BroadcastDescriptor — The updated descriptor.
Raises:
-
NotOwner— If the caller's ownership epoch is stale. -
BroadcastTerminal— If the broadcast already ended or failed. -
ValueError— If the edge is not in the legal state graph.
Atomically claim producer ownership.
claim_owner(tenant_id: str, broadcast_id: str, worker_id: str, *, now: Optional[float] = None) -> tuple[bool, int]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
worker_id |
str |
||
now |
Optional[float] |
None |
Returns: tuple[bool, int] — (claimed, owner_epoch). claimed is False when a live owner already holds the lease; owner_epoch is then that owner's epoch, so the caller can fence itself.
Extend an ownership lease.
renew_owner(tenant_id: str, broadcast_id: str, worker_id: str, owner_epoch: int, *, now: Optional[float] = None) -> bool
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
worker_id |
str |
||
owner_epoch |
int |
||
now |
Optional[float] |
None |
Returns: bool — False when the caller has been fenced — it must stop publishing immediately rather than wait for its own lease to expire.
Atomically reserve one of the ten receiving seats.
The first successful reservation — and only the first — sets
moderator_lease_id, sets the initial speaker_lease_id to the
same lease, moves the floor to granted at epoch 1, and reports
is_first=True so the caller starts the producer exactly once.
reserve_viewer(tenant_id: str, broadcast_id: str, principal: ParticipantPrincipal, livekit_identity: str, *, now: Optional[float] = None) -> Admission
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
principal |
ParticipantPrincipal |
||
livekit_identity |
str |
||
now |
Optional[float] |
None |
Returns: Admission
Raises:
-
ViewerLimitReached— If seats plus retained reservations are full. -
IdentityTombstoned— If that LiveKit identity recently departed. -
BroadcastTerminal— If the broadcast ended or failed.
Mark a lease as an active, confirmed room participant.
confirm_viewer(tenant_id: str, broadcast_id: str, lease_id: str) -> ViewerLease
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
Returns: ViewerLease
Record a control-socket heartbeat. Does not bump the version.
heartbeat_control(tenant_id: str, broadcast_id: str, lease_id: str, *, now: Optional[float] = None) -> None
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
||
now |
Optional[float] |
None |
Release a seat idempotently and report the moderation consequences.
release_viewer(tenant_id: str, broadcast_id: str, lease_id: str, *, now: Optional[float] = None) -> ReleaseOutcome
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
||
now |
Optional[float] |
None |
Returns: ReleaseOutcome
Return every lease currently holding a seat, in admission order.
list_leases(tenant_id: str, broadcast_id: str) -> List[ViewerLease]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
Returns: List[ViewerLease]
Record an idempotent raise-hand request. Grants no permission.
raise_hand(tenant_id: str, broadcast_id: str, lease_id: str, *, now: Optional[float] = None) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
||
now |
Optional[float] |
None |
Returns: BroadcastDescriptor
Withdraw the caller's own hand request. Idempotent.
cancel_hand(tenant_id: str, broadcast_id: str, lease_id: str) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
Returns: BroadcastDescriptor
Moderator-only dismissal of another participant's request.
dismiss_hand(tenant_id: str, broadcast_id: str, moderator_lease_id: str, target_lease_id: str) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
moderator_lease_id |
str |
||
target_lease_id |
str |
Returns: BroadcastDescriptor
Raises:
-
NotModerator— If the caller is not the current moderator.
Open the handoff barrier towards target_lease_id.
Clears the permitted speaker, increments floor_epoch and enters
switching atomically. target_lease_id=None means revoke —
the floor returns to the moderator once the barrier is acknowledged.
grant_floor(tenant_id: str, broadcast_id: str, moderator_lease_id: str, target_lease_id: Optional[str], expected_version: int) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
moderator_lease_id |
str |
||
target_lease_id |
Optional[str] |
||
expected_version |
int |
Returns: BroadcastDescriptor
Raises:
-
NotModerator— If the caller is not the current moderator. -
StaleVersion— On a compare-and-set conflict, including an already-switching floor. -
FloorNotGranted— If the target is not an active admitted lease.
Acknowledge the barrier and install the new speaker.
commit_floor(tenant_id: str, broadcast_id: str, target_lease_id: str, floor_epoch: int) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
target_lease_id |
str |
||
floor_epoch |
int |
Returns: BroadcastDescriptor
Raises:
-
StaleFloorEpoch— If the floor is not switching atfloor_epoch. -
FloorNotGranted— If the target is not the pending target or has since departed.
Abandon a failed or timed-out barrier, leaving the floor idle.
abort_floor(tenant_id: str, broadcast_id: str, floor_epoch: int) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
floor_epoch |
int |
Returns: BroadcastDescriptor
Speaker-initiated "Finish Speaking" — barrier back to the moderator.
release_floor(tenant_id: str, broadcast_id: str, speaker_lease_id: str) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
speaker_lease_id |
str |
Returns: BroadcastDescriptor
Raises:
-
NotSpeaker— If the caller does not currently hold the floor.
Moderator revoke — :meth:grant_floor with a None target.
revoke_floor(tenant_id: str, broadcast_id: str, moderator_lease_id: str, expected_version: int) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
moderator_lease_id |
str |
||
expected_version |
int |
Returns: BroadcastDescriptor
Elect the earliest remaining healthy participant as moderator.
elect_moderator(tenant_id: str, broadcast_id: str, *, now: Optional[float] = None) -> Optional[str]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
now |
Optional[float] |
None |
Returns: Optional[str] — The elected lease id, or None when nobody is eligible.
Bind the single microphone socket permitted to send audio.
bind_speaker_socket(tenant_id: str, broadcast_id: str, lease_id: str, socket_id: str, floor_epoch: int) -> bool
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
||
socket_id |
str |
||
floor_epoch |
int |
Returns: bool
Raises:
-
FloorNotGranted— If the lease does not hold the floor. -
StaleFloorEpoch— If the epoch is superseded. -
SpeakerConnectionExists— If a different socket is already bound.
Drop a microphone-socket binding. Idempotent.
unbind_speaker_socket(tenant_id: str, broadcast_id: str, lease_id: str, socket_id: str) -> bool
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
||
socket_id |
str |
Returns: bool
Record the durable desired terminal state. Moderator only.
request_stop(tenant_id: str, broadcast_id: str, by_lease_id: str) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
by_lease_id |
str |
Returns: BroadcastDescriptor
Raises:
-
NotModerator— If the caller is not the current moderator.
Whether a stop has been requested. Polled by the owner every second.
stop_requested(tenant_id: str, broadcast_id: str) -> bool
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
Returns: bool
Persist producer-owned media facts onto the durable descriptor.
The publisher identities decide which track a browser plays. They were
previously known only to the process running the producer, so any other
worker projected selected_identity=None and its viewers could not
tell which publisher to attach — the descriptor had the fields, nothing
ever filled them in.
set_media_state(tenant_id: str, broadcast_id: str, *, room_name: Optional[str] = None, avatar_identity: Optional[str] = None, direct_identity: Optional[str] = None, liveavatar_session_id: Optional[str] = None) -> Optional[BroadcastDescriptor]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
Tenant scope. | |
broadcast_id |
str |
Broadcast concerned. | |
room_name |
Optional[str] |
None |
LiveKit room backing the broadcast. |
avatar_identity |
Optional[str] |
None |
Avatar publisher identity. |
direct_identity |
Optional[str] |
None |
Direct audio publisher identity. |
liveavatar_session_id |
Optional[str] |
None |
Vendor session id, when one exists. |
Returns: Optional[BroadcastDescriptor] — The updated descriptor, or None when it is gone.
Every live broadcast in the store, as (tenant_id, broadcast_id).
Reconciliation needs this to be store-wide, not process-local: the whole point of fencing a dead owner is that some other worker — one that may never have served this broadcast — notices it and takes over. A reconciler that only walks what its own process happened to serve cannot, by construction, recover a broadcast whose only worker died.
list_broadcasts() -> List[Tuple[str, str]]
Returns: List[Tuple[str, str]] — Live broadcasts, in unspecified order.
Run one reconciliation pass and report what expired.
Deliberately conservative: an expired control participant is marked
leaving and reported, not released. The caller must remove it
from the LiveKit room first and then call :meth:release_viewer, so an
unreachable participant can never be replaced by an over-admitted one.
expire(tenant_id: str, broadcast_id: str, *, now: Optional[float] = None) -> List[ExpiryEvent]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
now |
Optional[float] |
None |
Returns: List[ExpiryEvent]
One thing a reconciliation pass expired.
| Parameter | Type | Default | Description |
|---|---|---|---|
kind |
ExpiryKind |
||
lease_id |
Optional[str] |
None |
|
detail |
str |
'' |
Fields:
| Field | Type | Default | Description |
|---|---|---|---|
kind |
ExpiryKind |
What expired. | |
lease_id |
Optional[str] |
None |
Lease concerned, for lease-scoped kinds. |
detail |
str |
'' |
Operator-facing detail; never returned to a client. |
What a reconciliation pass found expired.
Single-process reference implementation of :class:BroadcastRegistry.
Serialises every mutation of one broadcast behind a per-broadcast
:class:asyncio.Lock, which is what makes the concurrent-admission and
conflicting-grant races deterministic. This is the semantics the Redis
implementation reproduces with atomic scripts.
| Parameter | Type | Default | Description |
|---|---|---|---|
clock |
Optional[Callable[[], float]] |
None |
Callable returning epoch seconds. Injected so TTL behaviour is testable without sleeping. |
create(descriptor: BroadcastDescriptor) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
descriptor |
BroadcastDescriptor |
Returns: BroadcastDescriptor
get(tenant_id: str, broadcast_id: str) -> Optional[BroadcastDescriptor]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
Returns: Optional[BroadcastDescriptor]
transition(tenant_id: str, broadcast_id: str, new_state: BroadcastState, *, output_epoch: Optional[int] = None, reason: Optional[BroadcastReason] = None, expected_owner_epoch: int) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
new_state |
BroadcastState |
||
output_epoch |
Optional[int] |
None |
|
reason |
Optional[BroadcastReason] |
None |
|
expected_owner_epoch |
int |
Returns: BroadcastDescriptor
claim_owner(tenant_id: str, broadcast_id: str, worker_id: str, *, now: Optional[float] = None) -> tuple[bool, int]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
worker_id |
str |
||
now |
Optional[float] |
None |
Returns: tuple[bool, int]
renew_owner(tenant_id: str, broadcast_id: str, worker_id: str, owner_epoch: int, *, now: Optional[float] = None) -> bool
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
worker_id |
str |
||
owner_epoch |
int |
||
now |
Optional[float] |
None |
Returns: bool
reserve_viewer(tenant_id: str, broadcast_id: str, principal: ParticipantPrincipal, livekit_identity: str, *, now: Optional[float] = None) -> Admission
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
principal |
ParticipantPrincipal |
||
livekit_identity |
str |
||
now |
Optional[float] |
None |
Returns: Admission
confirm_viewer(tenant_id: str, broadcast_id: str, lease_id: str) -> ViewerLease
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
Returns: ViewerLease
heartbeat_control(tenant_id: str, broadcast_id: str, lease_id: str, *, now: Optional[float] = None) -> None
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
||
now |
Optional[float] |
None |
release_viewer(tenant_id: str, broadcast_id: str, lease_id: str, *, now: Optional[float] = None) -> ReleaseOutcome
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
||
now |
Optional[float] |
None |
Returns: ReleaseOutcome
list_leases(tenant_id: str, broadcast_id: str) -> List[ViewerLease]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
Returns: List[ViewerLease]
raise_hand(tenant_id: str, broadcast_id: str, lease_id: str, *, now: Optional[float] = None) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
||
now |
Optional[float] |
None |
Returns: BroadcastDescriptor
cancel_hand(tenant_id: str, broadcast_id: str, lease_id: str) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
Returns: BroadcastDescriptor
dismiss_hand(tenant_id: str, broadcast_id: str, moderator_lease_id: str, target_lease_id: str) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
moderator_lease_id |
str |
||
target_lease_id |
str |
Returns: BroadcastDescriptor
grant_floor(tenant_id: str, broadcast_id: str, moderator_lease_id: str, target_lease_id: Optional[str], expected_version: int) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
moderator_lease_id |
str |
||
target_lease_id |
Optional[str] |
||
expected_version |
int |
Returns: BroadcastDescriptor
commit_floor(tenant_id: str, broadcast_id: str, target_lease_id: str, floor_epoch: int) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
target_lease_id |
str |
||
floor_epoch |
int |
Returns: BroadcastDescriptor
abort_floor(tenant_id: str, broadcast_id: str, floor_epoch: int) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
floor_epoch |
int |
Returns: BroadcastDescriptor
release_floor(tenant_id: str, broadcast_id: str, speaker_lease_id: str) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
speaker_lease_id |
str |
Returns: BroadcastDescriptor
revoke_floor(tenant_id: str, broadcast_id: str, moderator_lease_id: str, expected_version: int) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
moderator_lease_id |
str |
||
expected_version |
int |
Returns: BroadcastDescriptor
elect_moderator(tenant_id: str, broadcast_id: str, *, now: Optional[float] = None) -> Optional[str]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
now |
Optional[float] |
None |
Returns: Optional[str]
bind_speaker_socket(tenant_id: str, broadcast_id: str, lease_id: str, socket_id: str, floor_epoch: int) -> bool
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
||
socket_id |
str |
||
floor_epoch |
int |
Returns: bool
unbind_speaker_socket(tenant_id: str, broadcast_id: str, lease_id: str, socket_id: str) -> bool
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
lease_id |
str |
||
socket_id |
str |
Returns: bool
request_stop(tenant_id: str, broadcast_id: str, by_lease_id: str) -> BroadcastDescriptor
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
by_lease_id |
str |
Returns: BroadcastDescriptor
stop_requested(tenant_id: str, broadcast_id: str) -> bool
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
Returns: bool
set_media_state(tenant_id: str, broadcast_id: str, *, room_name: Optional[str] = None, avatar_identity: Optional[str] = None, direct_identity: Optional[str] = None, liveavatar_session_id: Optional[str] = None) -> Optional[BroadcastDescriptor]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
room_name |
Optional[str] |
None |
|
avatar_identity |
Optional[str] |
None |
|
direct_identity |
Optional[str] |
None |
|
liveavatar_session_id |
Optional[str] |
None |
Returns: Optional[BroadcastDescriptor]
list_broadcasts() -> List[Tuple[str, str]]
Returns: List[Tuple[str, str]]
expire(tenant_id: str, broadcast_id: str, *, now: Optional[float] = None) -> List[ExpiryEvent]
| Parameter | Type | Default | Description |
|---|---|---|---|
tenant_id |
str |
||
broadcast_id |
str |
||
now |
Optional[float] |
None |
Returns: List[ExpiryEvent]
Consequences of releasing one viewer seat.
| Parameter | Type | Default | Description |
|---|---|---|---|
audience_empty |
bool |
||
floor_returned_to |
Optional[str] |
None |
|
new_moderator |
Optional[str] |
None |
Fields:
| Field | Type | Default | Description |
|---|---|---|---|
audience_empty |
bool |
Whether no participants remain, so the caller must tear the producer down. | |
floor_returned_to |
Optional[str] |
None |
Lease the floor barrier now targets, if the departure moved the floor. The caller must acknowledge with commit_floor. |
new_moderator |
Optional[str] |
None |
Lease elected as moderator, if the moderator departed. |
Reject microphone input that is unauthorized, stale or from a stray socket.
Called at both ingress and the producer, immediately before queueing PCM (spec §2: "Validate authority at both ingress and the producer just before queueing PCM"). Pure and synchronous so the producer can call it per frame without touching the store.
Socket possession, moderator role, or a valid LiveKit viewer JWT alone never authorize input — only the fencing tuple below does.
validate_audio_authority(descriptor: BroadcastDescriptor, lease_id: str, floor_epoch: int, socket_id: str, *, bound_socket_id: Optional[str] = None) -> None
| Parameter | Type | Default | Description |
|---|---|---|---|
descriptor |
BroadcastDescriptor |
Current broadcast descriptor. | |
lease_id |
str |
Lease the frame claims to come from. | |
floor_epoch |
int |
Floor epoch the frame was produced under. | |
socket_id |
str |
Microphone socket the frame arrived on. | |
bound_socket_id |
Optional[str] |
None |
The socket currently bound to the floor, when known. |
Raises:
-
FloorNotGranted— If no floor is granted, or it is granted to someone else. -
StaleFloorEpoch— If the frame belongs to a superseded floor epoch. -
SpeakerConnectionExists— If a different socket holds the binding.
- 1. MCP Server — exposing tools as a service
- 2. A2A — exposing agents and orchestrators as services
- 3. Toolkits for third party services and Cloud Security composition
- 4. Interaction surface — WebSockets, audio, integrations
- 5. Hardening — anti prompt injection, PBAC and tool gating
- 6. Cross cutting concerns and reference deployment
- 7. AgentCrew — Sequential, Parallel, Flow and Loop execution
- 8. AgentsFlow — DAG first orchestration with per node FSM
- 9. Ontologic RAG — graph first retrieval, intent routing & multi tenant knowledge
- 10. Observability — OpenLIT + OpenTelemetry
- Class Catalog by Module
- Module level Functions Catalog
- AI Parrot — Exposure, Interoperability & Hardening Architecture
- Agent Mesh
- AgentService — Standalone Runtime for Autonomous Agents
- AbstractClient: The Provider Client Family
- Anthropic client
- Bedrock Mantle Client
- TypeSafe System One Client (
JevClient) - Meta Model API Client (Muse Spark)
- OpenAI Compatible Client Base (
OpenAIBaseClient) - Per Loop LLM Client Cache
- Question Token Budgets (Bedrock Converse, Nova text, Bedrock Mantle)
- Agent Configure Lifecycle
- AgentTalk Integration Guide
- Agent Configuration via
agents.yaml - AgentFactory HTTP API
- Agent Studio — API Reference
- Agent CLI Daemon (agentd)
- FirefliesInsightsAgent
- Follow up Suggestion Chips (FEAT 752)
- Agents and Chatbots: The Bot Class Hierarchy
- Agent Studio — database storage (host guide)
- Ephemeral User Agents — Frontend Integration Handoff
parrot agent— Agent Terminal Workspace- Crew Handler
- Database Agent
- Running the CVE Experts
- Domain Experts (FEAT 778)
- FEAT 437
- Technical Voice Guide (AgentTalk Voice) for Frontend
- AgentDashboard — A2UI v1.0 Technical Reference for
navigator frontend next - Semantic UI Model → Adaptive Cards (FEAT 303)
- Exposing an AI Parrot Agent as an MCP Server
- AgentCrew User Guide
- AgentsFlow User Guide
- Crew Definition Storage
- A2UI Agent Functions Runtime — the v1.0 RPC leg (FEAT 469)
- Capabilities of an AI Parrot Analytical Agent (PandasAgent)
- Agent Security Guardrails (FEAT 761)
- SpawnSubAgentTool
- Testagent
- Agentic End to End Testing (FEAT 581)
- Uiagent
- WebAgent — Browser Interaction via Chrome DevTools
- WebNavigatorAgent — Catalogued Web Navigation on Your Chrome Profile
- ExecutionMemory Integration Guide
- Agent Brain
- Agent Memory
- Conversation History Ownership
- Conversation Memory Subsystem Overview
- Dream Cycle — episodic → wiki brain consolidation
- Durable Conversation Memory
- Memory Dynamics
- Per Turn Conversation Compaction
- Recoverable Task Memory (FEAT 538)
- Task Memory — Phase 0 Integration Map (FEAT 538 / TASK 2970)
- User Memory
- Bookstore Agentic Retrieval
- Bookstore in Codex
- Bookstore Conceptual Relations — the book graph (FEAT 533)
- Bookstore notebooks
- Contracts catalog performance (FEAT 539, AC14)
- Contracts pilot acceptance — Bob's twelve cases (FEAT 539, AC15)
- Contracts Card & Ontology (FEAT 539)
- Luau parser resource policy (FEAT 532 TASK 2896)
- Glossary of Terms (FEAT 917)
- GraphIndex core seams (FEAT 540)
- GraphIndex — Structured Knowledge Graph Indexing
- Local Knowledge Base
- Procedure Graph — Assembly Manuals (FEAT 601)
- Ontology backend programme
- Ontology vocabulary store
- PageIndex Agentic Retrieval and Citations
- PageIndex Generation Publication
- PageIndex Layout Structure Builder
- PageIndex Local MCP Toolkit
- PageIndex Segment Store
- PageIndex Tree Optimizer
- PageIndex — Tree Based RAG for Document Retrieval
- ArxivTool for AI Parrot
- Accounting metrics layer
- Tool Result Compression Pipeline (FEAT 380)
- DatasetManager Implementation Walkthrough
- FredAPITool Documentation
- EmployeesTool Employee Hierarchy Tool for AI Parrot
- HoobaToolkit
- Jira text templates (JiraToolkit)
- Expose Toolkits as Local MCP (
parrot mcp local) - MultiStoreSearch Toolkit — Multi Origin Retrieval for Agents
- Supervised Obscura Browser Integration
- OdooHelpdeskToolkit — Softhealer helpdesk on Odoo 19
- OdooToolkit Capabilities
- QuerysourceToolkit
- ReadOnlyRepoToolkit (FEAT 484)
- PythonREPLTool Sandbox: Worker Process Execution Model
- Research Tools for Agents
- gVisor Installation Guide for AI Parrot Secure Sandbox
- SDD Sandbox — OS Setup
- Governed semantic layer
- Tool optimizations for Claude Code and Codex (FEAT 543)
- AbstractTool Clone Method
- Toolbar API Documentation
- AudioNoteCaptureToolkit
- ExecutionPlanToolkit — Reference
- Host toolkits for Agent Studio
- Infographic Authoring for Data Agents (FEAT 326)
- InfographicToolkit — Reference
- Tool System Internals: Tools, Toolkits and ToolManager
- AI Parrot Tools Documentation
- What If Scenario Analysis
- Workday worker history
- DecisionFlowNode Usage Guide
- Multi Agent Orchestration: AgentCrew and AgentsFlow
- Docker Tool Executor & Execution Policy
- Generic Gate Host
- HeartbeatManager — Per Agent Autonomous Heartbeat Loop
- JobManager
- Node Types Reference
- OrchestratorAgent — Multi Party Conferencing (
confer) - Planogram compliance cycle (perceive → identify → compare)
- Planogram compliance — migrating configurations to the new cycle (FEAT 574, FEAT 612)
- Planogram perception spike — FEAT 574
- Scheduler backends in multi worker deployments
- Thales User Guide
- Per tenant skills (FEAT 707)
- Skill routing and trigger caching
- Skills system: discovery, toolkits and mixin
- Contextual Embedding Headers
- DocumentDB Usage Patterns
- DocumentDB Interface Guide
- DynamoDB Local (docker compose)
- Fully offline local agent with LanceDB (FEAT 542)
- LanceDB vector, full text and hybrid store (FEAT 542)
- Loader Metadata Standard
- Document Loaders for RAG
- Matryoshka Embedding Truncation
- Parent Child Retrieval (Small to Big)
- Storage Backends Guide
- User stores (Redis by default)
- Vector Stores and Embeddings Reference
- Vector Store Handler — API Reference
- A2A Secure Communication Demo
- Agent as a Local MCP Server (parrot toolkits install agent)
- add repository:
- GitHub MCP Installation and Usage
- MCP integration: client, server and agent tools
- Create and configure agent
- Roost — local inter agent sub protocol
- Roost carriers
- Roost performatives, protocols and obligations
- Simple Mcp Server
- SimpleMCPServer Configuration
- API Endpoints Reference
- Admin UI (FEAT 468)
- Infographic Render Endpoint — Reference
- EventBus v2 Configuration Reference (
[bus]/[bus.alerts]) - EventBus v2 Migration Notes (FEAT 310)
- EventBus v2 — Unified Event Fabric (FEAT 310)
- Session file store
- A2UI Dashboard + Widget Renderer — Frontend Build Guide
- Avatar Technical Guide (LiveAvatar Phase A) for Frontend
- Frontend Guide for SvelteKit: LiveAvatar FULL Mode and VoiceBot (FEAT 248)
- DEPRECATED: Native Voice Avatar (LiveAvatar Phase C) Technical Guide for Frontend
- Technical Guide to Structured Artifacts for Frontend
- VoiceBot · VoiceChatHandler · FEAT 245 — Frontend Guide for Realtime Conversation with Agents
- Server Layer: BotManager and HTTP Handlers
- Infographic Handler — Frontend API Contract
- Interactive Artifacts — Frontend API Contract
- Google Drive file manager
- SharePoint & OneDrive file managers
- WhatsApp Integration Implementation Summary
- WhatsApp Integration for AI Parrot
- P3 — parrot admin ui inventory (canvases / A2UI / infographic / builders)
- WhatsApp + AutonomousOrchestrator Integration
- Audio Form Voice Modes — Developer Guide
- Who owns an OAuth2 (3LO) credential
- CommCenter — Bulk Notification Sender (FEAT 417)
- FormDesigner → MS Teams: Adaptive Card renderer and bot submit path (FEAT 551)
- GitHub reviewer
- Google OAuth 2.0 — AI Parrot Integration
- Fireflies Agent Examples
- HITL Tool Call Confirmation (FEAT 235)
- Teams HITL Channel Setup Guide (FEAT 205)
- JiraSpecialist Prompt Layer Stack
- JiraSpecialist — Daily Standup Lanes
- Jira Transition Actions — Activating
TRIGGER_AGENTDispatch - Jupyter Output Mode Documentation
- Knowledge upload from chat (FEAT 647)
- LiveAvatar over your own LiveKit (Cloud or self hosted)
- Matrix Bridges for the AI Parrot Swarm (FEAT 463)
- Matrix Clients for the AI Parrot Swarm (FEAT 463)
- Migration Guide: FEAT 202 — ai parrot integrations
- Connections on Microsoft Teams
- MS Teams Toolkit for AI Parrot
- Nova Sonic Voice Protocol Reference
- Office 365 OAuth 2.0 (Delegated) — AI Parrot Integration
- PR Review Command — Setup Guide
- Queued chat commands
- Runbook — the
issuesnamespace (Jira ticket corpus) - Dev loop kick off from Slack (FEAT 555)
- Telegram Auth Open Mode (webview | browser)
- Telegram connections
- Telegram Bot Integration Guide
- FEAT 536 — VoiceBot Nova Dual Output + LiveAvatar: Real Live Operational Acceptance
- FEAT 537 — Nova VoiceBot avatar broadcast: operational acceptance
- FEAT 537 — Nova PCM → LiveAvatar LITE → LiveKit multi subscriber live gate
- speech_report TTS backends
- Nova VoiceBot avatar broadcast for multiple browsers (FEAT 537)
- 🦜 AI Parrot Voice Chat
- WhisperX Setup Guide for AI Parrot
- A2UI Linked Surfaces (FEAT 598)
- A2UI v1.0 Wire (FEAT 470)
- === D3.js ===
- Backend HTML Design System (FEAT 493)
- FEAT 488
- FormDesigner Audio Renderer
- Form Designer — Autonomous FormSchema Persistence (Standalone Forms)
- Form Designer — Conditional Sections: Pre/Post Dependencies
- FormBuilder — LLM answer plausibility enforcement
- FormDesigner — orphan upload cleanup (FEAT 731)
- FormDesigner — public response controls
- Form Designer — Relational Fields
- Serving FormDesigner forms from a Teams agent
- Form Designer — Unknown Field Capture Policy for Form Submissions
- FormDesigner — validation audit trail
- Infographic Recipes (FEAT 324)
- Inline A2UI Component Routing (FEAT 755)
- Metric Definition Registry (FEAT 756)
- Smart OutputFormatter Documentation
- N4 — navigator api backend inventory (dashboards / widgets / templates / modules / programs)
- P1 — ai parrot HTTP/WS endpoint inventory (report builder lens)
- P2 — ai parrot (Python) UI components, models, renderers, persistence — inventory for a REPORT BUILDER
- P4 — ai parrot prior art for a Report Builder (SDD inventory)
- ai parrot server — Admin / Bots / Studio / misc endpoint inventory
- P1 — ai parrot HTTP/WS endpoint inventory (report builder lens) ( core)
- parrot formdesigner — HTTP/WS endpoint inventory
- Report Builder — ai parrot inventory and analysis
- WeasyPrint 69.0 CSS Support — Empirical Findings
- Identity Capability User Guide
- Layers Reference
- Output Language (FEAT 638)
- PromptBuilder — User Modifiable Variables
- PromptBuilder User Guide
- Delegated OAuth2 connections
- Delegated OAuth2 connections on the web channel — deployment recipe and live harness
- Deterministic Groundedness Scoring
- ONNX Backend for the Prompt Injection Guardrail (FEAT 439)
- PBAC Guardrails — Policy Driven Tool Call Denial (FEAT 406)
- SecurityAdvisor — SOC2 Oriented Read Only Advisory Agent
- User Profile Management
- AI Parrot MCP Server AWS Deployment Guide
- Bot Cleanup Lifecycle
- Business Automation — Operator Runbook
parrot loginand connections- CompanyInfoToolkit
- Per component and per agent LLM defaults (FEAT 796, FEAT 882)
- Answer Accuracy Metrics for the Evaluation Harness (FEAT 652)
- Infographic CSP and Signed URLs — Operations Guide
- Global install: the parrot managed runtime (reference)
- Runbook — the Fireflies Meeting Registry
- Wiki standup briefs — runbook
parrot.finance— the finance satellite- Migration — FEAT 201: ai parrot embeddings
- Migration — FEAT 203: ai parrot server
- FEAT 223 — Structured Artifact Contract: Migration Guide
- FEAT 273 — Legacy output mode deprecations → A2UI
- Migration — FEAT 315: Unified NovaClient for all Amazon Nova models
- Migration — FEAT 421: Client declared tenant in the forms URL
- Migration — FEAT 446: SaaS Auth Hardening (S0 of Parrot Research Cloud)
- Migration — FEAT 473: A2UI v1.0 for STRUCTURED_CHART / STRUCTURED_TABLE / STRUCTURED_MAP
- Migration — FEAT 523: PEP 420 LLM Client Extraction
- Gemini 2.5 retirement (FEAT 798)
- Migration — FEAT 564: Reliable video reels with Gemini Omni and Veo 3.1
- Native Claude sandbox for SDD sessions (FEAT 768)
- Complementary (collaborative) research partner (FEAT 482)
- Dev flow per seat LLM configuration (
DevFlowModelPlan) - Dev loop
novabackend (AWS Bedrock) - sdd worker as orchestrator of parallel sdd coder seats (FEAT 549)
- SDD compaction capability record
- SDD execution optimization — operation and rollout
- Proposals to Reduce SDD Execution Time
- Dev flow / dev loop telemetry accounting
- Language Agnostic Validation Runners (FEAT 709)
- Spec Driven Development in Google Gemini / Antigravity CLI
- Guide to using the SDD slash commands
- AI Parrot Spec Driven Development (SDD) Platform
- SDD on Google Antigravity (agy)
/sdd donecloseout hooks- Decision Audit (FEAT 784)
- SDD experience memory
- SDD Expert Consult
- Ledger outbox (FEAT 758)
- FEAT 580 LSP Pilot — Live Evaluation Results
- SDD LSP research pilot (FEAT 580)
- Necessity Ladder (FEAT 908)
- Procedure Graph
- Test selection in the SDD flow — the Validation Contract (FEAT 699)
- wikitoolkit Cheatsheet
- wikitoolkit inbox
- wikitoolkit lint
- LLM Wiki — an agent maintained knowledge repository
- Schema Plane — Operator Guide (FEAT 600)
- SQLite concurrency for wiki and ledger
- wikitoolkit standup
- WikiToolkit as Claude Code infrastructure
- Authentication uses Navigator Auth
- AbstractClient base changes require a decision
- Clients are memory less
- Configuration uses NavConfig
- Graph backends — retire ArangoDB for PostgreSQL + SurrealDB
- Conversation history has one writer
- HTTP stack uses aiohttp
- LangChain is not part of the stack
- Async code remains non blocking
- Concrete tools live in ai parrot tools