Reviewer: Claude Fable 5.1 (claude-fable-5-1) โ whole-code review @ 8baa6f5
CHANGES REQUIRED โ one small blocker; everything else holds. Re-review of the fix is a delta check, not a second whole-code pass.
What I did: scratch worktree at origin/team-mode (8baa6f5), read the full diff against b3cfa5c (every team_*.go, teamstate, the hub, store, handlers, stream, templates), Home's implementation/teammode-package.md, AGENTS.md "Team mode", spec ยง16. make ci (pinned go1.26.5) green in 16 s; make race green in 53 s. 38 team tests. I ran 39 hand mutations (below). Worktree removed.
Blocker
- The sign-in door under an Unknown host answers "sent" and sends nothing.
internal/calls/auth.go:175-180(mayRequestLink): in team mode a join cookie whose link's host is anything but Member returnsmemberโ the dead-link shape. For NotMember that is right (the link is dead, and the test for it is good). For Unknown it contradicts Paul's ruling and ยง16.3's own sentence ("every new entry โฆ is a retryable 503"): an outsider following a require-sign-in link during a Home blip types their address, is told to check their mail, no pending row is written, no mail is sent, and nothing tells them to try again. Fix: decide the cookie's host before the address is read โ ingateBegin(auth.go:113), or at the top ofmayRequestLinkwith a tri-state answer โ and answerteamUnavailable(503, no-store, Retry-After) when the host is Unknown; keep NotMember as it is. The host read does not depend on the address, so the Astra #25 timing rule holds, and the holding page already answers the same 503 to the same person, so it is no oracle. Add the case toTestTeamHostUnknownRefusesEntriesAndHoldsTheCall(which today asserts no mail under Unknown โ that assertion should become "503, no row, no mail") and correct ยง16.3. Optional, same place: go throughmeetingStandsrather thanhostAccessso this touch settles a removed host's meeting like every other.
The guarantees (same list as Calendar #35 and Slides #33)
Standing on every request: teamRequirePerson (pages, writes, signalling), requireAgent (operator, fresh Access), teamSignin โ yes. Role: Calls consults none; correct. Revocation within the lease: the gate signs a removed Home identity out (M17, M26 killed); the stream's own decision ends a removed member (Recheck โ lost{standing}, M3 killed) and a removed host (lost{ended}, M4, M40 killed); /ice (M9), /signal (M15, M16), fresh and resumed streams (M28, M13-equivalent), joins and links (M10, M39) all stand on the host first and the person second. Marker before migrations: teamBootSchema precedes migrate.Apply โ yes. Census over home_identity_links, calls_team_home_persons โ yes. Home-only via connect's hooks, no address at rest in Home: the placeholder and label are local rows; nothing leaves the instance โ yes. Guard in every write transaction: 17 routes (M5, M24, M25 killed; consumePending and the named guest on the host's Access). Partial list: empty with the notice, asked after building of the same Access, NotMember never partial, JSON 503 when partial (M11, M27, M32 killed). Probe outside session middleware. Pins: teammode, roster, connect at 67c12e3; handoff untouched. Standing read before reach: teamStreamDecide reads the host, then the participation, then own; teamStandingFor host, then own โ yes.
Team mode off: a.team == nil is the switch on every branch, serveStream untouched, store.team false means every guard/guarded is the old write; I accept the 212-response diff and the unchanged off-mode suite.
The specific questions
Held stream. Safe, and better than Slides' drop-and-catch-up for this protocol. What is held is delivered only after a decision made on fresh Accesses says Member for the host and (member-kind) the person; every delivery re-reads those leases (stands()), and a removal publication ends a lease for good (#97), so a removed member's held backlog is never written: own NotMember โ Recheck โ streamEnds, backlog discarded; host NotMember โ ended, backlog discarded; Unknown โ still held. Terminal events bypass the hold and carry no content. The 64 bound ends the stream as a slow subscriber (lost{buffer}), and the browser's resume replays from the ring or resets the pair โ the path that already exists. The held content is exactly what a ring replay would hand a resume on the same standing, so keep-and-deliver is no wider than drop-and-catch-up, and it spares a short blip the generation resets. Timer: again is reset only in decide(); a heartbeat that re-arms it to the lease timer (my M1b) is killed by TestTeamRemovalEndsAMembersLiveSession, so the fix is test-protected. Note the hub tick (15 s) is also a backstop for joined peers, which is why the original bug was low-impact in production.
Hub changes. ErrStandingUnknown joined into errTeamUnavailable so errors.Is reaches it from either side; only Resume tolerates it (M7 killed: without it a resume under Unknown is a 500). Recheck is Authorize's first half with the ending in the hub's words; no new lock discipline, standing still read with the lock down. Accepted. Note: CanResume (relay.go:199) and the tick (hub.go ~496) log a Warn per probe / per participation per 15 s during a blip; demote or rate-limit when errors.Is(err, ErrStandingUnknown) โ not a blocker.
Meeting links stand on the creator; a removed host's meeting ends for good. Ruled: accept. The creator, not the link minter: a link is what the meeting hands out, and "each link stands on its minter" would let a meeting outlive the only person Calls can say it belongs to. No revival on re-add matches #97's lease and Slides. hostOf resolves person:/agent: only; anything else is NotMember and ends โ fine for team databases, which are new; record it. The list GET that ends meetings (deviation 10): acceptable. It is a system reconciliation of a state the roster has already decided, idempotent, not on the viewer's standing, bounded by distinct hosts per list, never under Unknown (M27), and the hub tick already does the same for live rooms. A job would exist to end quiet meetings nobody will touch; "the next write" would leave the list offering a meeting that 404s. Keep it.
Media reality / ICE TTL. The statement in ยง16.5 is honest and sufficient; do not shorten the ICE life in team mode. Relay credentials bound only relayed media: a colluding pair on a direct path needs none, so a shorter TTL buys a bound the adversary sidesteps, while making /ice renewals โ which are 503 under Unknown โ the thing that drops honest relayed media in any blip longer than the TTL, exactly what the held stream exists to prevent. The real mitigation is the one built: signalling and /ice refused, gone to the room, peers close. Renewal stops at removal, so the three hours is the ceiling, as recorded.
Push. Members-now only, nobody under Unknown, a fresh Access per recipient (M6 killed). cmd/calls not reading CALLS_APNS_* is a pre-existing gap on main, not this branch's; note it for the Alta recipe.
CI toolchain pin (8baa6f5). Right fix: the credits test itself prescribes GOTOOLCHAIN=<want> make ci, and pinning the gate (not the native builds) is the smallest true statement. The target-scoped export reaches ci's prerequisites, each .amadan/ci.d step (they exec make <target>), race, and credits, so notices.json and the gate move together; a Go bump is now "edit the pin, make credits, one commit". It belongs on main regardless of team mode: land 8baa6f5 first (cherry-pick or fast-forward) or merge the branch with a merge commit so both commits stay reachable; do not squash.
Paul's question 1 โ host removed mid-call. Recommend end for everyone, as built. After removal the meeting has no host, and every later touch re-derives NotMember from created_by; "keep it for the members present" needs either a re-host write (transferring created_by, which nobody's standing makes cleanly) or a second rule for hostless meetings. Slides ends a removed presenter's talk the same way; the members restart in one click; a host's removal is rare and the conservative answer is the right default. If you ever want the other behaviour, it is "a present member takes the meeting over", not "end only the guests".
Deviations, ruled
- Creator/operator host, ended and not revived โ accept. 2. Ends for everyone โ accept (recommendation above). 3. Removed Home identities signed out, guests and unlinked locals stay guests โ accept (Calendar's shape). 4. Local sessions not re-checked against the allowlist per request โ accept: in team mode the list is only the link page's door; an unlinked local account reaches nothing either way. 5. Held streams keep and deliver โ accept. 6.
ErrStandingUnknown,Recheckโ accept. 7. Agent mint/revoke guarded โ accept, better than Slides. 8./continue503 without consuming โ accept. 9. Named guest + grant one transaction โ accept. 10. Listing settles hosts โ accept (above). 11./native/exchangeunchanged โ accept. 12. Relay life unchanged โ accept (above). 13. Tick warning per participation per 15 s โ accept, with the log note. 14. Toolchain pin โ accept, land first.
Mutations I ran (39)
Killed (33): heartbeat re-arms the lease timer; own-removed without Recheck; host-removed not ended; guard off; push includes Unknown; Resume refuses Unknown; live delivery while held; ICE without the host check; a removed member following a link; API list ignores Partial; settle never ends; settle ends Unknown; sign-in mail on an Unknown host; signal Unknown as 500; standingFor skips the host; requirePerson keeps a removed member; requireMember admits Unknown; own-Unknown as a guest; pending grant unguarded; named guest unguarded; /signin keeps a removed member; fresh stream Unknown as 404; index sends Unknown to /welcome; renew 0 on a lapsed lease; terminal events held; a resume's roster/replay written under hold; agent's meeting on the agent id; link page Unknown as 404; endForHost without hub.End. Survived, equivalent (4): the drain loop's per-event stands() (team_stream.go:221 โ the decide just read Member a few microseconds earlier; the live path is covered); the resume path's m.EndedAt assignment (stream.go:185 โ meetingStands has already ended it and the tombstone answers 410); /continue minting under a host Unknown (the guard on the host's Access refuses, as the author recorded); a heartbeat re-arming the hold timer (same interval; the faithful variant is killed). Survived, test gap (1): requireAgent admitting Unknown (api.go case roster.Unknown) โ the list still 503s via Partial and writes via the guard, but an item GET on another member's meeting answers 200 under an Unknown operator. ยง16.6 promises 503; add the assertion to TestTeamAgentStandsOnItsOperator. Not a blocker.
Notes (no action required)
- The partial list still shows the Start/New forms; a POST under Unknown is the 503 page. Fine.
- An allowlisted, unlinked local account landing on
/goes to/welcome, with the link offered in the account menu; member routes redirect it to/account/home. Consistent enough. - A fresh stream opened during a blip climbs the browser's stall ladder (8 rounds) to "unreachable"; a held resume never does. That matches "new entries are retryable 503s".
standingOfanswering nil (Unknown) on a storage failure is the right closed answer everywhere it is read.- Alta's recipe changes (
Roster: true,teamKeys, drop the owner allowlist) are as ยง16.9 says; not reviewed here.