sew-proto 0.11.6

Sew wire contracts: ids, addresses, errors, HTTP and gateway bodies, permissions, policies, audit.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
{
  "$defs": {
    "CallKeysInit": {
      "description": "What a key join answers (the voice join's `VoiceJoinResponse.e2ee`, the key join, and\nthe `init` dispatch).",
      "properties": {
        "activate_on_create": {
          "description": "The creator activates epoch 0 at once (first joiner of a fresh call only).",
          "type": "boolean"
        },
        "call_id": {
          "description": "The call: its `r_…` room.",
          "pattern": "^r_[a-z2-7]{26}$",
          "type": "string"
        },
        "create": {
          "description": "The caller creates the group now.",
          "type": "boolean"
        },
        "epoch": {
          "description": "The group's epoch.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "external_sender": {
          "description": "TLS `ExternalSender` of the install's DS key.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "group_id": {
          "description": "The current group (16 bytes).",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "join_id": {
          "description": "The caller's Sew-minted join id; every per-call key route's body carries it.",
          "pattern": "^[0-9a-f]{32}$",
          "type": "string"
        },
        "lk_identity": {
          "description": "The caller's engine identity (`p_` + base32 of `join_id`; the token's `sub`).",
          "pattern": "^p_[a-z2-7]{26}$",
          "type": "string"
        },
        "params": {
          "$ref": "#/$defs/CallKeysParams",
          "description": "Client timings."
        },
        "scope": {
          "description": "The call's scope, `call:<channel_id>`; members refuse leaves with another.",
          "pattern": "^call:[1-9][0-9]*$",
          "type": "string"
        },
        "slot_base": {
          "description": "`slot(e) = (slot_base + e) mod 64`.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "call_id",
        "join_id",
        "lk_identity",
        "scope",
        "group_id",
        "epoch",
        "create",
        "activate_on_create",
        "slot_base",
        "external_sender",
        "params"
      ],
      "type": "object"
    },
    "CallKeysParams": {
      "description": "The client timings and constants the server relays (READY `call_keys.params` and every\n[`CallKeysInit`]). The single source for client timings.",
      "properties": {
        "ciphersuite": {
          "description": "The ciphersuite every group uses (1).",
          "format": "uint16",
          "maximum": 65535,
          "minimum": 0,
          "type": "integer"
        },
        "ciphersuites": {
          "description": "The ciphersuites the server accepts (`[1]` in v1).",
          "items": {
            "format": "uint16",
            "maximum": 65535,
            "minimum": 0,
            "type": "integer"
          },
          "type": "array"
        },
        "client_activate_fallback_ms": {
          "description": "A sender that acked but hears no `activate` switches after this long.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "exporter_label": {
          "description": "The MLS exporter label of frame keys ([`tls::EXPORTER_LABEL`]).",
          "type": "string"
        },
        "kdf": {
          "description": "`\"hkdf\"`.",
          "type": "string"
        },
        "key_package_max_lifetime_s": {
          "description": "Longest KeyPackage lifetime the server accepts.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "key_ring_size": {
          "description": "Always 64.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "release_info_label": {
          "description": "The recorder release `info` label ([`tls::RELEASE_INFO_LABEL`]).",
          "type": "string"
        },
        "retire_after_ms": {
          "description": "Receivers retire an old slot this long after `activate`.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "securing_indicator_after_ms": {
          "description": "\"Securing…\" shows only after this long.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "unknown_call_buffer_ms": {
          "description": "Dispatches for a `call_id` the client does not know yet are buffered this long.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "ciphersuite",
        "ciphersuites",
        "key_ring_size",
        "kdf",
        "exporter_label",
        "release_info_label",
        "retire_after_ms",
        "client_activate_fallback_ms",
        "key_package_max_lifetime_s",
        "unknown_call_buffer_ms",
        "securing_indicator_after_ms"
      ],
      "type": "object"
    },
    "KeyResyncReason": {
      "description": "Why a leaf is told to resync (`resync.reason`). `stale_slot` re-asserts the\nsender slot; every other reason is answered with an invalid report.",
      "oneOf": [
        {
          "const": "behind",
          "description": "The leaf is behind the DS's epoch.",
          "type": "string"
        },
        {
          "const": "group_mismatch",
          "description": "The leaf holds another group.",
          "type": "string"
        },
        {
          "const": "lagging",
          "description": "The leaf stopped acking.",
          "type": "string"
        },
        {
          "const": "stale_slot",
          "description": "The engine sees the leaf sending on the wrong slot.",
          "type": "string"
        }
      ]
    },
    "LeafBindingEntryJson": {
      "description": "One `LeafBinding` entry in JSON: exactly one of `leaf` (key type 1) or `key_package_ref`\n(key type 2), the join id and its engine identity.",
      "properties": {
        "join_id": {
          "description": "The join id.",
          "pattern": "^[0-9a-f]{32}$",
          "type": "string"
        },
        "key_package_ref": {
          "description": "The Add's `key_package_ref` (proposals).",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": [
            "string",
            "null"
          ]
        },
        "leaf": {
          "description": "The leaf index (commit, welcome, state report reply, recorder tables).",
          "format": "uint32",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "lk_identity": {
          "description": "`p_` + base32 of `join_id` (not signed; clients recompute and compare).",
          "pattern": "^p_[a-z2-7]{26}$",
          "type": "string"
        }
      },
      "required": [
        "join_id",
        "lk_identity"
      ],
      "type": "object"
    },
    "LeafBindingTable": {
      "description": "The DS-signed leaf ↔ join id table. `sig` = Ed25519(`sew-call-ds`,\n`\"sew call leaf binding v1\"` ‖ TLS([`LeafBindingTableTbs`])).",
      "properties": {
        "call_id": {
          "description": "The call.",
          "pattern": "^r_[a-z2-7]{26}$",
          "type": "string"
        },
        "entries": {
          "description": "Ascending by leaf or by ref; one key type per table.",
          "items": {
            "$ref": "#/$defs/LeafBindingEntryJson"
          },
          "type": "array"
        },
        "epoch": {
          "description": "The proposal epoch (key type 2) or the new epoch (key type 1).",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "group_id": {
          "description": "The group (16 bytes).",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "sig": {
          "description": "64-byte Ed25519 signature.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        }
      },
      "required": [
        "call_id",
        "group_id",
        "epoch",
        "entries",
        "sig"
      ],
      "type": "object"
    },
    "RemoveReason": {
      "description": "Why a leaf left the key group (`removed.reason`; every voice leave reason plus\nthe key service's and DM calls' own). Codes are stable for metrics and logs.",
      "oneOf": [
        {
          "const": "left",
          "description": "The member left.",
          "type": "string"
        },
        {
          "const": "disconnected",
          "description": "The media connection ended for good.",
          "type": "string"
        },
        {
          "const": "replaced",
          "description": "Another device of the member took over (swap).",
          "type": "string"
        },
        {
          "const": "moved",
          "description": "The member moved or switched channel.",
          "type": "string"
        },
        {
          "const": "removed_by_moderator",
          "description": "A moderator disconnected the member.",
          "type": "string"
        },
        {
          "const": "perms_lost",
          "description": "The member lost CONNECT or VIEW.",
          "type": "string"
        },
        {
          "const": "channel_archived",
          "description": "The channel was archived.",
          "type": "string"
        },
        {
          "const": "removed_from_space",
          "description": "The member left or was removed from the space.",
          "type": "string"
        },
        {
          "const": "timed_out",
          "description": "The member was timed out.",
          "type": "string"
        },
        {
          "const": "account_removed",
          "description": "The account was deprovisioned.",
          "type": "string"
        },
        {
          "const": "session_revoked",
          "description": "The login session was revoked.",
          "type": "string"
        },
        {
          "const": "device_revoked",
          "description": "The device was revoked.",
          "type": "string"
        },
        {
          "const": "orphaned",
          "description": "The media outlived every socket.",
          "type": "string"
        },
        {
          "const": "alone_timeout",
          "description": "Alone in the call too long.",
          "type": "string"
        },
        {
          "const": "connect_timeout",
          "description": "Media never connected.",
          "type": "string"
        },
        {
          "const": "media_restarted",
          "description": "The engine restarted and the media did not come back.",
          "type": "string"
        },
        {
          "const": "voice_disabled",
          "description": "Voice was turned off.",
          "type": "string"
        },
        {
          "const": "e2ee_sender_index_stuck",
          "description": "The sender stayed on a stale key slot.",
          "type": "string"
        },
        {
          "const": "unresponsive",
          "description": "The device stopped answering key requests (removed as unresponsive).",
          "type": "string"
        },
        {
          "const": "rebuild_orphan",
          "description": "A rebuild found no live entry for the leaf.",
          "type": "string"
        },
        {
          "const": "create_failed",
          "description": "The creator's group was refused.",
          "type": "string"
        },
        {
          "const": "call_ended",
          "description": "The DM call ended for everyone.",
          "type": "string"
        }
      ]
    },
    "ResetReason": {
      "description": "Why a call's group is reset (`reset.reason`).",
      "oneOf": [
        {
          "const": "committer_timeout",
          "description": "Every committer candidate was silent.",
          "type": "string"
        },
        {
          "const": "remove_deadline",
          "description": "A removal was not activated by `remove_deadline_ms`.",
          "type": "string"
        },
        {
          "const": "rebuild_conflict",
          "description": "A rebuild found two equally covered groups.",
          "type": "string"
        },
        {
          "const": "invalid_commits",
          "description": "Too many invalid commits in one generation.",
          "type": "string"
        },
        {
          "const": "invariant",
          "description": "A state report broke a group invariant.",
          "type": "string"
        }
      ]
    },
    "TransitionReason": {
      "description": "Why a transition started (`proposals.reason`).",
      "oneOf": [
        {
          "const": "join",
          "description": "Leaves joined.",
          "type": "string"
        },
        {
          "const": "leave",
          "description": "Leaves left or were removed.",
          "type": "string"
        },
        {
          "const": "swap",
          "description": "A device swap (Remove + Add of one member).",
          "type": "string"
        },
        {
          "const": "readd",
          "description": "A re-add after a missed epoch or a failed commit.",
          "type": "string"
        },
        {
          "const": "rekey",
          "description": "A requested rekey.",
          "type": "string"
        },
        {
          "const": "consent",
          "description": "Recording consent was withdrawn.",
          "type": "string"
        },
        {
          "const": "recorder_stop",
          "description": "The recording stopped.",
          "type": "string"
        },
        {
          "const": "revoke",
          "description": "A device was revoked.",
          "type": "string"
        },
        {
          "const": "periodic",
          "description": "The periodic rekey.",
          "type": "string"
        },
        {
          "const": "refresh",
          "description": "A leaf-lifetime refresh.",
          "type": "string"
        },
        {
          "const": "rebuild_orphan",
          "description": "Leaves a rebuild could not match.",
          "type": "string"
        },
        {
          "const": "stuck_sender",
          "description": "A sender stuck on a stale slot was removed.",
          "type": "string"
        }
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "The `call_keys_delivered` dispatch body, tagged by `kind`. Clients ignore kinds\nthey do not know ([`CallKeysMessage::Unknown`]).",
  "oneOf": [
    {
      "$ref": "#/$defs/CallKeysInit",
      "description": "A creator failover or a reset creator: the [`CallKeysInit`] fields.",
      "properties": {
        "kind": {
          "const": "init",
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    },
    {
      "description": "A transition starts.",
      "properties": {
        "bindings": {
          "$ref": "#/$defs/LeafBindingTable",
          "description": "One entry per Add, keyed by its `key_package_ref`."
        },
        "call_id": {
          "description": "The call.",
          "pattern": "^r_[a-z2-7]{26}$",
          "type": "string"
        },
        "committer": {
          "description": "The designated committer's leaf.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "epoch": {
          "description": "The epoch the proposals are for.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "group_id": {
          "description": "The group.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "kind": {
          "const": "proposals",
          "type": "string"
        },
        "proposals": {
          "description": "DS-signed external `MLSMessage`s (Add and Remove only); empty for a rekey.",
          "items": {
            "description": "Bytes as base64url without padding (RFC 4648 §5); canonical trailing bits.",
            "pattern": "^[A-Za-z0-9_-]*$",
            "type": "string"
          },
          "type": "array"
        },
        "reason": {
          "$ref": "#/$defs/TransitionReason",
          "description": "Why."
        }
      },
      "required": [
        "kind",
        "call_id",
        "group_id",
        "epoch",
        "proposals",
        "committer",
        "reason",
        "bindings"
      ],
      "type": "object"
    },
    {
      "description": "Failover to the next committer candidate.",
      "properties": {
        "attempt": {
          "description": "2 or 3.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "call_id": {
          "description": "The call.",
          "pattern": "^r_[a-z2-7]{26}$",
          "type": "string"
        },
        "committer": {
          "description": "The candidate's leaf.",
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "epoch": {
          "description": "The epoch.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "group_id": {
          "description": "The group.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "kind": {
          "const": "commit_request",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "call_id",
        "group_id",
        "epoch",
        "committer",
        "attempt"
      ],
      "type": "object"
    },
    {
      "description": "The accepted commit.",
      "properties": {
        "bindings": {
          "$ref": "#/$defs/LeafBindingTable",
          "description": "The leaves this commit added, keyed by leaf, for `epoch_from + 1`."
        },
        "call_id": {
          "description": "The call.",
          "pattern": "^r_[a-z2-7]{26}$",
          "type": "string"
        },
        "commit": {
          "description": "TLS `MLSMessage(PublicMessage commit)`.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "epoch_from": {
          "description": "The epoch the commit leaves.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "group_id": {
          "description": "The group.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "kind": {
          "const": "commit",
          "type": "string"
        },
        "slot": {
          "description": "The slot of `epoch_from + 1`.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "kind",
        "call_id",
        "group_id",
        "epoch_from",
        "commit",
        "slot",
        "bindings"
      ],
      "type": "object"
    },
    {
      "description": "A joiner's Welcome.",
      "properties": {
        "bindings": {
          "$ref": "#/$defs/LeafBindingTable",
          "description": "The full table of `epoch`."
        },
        "call_id": {
          "description": "The call.",
          "pattern": "^r_[a-z2-7]{26}$",
          "type": "string"
        },
        "epoch": {
          "description": "The epoch the Welcome joins.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "group_id": {
          "description": "The group.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "join_id": {
          "description": "The joiner's join id.",
          "pattern": "^[0-9a-f]{32}$",
          "type": "string"
        },
        "kind": {
          "const": "welcome",
          "type": "string"
        },
        "ratchet_tree": {
          "description": "TLS `RatchetTree` of `epoch`.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "slot": {
          "description": "`slot(epoch)`.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "slot_base": {
          "description": "The group's slot base.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        },
        "welcome": {
          "description": "TLS `MLSMessage(Welcome)`.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "call_id",
        "group_id",
        "join_id",
        "epoch",
        "welcome",
        "ratchet_tree",
        "slot_base",
        "slot",
        "bindings"
      ],
      "type": "object"
    },
    {
      "description": "Every sender switches to `slot`.",
      "properties": {
        "call_id": {
          "description": "The call.",
          "pattern": "^r_[a-z2-7]{26}$",
          "type": "string"
        },
        "epoch": {
          "description": "The epoch.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "group_id": {
          "description": "The group.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "kind": {
          "const": "activate",
          "type": "string"
        },
        "slot": {
          "description": "Its slot.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "kind",
        "call_id",
        "group_id",
        "epoch",
        "slot"
      ],
      "type": "object"
    },
    {
      "description": "The group is replaced; send a fresh KeyPackage.",
      "properties": {
        "call_id": {
          "description": "The call.",
          "pattern": "^r_[a-z2-7]{26}$",
          "type": "string"
        },
        "collect_ms": {
          "description": "The collection window.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "kind": {
          "const": "reset",
          "type": "string"
        },
        "new_group_id": {
          "description": "The group being collected.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "reason": {
          "$ref": "#/$defs/ResetReason",
          "description": "Why."
        },
        "slot_base": {
          "description": "The new group's slot base.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "kind",
        "call_id",
        "new_group_id",
        "reason",
        "slot_base",
        "collect_ms"
      ],
      "type": "object"
    },
    {
      "description": "The recorder: a certified key recipient, or `removed: true` (no key fields).",
      "properties": {
        "call_id": {
          "description": "The call.",
          "pattern": "^r_[a-z2-7]{26}$",
          "type": "string"
        },
        "hpke_pub": {
          "description": "The recorder's X25519 public key (32 bytes).",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "const": "recorder",
          "type": "string"
        },
        "lk_identity": {
          "description": "The recorder's engine identity (`p_…`, from the voice service's `admit_recorder`).",
          "pattern": "^p_[a-z2-7]{26}$",
          "type": [
            "string",
            "null"
          ]
        },
        "recorder_cert": {
          "description": "TLS `RecorderCert`.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": [
            "string",
            "null"
          ]
        },
        "recording_id": {
          "description": "The recording.",
          "pattern": "^[1-9][0-9]{0,18}$",
          "type": "string"
        },
        "removed": {
          "description": "The recording stopped.",
          "type": "boolean"
        }
      },
      "required": [
        "kind",
        "call_id",
        "recording_id"
      ],
      "type": "object"
    },
    {
      "description": "Device certificates were revoked.",
      "properties": {
        "kind": {
          "const": "revoked",
          "type": "string"
        },
        "serials": {
          "description": "The revoked serials.",
          "items": {
            "description": "A Sew id: a decimal string of a 64-bit time-sortable id (1 to 9223372036854775807).",
            "pattern": "^[1-9][0-9]{0,18}$",
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "kind",
        "serials"
      ],
      "type": "object"
    },
    {
      "description": "The leaf was removed; its last key message.",
      "properties": {
        "call_id": {
          "description": "The call.",
          "pattern": "^r_[a-z2-7]{26}$",
          "type": "string"
        },
        "group_id": {
          "description": "The group.",
          "pattern": "^[A-Za-z0-9_-]*$",
          "type": "string"
        },
        "join_id": {
          "description": "The removed join.",
          "pattern": "^[0-9a-f]{32}$",
          "type": "string"
        },
        "kind": {
          "const": "removed",
          "type": "string"
        },
        "reason": {
          "$ref": "#/$defs/RemoveReason",
          "description": "Why."
        }
      },
      "required": [
        "kind",
        "call_id",
        "group_id",
        "join_id",
        "reason"
      ],
      "type": "object"
    },
    {
      "description": "The dispatch form of the state report's `409` answers, and `stale_slot`.",
      "properties": {
        "call_id": {
          "description": "The call.",
          "pattern": "^r_[a-z2-7]{26}$",
          "type": "string"
        },
        "expected_slot": {
          "description": "With `stale_slot`: the slot the sender must use.",
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "join_id": {
          "description": "The leaf's join id.",
          "pattern": "^[0-9a-f]{32}$",
          "type": "string"
        },
        "kind": {
          "const": "resync",
          "type": "string"
        },
        "reason": {
          "$ref": "#/$defs/KeyResyncReason",
          "description": "Why."
        }
      },
      "required": [
        "kind",
        "call_id",
        "join_id",
        "reason"
      ],
      "type": "object"
    }
  ],
  "title": "CallKeysMessage"
}