Skip to main content

Module event_group

Module event_group 

Source
Expand description

ai.hyprstream.event.group / ai.hyprstream.event.groupItem — lexicon records for EventService managed-list groups (epic #600, EV2 #602).

Built on the generic crate::list_record module: a parallel, pattern-matching lexicon, deliberately modeled on the signed-off ai.hyprstream.placement.group/groupItem pattern from #524 (atproto list, owner-curated, with a separate listitem per member; bidirectional consent = owner lists the member and the member’s own record consents) — but NOT a literal reuse of ai.hyprstream.placement.group, since that lexicon is sign-off-frozen (unknown fields rejected at decode) and event groups need an extra keysetId field placement groups don’t have.

Resolved design decision (human review, #602): keep these as separate NSIDs/collections — this preserves cheap collection-based firehose/AppView filtering and keeps placement-membership and event-key-membership as genuinely distinct axes — while sharing the list/listitem/consent mechanics via crate::list_record so neither lexicon hand-duplicates validation, encoding, or the consent check.

§Key material is NOT in the record

keysetId is a stable opaque reference (“this group’s key material is generation X”), never the key bytes. The actual K_group symmetric key is generated fresh per rotation (exactly as SecureEventPublisher::register_prefix does today) and delivered per-member via DH-wrap-on-join (derive_wrap_key/wrap_group_key) — never committed to the public, firehose-synced atproto repo. This matches #524’s “durable facts = atproto records, volatile/secret facts = ephemeral RPC” split, and keeps the relay/firehose blind to K_group (epic #600’s threat model).

Membership is bidirectional: EventGroupItemRecord is the owner’s claim that a member belongs to the group; it is NOT sufficient alone — the member’s own identity record must independently consent (carry the group’s at-uri in its own groups-style field). Which lexicon carries that member-side consent for EventService members remains an open question: candidates are reusing ai.hyprstream.placement.node.groups for members that are also placement nodes, or a new minimal ai.hyprstream.event.member record for members that are not. check_bidirectional_consent implements the check generically over two already-fetched claims, deliberately not committing to the member-side lexicon.

Re-exports§

Structs§

EventGroupExtra
ai.hyprstream.event.group’s extra field beyond the common list shape.

Constants§

GROUP_COLLECTION_NSID
NSID for the group (list) record.
GROUP_ITEM_COLLECTION_NSID
NSID for the groupItem (listitem) record.

Type Aliases§

EventGroupItemRecord
ai.hyprstream.event.groupItem — the owner-side membership claim (listitem), lives in the owner’s repo. Identical shape to every other listitem lexicon in this crate — see ListItemRecord.
EventGroupRecord
ai.hyprstream.event.group — the list record, lives in the owner’s repo.