feat: confederation events reach relays, and come back from them (confederation, Phase 5)

Behind ExperimentalFeatures.confederation. A live subscription asks
the public relays for what names our rooms and what answers open
proposals, and files it in the confederation's table rather than as a
NostrEvent. What a group signs is filed on every device and owed to
relays by the one that proposed it; a publisher keeps at it until a
relay takes each, and the broadcast screen can send one again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kgothatso NgakoandClaude Opus 5.5 committed 2026-11-21 21:59:52 +02:00
1 parent f7b361c95f
commit bd1b5d56dd
17 files changed
+701 -10

No files matched your search

+1
View File
@@ -47,6 +47,7 @@ wait on upstream (see the next section).
| 2 | done. `nostr/confederation/`: `ConfederationKinds`, the proposal, acceptance, rejection and withdrawal events, `ConfederationAdminList` (decodes only its own encoding), `ConfederationSeal`, `ConfederationStatus`, five tag classes. `ConfederationEventsTest` 27/27; `RetiredKindsTest` checks the family is nobody else's and regular. An answer counts only if made by the proposal's expiry, so `ACCEPTED` does not depend on when a device heard. The seal tag rides the FROST proposal through `ConfederationSealTag` rather than `FrostSigningEvents.assembleTags` |
| 3 | done. `ConfederationRefusal` in all four places in `FrostSigningManager`: on arrival, again at approval (the admins can change while a member decides), as the decline's reason, and in the resend, which carries the seal again. Two tags ride the FROST proposal: `confederation_seal` and, for an answer, `confederation_proposal`, the signed 9430 it answers, so a signer does not depend on its relays (verified and filed like a relay's copy). `proposeSigningBatch` takes `proposalTags`. `ConfederationManager.proposeConfederation`, `proposeAcceptance`, `proposeRejection` and `proposeWithdrawal` build them. `ProposedEvent` summarises the four kinds. `ConfederationDeclineJvmTest` 16/16 replaces the Phase 1 pin. The warnings half of D6 waits for the approval screen (Phase 7). Full jvmTest 1,569, all passing once `ShippedProfileUpgradeJvmTest` was moved to 43 |
| 4 | done, before 3, because the refusals need somewhere to keep the seal and the reason past arrival. Schema 43: `ConfederationEvent` (every kind in one table, keyed by event id, indexed by the proposal it is about), `ConfederationInvitee` (which proposals name a group) and `ConfederationSigning` (per signing session: the seal secret, the carried proposal, the refusal). No `ConfederationGroup` cache: D2's lookups land in the existing `Profile` rows. `ConfederationManager.record` verifies the author's signature and files; `status` computes D8 from the rows. The repository waits for Phase 6, its first caller. `ConfederationStorageJvmTest` 5/5 |
| 5 | done. `ExperimentalFeatures.confederation`, on in development builds. `LiveSubscriptionManager` holds `live-confederation` on the publish set while it is on: every confederation kind `#p`-tagged to one of our Marmot rooms, and every answer `#e`-tagged to a proposal not yet expired, re-sent when either changes. What arrives goes to `ConfederationRepository.record`, never `saveNostrEvent`. `FrostSigningManager.complete` calls `ConfederationManager.onSigned`, which files the signed events on every device and, on the coordinator's, marks them owed (`ConfederationEvent.ownSessionId`, `publishedAt`, folded into schema 43 since it has not shipped). `ConfederationPublisher`, run by `SynchronizationViewModel`, sends owed events to the publish set and the proposal's hints and backs off from a minute to half an hour until a relay takes each. `BROADCASTABLE_KINDS` gains 9430–9433. `ChatMessage.applyInnerEvent` draws nothing for these kinds rather than a raw-JSON bubble. `ConfederationRelayTest` 6/6, `ConfederationStorageJvmTest` 7/7 |
---