@fleetless/contracts 15.1.0-next.1 → 15.1.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,9 +28,7 @@
28
28
  "waitlist",
29
29
  "waitlist_invitations",
30
30
  "waitlist_invitation_proofs",
31
- "waitlist_consents",
32
- "operator_effect_outbox",
33
- "operator_effect_mail_deliveries"
31
+ "waitlist_consents"
34
32
  ]
35
33
  },
36
34
  "id": {
@@ -579,6 +577,91 @@
579
577
  ],
580
578
  "additionalProperties": false
581
579
  },
580
+ {
581
+ "type": "object",
582
+ "properties": {
583
+ "membership_kind": {
584
+ "type": "string",
585
+ "enum": [
586
+ "affected",
587
+ "unaffected"
588
+ ]
589
+ },
590
+ "type": {
591
+ "type": "string",
592
+ "const": "waitlist_mail_effect"
593
+ },
594
+ "effect_id": {
595
+ "type": "string",
596
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
597
+ },
598
+ "source_action": {
599
+ "type": "string",
600
+ "enum": [
601
+ "waitlist_invite",
602
+ "waitlist_reinvite",
603
+ "waitlist_decline",
604
+ "waitlist_confirm"
605
+ ],
606
+ "description": "The source action the operator_effect_outbox row had when it was frozen; replay deletes the row only if it still has it."
607
+ }
608
+ },
609
+ "required": [
610
+ "membership_kind",
611
+ "type",
612
+ "effect_id",
613
+ "source_action"
614
+ ],
615
+ "additionalProperties": false
616
+ },
617
+ {
618
+ "type": "object",
619
+ "properties": {
620
+ "membership_kind": {
621
+ "type": "string",
622
+ "enum": [
623
+ "affected",
624
+ "unaffected"
625
+ ]
626
+ },
627
+ "type": {
628
+ "type": "string",
629
+ "const": "waitlist_mail_delivery"
630
+ },
631
+ "delivery_id": {
632
+ "type": "string",
633
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
634
+ },
635
+ "effect_id": {
636
+ "type": "string",
637
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
638
+ },
639
+ "entry_id": {
640
+ "type": "string",
641
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
642
+ "description": "The waiting-list entry the delivery was addressed for (its target); the entry itself may already be gone."
643
+ },
644
+ "source_action": {
645
+ "type": "string",
646
+ "enum": [
647
+ "waitlist_invite",
648
+ "waitlist_reinvite",
649
+ "waitlist_decline",
650
+ "waitlist_confirm"
651
+ ],
652
+ "description": "The source action of the delivery's effect when it was frozen; replay deletes the delivery only if its effect still has it."
653
+ }
654
+ },
655
+ "required": [
656
+ "membership_kind",
657
+ "type",
658
+ "delivery_id",
659
+ "effect_id",
660
+ "entry_id",
661
+ "source_action"
662
+ ],
663
+ "additionalProperties": false
664
+ },
582
665
  {
583
666
  "type": "object",
584
667
  "properties": {
@@ -155,6 +155,7 @@
155
155
  "ops_global_event.retention",
156
156
  "operator_audit.retention",
157
157
  "waitlist.retention",
158
+ "waitlist.withdrawal",
158
159
  "org_note_text.remove",
159
160
  "org_note_text.replace",
160
161
  "oidc_interaction.expire",
@@ -155,6 +155,7 @@
155
155
  "ops_global_event.retention",
156
156
  "operator_audit.retention",
157
157
  "waitlist.retention",
158
+ "waitlist.withdrawal",
158
159
  "org_note_text.remove",
159
160
  "org_note_text.replace",
160
161
  "oidc_interaction.expire",
@@ -591,6 +591,22 @@ export declare const journalIntentV2Body: z.ZodDiscriminatedUnion<readonly [z.Zo
591
591
  manifest_id: z.ZodString;
592
592
  manifest_version_id: z.ZodString;
593
593
  manifest_hash: z.ZodString;
594
+ }, z.core.$strict>, z.ZodObject<{
595
+ kind: z.ZodLiteral<"waitlist.withdrawal">;
596
+ ids: z.ZodObject<{
597
+ entry_id: z.ZodString;
598
+ }, z.core.$strict>;
599
+ schema: z.ZodLiteral<"fleetless.deletion-intent.v2">;
600
+ environment: z.ZodString;
601
+ generation: z.ZodString;
602
+ sequence: z.ZodNumber;
603
+ operation_id: z.ZodString;
604
+ intent_at: z.ZodISODateTime;
605
+ previous_hash: z.ZodString;
606
+ signing_key_id: z.ZodString;
607
+ manifest_id: z.ZodString;
608
+ manifest_version_id: z.ZodString;
609
+ manifest_hash: z.ZodString;
594
610
  }, z.core.$strict>, z.ZodObject<{
595
611
  kind: z.ZodLiteral<"org_note_text.remove">;
596
612
  ids: z.ZodObject<{
@@ -1499,6 +1515,24 @@ export declare const journalIntentV2: z.ZodDiscriminatedUnion<[z.ZodObject<{
1499
1515
  manifest_hash: z.ZodString;
1500
1516
  record_hash: z.ZodString;
1501
1517
  signature: z.ZodString;
1518
+ }, z.core.$strict> | z.ZodObject<{
1519
+ kind: z.ZodLiteral<"waitlist.withdrawal">;
1520
+ ids: z.ZodObject<{
1521
+ entry_id: z.ZodString;
1522
+ }, z.core.$strict>;
1523
+ schema: z.ZodLiteral<"fleetless.deletion-intent.v2">;
1524
+ environment: z.ZodString;
1525
+ generation: z.ZodString;
1526
+ sequence: z.ZodNumber;
1527
+ operation_id: z.ZodString;
1528
+ intent_at: z.ZodISODateTime;
1529
+ previous_hash: z.ZodString;
1530
+ signing_key_id: z.ZodString;
1531
+ manifest_id: z.ZodString;
1532
+ manifest_version_id: z.ZodString;
1533
+ manifest_hash: z.ZodString;
1534
+ record_hash: z.ZodString;
1535
+ signature: z.ZodString;
1502
1536
  }, z.core.$strict> | z.ZodObject<{
1503
1537
  kind: z.ZodLiteral<"org_note_text.remove">;
1504
1538
  ids: z.ZodObject<{
@@ -75,8 +75,10 @@ const branches = [
75
75
  captured('ops_event.retention', z.strictObject({ ...org, ...batch })),
76
76
  captured('ops_global_event.retention', z.strictObject(batch)),
77
77
  captured('operator_audit.retention', z.strictObject(batch)),
78
- // The waiting list has no organization: entries are deleted by their own retention period.
78
+ // The waiting list has no organization: entries are deleted when their own period ends
79
+ // (a sweep), or when the person withdraws (one entry, named by its id, never its address).
79
80
  captured('waitlist.retention', z.strictObject(batch)),
81
+ captured('waitlist.withdrawal', z.strictObject({ entry_id: uuid })),
80
82
  plain('org_note_text.remove', z.strictObject({ ...org, old_note_generation: uuid })),
81
83
  plain('org_note_text.replace', z.strictObject({ ...org, old_note_generation: uuid })),
82
84
  captured('oidc_interaction.expire', z.strictObject({ ...org, ...batch })),
@@ -42,8 +42,6 @@ export declare const journalManifestRow: z.ZodUnion<readonly [z.ZodObject<{
42
42
  waitlist_invitations: "waitlist_invitations";
43
43
  waitlist_invitation_proofs: "waitlist_invitation_proofs";
44
44
  waitlist_consents: "waitlist_consents";
45
- operator_effect_outbox: "operator_effect_outbox";
46
- operator_effect_mail_deliveries: "operator_effect_mail_deliveries";
47
45
  }>;
48
46
  id: z.ZodString;
49
47
  row_generation: z.ZodString;
@@ -189,6 +187,34 @@ export declare const journalManifestRow: z.ZodUnion<readonly [z.ZodObject<{
189
187
  affected: "affected";
190
188
  unaffected: "unaffected";
191
189
  }>;
190
+ }, z.core.$strict>, z.ZodObject<{
191
+ type: z.ZodLiteral<"waitlist_mail_effect">;
192
+ effect_id: z.ZodString;
193
+ source_action: z.ZodEnum<{
194
+ waitlist_invite: "waitlist_invite";
195
+ waitlist_reinvite: "waitlist_reinvite";
196
+ waitlist_decline: "waitlist_decline";
197
+ waitlist_confirm: "waitlist_confirm";
198
+ }>;
199
+ membership_kind: z.ZodEnum<{
200
+ affected: "affected";
201
+ unaffected: "unaffected";
202
+ }>;
203
+ }, z.core.$strict>, z.ZodObject<{
204
+ type: z.ZodLiteral<"waitlist_mail_delivery">;
205
+ delivery_id: z.ZodString;
206
+ effect_id: z.ZodString;
207
+ entry_id: z.ZodString;
208
+ source_action: z.ZodEnum<{
209
+ waitlist_invite: "waitlist_invite";
210
+ waitlist_reinvite: "waitlist_reinvite";
211
+ waitlist_decline: "waitlist_decline";
212
+ waitlist_confirm: "waitlist_confirm";
213
+ }>;
214
+ membership_kind: z.ZodEnum<{
215
+ affected: "affected";
216
+ unaffected: "unaffected";
217
+ }>;
192
218
  }, z.core.$strict>, z.ZodObject<{
193
219
  type: z.ZodLiteral<"retention_range">;
194
220
  membership_kind: z.ZodLiteral<"affected">;
@@ -264,8 +290,6 @@ export declare const journalManifestBatch: z.ZodUnion<readonly [z.ZodObject<{
264
290
  waitlist_invitations: "waitlist_invitations";
265
291
  waitlist_invitation_proofs: "waitlist_invitation_proofs";
266
292
  waitlist_consents: "waitlist_consents";
267
- operator_effect_outbox: "operator_effect_outbox";
268
- operator_effect_mail_deliveries: "operator_effect_mail_deliveries";
269
293
  }>;
270
294
  id: z.ZodString;
271
295
  row_generation: z.ZodString;
@@ -411,6 +435,34 @@ export declare const journalManifestBatch: z.ZodUnion<readonly [z.ZodObject<{
411
435
  affected: "affected";
412
436
  unaffected: "unaffected";
413
437
  }>;
438
+ }, z.core.$strict>, z.ZodObject<{
439
+ type: z.ZodLiteral<"waitlist_mail_effect">;
440
+ effect_id: z.ZodString;
441
+ source_action: z.ZodEnum<{
442
+ waitlist_invite: "waitlist_invite";
443
+ waitlist_reinvite: "waitlist_reinvite";
444
+ waitlist_decline: "waitlist_decline";
445
+ waitlist_confirm: "waitlist_confirm";
446
+ }>;
447
+ membership_kind: z.ZodEnum<{
448
+ affected: "affected";
449
+ unaffected: "unaffected";
450
+ }>;
451
+ }, z.core.$strict>, z.ZodObject<{
452
+ type: z.ZodLiteral<"waitlist_mail_delivery">;
453
+ delivery_id: z.ZodString;
454
+ effect_id: z.ZodString;
455
+ entry_id: z.ZodString;
456
+ source_action: z.ZodEnum<{
457
+ waitlist_invite: "waitlist_invite";
458
+ waitlist_reinvite: "waitlist_reinvite";
459
+ waitlist_decline: "waitlist_decline";
460
+ waitlist_confirm: "waitlist_confirm";
461
+ }>;
462
+ membership_kind: z.ZodEnum<{
463
+ affected: "affected";
464
+ unaffected: "unaffected";
465
+ }>;
414
466
  }, z.core.$strict>, z.ZodObject<{
415
467
  type: z.ZodLiteral<"retention_range">;
416
468
  membership_kind: z.ZodLiteral<"affected">;
@@ -446,8 +498,6 @@ export declare const journalManifestBatch: z.ZodUnion<readonly [z.ZodObject<{
446
498
  waitlist_invitations: "waitlist_invitations";
447
499
  waitlist_invitation_proofs: "waitlist_invitation_proofs";
448
500
  waitlist_consents: "waitlist_consents";
449
- operator_effect_outbox: "operator_effect_outbox";
450
- operator_effect_mail_deliveries: "operator_effect_mail_deliveries";
451
501
  }>;
452
502
  id: z.ZodString;
453
503
  row_generation: z.ZodString;
@@ -593,6 +643,34 @@ export declare const journalManifestBatch: z.ZodUnion<readonly [z.ZodObject<{
593
643
  affected: "affected";
594
644
  unaffected: "unaffected";
595
645
  }>;
646
+ }, z.core.$strict>, z.ZodObject<{
647
+ type: z.ZodLiteral<"waitlist_mail_effect">;
648
+ effect_id: z.ZodString;
649
+ source_action: z.ZodEnum<{
650
+ waitlist_invite: "waitlist_invite";
651
+ waitlist_reinvite: "waitlist_reinvite";
652
+ waitlist_decline: "waitlist_decline";
653
+ waitlist_confirm: "waitlist_confirm";
654
+ }>;
655
+ membership_kind: z.ZodEnum<{
656
+ affected: "affected";
657
+ unaffected: "unaffected";
658
+ }>;
659
+ }, z.core.$strict>, z.ZodObject<{
660
+ type: z.ZodLiteral<"waitlist_mail_delivery">;
661
+ delivery_id: z.ZodString;
662
+ effect_id: z.ZodString;
663
+ entry_id: z.ZodString;
664
+ source_action: z.ZodEnum<{
665
+ waitlist_invite: "waitlist_invite";
666
+ waitlist_reinvite: "waitlist_reinvite";
667
+ waitlist_decline: "waitlist_decline";
668
+ waitlist_confirm: "waitlist_confirm";
669
+ }>;
670
+ membership_kind: z.ZodEnum<{
671
+ affected: "affected";
672
+ unaffected: "unaffected";
673
+ }>;
596
674
  }, z.core.$strict>, z.ZodObject<{
597
675
  type: z.ZodLiteral<"retention_range">;
598
676
  membership_kind: z.ZodLiteral<"affected">;
@@ -683,8 +761,6 @@ export declare const journalDeletionManifest: z.ZodObject<{
683
761
  waitlist_invitations: "waitlist_invitations";
684
762
  waitlist_invitation_proofs: "waitlist_invitation_proofs";
685
763
  waitlist_consents: "waitlist_consents";
686
- operator_effect_outbox: "operator_effect_outbox";
687
- operator_effect_mail_deliveries: "operator_effect_mail_deliveries";
688
764
  }>;
689
765
  id: z.ZodString;
690
766
  row_generation: z.ZodString;
@@ -830,6 +906,34 @@ export declare const journalDeletionManifest: z.ZodObject<{
830
906
  affected: "affected";
831
907
  unaffected: "unaffected";
832
908
  }>;
909
+ }, z.core.$strict>, z.ZodObject<{
910
+ type: z.ZodLiteral<"waitlist_mail_effect">;
911
+ effect_id: z.ZodString;
912
+ source_action: z.ZodEnum<{
913
+ waitlist_invite: "waitlist_invite";
914
+ waitlist_reinvite: "waitlist_reinvite";
915
+ waitlist_decline: "waitlist_decline";
916
+ waitlist_confirm: "waitlist_confirm";
917
+ }>;
918
+ membership_kind: z.ZodEnum<{
919
+ affected: "affected";
920
+ unaffected: "unaffected";
921
+ }>;
922
+ }, z.core.$strict>, z.ZodObject<{
923
+ type: z.ZodLiteral<"waitlist_mail_delivery">;
924
+ delivery_id: z.ZodString;
925
+ effect_id: z.ZodString;
926
+ entry_id: z.ZodString;
927
+ source_action: z.ZodEnum<{
928
+ waitlist_invite: "waitlist_invite";
929
+ waitlist_reinvite: "waitlist_reinvite";
930
+ waitlist_decline: "waitlist_decline";
931
+ waitlist_confirm: "waitlist_confirm";
932
+ }>;
933
+ membership_kind: z.ZodEnum<{
934
+ affected: "affected";
935
+ unaffected: "unaffected";
936
+ }>;
833
937
  }, z.core.$strict>, z.ZodObject<{
834
938
  type: z.ZodLiteral<"retention_range">;
835
939
  membership_kind: z.ZodLiteral<"affected">;
@@ -880,8 +984,6 @@ export declare const journalDeletionManifest: z.ZodObject<{
880
984
  waitlist_invitations: "waitlist_invitations";
881
985
  waitlist_invitation_proofs: "waitlist_invitation_proofs";
882
986
  waitlist_consents: "waitlist_consents";
883
- operator_effect_outbox: "operator_effect_outbox";
884
- operator_effect_mail_deliveries: "operator_effect_mail_deliveries";
885
987
  }>;
886
988
  id: z.ZodString;
887
989
  row_generation: z.ZodString;
@@ -1027,6 +1129,34 @@ export declare const journalDeletionManifest: z.ZodObject<{
1027
1129
  affected: "affected";
1028
1130
  unaffected: "unaffected";
1029
1131
  }>;
1132
+ }, z.core.$strict>, z.ZodObject<{
1133
+ type: z.ZodLiteral<"waitlist_mail_effect">;
1134
+ effect_id: z.ZodString;
1135
+ source_action: z.ZodEnum<{
1136
+ waitlist_invite: "waitlist_invite";
1137
+ waitlist_reinvite: "waitlist_reinvite";
1138
+ waitlist_decline: "waitlist_decline";
1139
+ waitlist_confirm: "waitlist_confirm";
1140
+ }>;
1141
+ membership_kind: z.ZodEnum<{
1142
+ affected: "affected";
1143
+ unaffected: "unaffected";
1144
+ }>;
1145
+ }, z.core.$strict>, z.ZodObject<{
1146
+ type: z.ZodLiteral<"waitlist_mail_delivery">;
1147
+ delivery_id: z.ZodString;
1148
+ effect_id: z.ZodString;
1149
+ entry_id: z.ZodString;
1150
+ source_action: z.ZodEnum<{
1151
+ waitlist_invite: "waitlist_invite";
1152
+ waitlist_reinvite: "waitlist_reinvite";
1153
+ waitlist_decline: "waitlist_decline";
1154
+ waitlist_confirm: "waitlist_confirm";
1155
+ }>;
1156
+ membership_kind: z.ZodEnum<{
1157
+ affected: "affected";
1158
+ unaffected: "unaffected";
1159
+ }>;
1030
1160
  }, z.core.$strict>, z.ZodObject<{
1031
1161
  type: z.ZodLiteral<"retention_range">;
1032
1162
  membership_kind: z.ZodLiteral<"affected">;
@@ -1062,8 +1192,6 @@ export declare const journalDeletionManifest: z.ZodObject<{
1062
1192
  waitlist_invitations: "waitlist_invitations";
1063
1193
  waitlist_invitation_proofs: "waitlist_invitation_proofs";
1064
1194
  waitlist_consents: "waitlist_consents";
1065
- operator_effect_outbox: "operator_effect_outbox";
1066
- operator_effect_mail_deliveries: "operator_effect_mail_deliveries";
1067
1195
  }>;
1068
1196
  id: z.ZodString;
1069
1197
  row_generation: z.ZodString;
@@ -1209,6 +1337,34 @@ export declare const journalDeletionManifest: z.ZodObject<{
1209
1337
  affected: "affected";
1210
1338
  unaffected: "unaffected";
1211
1339
  }>;
1340
+ }, z.core.$strict>, z.ZodObject<{
1341
+ type: z.ZodLiteral<"waitlist_mail_effect">;
1342
+ effect_id: z.ZodString;
1343
+ source_action: z.ZodEnum<{
1344
+ waitlist_invite: "waitlist_invite";
1345
+ waitlist_reinvite: "waitlist_reinvite";
1346
+ waitlist_decline: "waitlist_decline";
1347
+ waitlist_confirm: "waitlist_confirm";
1348
+ }>;
1349
+ membership_kind: z.ZodEnum<{
1350
+ affected: "affected";
1351
+ unaffected: "unaffected";
1352
+ }>;
1353
+ }, z.core.$strict>, z.ZodObject<{
1354
+ type: z.ZodLiteral<"waitlist_mail_delivery">;
1355
+ delivery_id: z.ZodString;
1356
+ effect_id: z.ZodString;
1357
+ entry_id: z.ZodString;
1358
+ source_action: z.ZodEnum<{
1359
+ waitlist_invite: "waitlist_invite";
1360
+ waitlist_reinvite: "waitlist_reinvite";
1361
+ waitlist_decline: "waitlist_decline";
1362
+ waitlist_confirm: "waitlist_confirm";
1363
+ }>;
1364
+ membership_kind: z.ZodEnum<{
1365
+ affected: "affected";
1366
+ unaffected: "unaffected";
1367
+ }>;
1212
1368
  }, z.core.$strict>, z.ZodObject<{
1213
1369
  type: z.ZodLiteral<"retention_range">;
1214
1370
  membership_kind: z.ZodLiteral<"affected">;
@@ -1311,8 +1467,6 @@ export declare const journalManifestBinding: z.ZodObject<{
1311
1467
  waitlist_invitations: "waitlist_invitations";
1312
1468
  waitlist_invitation_proofs: "waitlist_invitation_proofs";
1313
1469
  waitlist_consents: "waitlist_consents";
1314
- operator_effect_outbox: "operator_effect_outbox";
1315
- operator_effect_mail_deliveries: "operator_effect_mail_deliveries";
1316
1470
  }>;
1317
1471
  id: z.ZodString;
1318
1472
  row_generation: z.ZodString;
@@ -1458,6 +1612,34 @@ export declare const journalManifestBinding: z.ZodObject<{
1458
1612
  affected: "affected";
1459
1613
  unaffected: "unaffected";
1460
1614
  }>;
1615
+ }, z.core.$strict>, z.ZodObject<{
1616
+ type: z.ZodLiteral<"waitlist_mail_effect">;
1617
+ effect_id: z.ZodString;
1618
+ source_action: z.ZodEnum<{
1619
+ waitlist_invite: "waitlist_invite";
1620
+ waitlist_reinvite: "waitlist_reinvite";
1621
+ waitlist_decline: "waitlist_decline";
1622
+ waitlist_confirm: "waitlist_confirm";
1623
+ }>;
1624
+ membership_kind: z.ZodEnum<{
1625
+ affected: "affected";
1626
+ unaffected: "unaffected";
1627
+ }>;
1628
+ }, z.core.$strict>, z.ZodObject<{
1629
+ type: z.ZodLiteral<"waitlist_mail_delivery">;
1630
+ delivery_id: z.ZodString;
1631
+ effect_id: z.ZodString;
1632
+ entry_id: z.ZodString;
1633
+ source_action: z.ZodEnum<{
1634
+ waitlist_invite: "waitlist_invite";
1635
+ waitlist_reinvite: "waitlist_reinvite";
1636
+ waitlist_decline: "waitlist_decline";
1637
+ waitlist_confirm: "waitlist_confirm";
1638
+ }>;
1639
+ membership_kind: z.ZodEnum<{
1640
+ affected: "affected";
1641
+ unaffected: "unaffected";
1642
+ }>;
1461
1643
  }, z.core.$strict>, z.ZodObject<{
1462
1644
  type: z.ZodLiteral<"retention_range">;
1463
1645
  membership_kind: z.ZodLiteral<"affected">;
@@ -1508,8 +1690,6 @@ export declare const journalManifestBinding: z.ZodObject<{
1508
1690
  waitlist_invitations: "waitlist_invitations";
1509
1691
  waitlist_invitation_proofs: "waitlist_invitation_proofs";
1510
1692
  waitlist_consents: "waitlist_consents";
1511
- operator_effect_outbox: "operator_effect_outbox";
1512
- operator_effect_mail_deliveries: "operator_effect_mail_deliveries";
1513
1693
  }>;
1514
1694
  id: z.ZodString;
1515
1695
  row_generation: z.ZodString;
@@ -1655,6 +1835,34 @@ export declare const journalManifestBinding: z.ZodObject<{
1655
1835
  affected: "affected";
1656
1836
  unaffected: "unaffected";
1657
1837
  }>;
1838
+ }, z.core.$strict>, z.ZodObject<{
1839
+ type: z.ZodLiteral<"waitlist_mail_effect">;
1840
+ effect_id: z.ZodString;
1841
+ source_action: z.ZodEnum<{
1842
+ waitlist_invite: "waitlist_invite";
1843
+ waitlist_reinvite: "waitlist_reinvite";
1844
+ waitlist_decline: "waitlist_decline";
1845
+ waitlist_confirm: "waitlist_confirm";
1846
+ }>;
1847
+ membership_kind: z.ZodEnum<{
1848
+ affected: "affected";
1849
+ unaffected: "unaffected";
1850
+ }>;
1851
+ }, z.core.$strict>, z.ZodObject<{
1852
+ type: z.ZodLiteral<"waitlist_mail_delivery">;
1853
+ delivery_id: z.ZodString;
1854
+ effect_id: z.ZodString;
1855
+ entry_id: z.ZodString;
1856
+ source_action: z.ZodEnum<{
1857
+ waitlist_invite: "waitlist_invite";
1858
+ waitlist_reinvite: "waitlist_reinvite";
1859
+ waitlist_decline: "waitlist_decline";
1860
+ waitlist_confirm: "waitlist_confirm";
1861
+ }>;
1862
+ membership_kind: z.ZodEnum<{
1863
+ affected: "affected";
1864
+ unaffected: "unaffected";
1865
+ }>;
1658
1866
  }, z.core.$strict>, z.ZodObject<{
1659
1867
  type: z.ZodLiteral<"retention_range">;
1660
1868
  membership_kind: z.ZodLiteral<"affected">;
@@ -1690,8 +1898,6 @@ export declare const journalManifestBinding: z.ZodObject<{
1690
1898
  waitlist_invitations: "waitlist_invitations";
1691
1899
  waitlist_invitation_proofs: "waitlist_invitation_proofs";
1692
1900
  waitlist_consents: "waitlist_consents";
1693
- operator_effect_outbox: "operator_effect_outbox";
1694
- operator_effect_mail_deliveries: "operator_effect_mail_deliveries";
1695
1901
  }>;
1696
1902
  id: z.ZodString;
1697
1903
  row_generation: z.ZodString;
@@ -1837,6 +2043,34 @@ export declare const journalManifestBinding: z.ZodObject<{
1837
2043
  affected: "affected";
1838
2044
  unaffected: "unaffected";
1839
2045
  }>;
2046
+ }, z.core.$strict>, z.ZodObject<{
2047
+ type: z.ZodLiteral<"waitlist_mail_effect">;
2048
+ effect_id: z.ZodString;
2049
+ source_action: z.ZodEnum<{
2050
+ waitlist_invite: "waitlist_invite";
2051
+ waitlist_reinvite: "waitlist_reinvite";
2052
+ waitlist_decline: "waitlist_decline";
2053
+ waitlist_confirm: "waitlist_confirm";
2054
+ }>;
2055
+ membership_kind: z.ZodEnum<{
2056
+ affected: "affected";
2057
+ unaffected: "unaffected";
2058
+ }>;
2059
+ }, z.core.$strict>, z.ZodObject<{
2060
+ type: z.ZodLiteral<"waitlist_mail_delivery">;
2061
+ delivery_id: z.ZodString;
2062
+ effect_id: z.ZodString;
2063
+ entry_id: z.ZodString;
2064
+ source_action: z.ZodEnum<{
2065
+ waitlist_invite: "waitlist_invite";
2066
+ waitlist_reinvite: "waitlist_reinvite";
2067
+ waitlist_decline: "waitlist_decline";
2068
+ waitlist_confirm: "waitlist_confirm";
2069
+ }>;
2070
+ membership_kind: z.ZodEnum<{
2071
+ affected: "affected";
2072
+ unaffected: "unaffected";
2073
+ }>;
1840
2074
  }, z.core.$strict>, z.ZodObject<{
1841
2075
  type: z.ZodLiteral<"retention_range">;
1842
2076
  membership_kind: z.ZodLiteral<"affected">;
@@ -24,8 +24,14 @@ const uuidRowTable = z.enum([
24
24
  'assets', 'audit_events', 'job_runs', 'oidc_interactions',
25
25
  'organization_exports', 'ops_notification_jobs', 'console_oauth_codes',
26
26
  'waitlist', 'waitlist_invitations', 'waitlist_invitation_proofs', 'waitlist_consents',
27
- 'operator_effect_outbox', 'operator_effect_mail_deliveries',
28
27
  ]);
28
+ /**
29
+ * The operator mail effects that concern the waiting list. The outbox and its
30
+ * deliveries are shared with billing and plan-change effects, so a waiting-list
31
+ * member names the effect's source action and replay deletes a row only when
32
+ * it still has it: no manifest can make a restore delete another effect.
33
+ */
34
+ const waitlistMailAction = z.enum(['waitlist_invite', 'waitlist_reinvite', 'waitlist_decline', 'waitlist_confirm']);
29
35
  const member = { membership_kind: membership };
30
36
  // Retention sweeps name an expired time range instead of every deleted row.
31
37
  const retentionRangeTable = z.enum(['datapoint_series_samples', 'bridge_latency_buckets']);
@@ -49,6 +55,15 @@ export const journalManifestRow = z.union([
49
55
  z.strictObject({ ...member, type: z.literal('global_ops_event'), event_id: uuid }),
50
56
  z.strictObject({ ...member, type: z.literal('org_operator_audit'), org_id: uuid, audit_id: uuid }),
51
57
  z.strictObject({ ...member, type: z.literal('global_operator_audit'), audit_id: uuid }),
58
+ z.strictObject({
59
+ ...member, type: z.literal('waitlist_mail_effect'), effect_id: uuid,
60
+ source_action: waitlistMailAction.meta({ description: 'The source action the operator_effect_outbox row had when it was frozen; replay deletes the row only if it still has it.' }),
61
+ }),
62
+ z.strictObject({
63
+ ...member, type: z.literal('waitlist_mail_delivery'), delivery_id: uuid, effect_id: uuid,
64
+ entry_id: uuid.meta({ description: 'The waiting-list entry the delivery was addressed for (its target); the entry itself may already be gone.' }),
65
+ source_action: waitlistMailAction.meta({ description: 'The source action of the delivery\'s effect when it was frozen; replay deletes the delivery only if its effect still has it.' }),
66
+ }),
52
67
  z.strictObject({
53
68
  type: z.literal('retention_range'),
54
69
  membership_kind: z.literal('affected'),
@@ -116,6 +131,8 @@ function rowKey(row) {
116
131
  case 'global_ops_event': return JSON.stringify(['ops_events', row.event_id]);
117
132
  case 'org_operator_audit':
118
133
  case 'global_operator_audit': return JSON.stringify(['operator_audit', row.audit_id]);
134
+ case 'waitlist_mail_effect': return JSON.stringify(['operator_effect_outbox', row.effect_id]);
135
+ case 'waitlist_mail_delivery': return JSON.stringify(['operator_effect_mail_deliveries', row.delivery_id]);
119
136
  case 'retention_range': return JSON.stringify([row.table, 'range', row.robot_id, row.series_id ?? null, row.from]);
120
137
  }
121
138
  }
@@ -143,11 +160,10 @@ const backedBranches = journalIntentV2Body.options.filter((branch) => 'manifest_
143
160
  export const journalManifestIntentProjection = z.union(backedBranches.map((branch) => z.strictObject({
144
161
  operation_id: branch.shape.operation_id, kind: branch.shape.kind, ids: branch.shape.ids,
145
162
  })));
146
- /** What a waiting-list retention batch may name: the entries, what hangs off them, and the mail rows that carry their addresses. */
147
- const waitlistTables = new Set([
148
- 'waitlist', 'waitlist_invitations', 'waitlist_invitation_proofs', 'waitlist_consents',
149
- 'operator_effect_outbox', 'operator_effect_mail_deliveries',
150
- ]);
163
+ /** The waiting list's own tables. Their rows, and the waiting-list mail members, belong to the `waitlist` scope and to no other. */
164
+ const waitlistTables = new Set(['waitlist', 'waitlist_invitations', 'waitlist_invitation_proofs', 'waitlist_consents']);
165
+ const isWaitlistMember = (row) => (row.type === 'uuid_row' && waitlistTables.has(row.table))
166
+ || row.type === 'waitlist_mail_effect' || row.type === 'waitlist_mail_delivery';
151
167
  const nonOrganizationScope = {
152
168
  'mcp_central_client.revoke': 'central_mcp',
153
169
  'mcp_central_interaction.expire': 'central_mcp',
@@ -157,6 +173,7 @@ const nonOrganizationScope = {
157
173
  'ops_global_event.retention': 'global_ops_event',
158
174
  'operator_audit.retention': 'operator_audit',
159
175
  'waitlist.retention': 'waitlist',
176
+ 'waitlist.withdrawal': 'waitlist',
160
177
  'auth_factor.remove': 'subject',
161
178
  };
162
179
  const rangeTableOfKind = {
@@ -233,11 +250,29 @@ export const journalManifestBinding = z.strictObject({
233
250
  console_oauth: (row) => row.type === 'console_interaction' || (row.type === 'uuid_row' && row.table === 'console_oauth_codes'),
234
251
  global_ops_event: (row) => row.type === 'global_ops_event' || (row.type === 'uuid_row' && row.table === 'ops_notification_jobs'),
235
252
  operator_audit: (row) => row.type === 'global_operator_audit' || row.type === 'org_operator_audit',
236
- waitlist: (row) => row.type === 'uuid_row' && waitlistTables.has(row.table),
253
+ waitlist: isWaitlistMember,
237
254
  };
238
255
  const allows = allowedRows[manifest.scope.kind];
239
256
  if (allows && !manifest.rows.every(allows))
240
257
  problem('Row outside closed source scope', ['manifest', 'rows']);
258
+ if (manifest.scope.kind !== 'waitlist' && manifest.rows.some(isWaitlistMember))
259
+ problem('Waiting-list row outside the waitlist scope', ['manifest', 'rows']);
260
+ if (manifest.scope.kind === 'waitlist') {
261
+ // The waiting list has no objects: no mapping, so no free string can carry an address into this manifest.
262
+ if (manifest.entries.length !== 0)
263
+ problem('A waitlist manifest has no object entries', ['manifest', 'entries']);
264
+ if (intent.kind === 'waitlist.withdrawal') {
265
+ // One entry: exactly its own row, and mail deliveries addressed for it alone.
266
+ const entries = manifest.rows.filter((row) => row.type === 'uuid_row' && row.table === 'waitlist');
267
+ const only = entries[0];
268
+ if (entries.length !== 1 || only?.type !== 'uuid_row' || only.id !== ids.entry_id || only.membership_kind !== 'affected') {
269
+ problem('A withdrawal names exactly its own entry', ['manifest', 'rows']);
270
+ }
271
+ if (manifest.rows.some((row) => row.type === 'waitlist_mail_delivery' && row.entry_id !== ids.entry_id)) {
272
+ problem('A withdrawal deletes only its own entry\'s deliveries', ['manifest', 'rows']);
273
+ }
274
+ }
275
+ }
241
276
  const ranges = manifest.rows.filter((row) => row.type === 'retention_range');
242
277
  if (ranges.length > 0)
243
278
  for (const message of new Set(retentionRangeProblems(intent.kind, ids, ranges)))