Repository navigation
Huddles on self-hosted LiveKit, with a formal model of huddle authority - #10073
Draft
tlongwell-block wants to merge 130 commits into
Draft
tlongwell-block wants to merge 130 commits into
tlongwell-block wants to merge 130 commits into
Conversation
The relay mints room-bound LiveKit tokens and evicts by a default-deny sweep; LiveKit presence is a cache of Buzz authority, with no seat table. The model checks mint authority, community separation, owner-only side publishing, deaf agents in main rooms, eviction after lost authority and retirement after the deadline, with a seeded fault for each. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…ndition Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
buzz-huddle-gate: decide(party, room) in verus!, whose ensures states the model's MintAuthorized, CommunitySeparation, SidePublishOwnerOnly and AgentDeafInMain per decision and equals the contract's grant table both ways. Room names and identities parse canonically. Verus pins from #9873. buzz-conformance::livekit: an independent per-huddle replay of mint, refuse, sweep, remove and webhook steps, with one bad fixture per rule, each a single edit of the good trace. Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…ooms parse_room returns Ours, Foreign (not under <prefix>:, skipped by the sweep) or Malformed (ours but not canonical, invalid). Key::from_bytes / to_bytes fix the four-word big-endian conversion. Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…ndent seats Attribute updates refresh the LiveKit token immediately and may land after a loss of authority, so ApplyRenew is unguarded. The renew-unchecked fault breaks Eviction. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Max <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Max <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Max <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
A side_rooms request returns one grant per seated agent under a single NIP-98 id, so key request reuse by (request, room). The trace cannot prove webhook causation; say so. Co-authored-by: Dawn <c6237ef84fa537c78dcee78efd2d4e59f728859c7f194da42ac51ededfa0be05@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…int) Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…empty room Pins the livekit-server behaviour docs/livekit-huddles.md rests on, against the pinned master with token_revocation enabled. Every gate asserts its control first; against stock --dev (revocation off) the four revocation gates fail. Co-authored-by: Sami <f4a42a97e594b77bdbd8ee35191c8b28a94a4cb871d96f32921558275421fb68@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Ok on the pinned server with token_revocation on; not_found on stock --dev. Co-authored-by: Sami <f4a42a97e594b77bdbd8ee35191c8b28a94a4cb871d96f32921558275421fb68@buzz.block.builderlab.xyz> Signed-off-by: Tyler Longwell <tlongwell@squareup.com> Co-authored-by: Tyler Longwell <tlongwell@squareup.com>
Add validated LiveKit configuration, revocation probing, explicit removal cutoffs and gate-derived JWT grants. Extract the existing membership precheck without changing its behavior. Keep legacy transport callers until the HTTP admission and sweep integration is implemented. Validate signed claims for four seat types and the SDK removal RPC. Mutation controls cover data publishing, cutoff and namespace validation. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…the last decision Meli's interleaving (329b5e25): deadline 120, renew decided at 119, UpdateParticipant applied at 121 writes 239, and another pod renews again. LiveKit has no compare-and-set on attributes, so the write cannot be fenced. Model renewal per admission: ApplyRenew refreshes every dependent seat and removes the admission from gone. Retirement now holds once the deadline has passed with no renew in flight, which is stable because the relay decides no renew for a passed deadline. New coverage check RenewBeforeDeadline must be violated to show the late write is reachable. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Route join through the shared signed-body HTTP admission chain while retaining verified FI evidence and the original request ID. Recheck channel roles and archives under membership locks, cap leases by FI authority, and recheck actor and owner relay authority before minting. Keep normal startup disabled pending the eviction runtime. Other control operations, lifecycle, trace emission and legacy retirement remain pending. Exercise the real router with Postgres and Redis, including a role change after precheck. Removing the locked refusal makes that test return 200 instead of 403; restoring it passes. Shared accessory auth regression and library Clippy also pass. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Integrate lk/base 8a6f181. Delayed authorized renewal may replace an elapsed deadline; retirement is bounded from the last renewal decision. The model now changes admission expiry on apply and covers late writes. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Reconstruct current community, channel, owner and FI authority before keeping a seat. Require exact main dependencies for side rooms and compare observed permissions with the gate. Preserve the validated lifecycle parent as a protected lookup hint and recheck its creator-signed link. Extend the real-router/Postgres test through the RoomService sweep boundary. Normal startup remains disabled pending scheduling and integration coverage. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Limit room listing and seat validation concurrency to eight. Add a cancellable runner with jittered startup, Redis lease renewal and guarded release, and idempotent eviction when coordination is unavailable. Exercise exact main dependencies, issuer-scoped owner denial, parent-link revocation and scheduled eviction against Postgres/Redis with a shared RoomService boundary. Executable startup remains disabled in this increment. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Probe before exposing huddle control and start an owned sweep task before listeners. Drain it on shutdown or listener failure; a failed probe leaves huddles unavailable without preventing other relay services from starting. Add signed-body leave for the authenticated actor's exact admission, including dependent owner seats when an agent leaves. Filter side rooms by resolved community and huddle and tombstone absent caller identities. Exercise startup and leave through the existing Postgres/Redis fixtures. Document startup behavior and lease/tick overrides. Side-room mint, renewal, webhooks and live load validation remain separate work. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Add signed-body side_rooms requests to the shared huddle admission path. Resolve the exact caller admission and candidate agent admissions in the scoped main room, reuse sweep authority validation, and retain the caller's transactional role and request-proof checks. Bound each gate-derived grant by both main deadlines and the current assertion's authority deadlines. Extend the router fixture for multiple admissions, owner/agent permissions, wrong-device refusal, empty grant sets and current agent-role loss. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Capture immutable per-seat deadlines before sending attribute-only updates, update main first, and reuse each side holder's main FI evidence. Exercise the signed router with a decision barrier and dependency failure controls. Preserve seats on unreadable sweep authority while retrying each seat; retain fail-closed FI restoration and known-denial removals. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Distinguish a failed participant listing from a main room omitted by a successful room listing. Only the failed listing preserves dependent seats for retry. Exercise both cases against the RoomService boundary. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Validate webhook body signatures and current participants before owner hints. Coalesce notifications in the owned sweep worker independently of the tick lease. Honor effective FI mode when checking existing presence. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Use the LiveKit room SID as generation after authorized session linkage. Return no event for absent or expired presence and unavailable for failed RoomService reads, without falling back to legacy media state. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…e, renew, sweep Grants carry the contract's room, identity, lease and sources; a non-member and another community's host are refused; rejoin is a new identity; leave revokes exactly one admission and removes a live seat; renew extends buzz.deadline in place; an unrenewed seat is swept within one tick of its deadline. Controls: 30 s sweep, no-op UpdateParticipant, and a sweep blind to buzz.deadline all fail. Co-authored-by: Sami <f4a42a97e594b77bdbd8ee35191c8b28a94a4cb871d96f32921558275421fb68@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Persist deterministic joined, left and ended events from verified webhooks, checking current room generation and presence before publication. Teardown references a prior valid relay-signed join and never archives a channel. Pin the exclusive seat deadline boundary while retaining the post-DB check. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Avoid global room enumeration for renewal. Preserve unavailable errors and skip successful empty participant listings. Exercise both paths through the HTTP journey with global listing disabled. Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
An absent main room (deleted, as LiveKit does after its departure timeout) evicts the side seat within one tick; a main room whose listing fails keeps it for retry. Fails at lk/relay 23dd489 (side seat held 120 s, past its own deadline); passes with the unlisted fix; dropping the unlisted guard evicts and fails the preserve arm. Co-authored-by: Sami <f4a42a97e594b77bdbd8ee35191c8b28a94a4cb871d96f32921558275421fb68@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Conflicts: ARCHITECTURE.md takes upstream's rollout-cohort wording without the retired audio socket; nip_fi_policy/postgres_tests.rs takes upstream's cohort matrix on the root path only (the audio path is retired here); Cargo.lock resolved by rerere. Semantic resolutions: the LiveKit sweep (presence.rs) derives the community's NIP-FI mode with nip_fi.effective_mode, which #9758 introduced, so rollout cohort communities enforce in huddles as they do on requests; upstream's new policy_sweep test call drops the retired audio flag. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
A shadow-mode community inside BUZZ_NIP_FI_ENFORCE_PERCENT evicts seats on a deny entry exactly as Enforce does. Reverting presence.rs to the stored-only derivation fails the new assertion (sweep_tests.rs:781). Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The side pass treated a holder missing from the checked mains as locally valid, so an absent owner seat plus an unreadable agent seat deferred the side seat instead of removing it. Classify each exact dependency as valid, known invalid, or unknown, and remove on any known invalid one before deferring on an unknown one. Cover both directions in the partial-outage test. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
A failed startup probe left the process with no sweep task, so if every replica started during a RoomService outage, deadline enforcement never resumed. Install the control through a once-set slot that the runtime owns: mint stays gated until a probe passes, the probe retries with backoff up to 30 seconds, and the first passing probe starts eviction in the same process. Cover recovery with a pre-existing expired seat. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
A failed side-room lookup or connect ended reconciliation for the rest of the call: the issue stayed set, a hint that arrived during the failed attempt was stranded, and a terminal side-room close scheduled no refresh. Retry with bounded backoff (honouring Retry-After, 1 to 30 seconds) while the call is current, which also drains a pending hint; a refusal without Retry-After stays final. Rediscover after a terminal side close and clear the issue once reconciliation succeeds. Cover one failed lookup that recovers with no further hint or reconnect, then a terminal close. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
A main-room reconnect changed the session phase while side rooms kept publishing, and setMuted dropped the request in that phase, so the owner could not mute their agent microphone. Accept mute while reconnecting, apply it to live side rooms immediately, and apply the stored setting to main once it resumes. Cover a reconnecting main with a healthy side room. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
VISION.md still described a built-in Opus relay with no external SFU, and mobile/HUDDLES.md still described the retired kind 24811 admission over the Buzz socket. Describe the self-hosted LiveKit deployment, NIP-98-signed HTTP admission that works while the WebSocket is paused, and that huddles are off until LiveKit is configured. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
A hint during the Retry-After window started a lookup immediately, and the original timer then fired another. Keep hints pending while the retry timer is active so the timer drains them in one lookup. Assert one lookup until the deadline, exactly one at expiry, and none after success. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The full-screen call sheet hid its controls while main reconnected, so a user looking at the call could not mute a still-live side room. Show the controls while reconnecting and let speaker routing change then too. Cover it with a widget test that taps mute during reconnect and sees the side room mute before main resumes. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The huddle request extension used the notifier's protected ref directly, which flutter analyze rejects. Read the signing pubkey and hosted auth through private getters on the notifier, and brace the retired-session check. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
relay_session.dart held two identical relayConfigProvider getters, which put it one line over the mobile file-size ratchet. Huddle requests now read _snapshotConfig; behaviour is unchanged. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…ice settings section The LiveKit change removed the 0.x huddle companion window and the Voice settings section. The thread-load guard now reaches the transcript the remaining way, through the huddle card's View action, and the settings layout test stops visiting Voice. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Conflicts: Justfile and scripts/run-tests.sh keep main's command-persistence span tests and drop the audio::join/audio::handler suites this branch removes; crates/buzz-audio-client stays deleted. The new clippy bans (#10077) apply to the LiveKit test crate and the huddle gate as they do to every other crate: tests may use them. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…spec This branch removes the desktop profile Huddle action and the Voice settings section; the integration project still expected both (CI shard 2/3 at 151ef32). Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Owner and agent renewing at once each wrote min(own new, other's old) to the owner's side seat, so the seat kept the old deadline and the sweep removed it one lease later (local soak, 2026-12-02). A side seat now carries buzz.deadline (its holder's) and buzz.agent.deadline (its agent's); each renewal writes only its own, and the seat ends at the earlier of the two, still enforced when the main room is unreadable. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
A holder renewal rewrites buzz.deadline, so reading it as a missing agent lease loses the agent's bound. No released relay mints side seats, so a side seat without buzz.agent.deadline is simply invalid: the sweep removes it and the client rejoins with a fresh grant. Main seats keep their single lease. Cover the agent arm with a readable main, and keep the renewed mains in the renewal test so it no longer depends on the second boundary. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Meli <5aaa86bce934fc3445fc254aab560a40923f10252f92107e665073dede0e04d3@buzz.block.builderlab.xyz> Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com> * meli/huddles-compose: Build only the relay for local huddle tests Run the local relay and LiveKit together in the huddles profile Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
The test stopped the worker as soon as the mock saw RemoveParticipant, which could cancel the pass before it traced the removal or judged its other seats. A 200 ms delay before trace_remove made it fail 3/3. Now it waits until the trace has a Remove and passes conformance, then it stops. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Shutdown and crashes can stop a sweep pass partway (runtime.rs:112, :162), which leaves its obligations open at the end of the trace. Replay such a trace up to its last finished pass. The next pass re-derives every seat. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Per Dawn: strict replay holds only for a trace that ends at rest. A later pass on any pod re-derives seats; a cut-off leave is retried by the client or ends at the seat's deadline. No stop step, since a crash could never write one. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Brings in a6c7a2e (#10090, seal the buzz-db boundary) and 0c8478c (#10135). Conflicts: audio/handler.rs stays deleted (this branch retires the audio module); nip_fi.rs keeps this branch's root_disconnect_witness in place of the removed community-connection test that main had edited. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Brings in 95cff20 (#10137) and its parents #10114, #10106, #10141. No conflicts. Co-authored-by: Lain <7d83e66e949bde01875eadd5794011c24c661ec1ddb489cc759d075f4440315a@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Huddles move to a self-hosted LiveKit server that runs as its own deployment. The relay stops carrying media. It decides who may sit in which room, mints a short LiveKit token bound to one exact room, and evicts seats that lose authority. There is no fallback: without LiveKit configured, huddles are off. The old WebSocket huddle transport is deleted (
crates/buzz-relay/src/audio/, the/huddle/{id}/audioroute, mesh huddle ownership,buzz-audio-client, mobile native call audio, and the deprecated 0.x desktop transport).decidefor both mint and sweep. It keeps no seat table: LiveKit's participant list is a cache of Buzz authority, and the sweep re-derives each seat from Buzz state.6fd3a33e0c4844f49e5c8ff748c0ac756e880799, which includes OSS token revocation.The contract is
docs/livekit-huddles.md: wire, grants, authority, configuration, trace steps and the model-to-code mapping.mobile/HUDDLES.mdcovers the Flutter side.Net diff: about +6.9k / −53.3k production lines. The new relay module
crates/buzz-relay/src/livekit/is about 3.7k production lines.Buzz 1.0 desktop (block/buzz-app
main) still dials/huddle/{room}/audio, which this PR removes. Desktop huddles will stop working on any relay running this branch until the block/buzz-app LiveKit PR lands. Hold the deploy until that PR is ready.Related issue
None found.
Formal model and breakpoints
docs/spec/LiveKitHuddle.tla, run bydocs/spec/check.sh livekit). It checks these properties:MintAuthorized,CommunitySeparation,SidePublishOwnerOnly,AgentDeafInMain,Eviction,Retirement.NeverRejoinAfterRemove(rejoin race) andRenewBeforeDeadline(late renew) are reachable. See the table in the contract.livekit-restart-safety). Restart combined with community separation is argued in the contract, not model-checked.livekit: 14.56M states.livekit-leave: 1.12M states, 20–25 min.livekit-restart: 547k states, 52 min on 4 workers.crates/buzz-huddle-gate,just verify-huddle-gate): 7 obligations verified, 0 errors. The proof showsdecidemeets the model's rules, and Cargo compiles the same body.crates/buzz-conformance): relay traces are replayed by an independent checker, and CI fails on an illegal step.LoseAuthority(k,c), and the renewal prefilter maps toDependent(i).livekit-leave. Whatever replaces it must still failno-deadline,side-agent-unbound,renew-uncheckedandlate-renew.Testing
All receipts are at the pushed head or its parent
d84a80f55. Rust is unchanged since348a8426e.cargo fmt, workspace clippy--all-targets -D warningsjust test-unit, every step run to completionscripts/postgres-test-run.sh, Redis)flutter analyze, fullflutter testcrates/buzz-test-client/tests/e2e_livekit.rs, pinned livekit-server)Known failures, none from this branch:
api::git::transport::track_c_tests::push_is_published_exactly_when_receive_pack_changed_refsfails locally. The message isng refs/heads/feature refname conflictfrom local git 2.51.crates/buzz-relay/src/api/gitis byte-identical toorigin/main, and the test failed the same way at earlier heads of this branch. I pushed with therust-testshook lane skipped because of it; every other lane ran.buzz-searchandsearch_backend_postgres_tests). 4 arebuzz-dbtests that also fail onorigin/mainalone.Native e2e scope:
sweep_tests.rs:781, and the 2- and 3-field proofs inauthorization_tests.rs:539-559.POST /huddlereturned 503, and the probe retried at 1, 2, 4 and 8 s.sweep_postgres_tests.rs:464-476and:684-698, andrenewal_postgres_tests.rs:68-72.Mutation testing: 47 mutants at
78cd1815b. Survivors were killed atd3d3c823a,4ab3fe5ff,f3e65a731and8846be8f7. Remaining:pm-publish-none: equivalent.side-auth-true: masked by an earlier check.presence.rs:153: defence in depth.Each review fix also has a control that fails at the parent and at least one mutant that fails its test:
7e0ab45afa37538d5857eb22aa3,e33809db7Retry-Afteror bounded backoff. Hints during the wait coalesce into one retry.Retry-Aftergive exactly one retry.432042a79,ee90bb152_resumeMutemutant and the old sheet predicate both fail.Deployment
0111withBUZZ_AUTO_MIGRATE=trueorbuzz-admin migrate. The migrations come frommain; this branch adds none.huddlesprofile and the Helm values. Then setBUZZ_LIVEKIT_URL,BUZZ_LIVEKIT_API_KEYandBUZZ_LIVEKIT_API_SECRET, and optionallyBUZZ_LIVEKIT_API_URL,_ROOM_PREFIX,_LEASE_SECONDSand_SWEEP_SECONDS.buzz.fiattribute. A malformed or mismatched value denies the seat even when NIP-FI is in Off mode. The rollout cohort is enforced for huddles.data_losserrors are surfaced with their Twirp code (twirp v8.1.3errors.go:257).Human test (Tyler)
docker compose --profile huddles up -d --build livekit.BUZZ_AUTO_MIGRATE=trueand the fourBUZZ_LIVEKIT_*values from the contract's local-development block, then runjust relay.just mobile-dev, or a device on the same machine) as two members of one channel. Start a huddle on one and join it from the other.Draft until the agent review, agent exercise and the human test above are done.