@fleetless/contracts 13.0.0 → 13.1.0

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.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,31 @@ version.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [13.1.0] — 2026-11-03
13
+
14
+ ### Added
15
+
16
+ - `retention_range` member of `journalManifestRow` for retention sweeps of
17
+ `datapoint_series_samples` and `bridge_latency_buckets`. One row names an
18
+ expired time range (`table`, `org_id`, `robot_id`, optional `series_id`,
19
+ `from` inclusive, `cutoff` exclusive, `row_count` and a SHA-256
20
+ `rows_digest` of the sorted row keys the range held when it was frozen)
21
+ instead of one manifest row per deleted row. Replay deletes the rows of the
22
+ range and none at or after its cutoff. `journalManifestBinding` accepts
23
+ ranges only under `history.retention`, `history.slug_delete` and
24
+ `latency.retention`, bound to the intent's organization, robot, series and
25
+ cutoff, with no overlap inside one robot. The per-row `history_sample` and
26
+ `latency_bucket` members stay valid for journals written before.
27
+
28
+ ## [13.0.1] — 2026-11-03
29
+
30
+ ### Fixed
31
+
32
+ - Corrected the `cancellation_document_url` and invoice PDF route descriptions:
33
+ Cloud always returns `null` for cancellation document URLs and does not
34
+ serve cancellation PDFs; cancellation documents are held in Lexware.
35
+ `cancelled` and the wire schemas are unchanged.
36
+
12
37
  ## [13.0.0] — 2026-11-02
13
38
 
14
39
  ### Changed
@@ -10720,7 +10720,7 @@
10720
10720
  "/api/billing/invoices/{id}/pdf": {
10721
10721
  "get": {
10722
10722
  "operationId": "get_api_billing_invoices_id_pdf",
10723
- "summary": "Downloads an invoice's original or cancellation PDF.",
10723
+ "summary": "Downloads a historical Cloud invoice's original PDF.",
10724
10724
  "tags": [
10725
10725
  "billing"
10726
10726
  ],
@@ -10744,7 +10744,7 @@
10744
10744
  "in": "query",
10745
10745
  "required": false,
10746
10746
  "schema": {
10747
- "description": "The original invoice or its stored cancellation PDF; omitted means `invoice`.",
10747
+ "description": "Omitted or `invoice` selects the original invoice PDF. `cancellation` is accepted but returns `404 not_found`: Cloud has no cancellation PDFs.",
10748
10748
  "type": "string",
10749
10749
  "enum": [
10750
10750
  "invoice",
@@ -10776,7 +10776,7 @@
10776
10776
  }
10777
10777
  }
10778
10778
  },
10779
- "description": "Owner-only. Omitted `kind` or `kind=invoice` returns the original PDF, rendered once with `pdfkit` when issued and stored as bytes. `kind=cancellation` returns the stored cancellation PDF for this same invoice id; no read renders a new PDF. `404 not_found` for an unknown id, one from another org, or a missing cancellation number or PDF. This reads historical Cloud invoices only: a due charge has no PDF of its own here — its eventual Lexware invoice is a document, read through `GET /api/billing/documents/:id/file`."
10779
+ "description": "Owner-only. Omitted `kind` or `kind=invoice` returns the original PDF, rendered once with `pdfkit` when issued and stored as bytes. `kind=cancellation` returns `404 not_found`: Cloud has no cancellation PDFs. Cancellation documents are held in Lexware. `404 not_found` also covers an unknown id or one from another org. This reads historical Cloud invoices only: a due charge has no PDF of its own here — its eventual Lexware invoice is a document, read through `GET /api/billing/documents/:id/file`."
10780
10780
  }
10781
10781
  },
10782
10782
  "/api/billing/documents": {
@@ -14694,7 +14694,7 @@
14694
14694
  "type": "null"
14695
14695
  }
14696
14696
  ],
14697
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
14697
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
14698
14698
  },
14699
14699
  "currency": {
14700
14700
  "type": "string",
@@ -15018,7 +15018,7 @@
15018
15018
  "type": "null"
15019
15019
  }
15020
15020
  ],
15021
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
15021
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
15022
15022
  },
15023
15023
  "currency": {
15024
15024
  "type": "string",
@@ -15866,7 +15866,7 @@
15866
15866
  "type": "null"
15867
15867
  }
15868
15868
  ],
15869
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
15869
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
15870
15870
  },
15871
15871
  "currency": {
15872
15872
  "type": "string",
@@ -20683,7 +20683,7 @@
20683
20683
  "type": "null"
20684
20684
  }
20685
20685
  ],
20686
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
20686
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
20687
20687
  },
20688
20688
  "currency": {
20689
20689
  "type": "string",
@@ -36841,7 +36841,7 @@
36841
36841
  "type": "null"
36842
36842
  }
36843
36843
  ],
36844
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
36844
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
36845
36845
  },
36846
36846
  "currency": {
36847
36847
  "type": "string",
@@ -37165,7 +37165,7 @@
37165
37165
  "type": "null"
37166
37166
  }
37167
37167
  ],
37168
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
37168
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
37169
37169
  },
37170
37170
  "currency": {
37171
37171
  "type": "string",
@@ -38013,7 +38013,7 @@
38013
38013
  "type": "null"
38014
38014
  }
38015
38015
  ],
38016
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
38016
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
38017
38017
  },
38018
38018
  "currency": {
38019
38019
  "type": "string",
@@ -7181,7 +7181,7 @@
7181
7181
  "method": "GET",
7182
7182
  "path": "/api/billing/invoices/:id/pdf",
7183
7183
  "section": "billing",
7184
- "summary": "Downloads an invoice's original or cancellation PDF.",
7184
+ "summary": "Downloads a historical Cloud invoice's original PDF.",
7185
7185
  "audience": "developer",
7186
7186
  "auth": "developer",
7187
7187
  "rateLimited": false,
@@ -7206,7 +7206,7 @@
7206
7206
  "not_found"
7207
7207
  ],
7208
7208
  "transport": "http",
7209
- "notes": "Owner-only. Omitted `kind` or `kind=invoice` returns the original PDF, rendered once with `pdfkit` when issued and stored as bytes. `kind=cancellation` returns the stored cancellation PDF for this same invoice id; no read renders a new PDF. `404 not_found` for an unknown id, one from another org, or a missing cancellation number or PDF. This reads historical Cloud invoices only: a due charge has no PDF of its own here — its eventual Lexware invoice is a document, read through `GET /api/billing/documents/:id/file`."
7209
+ "notes": "Owner-only. Omitted `kind` or `kind=invoice` returns the original PDF, rendered once with `pdfkit` when issued and stored as bytes. `kind=cancellation` returns `404 not_found`: Cloud has no cancellation PDFs. Cancellation documents are held in Lexware. `404 not_found` also covers an unknown id or one from another org. This reads historical Cloud invoices only: a due charge has no PDF of its own here — its eventual Lexware invoice is a document, read through `GET /api/billing/documents/:id/file`."
7210
7210
  },
7211
7211
  {
7212
7212
  "method": "GET",
@@ -1131,7 +1131,7 @@
1131
1131
  "type": "null"
1132
1132
  }
1133
1133
  ],
1134
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
1134
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
1135
1135
  },
1136
1136
  "currency": {
1137
1137
  "type": "string",
@@ -1455,7 +1455,7 @@
1455
1455
  "type": "null"
1456
1456
  }
1457
1457
  ],
1458
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
1458
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
1459
1459
  },
1460
1460
  "currency": {
1461
1461
  "type": "string",
@@ -2303,7 +2303,7 @@
2303
2303
  "type": "null"
2304
2304
  }
2305
2305
  ],
2306
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
2306
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
2307
2307
  },
2308
2308
  "currency": {
2309
2309
  "type": "string",
@@ -3,7 +3,7 @@
3
3
  "type": "object",
4
4
  "properties": {
5
5
  "kind": {
6
- "description": "The original invoice or its stored cancellation PDF; omitted means `invoice`.",
6
+ "description": "Omitted or `invoice` selects the original invoice PDF. `cancellation` is accepted but returns `404 not_found`: Cloud has no cancellation PDFs.",
7
7
  "type": "string",
8
8
  "enum": [
9
9
  "invoice",
@@ -38,7 +38,7 @@
38
38
  "type": "null"
39
39
  }
40
40
  ],
41
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
41
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
42
42
  },
43
43
  "currency": {
44
44
  "type": "string",
@@ -695,7 +695,7 @@
695
695
  "type": "null"
696
696
  }
697
697
  ],
698
- "description": "Relative same-origin path `/api/billing/invoices/<id>/pdf?kind=cancellation` for a cancelled historical Cloud invoice with a stored cancellation number and PDF; otherwise `null`. The path uses this invoice's id, not the cancellation number."
698
+ "description": "Cloud always returns `null` for this field, including cancelled historical Cloud invoices. Cancellation documents are held in Lexware."
699
699
  },
700
700
  "currency": {
701
701
  "type": "string",
@@ -843,9 +843,79 @@
843
843
  "audit_id"
844
844
  ],
845
845
  "additionalProperties": false
846
+ },
847
+ {
848
+ "type": "object",
849
+ "properties": {
850
+ "type": {
851
+ "type": "string",
852
+ "const": "retention_range"
853
+ },
854
+ "membership_kind": {
855
+ "type": "string",
856
+ "const": "affected"
857
+ },
858
+ "table": {
859
+ "type": "string",
860
+ "enum": [
861
+ "datapoint_series_samples",
862
+ "bridge_latency_buckets"
863
+ ],
864
+ "description": "The table the range was deleted from."
865
+ },
866
+ "org_id": {
867
+ "type": "string",
868
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
869
+ },
870
+ "robot_id": {
871
+ "type": "string",
872
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
873
+ },
874
+ "series_id": {
875
+ "description": "The one datapoint series of the range; absent when the range covers every series of the robot. Never set for latency buckets.",
876
+ "type": "integer",
877
+ "minimum": 1,
878
+ "maximum": 9007199254740991
879
+ },
880
+ "from": {
881
+ "type": "string",
882
+ "format": "date-time",
883
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
884
+ "description": "Inclusive lower bound of the deleted range (UTC, milliseconds)."
885
+ },
886
+ "cutoff": {
887
+ "type": "string",
888
+ "format": "date-time",
889
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
890
+ "description": "Exclusive upper bound of the deleted range (UTC, milliseconds). Replay deletes every row of the table inside [from, cutoff) for this robot and series and no row at or after the cutoff."
891
+ },
892
+ "row_count": {
893
+ "type": "integer",
894
+ "minimum": 1,
895
+ "maximum": 9007199254740991,
896
+ "description": "How many rows the range held when it was frozen."
897
+ },
898
+ "rows_digest": {
899
+ "type": "string",
900
+ "pattern": "^[0-9a-f]{64}$",
901
+ "description": "SHA-256 over the sorted row keys the range held when it was frozen (retention range digest v1); lets a backup of the range be checked against what was deleted."
902
+ }
903
+ },
904
+ "required": [
905
+ "type",
906
+ "membership_kind",
907
+ "table",
908
+ "org_id",
909
+ "robot_id",
910
+ "from",
911
+ "cutoff",
912
+ "row_count",
913
+ "rows_digest"
914
+ ],
915
+ "additionalProperties": false
846
916
  }
847
917
  ],
848
- "description": "JSON Schema consumers must also check uuid_row generation equality and exact physical identity."
918
+ "description": "JSON Schema consumers must also check uuid_row generation equality, exact physical identity and that a retention range starts before it ends."
849
919
  }
850
920
  },
851
921
  "batches": {
@@ -1464,9 +1534,79 @@
1464
1534
  "audit_id"
1465
1535
  ],
1466
1536
  "additionalProperties": false
1537
+ },
1538
+ {
1539
+ "type": "object",
1540
+ "properties": {
1541
+ "type": {
1542
+ "type": "string",
1543
+ "const": "retention_range"
1544
+ },
1545
+ "membership_kind": {
1546
+ "type": "string",
1547
+ "const": "affected"
1548
+ },
1549
+ "table": {
1550
+ "type": "string",
1551
+ "enum": [
1552
+ "datapoint_series_samples",
1553
+ "bridge_latency_buckets"
1554
+ ],
1555
+ "description": "The table the range was deleted from."
1556
+ },
1557
+ "org_id": {
1558
+ "type": "string",
1559
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
1560
+ },
1561
+ "robot_id": {
1562
+ "type": "string",
1563
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
1564
+ },
1565
+ "series_id": {
1566
+ "description": "The one datapoint series of the range; absent when the range covers every series of the robot. Never set for latency buckets.",
1567
+ "type": "integer",
1568
+ "minimum": 1,
1569
+ "maximum": 9007199254740991
1570
+ },
1571
+ "from": {
1572
+ "type": "string",
1573
+ "format": "date-time",
1574
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
1575
+ "description": "Inclusive lower bound of the deleted range (UTC, milliseconds)."
1576
+ },
1577
+ "cutoff": {
1578
+ "type": "string",
1579
+ "format": "date-time",
1580
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
1581
+ "description": "Exclusive upper bound of the deleted range (UTC, milliseconds). Replay deletes every row of the table inside [from, cutoff) for this robot and series and no row at or after the cutoff."
1582
+ },
1583
+ "row_count": {
1584
+ "type": "integer",
1585
+ "minimum": 1,
1586
+ "maximum": 9007199254740991,
1587
+ "description": "How many rows the range held when it was frozen."
1588
+ },
1589
+ "rows_digest": {
1590
+ "type": "string",
1591
+ "pattern": "^[0-9a-f]{64}$",
1592
+ "description": "SHA-256 over the sorted row keys the range held when it was frozen (retention range digest v1); lets a backup of the range be checked against what was deleted."
1593
+ }
1594
+ },
1595
+ "required": [
1596
+ "type",
1597
+ "membership_kind",
1598
+ "table",
1599
+ "org_id",
1600
+ "robot_id",
1601
+ "from",
1602
+ "cutoff",
1603
+ "row_count",
1604
+ "rows_digest"
1605
+ ],
1606
+ "additionalProperties": false
1467
1607
  }
1468
1608
  ],
1469
- "description": "JSON Schema consumers must also check uuid_row generation equality and exact physical identity."
1609
+ "description": "JSON Schema consumers must also check uuid_row generation equality, exact physical identity and that a retention range starts before it ends."
1470
1610
  }
1471
1611
  }
1472
1612
  },
@@ -2069,9 +2209,79 @@
2069
2209
  "audit_id"
2070
2210
  ],
2071
2211
  "additionalProperties": false
2212
+ },
2213
+ {
2214
+ "type": "object",
2215
+ "properties": {
2216
+ "type": {
2217
+ "type": "string",
2218
+ "const": "retention_range"
2219
+ },
2220
+ "membership_kind": {
2221
+ "type": "string",
2222
+ "const": "affected"
2223
+ },
2224
+ "table": {
2225
+ "type": "string",
2226
+ "enum": [
2227
+ "datapoint_series_samples",
2228
+ "bridge_latency_buckets"
2229
+ ],
2230
+ "description": "The table the range was deleted from."
2231
+ },
2232
+ "org_id": {
2233
+ "type": "string",
2234
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
2235
+ },
2236
+ "robot_id": {
2237
+ "type": "string",
2238
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
2239
+ },
2240
+ "series_id": {
2241
+ "description": "The one datapoint series of the range; absent when the range covers every series of the robot. Never set for latency buckets.",
2242
+ "type": "integer",
2243
+ "minimum": 1,
2244
+ "maximum": 9007199254740991
2245
+ },
2246
+ "from": {
2247
+ "type": "string",
2248
+ "format": "date-time",
2249
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
2250
+ "description": "Inclusive lower bound of the deleted range (UTC, milliseconds)."
2251
+ },
2252
+ "cutoff": {
2253
+ "type": "string",
2254
+ "format": "date-time",
2255
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
2256
+ "description": "Exclusive upper bound of the deleted range (UTC, milliseconds). Replay deletes every row of the table inside [from, cutoff) for this robot and series and no row at or after the cutoff."
2257
+ },
2258
+ "row_count": {
2259
+ "type": "integer",
2260
+ "minimum": 1,
2261
+ "maximum": 9007199254740991,
2262
+ "description": "How many rows the range held when it was frozen."
2263
+ },
2264
+ "rows_digest": {
2265
+ "type": "string",
2266
+ "pattern": "^[0-9a-f]{64}$",
2267
+ "description": "SHA-256 over the sorted row keys the range held when it was frozen (retention range digest v1); lets a backup of the range be checked against what was deleted."
2268
+ }
2269
+ },
2270
+ "required": [
2271
+ "type",
2272
+ "membership_kind",
2273
+ "table",
2274
+ "org_id",
2275
+ "robot_id",
2276
+ "from",
2277
+ "cutoff",
2278
+ "row_count",
2279
+ "rows_digest"
2280
+ ],
2281
+ "additionalProperties": false
2072
2282
  }
2073
2283
  ],
2074
- "description": "JSON Schema consumers must also check uuid_row generation equality and exact physical identity."
2284
+ "description": "JSON Schema consumers must also check uuid_row generation equality, exact physical identity and that a retention range starts before it ends."
2075
2285
  }
2076
2286
  }
2077
2287
  },
@@ -613,9 +613,79 @@
613
613
  "audit_id"
614
614
  ],
615
615
  "additionalProperties": false
616
+ },
617
+ {
618
+ "type": "object",
619
+ "properties": {
620
+ "type": {
621
+ "type": "string",
622
+ "const": "retention_range"
623
+ },
624
+ "membership_kind": {
625
+ "type": "string",
626
+ "const": "affected"
627
+ },
628
+ "table": {
629
+ "type": "string",
630
+ "enum": [
631
+ "datapoint_series_samples",
632
+ "bridge_latency_buckets"
633
+ ],
634
+ "description": "The table the range was deleted from."
635
+ },
636
+ "org_id": {
637
+ "type": "string",
638
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
639
+ },
640
+ "robot_id": {
641
+ "type": "string",
642
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
643
+ },
644
+ "series_id": {
645
+ "description": "The one datapoint series of the range; absent when the range covers every series of the robot. Never set for latency buckets.",
646
+ "type": "integer",
647
+ "minimum": 1,
648
+ "maximum": 9007199254740991
649
+ },
650
+ "from": {
651
+ "type": "string",
652
+ "format": "date-time",
653
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
654
+ "description": "Inclusive lower bound of the deleted range (UTC, milliseconds)."
655
+ },
656
+ "cutoff": {
657
+ "type": "string",
658
+ "format": "date-time",
659
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
660
+ "description": "Exclusive upper bound of the deleted range (UTC, milliseconds). Replay deletes every row of the table inside [from, cutoff) for this robot and series and no row at or after the cutoff."
661
+ },
662
+ "row_count": {
663
+ "type": "integer",
664
+ "minimum": 1,
665
+ "maximum": 9007199254740991,
666
+ "description": "How many rows the range held when it was frozen."
667
+ },
668
+ "rows_digest": {
669
+ "type": "string",
670
+ "pattern": "^[0-9a-f]{64}$",
671
+ "description": "SHA-256 over the sorted row keys the range held when it was frozen (retention range digest v1); lets a backup of the range be checked against what was deleted."
672
+ }
673
+ },
674
+ "required": [
675
+ "type",
676
+ "membership_kind",
677
+ "table",
678
+ "org_id",
679
+ "robot_id",
680
+ "from",
681
+ "cutoff",
682
+ "row_count",
683
+ "rows_digest"
684
+ ],
685
+ "additionalProperties": false
616
686
  }
617
687
  ],
618
- "description": "JSON Schema consumers must also check uuid_row generation equality and exact physical identity."
688
+ "description": "JSON Schema consumers must also check uuid_row generation equality, exact physical identity and that a retention range starts before it ends."
619
689
  }
620
690
  }
621
691
  },
@@ -1218,9 +1288,79 @@
1218
1288
  "audit_id"
1219
1289
  ],
1220
1290
  "additionalProperties": false
1291
+ },
1292
+ {
1293
+ "type": "object",
1294
+ "properties": {
1295
+ "type": {
1296
+ "type": "string",
1297
+ "const": "retention_range"
1298
+ },
1299
+ "membership_kind": {
1300
+ "type": "string",
1301
+ "const": "affected"
1302
+ },
1303
+ "table": {
1304
+ "type": "string",
1305
+ "enum": [
1306
+ "datapoint_series_samples",
1307
+ "bridge_latency_buckets"
1308
+ ],
1309
+ "description": "The table the range was deleted from."
1310
+ },
1311
+ "org_id": {
1312
+ "type": "string",
1313
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
1314
+ },
1315
+ "robot_id": {
1316
+ "type": "string",
1317
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
1318
+ },
1319
+ "series_id": {
1320
+ "description": "The one datapoint series of the range; absent when the range covers every series of the robot. Never set for latency buckets.",
1321
+ "type": "integer",
1322
+ "minimum": 1,
1323
+ "maximum": 9007199254740991
1324
+ },
1325
+ "from": {
1326
+ "type": "string",
1327
+ "format": "date-time",
1328
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
1329
+ "description": "Inclusive lower bound of the deleted range (UTC, milliseconds)."
1330
+ },
1331
+ "cutoff": {
1332
+ "type": "string",
1333
+ "format": "date-time",
1334
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z))$",
1335
+ "description": "Exclusive upper bound of the deleted range (UTC, milliseconds). Replay deletes every row of the table inside [from, cutoff) for this robot and series and no row at or after the cutoff."
1336
+ },
1337
+ "row_count": {
1338
+ "type": "integer",
1339
+ "minimum": 1,
1340
+ "maximum": 9007199254740991,
1341
+ "description": "How many rows the range held when it was frozen."
1342
+ },
1343
+ "rows_digest": {
1344
+ "type": "string",
1345
+ "pattern": "^[0-9a-f]{64}$",
1346
+ "description": "SHA-256 over the sorted row keys the range held when it was frozen (retention range digest v1); lets a backup of the range be checked against what was deleted."
1347
+ }
1348
+ },
1349
+ "required": [
1350
+ "type",
1351
+ "membership_kind",
1352
+ "table",
1353
+ "org_id",
1354
+ "robot_id",
1355
+ "from",
1356
+ "cutoff",
1357
+ "row_count",
1358
+ "rows_digest"
1359
+ ],
1360
+ "additionalProperties": false
1221
1361
  }
1222
1362
  ],
1223
- "description": "JSON Schema consumers must also check uuid_row generation equality and exact physical identity."
1363
+ "description": "JSON Schema consumers must also check uuid_row generation equality, exact physical identity and that a retention range starts before it ends."
1224
1364
  }
1225
1365
  }
1226
1366
  },