block / block/buzz

feat: user groups — mentionable groups of people and agents

Open
#2,728 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

> 🤖 Filed by kray's AI agent on his behalf.

## Problem

Buzz has no way to address a set of members as one unit. Two Slack-parity gaps:

1. **Group mentions** — in Slack you define a user group (e.g. `@ios-team`); mentioning its handle notifies the members. In Buzz you must @-mention each person individually.
2. **Bulk channel membership** — putting a whole team into a channel means looking up and adding members one by one.

Buzz's existing **agent teams** (kind `30176`) don't cover this: they are containers of *persona IDs* (agent templates deployed into channels) with no pubkey membership and no humans. And because Buzz members and agents are both just pubkeys, a "user group" here can naturally contain **both people and agents** — something Slack can't do.

The kind registry already reserves an empty `47000–47999` "User groups" range (`buzz-core/src/kind.rs`), so this fills in that slot.

## Proposal

Community-shared, named, mentionable groups, following the established NIP-29-style pattern (signed command events + relay side effects + relay-published addressable state snapshot — same architecture as channel membership 9000→39002). NIP-51 follow sets (kind 30000) were considered but are single-author personal lists; groups need creator+admin multi-editor semantics.

### Proposed kinds

| Kind | Purpose |
|---|---|
| `47000` | create group (`handle`, `name`, `description`, initial `p` members, default `channel`s) |
| `47001` | edit metadata / default channels |
| `47002` | delete group |
| `47003` | add member(s) |
| `47004` | remove member(s) |
| `39100` | relay-published group state snapshot (parameterized replaceable, `d` = group id) |

### Semantics

- **Mentions expand to real `p` tags at compose time** (group members ∩ channel members, Slack parity: members not in the channel are silently skipped). Every existing notification path — `#p` live subs, mention feed, mobile, agent wake-up — works unchanged. A `["group", , ]` marker tag lets clients render `@handle` as a mention pill.
- **Bulk add to channel**: resolve group members → existing per-pubkey kind-9000 put-user loop (same as desktop's multi-select invite).
- **Default channels** (Slack parity): when a member is added to a group, the relay auto-adds them to the group's default channels (public channels only for MVP).
- **Permissions**: any member can create a group; only the creator and community admins can edit/delete/manage members. Handles are unique, validated `^[a-z0-9][a-z0-9_-]{1,31}$`.

### Surfaces (this iteration)

- **Relay**: command handling, Postgres storage, snapshot publishing, default-channel auto-join.
- **CLI**: `buzz groups create|list|show|update|delete|add-member|remove-member`, `buzz channels add-group`, group handles in message @-mention expansion.
- **Desktop**: groups in the @-mention selector, mention-pill rendering, groups management UI (people + agents in one picker), groups in the channel invite flow.

### Out of scope / follow-ups

- Mobile (Flutter) compose/manage/render — follow-up issue (mobile already *receives* group-mention notifications since they're plain `p` tags).
- Retroactive default-channel joins when the default-channel list is edited.
- Nested groups, group roles, private groups, workflow_sink group-mention parsing (relates to #2686).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.