feat(huddle): huddle-transcript signed event kind + SDK builder (#2513)#2522
Open
artile wants to merge 1 commit into
Open
feat(huddle): huddle-transcript signed event kind + SDK builder (#2513)#2522artile wants to merge 1 commit into
artile wants to merge 1 commit into
Conversation
…lock#2513) A huddle's spoken content is the one modality that never becomes part of the event log — agents watching a channel can see that a huddle happened, but never what was said (block#2513). This adds the protocol foundation for huddle transcripts as first-class, searchable, signed channel events. - buzz-core/kind.rs: new `KIND_HUDDLE_TRANSCRIPT = 48104`, in the huddle lifecycle range and registered in `ALL_KINDS`. - buzz-core/huddle.rs: `HuddleTranscriptSegment` — the typed reader side used by agents. A segment's *content is plain transcript text* (so it is FTS-indexed and readable like a message); structure is in tags: `h` channel, `p` speaker pubkey, `e` huddle-started event, `start`/`end` millisecond offsets, optional `lang`. `from_content_and_tags` parses one back out. - buzz-sdk/builders.rs: `build_huddle_transcript(...)` constructs the signed event with validation (hex speaker/huddle id, non-empty text, size cap, end >= start). - buzz-relay/ingest.rs: register the kind's write scope (`ChannelsWrite`) and `h`-channel scoping, alongside the other huddle events. Per-speaker attribution is inherent server-side: the audio room already keys participants by `(pubkey, peer_index)`, so a segment maps to a pubkey with no diarization. Because content is plain text, transcripts are searchable through the existing Postgres FTS `search_tsv` column with no extra indexer. Scope: this is the reviewable protocol slice. Server-side per-speaker recording (tap the audio room -> persist Opus per pubkey to buzz-media), the transcription pass over those tracks, and consent/retention (opt-in per huddle announced via KIND_HUDDLE_GUIDELINES; NIP-09 deletion for transcript events + object cleanup) are the documented follow-ups — see the PR body. Tested: buzz-core (5) + buzz-sdk (4) huddle tests pass, incl. a round-trip from the SDK builder through the core reader. Zero unsafe, no panics on new paths. Refs block#2513 Signed-off-by: Taras Kornichuk <dread9ko@gmail.com>
artile
force-pushed
the
feat/huddle-transcript-events
branch
from
July 23, 2026 14:32
52d5d0e to
b99a327
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A huddle's spoken content is the one modality that never becomes part of the event log. Agents watching a channel can see that a huddle happened (lifecycle events), but never what was said. This PR adds the protocol foundation for huddle transcripts as first-class, searchable, signed channel events — the core of #2513.
This is scoped as the reviewable protocol slice: the event kind, a typed reader, an SDK builder, and relay ingest registration — all built and tested. The server-side recording + transcription pipeline is designed below and called out as the honest follow-up, so this PR is small and correct rather than large and unbuildable.
What's in this PR
buzz-core/src/kind.rs— newKIND_HUDDLE_TRANSCRIPT = 48104, placed in the huddle lifecycle range (48100–48106) and registered inALL_KINDS(so the duplicate-detection test covers it).buzz-core/src/huddle.rs—HuddleTranscriptSegment, the reader side agents use. A segment's content is plain transcript text (so it is FTS-indexed and readable exactly like a message); structure lives in tags:from_content_and_tagsparses a segment back out (used by agents / any consumer).buzz-sdk/src/builders.rs—build_huddle_transcript(...), the signed-event builder, with validation (64-hex speaker + huddle id, non-empty text, 16 KB cap,end >= start).buzz-relay/src/handlers/ingest.rs— registers the kind's write scope (ChannelsWrite) andh-channel scoping, alongside the other huddle events.Why this shape
(pubkey, peer_index)(crates/buzz-relay/src/audio/room.rs), so a segment maps to a speaker pubkey with no diarization.search_tsvgenerated column automatically.Testing
cargo test -p buzz-core -p buzz-sdk huddle— 9 passed, 0 failed (5 core reader + 4 SDK builder, including a round-trip from the SDK builder through the core reader).cargo check -p buzz-relay(SQLX_OFFLINE) — clean.cargo fmt— clean.unsafe; no panics/unwraps on the new paths.Follow-ups (the rest of #2513) — designed, not in this PR
crates/buzz-media, S3/MinIO/Blossom) on huddle end. Needs a memory/retention budget per room.KIND_HUDDLE_GUIDELINES(48106) as a "this huddle is recorded" policy; a NIP-09 deletion path removes transcript events + their audio objects.Splitting these keeps each PR reviewable; this one lands the protocol contract they all build on.
Refs #2513