Skip to content

feat(relay): add conditional Solo member role updates - #9667

Merged
tellaho merged 7 commits into
mainfrom
tho/solo-agent-role-updates-relay
Nov 19, 2026
Merged

tellaho merged 7 commits into
mainfrom
tho/solo-agent-role-updates-relay

Conversation

@tellaho

@tellaho tellaho commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Category: improvement
User Impact: Solo chat owners can lower the access of any current non-owner, including people and agents.

Problem: Using invitations to change Solo chat access can restore a removed member, reject a downgrade because of the target’s invitation policy, or show a join notice for a role change.

Solution: Add signed role updates that require an active member at the expected role when the relay commits the change. A Solo owner can downgrade any current non-owner. Moving a viewer to Participating requires a verified agent, and granting Admin requires ownership of that agent. The relay refreshes signed group state without emitting a join notice.

Companion to block/buzz-app#3704. The app review identified the need for conditional writes, verified agent identity and live relay validation. #9592 introduced the atomic removal that uses the same membership lock.

File changes

crates/buzz-core/src/kind.rs

Register signed Solo role updates as kind 9050.

crates/buzz-db/src/store/channel_members.rs

Authorize the transition under the channel membership lock and commit the active row update and signed event together.

crates/buzz-relay/src/handlers/event.rs

Give the new command a bounded metrics label.

crates/buzz-relay/src/handlers/ingest.rs

Use the shared signed ingest path and require the channel administration scope.

crates/buzz-relay/src/handlers/mod.rs

Register the command handler and its PostgreSQL test.

crates/buzz-relay/src/handlers/solo_member_role.rs

Parse the command, route it to the conditional write, and refresh signed group state after commit.

crates/buzz-relay/src/handlers/solo_member_role_postgres_tests.rs

Exercise human and agent changes, restrictive invitation policy, promotion authorization, stale and removed membership, duplicate receipt, and signed roster updates through the relay’s production ingest path.

docs/solo-mobile-contract.md

Describe the wire format, permitted transitions, and handling when an older relay rejects the command.

Try it

  1. Run the updated relay and the companion app against a disposable Solo chat with a current human and agent. Open Chat access as the owner.
  2. Lower the human to Viewing only. Reopen Chat access and confirm the saved role. A role change should produce no join notice.
  3. Downgrade an agent with a restrictive invitation policy. Confirm its role changes. Check that Admin can be granted only to your own verified agent.
  4. Run solo_owner_edits_active_members_and_publishes_the_new_roster with PostgreSQL to check that a pending change for a removed member is refused and the signed roster stays clear of that member.

Validation

  • The PostgreSQL regression passes at relay commit 405f7d1da. It covers role and invite-policy enforcement, signed roster refresh, duplicate receipts, and rejection after removal.
  • The companion app at a470947dc6 passes 138 administration tests. Its production command builder, validator, and signed roster reader also passed over WebSocket against a local relay backed by PostgreSQL and Redis. A human moved from Admin to Participating to Viewing only, then was removed. The app preflight and relay both refused a further role edit, and the signed roster still excluded the member.
  • The live check exercised the app’s relay code headlessly. The UI walkthrough is pending.

tellaho and others added 2 commits November 18, 2026 10:21
Apply signed role changes to active Solo members at their expected role. Permit access reductions, require verified agent ownership for elevation, and refresh signed group state without sending admission notices.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho
tellaho marked this pull request as ready for review November 18, 2026 21:38
@tellaho
tellaho requested a review from a team as a code owner November 18, 2026 21:38
@tellaho
tellaho deployed to codex-review November 18, 2026 21:40 — with GitHub Actions Active
@github-actions github-actions Bot added the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 18, 2026
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🔐 Codex Security Review

Note: This is an automated, security-focused review generated by Codex.
Use it as a supplement to human review; false positives are possible.

Scope

  • Exact PR diff: fd436af8469ace8f47b1b334709a4411cb5310dc...38a49a01e3e3d1e24614525bd40e927b84eff59a
  • Model: gpt-6.1-sol

💡 Click "edited" above to see earlier reviews for this PR.


Review Summary

Overall Risk: NONE

No concrete security, correctness, or reliability findings identified in the authorized PR range.

Findings

No concrete security, correctness, or reliability findings were identified.

Notes

  • Review used read-only source and history inspection. Builds and tests were not run, as instructed.

Generated by Codex Security Review |
Requested by: @tellaho |
Workflow run

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Star Lord recommends changes at 1fb400a. An accepted Solo role edit can leave the relay-signed roster stale and block later edits. Source review only.

The locked Solo guard accepted any stream labelled buzz.solo, so an
open channel carrying that label let the owner's kind 9050 skip the
ordinary role-change policy and its notices. Require private
visibility, matching the Solo definition in the mobile contract.

Signed-off-by: Tom Brow <tomb@block.xyz>

@brow brow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 The pre-review recommends landing this with one small fix, #9677 refuse Solo role changes on open channels: without it, the relay accepts the new role command on any channel labelled buzz.solo, including an open one, where the owner can silently change the role of someone else's agent that its invitation policy protects. Please merge the fix into your branch (it needs no approval there, since it targets your branch), and this PR is then approved and merged on Tom's go-ahead.

tellaho and others added 4 commits November 18, 2026 15:26
Publish the kind:9050 capability in NIP-11 so clients can support independent rollout.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
* commit '5595b1c647bd4238bd38526c532daadeef6f602c':
  fix(relay): refuse Solo role changes on open channels

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Replace the signed admin and member lists before committing the role
change. Roll back the command and role together if either list write
fails so the same command can be retried.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Keep the Solo role command import and the artifact policy import.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@github-actions github-actions Bot removed the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 19, 2026
@tellaho
tellaho deployed to codex-review November 19, 2026 00:18 — with GitHub Actions Active
@github-actions github-actions Bot added the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 19, 2026
@tellaho

tellaho commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

🤖 @brow @wesbillman Both review findings are addressed at 38a49a01e3e3d1e24614525bd40e927b84eff59a.

The relay now accepts Solo role edits only on private streams, including the guard from #9677. It stores the command, role, signed admin list, and signed member roster in a single transaction. A roster write failure rolls back the entire edit, so the same signed command can be retried.

Six PostgreSQL regressions passed on that head, including open-channel rejection, rollback and retry, the Solo role workflow, and the upstream artifact-policy checks. The NIP-11 capability test also passed.

All five pre-push hooks passed.

@tellaho
tellaho deployed to codex-review November 19, 2026 00:32 — with GitHub Actions Active
@github-actions github-actions Bot added codex-security-review-current The posted Codex security review matches its recorded range. and removed codex-security-review-current The posted Codex security review matches its recorded range. labels Nov 19, 2026
@tellaho
tellaho merged commit db40da8 into main Nov 19, 2026
91 checks passed
@tellaho
tellaho deleted the tho/solo-agent-role-updates-relay branch November 19, 2026 01:16
bostonaholic added a commit that referenced this pull request Nov 19, 2026
…ction-p

* origin/main: (200 commits)
  fix(mobile): keep open shared sessions in Solo (#9704)
  fix(mobile): align channel indicators and Duo section menus (#9703)
  fix(mobile): allow person mentions in Solo chats (#9705)
  fix(mobile): let code scroll under the code block copy button (#9612)
  Transcribe Bestie hold recordings into text on device (#9645)
  feat(cli): show and search verified identity in users get (#9647)
  fix(mobile): keep agent poster up until the iOS video draws (#9688)
  test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691)
  Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689)
  feat(relay): add conditional Solo member role updates (#9667)
  feat(mobile): add saved channel section filters (#8479)
  feat(relay): support community-scoped NIP-AR artifacts (#9650)
  feat(mobile): add a diagnostics test report and test crash to Settings (#9676)
  fix(pubsub): round the rate-limit retry hint up from PTTL (#9552)
  feat(mobile): add diagnostic reporting module with crash capture (#9613)
  fix(mobile): recover stuck read-state updates and stale Mark Read (#9492)
  test(relay): refresh the author's membership cache after the stray-h private channel insert (#9640)
  fix(mobile): name the cause of account-unavailable sign-in errors (#9628)
  perf(db): bound deep keyset history pages by the cursor timestamp (#9549)
  feat(cli)!: consistent channels list/get/search output (type, visibility, labels, real created_at) (#9617)
  ...

Signed-off-by: Matthew Boston <mboston@squareup.com>
bostonaholic added a commit that referenced this pull request Nov 19, 2026
…eaction-recipients

* origin/main: (72 commits)
  fix(mobile): keep open shared sessions in Solo (#9704)
  fix(mobile): align channel indicators and Duo section menus (#9703)
  fix(mobile): allow person mentions in Solo chats (#9705)
  fix(mobile): let code scroll under the code block copy button (#9612)
  Transcribe Bestie hold recordings into text on device (#9645)
  feat(cli): show and search verified identity in users get (#9647)
  fix(mobile): keep agent poster up until the iOS video draws (#9688)
  test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691)
  Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689)
  feat(relay): add conditional Solo member role updates (#9667)
  feat(mobile): add saved channel section filters (#8479)
  feat(relay): support community-scoped NIP-AR artifacts (#9650)
  feat(mobile): add a diagnostics test report and test crash to Settings (#9676)
  fix(pubsub): round the rate-limit retry hint up from PTTL (#9552)
  feat(mobile): add diagnostic reporting module with crash capture (#9613)
  fix(mobile): recover stuck read-state updates and stale Mark Read (#9492)
  test(relay): refresh the author's membership cache after the stray-h private channel insert (#9640)
  fix(mobile): name the cause of account-unavailable sign-in errors (#9628)
  perf(db): bound deep keyset history pages by the cursor timestamp (#9549)
  feat(cli)!: consistent channels list/get/search output (type, visibility, labels, real created_at) (#9617)
  ...

Signed-off-by: Matthew Boston <mboston@squareup.com>
wpfleger96 added a commit that referenced this pull request Nov 19, 2026
…c-spec-mobile

* origin/main:
  fix(mobile): keep glass controls mounted and the wide thread push parallax (#9726)
  fix(mobile): stabilize Duo chat switching and sheet layering (#9717)
  Require relay schema owner review for migrations and schema (#9708)
  fix(relay): resurface a hidden DM when someone else messages it (#9678)
  fix(deploy): pin self-host installs to relay 0.3.0 (#9714)
  fix(mobile): keep open shared sessions in Solo (#9704)
  fix(mobile): align channel indicators and Duo section menus (#9703)
  fix(mobile): allow person mentions in Solo chats (#9705)
  fix(mobile): let code scroll under the code block copy button (#9612)
  Transcribe Bestie hold recordings into text on device (#9645)
  feat(cli): show and search verified identity in users get (#9647)
  fix(mobile): keep agent poster up until the iOS video draws (#9688)
  test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691)
  Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689)
  feat(relay): add conditional Solo member role updates (#9667)
  feat(mobile): add saved channel section filters (#8479)
  feat(relay): support community-scoped NIP-AR artifacts (#9650)
  feat(mobile): add a diagnostics test report and test crash to Settings (#9676)
  fix(pubsub): round the rate-limit retry hint up from PTTL (#9552)
  feat(mobile): add diagnostic reporting module with crash capture (#9613)

Signed-off-by: Will Pfleger <wpfleger@block.xyz>

# Conflicts:
#	mobile/test/features/activity/activity_page_test.dart
cshtdd added a commit that referenced this pull request Nov 19, 2026
…-workflow-verified-mentions

* 'main' of https://github.com/block/buzz: (21 commits)
  chore: require relay owner review for the relay and db crates (#9728)
  fix(mobile): align Huddle cards and preserve conversation navigation (#9713)
  Match mobile mention chips to desktop styling (#9706)
  feat(relay): push mentions to people outside a listed channel (#9623)
  fix(db): undo migration 0097 (#9710)
  fix(mobile): keep glass controls mounted and the wide thread push parallax (#9726)
  fix(mobile): stabilize Duo chat switching and sheet layering (#9717)
  Require relay schema owner review for migrations and schema (#9708)
  fix(relay): resurface a hidden DM when someone else messages it (#9678)
  fix(deploy): pin self-host installs to relay 0.3.0 (#9714)
  fix(mobile): keep open shared sessions in Solo (#9704)
  fix(mobile): align channel indicators and Duo section menus (#9703)
  fix(mobile): allow person mentions in Solo chats (#9705)
  fix(mobile): let code scroll under the code block copy button (#9612)
  Transcribe Bestie hold recordings into text on device (#9645)
  feat(cli): show and search verified identity in users get (#9647)
  fix(mobile): keep agent poster up until the iOS video draws (#9688)
  test(relay): stop bridge cancel_fixture tests timing out on the first replica connect (#9691)
  Revert "feat(relay): support community-scoped NIP-AR artifacts" (#9689)
  feat(relay): add conditional Solo member role updates (#9667)
  ...

Signed-off-by: Camilo Sanchez <camilos@squareup.com>
tellaho added a commit to block/buzz-app that referenced this pull request Nov 19, 2026
## Overview

**Category:** improvement

**User Impact:** Owners of Private Solo chats can change existing
members’ access from the member menu when their relay supports Solo role
updates.

**Problem:** The Solo member menu offered removal as the only way to
change an existing member’s access.

**Solution:** Owners can lower the access of current non-owners, restore
participation for verified agents, and grant Admin to their own verified
agents. The app checks relay support, signed Private visibility, and
current membership before signing and again before publishing. The relay
applies the conditional command only if the target’s current role still
matches.

## Changes

- Reuse the existing role menu and confirmation in Chat access. A person
can be downgraded to Viewing only. To restore their participation,
remove and invite them again.
- Enable role edits on web and desktop when the relay advertises
`buzz-solo-member-role` in NIP-11. Member removal is available
independently.
- Sign and publish kind `9050` through the purpose-bound writer. The
command carries the expected role, and the app checks the updated signed
roster before reporting success. Relay support is in block/buzz#9667.
- Cover permission differences, stale roster and profile checks, the web
and native signing contract, and the browser role-change flow.

## Reproduction steps

1. On a supporting relay, open **Access** as the owner of a Private Solo
chat with a participating agent you own and another participant.
2. Open the agent’s menu, choose **Admin**, then cancel. Reopen the menu
and verify the agent remains **Participating**.
3. Choose **Admin** again and confirm. Reopen the menu and verify the
new selection after the roster refreshes.
4. Open the other participant’s menu and verify that you can lower their
access. On a View only chat or a relay without the capability, verify
that the role choices are absent and member removal is still available.

## Validation

- Required CI and DCO passed on `0e2251a892`. Chromium and WebKit
covered the application flow against a simulated relay. [CI
run](https://github.com/block/buzz-app/actions/runs/44435871254/attempts/2)
- All 226 affected Vitest tests passed on `b741f17a17`, including the
shared Bot-to-Admin fixture and the native transport’s self-target
rejection.
- The Rust production IPC signing test passed on `b741f17a17`.
- An isolated PostgreSQL-backed relay built from the same relay source
as block/buzz#9667 advertised the capability, accepted two downgrades,
and refused both an Admin grant without matching relay ownership and a
role edit after removal. The client verified the relay-signed roster
after each change. The probe exercised the app’s command protocol over
WebSocket.

## Recording

A short walkthrough of the owner opening agent access, canceling without
a change, confirming Admin access, and verifying the saved role after
reload.

Recorded from the real Buzz UI at `e6dfcaaf4f` with fictional people and
messages and a simulated relay. This recording demonstrates the agent
promotion flow using the earlier implementation.


https://github.com/user-attachments/assets/f719ee6f-d017-4034-be08-753fa996117e

## Screenshots

Captured at `e6dfcaaf4f` with disposable fixture data, dark theme, and
normal text size.

| Before | Proposed agent menu |
| --- | --- |
| ![Existing agent menu only offers
removal](https://github.com/user-attachments/assets/b99d1884-abfc-4646-9b0f-9ee18b199034)
| ![Existing role choices enabled for the Solo
owner](https://github.com/user-attachments/assets/7187201a-6c9a-4a38-963e-c7cecaef0e17)
|

Promoting the agent opens a confirmation.

![Confirmation before granting Admin
access](https://github.com/user-attachments/assets/01b40ec0-fd63-4295-8fff-ac3067a14429)

---------

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>

This branch was successfully deployed

1 active deployment
codex-review — 38a49a01 Deployed Nov 19, 2026 by tellaho via Run Codex Security Review #16172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex-security-review-current The posted Codex security review matches its recorded range.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants