Skip to content

feat(relay): add kind:40009 interactive-card response events - #4924

Closed
mcdickenson wants to merge 1 commit into
block:mainfrom
mcdickenson:feature/todo-card-response-kind
Closed

feat(relay): add kind:40009 interactive-card response events#4924
mcdickenson wants to merge 1 commit into
block:mainfrom
mcdickenson:feature/todo-card-response-kind

Conversation

@mcdickenson

Copy link
Copy Markdown

Summary

Registers a new channel-scoped event kind, KIND_CARD_RESPONSE = 40009, for interactive to-do card check-offs. A response references the card message via an e tag and the item via an item tag; content is {"done":true|false}. Card state is a pure client-side fold over these signed events (huddle-card pattern) — the relay stores raw events only.

This is the relay half of the inline interactive to-do cards MVP; the card itself is a buzz:todo-card fenced sentinel inside a normal message (config-nudge pattern) and needs no relay changes. Desktop renderer + SDK builder land in follow-up PRs.

  • crates/buzz-core/src/kind.rs: KIND_CARD_RESPONSE + ALL_KINDS entry
  • crates/buzz-relay/src/handlers/ingest.rs: required_scope_for_kindMessagesWrite (stream-message arm), requires_h_channel_scope → true, so the generic pipeline enforces the h tag, NIP-42 session scope, and channel membership
  • Feed/unread queries are unaffected: they use explicit kind inclusion lists (buzz-db/src/feed.rs), so 40009 never creates unreads

Testing

  • cargo test -p buzz-core -p buzz-relay: allowlist-coverage (per_kind_scope_allowlist_covers_all_migrated_kinds), duplicate-kind detection, and new tests card_response_requires_messages_write_scope / card_response_is_channel_scoped_not_global all pass
  • 10 pre-existing failures in api::media/api::admin/api::mesh_demo reproduce on clean main (local-infra dependent) — unrelated
  • just fmt-check + just clippy clean

🤖 Generated with Claude Code

Registers KIND_CARD_RESPONSE (40009) so clients can publish signed
check-off responses to interactive card messages (e tag → card event,
item tag → item id). Channel-scoped like other stream-message kinds:
requires an h tag, MessagesWrite scope, and channel membership via the
generic ingest pipeline. Card state stays a client-side fold — the
relay stores raw events only, and feed/unread queries are unaffected
because they use explicit kind inclusion lists.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Dickenson <mdickenson@squareup.com>
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