Skip to content

feat(solo): let chat owners change agent access - #3704

Merged
tellaho merged 10 commits into
mainfrom
tho/solo-agent-role-controls
Nov 19, 2026
Merged

tellaho merged 10 commits into
mainfrom
tho/solo-agent-role-controls

Conversation

@tellaho

@tellaho tellaho commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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 feat(relay): add conditional Solo member role updates 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
  • 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 feat(relay): add conditional Solo member role updates 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.

demo.mp4

Screenshots

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

Before Proposed agent menu
Existing agent menu only offers removal Existing role choices enabled for the Solo owner

Promoting the agent opens a confirmation.

Confirmation before granting Admin access

Reuse member role menus and confirmed administration for existing Solo agents. Verify signed agent profiles before signing and publication; retain the human-role, addition and ownership-transfer restrictions.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
@tellaho
tellaho force-pushed the tho/solo-agent-role-controls branch from e6dfcaa to a365529 Compare November 17, 2026 22:18
@tellaho
tellaho changed the base branch from tho/solo-opening-agent-admins-client to main November 17, 2026 22:18
@tellaho
tellaho marked this pull request as ready for review November 18, 2026 17:34
@tellaho
tellaho requested a review from a team as a code owner November 18, 2026 17:34

@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 — Changes needed at a365529: the relay can reject demotions of current agents or restore a removed agent’s access during an in-flight role edit. Please also confirm whether Solo chat owners should be able to grant Admin to another person’s agent, and whether Viewing only should govern channel permissions alone. Source review only. The browser journey simulates relay acceptance.

Comment thread docs/solo/sharing.md Resolved
Comment thread tests/browser/fixture.mjs Resolved

@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.

🤖 Carl, an automated reviewer, commenting via Wes's GitHub account.

Changes requested at a365529. The relay does not limit Solo role edits to agents: its generic kind 9000 path lets a Solo owner set admin, member or guest on any member the target's policy allows (role authority). That makes this PR's client check the only thing enforcing "agents only", and right now it accepts unverified profile metadata (inline).

The earlier review's relay findings still hold on relay main at 11970789eb: the removed-agent race, a refused demotion leaving Admin in place, and a false join notice. Those threads stand as written. The race is narrower than it looked: the second preflight's expectedRole check catches a removal that lands before it, so only the gap between that check and the relay commit remains. Only the relay can close that gap.

No behavior change outside Solo. Non-Solo, system-channel, removal and ownership-transfer paths behave as before.

Open product question for Wes: should a Solo owner be able to grant Admin to an agent someone else owns? The tests deliberately allow it, while #3647 limits automatic grants to owned agents.

To merge: require verified agent identity for the Solo exception, resolve or explicitly accept the relay-side findings, and validate against a real relay. CI and the browser journey simulate relay acceptance.

tellaho and others added 2 commits November 18, 2026 10:06
Use a dedicated relay command carrying the current role. Allow owners to
lower access for existing participants and verify agent ownership for
promotions. Keep the menu, confirmation, and broker contract aligned.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Describe downgrades for current members, verified agent promotions, and
which chat permissions Viewing only grants.

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

tellaho commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

🤖 @wesbillman The fixes are in 4704c27950 and a470947dc6. Solo role edits use a signed conditional command. The relay checks active membership and the expected role in one transaction. Downgrades bypass invitation policy, and the signed roster refreshes without a join notice. The app uses verified ownership for promotions in both the menu and preflight. The guides describe which role changes Solo owners can make. Relay companion #9667

At a470947dc6, 271 focused app tests, the native signing contract, and Chromium and WebKit journeys with a simulated relay passed. The app’s production command builder and signed roster reader also passed over WebSocket against local relay 405f7d1da for a human downgrade and removal.

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Two remaining concerns: role controls are offered without relay support, and the new rejection fixtures do not detect removal of expected-role validation.

tellaho and others added 4 commits November 18, 2026 14:46
Keep automatic Admin grants on the existing invitation command when the caller omits the manual role-update option.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Exercise missing and invalid expected roles, the tag name, and the requested role independently in the shared signing fixture.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Wait for the action menu only while it is open and capture the confirmation using its own dialog locator.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Carry the relay advertisement through the existing web and desktop member administration writers. Hide Solo role controls and reject manual role edits before signing when the advertisement is absent.

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

tellaho commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

🤖 @kalvinnchau Both fixes are in a21eb01ce2. Web and desktop require the relay’s buzz-solo-member-role NIP-11 advertisement before showing or signing Solo role edits. Member removal remains available on older relays. The matching relay advertisement is in block/buzz#9667 at 4aa8a9923.

The shared signing fixture now isolates missing, misnamed, and invalid expected_role tags and an invalid new role. The native signing test passed at a261330872, and removing the TypeScript expected-role check made the fixture fail as intended.

TypeScript, 376 focused tests, and the pre-push checks passed at a21eb01ce2. Chromium and WebKit exercised both capability states against simulated relays. The relay advertisement test passed at 4aa8a9923.

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 The previous support-gating and fixture findings are repaired. One client/relay visibility mismatch remains.

Require signed private visibility in the shared Solo role authority and cover menu visibility, removal, and the publication preflight.

Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
tellaho added a commit to block/buzz that referenced this pull request Nov 19, 2026
**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](block/buzz-app#3704). The
[app
review](block/buzz-app#3704 (review))
identified the need for conditional writes, verified agent identity and
live relay validation. [#9592](#9592)
introduced the atomic removal that uses the same membership lock.

<details>
<summary>File changes</summary>

**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.

</details>

### 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.

---------

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

@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.

🤖 Carl, an automated reviewer, commenting via Wes's GitHub account.

No blockers at 0e2251a. The Court checked the client against relay main 946d9c3467 (block/buzz#9667). The menu, both preflights and the relay's 9050 transaction agree on every transition. All earlier threads are addressed at this head: the conditional write, admission policy and join notice are fixed in the relay, the agent-identity proof and private-only gate are fixed in the client, and the expected-role fixtures now isolate each constraint.

The two inline P3s are non-blocking. The PR body is stale: it still says people's roles get no choices and cites a365529076 for validation. At this head, owners can lower any non-owner's access, as docs/solo/sharing.md describes. Please update it.

Validation gaps: source review plus green CI at this head. Nobody has run this against a real or deployed relay; the browser journey simulates acceptance. The client proves ownership from the agent's signed profile, while the relay uses its stored ownership record. If those disagree, the owner gets an offered choice that the relay refuses. That's safe, but please check the refusal message during relay acceptance.

Product questions for Wes: should Solo owners be able to demote people at all? If so, should a person moved to Viewing only be restorable? Today only remove and re-invite works. Design should review the confirmation for that case.

To merge: update the PR body, address or accept the inline P3s, and complete relay acceptance on a relay advertising buzz-solo-member-role.

Comment thread docs/channels.md Resolved
tellaho and others added 2 commits November 19, 2026 13:17
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 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

🤖 @wesbillman The follow-ups are in b741f17a17. The shared signing contract now covers a participating agent becoming Admin and rejection of a well-formed self-targeted command. The protocol docs and PR description now describe the capability gate and conditional role changes.

All 226 affected Vitest tests and the Rust production IPC signing test passed. An isolated build of the merged relay advertised the capability, accepted two downgrades, and refused a mismatched ownership grant and an edit after removal. The signed roster matched the expected result after each operation.

Could you review the latest push so GitHub can clear the merge requirement?

@tellaho
tellaho merged commit 3b6cbe9 into main Nov 19, 2026
69 checks passed
@tellaho
tellaho deleted the tho/solo-agent-role-controls branch November 19, 2026 22:50
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.

3 participants