Skip to content

Huddles on self-hosted LiveKit, with a formal model of huddle authority - #10073

Draft
tlongwell-block wants to merge 130 commits into
mainfrom
lk/huddles
Draft

tlongwell-block wants to merge 130 commits into
mainfrom
lk/huddles

Conversation

@tlongwell-block

Copy link
Copy Markdown
Collaborator

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}/audio route, mesh huddle ownership, buzz-audio-client, mobile native call audio, and the deprecated 0.x desktop transport).

  client ──(1) POST /huddle/{id}  NIP-98 + NIP-FI ──► relay ── Postgres (authority)
    │      ◄─(2) { url, token, room, admission, … } ──┘  │
    │                                                     │ (4) RoomService: list, remove, update
    └─(3) WSS + UDP/TCP/TURN, token ──► LiveKit ◄─────────┘
                                         └─(5) signed webhooks ──► relay (triggers only)
  • Relay: runs one pure decide for 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.
  • LiveKit: enforces the token's room and grants, and holds revocation tombstones. It is pinned at 6fd3a33e0c4844f49e5c8ff748c0ac756e880799, which includes OSS token revocation.
  • Webhooks and timers: tell the relay when to look, never what is allowed.
  • Agent side rooms: an agent never subscribes in the main room. It hears its owner in a relay-made side room, where only that owner's admissions may publish.
  • Community separation: room names carry the community, and every grant binds one exact, nonempty room.

The contract is docs/livekit-huddles.md: wire, grants, authority, configuration, trace steps and the model-to-code mapping. mobile/HUDDLES.md covers 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.

⚠️ Merge order: block/buzz-app

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

  • TLA+ (docs/spec/LiveKitHuddle.tla, run by docs/spec/check.sh livekit). It checks these properties: MintAuthorized, CommunitySeparation, SidePublishOwnerOnly, AgentDeafInMain, Eviction, Retirement.
    • 14 seeded design errors each break the property they name. The coverage checks NeverRejoinAfterRemove (rejoin race) and RenewBeforeDeadline (late renew) are reachable. See the table in the contract.
    • Restart safety is checked with two humans (livekit-restart-safety). Restart combined with community separation is argued in the contract, not model-checked.
    • Local results (the spec is unchanged since they ran), all as expected:
      • livekit: 14.56M states.
      • livekit-leave: 1.12M states, 20–25 min.
      • livekit-restart: 547k states, 52 min on 4 workers.
  • Verus (crates/buzz-huddle-gate, just verify-huddle-gate): 7 obligations verified, 0 errors. The proof shows decide meets the model's rules, and Cargo compiles the same body.
  • Conformance (crates/buzz-conformance): relay traces are replayed by an independent checker, and CI fails on an illegal step.
  • Correspondence: model actions map to code in the contract's "Implementation correspondence" table. A live row maps to LoseAuthority(k,c), and the renewal prefilter maps to Dependent(i).
  • CI budget: TLC runs as one job with a 90-minute timeout. If the first hosted run takes more than about 60 minutes, shrink livekit-leave. Whatever replaces it must still fail no-deadline, side-agent-unbound, renew-unchecked and late-renew.

Testing

All receipts are at the pushed head or its parent d84a80f55. Rust is unchanged since 348a8426e.

Lane Result
cargo fmt, workspace clippy --all-targets -D warnings pass
Verus 7 verified / 0 errors
just test-unit, every step run to completion 6,997 passed, 1 failed (see below)
Postgres lane (scripts/postgres-test-run.sh, Redis) 1,742 passed / 72 failed, all environmental (see below). All 13 LiveKit/huddle tests pass.
Flutter: flutter analyze, full flutter test clean; 6,367 passed / 72 skipped
Pre-push: desktop check, typecheck, tests, Tauri checks, file-size, mobile checks pass
Native e2e (crates/buzz-test-client/tests/e2e_livekit.rs, pinned livekit-server) 25/25 gates, each running its failing control first

Known failures, none from this branch:

  • api::git::transport::track_c_tests::push_is_published_exactly_when_receive_pack_changed_refs fails locally. The message is ng refs/heads/feature refname conflict from local git 2.51. crates/buzz-relay/src/api/git is byte-identical to origin/main, and the test failed the same way at earlier heads of this branch. I pushed with the rust-tests hook lane skipped because of it; every other lane ran.
  • The local Postgres lane has 72 failures. 68 need OpenSearch (buzz-search and search_backend_postgres_tests). 4 are buzz-db tests that also fail on origin/main alone.

Native e2e scope:

  • It covers the no-proof path only. The rollout cohort is covered in sweep_tests.rs:781, and the 2- and 3-field proofs in authorization_tests.rs:539-559.
  • Leave race: 18 refused, 22 removed, 0 in flight.
  • Startup recovery, run by hand on the same rig with no relay restart:
    1. Started the relay with LiveKit down. POST /huddle returned 503, and the probe retried at 1, 2, 4 and 8 s.
    2. Started LiveKit. The next probe enabled mint and the join succeeded.
    3. The full file passed 25/25 again on that same relay process.
  • More coverage pointers: sweep_postgres_tests.rs:464-476 and :684-698, and renewal_postgres_tests.rs:68-72.

Mutation testing: 47 mutants at 78cd1815b. Survivors were killed at d3d3c823a, 4ab3fe5ff, f3e65a731 and 8846be8f7. Remaining:

  • pm-publish-none: equivalent.
  • 3 timing-only mutants.
  • 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:

Commit Fix Control and mutant
7e0ab45af The sweep classifies each side-seat dependency as valid, known invalid or unknown. A known invalid dependency removes the seat before an unknown one defers. Both orderings fail at the parent. The agent-half mutant fails.
a37538d58 A failed LiveKit probe retries with backoff of 1 to 30 s. Mint stays gated, and eviction starts in the same process once the probe passes. The single-probe mutant fails. Covered by a pre-existing expired seat across the outage.
57eb22aa3, e33809db7 Mobile retries a transient side-room failure with Retry-After or bounded backoff. Hints during the wait coalesce into one retry. Lone 503 then recovery. A terminal side close rediscovers the room. Two hints inside a 3 s Retry-After give exactly one retry.
432042a79, ee90bb152 Mute stays reachable while the main room reconnects, on the notifier and on the full-screen sheet. Side rooms mute immediately, and main applies the stored mute on resume. Controller and widget tests. The _resumeMute mutant and the old sheet predicate both fail.

Deployment

  • Run migrations through 0111 with BUZZ_AUTO_MIGRATE=true or buzz-admin migrate. The migrations come from main; this branch adds none.
  • Deploy LiveKit separately; see the Compose huddles profile and the Helm values. Then set BUZZ_LIVEKIT_URL, BUZZ_LIVEKIT_API_KEY and BUZZ_LIVEKIT_API_SECRET, and optionally BUZZ_LIVEKIT_API_URL, _ROOM_PREFIX, _LEASE_SECONDS and _SWEEP_SECONDS.
  • Start order no longer matters: a relay that starts before LiveKit retries its probe, and no restart is needed.
  • FI provenance travels in the buzz.fi attribute. A malformed or mismatched value denies the seat even when NIP-FI is in Off mode. The rollout cohort is enforced for huddles.
  • Liveness: within one community, eviction rests on fairness. There is no cross-community latency bound. T1 measured a 200/200 compose burst, with a max of 472 ms in rooms of 10 and 83 ms in rooms of 1000.
  • Diagnostics: RoomService data_loss errors are surfaced with their Twirp code (twirp v8.1.3 errors.go:257).

Human test (Tyler)

  1. Start LiveKit with docker compose --profile huddles up -d --build livekit.
  2. Start the relay with BUZZ_AUTO_MIGRATE=true and the four BUZZ_LIVEKIT_* values from the contract's local-development block, then run just relay.
  3. Run two mobile clients (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.
    • Working looks like: both people hear each other, and the roster shows both.
  4. Eviction: remove the second member from the channel.
    • Working looks like: their audio ends within about 30 s, and rejoining is refused.
  5. Startup recovery: stop LiveKit and restart the relay, then try to join.
    • Working looks like: the join says huddles are unavailable. Then start LiveKit and, without touching the relay, join again within about 30 s. It works.
  6. Agent side room (needs an agent that joins over LiveKit, so this waits on the block/buzz-app PR): with an agent seated, briefly drop the phone's network so the main room reconnects. Then tap mute on the call sheet.
    • Working looks like: the mute button stays visible during the reconnect, and the agent stops hearing you right away.
  7. Side-room recovery (also waits on the agent): restart the relay mid-call.
    • Working looks like: "Agent audio is unavailable" appears, then clears by itself within about 30 s, with no rejoin.

Draft until the agent review, agent exercise and the human test above are done.

tlongwell-block and others added 30 commits November 25, 2026 17:40
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>
tlongwell-block and others added 30 commits November 26, 2026 06:50
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant