cachekit-rs 0.13.1

Caching for Rust (beta). Supports cachekit.io SaaS, Redis, Memcached, local File, and Cloudflare Workers.
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
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
{
  "version": "1.3.0",
  "spec": "spec/interop-mode.md",
  "generator": "tools/interop-reference.py (CPython stdlib)",
  "cross_checked_by": "tools/interop-crosscheck.mjs (independent encoder + @noble/hashes blake2b + WebCrypto HKDF/AES-GCM)",
  "hash_algorithm": "blake2b-256 (digest_size=32, unkeyed) over canonical MessagePack of the flat argument array",
  "key_format": "{namespace}:{operation}:{args_hash}",
  "segment_pattern": "^[a-z0-9][a-z0-9._-]{0,63}$",
  "segment_pattern_note": "Full-string match REQUIRED (Python: re.fullmatch, not re.match \u2014 $ matches before a trailing newline). namespace additionally MUST NOT be exactly 'ns' or 'nsapi' (reserved: the server parses those key prefixes). The reservation is namespace-only; operation has no reserved values. Neither segment may contain '..' (the pattern admits it; the server rejects '..' anywhere in a key). A lone '.' stays valid.",
  "width_coverage_note": "All *16 header boundaries (uint/int widths, str8->str16, bin8->bin16, fixarray->array16, fixmap->map16, including the root argument array) are pinned by vectors. The *32 tier (str32/bin32/array32/map32, >=64 KiB or >=65536 elements) is normative and implemented by both tools but untested-by-design: fixture blobs that size would bloat the file without exercising different logic (same length-prefix code path, wider field).",
  "error_vectors_note": "The 'error' field is a human-readable reason for maintainers. Conformance means the input MUST be rejected with an error; the message text is not normative.",
  "reader_vectors_note": "Inputs for an interop VALUE reader, as raw MessagePack. A reader MUST decode every reader_accept_vectors document without error: each is well-formed but not canonical (a padded width, unsorted keys, a float32, a non-string map key, an ext type). Where tagged JSON can carry it, 'value' is what the document decodes to. A reader MUST reject every reader_reject_vectors document.",
  "tagged_json": {
    "note": "Single-key objects with a $-prefixed key are typed input tags; all other JSON maps directly.",
    "$set": "set of tagged values (unordered)",
    "$bytes": "hex-encoded byte string",
    "$datetime": "ISO 8601 with mandatory UTC offset",
    "$uuid": "UUID string (any case on input)",
    "$float": "decimal float literal (JSON numbers are always integers in this file). Error vectors use 'nan' (parses to NaN in Python and JS) and '1e999' (overflows to +Infinity in Python, JS, and Rust) \u2014 never 'inf', which JS parses to NaN. A JavaScript harness must wrap the parsed Number in a type of its own (tools/interop-crosscheck.mjs uses a Float class), so the SDK can tell an explicit float from a bare Number, which this file only ever uses for a safe integer: an integral $float must still reach the SDK as a float ('2.0' stays float64 in a value, and '18446744073709551616' is a float64 argument, where a bare Number that large must be rejected).",
    "$int": "decimal integer literal (for values beyond 2^53, unsafe in JS JSON.parse)"
  },
  "key_vectors": [
    {
      "name": "empty_args",
      "description": "Zero arguments: canonical encoding of the empty array",
      "namespace": "users",
      "operation": "get_all",
      "args": [],
      "canonical_args_hex": "90",
      "args_hash": "8064bf5f945dba521b017bb3f32b31a293a6e16944838d171ea9e77fab085e8e",
      "expected_key": "users:get_all:8064bf5f945dba521b017bb3f32b31a293a6e16944838d171ea9e77fab085e8e"
    },
    {
      "name": "single_int",
      "description": "Issue #1 example: users:get_user with one integer argument",
      "namespace": "users",
      "operation": "get_user",
      "args": [
        42
      ],
      "canonical_args_hex": "912a",
      "args_hash": "61598716255080080f6456eb065c2e51badfaa4320b0efe97469c29cffee8875",
      "expected_key": "users:get_user:61598716255080080f6456eb065c2e51badfaa4320b0efe97469c29cffee8875"
    },
    {
      "name": "uint64_max",
      "description": "Largest interop integer (2^64-1), e.g. a snowflake ID",
      "namespace": "users",
      "operation": "get_user",
      "args": [
        {
          "$int": "18446744073709551615"
        }
      ],
      "canonical_args_hex": "91cfffffffffffffffff",
      "args_hash": "0cc46c520dfb8f301e03756131351da58fb433d5258f5db3dde927a8c83b9430",
      "expected_key": "users:get_user:0cc46c520dfb8f301e03756131351da58fb433d5258f5db3dde927a8c83b9430"
    },
    {
      "name": "int64_min",
      "description": "Smallest interop integer (-2^63)",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$int": "-9223372036854775808"
        }
      ],
      "canonical_args_hex": "91d38000000000000000",
      "args_hash": "2882730c0cc9df9bc2152c1833892075377b801a72a715434f103b694e4a5909",
      "expected_key": "t:op:2882730c0cc9df9bc2152c1833892075377b801a72a715434f103b694e4a5909"
    },
    {
      "name": "uint_width_ladder",
      "description": "Every unsigned width boundary: 127/128 (fixint/uint8), 255/256 (uint8/uint16), 65535/65536 (uint16/uint32), 4294967295/4294967296 (uint32/uint64)",
      "namespace": "t",
      "operation": "op",
      "args": [
        127,
        128,
        255,
        256,
        65535,
        65536,
        4294967295,
        4294967296
      ],
      "canonical_args_hex": "987fcc80ccffcd0100cdffffce00010000ceffffffffcf0000000100000000",
      "args_hash": "ccf107ae1fc53bde440609a16dc30794916bd692f06309832621b9c49c89f9b7",
      "expected_key": "t:op:ccf107ae1fc53bde440609a16dc30794916bd692f06309832621b9c49c89f9b7"
    },
    {
      "name": "int_width_ladder",
      "description": "Every signed width boundary: -32/-33 (fixint/int8), -128/-129 (int8/int16), -32768/-32769 (int16/int32), -2147483648/-2147483649 (int32/int64)",
      "namespace": "t",
      "operation": "op",
      "args": [
        -32,
        -33,
        -128,
        -129,
        -32768,
        -32769,
        -2147483648,
        -2147483649
      ],
      "canonical_args_hex": "98e0d0dfd080d1ff7fd18000d2ffff7fffd280000000d3ffffffff7fffffff",
      "args_hash": "92fa9f5c0f336f282290472144b6a4cf86b2840a1cbd8366e42fdfa1d4faa98f",
      "expected_key": "t:op:92fa9f5c0f336f282290472144b6a4cf86b2840a1cbd8366e42fdfa1d4faa98f"
    },
    {
      "name": "unicode_string",
      "description": "UTF-8 string, no Unicode normalization applied",
      "namespace": "t",
      "operation": "op",
      "args": [
        "h\u00e9llo w\u00f6rld \u2713"
      ],
      "canonical_args_hex": "91b168c3a96c6c6f2077c3b6726c6420e29c93",
      "args_hash": "00fd1c3045fe23cfe4cac788a9e15773e1f9722ca84e28917f64be99dd7a5a3c",
      "expected_key": "t:op:00fd1c3045fe23cfe4cac788a9e15773e1f9722ca84e28917f64be99dd7a5a3c"
    },
    {
      "name": "str_width_ladder",
      "description": "String header boundaries by UTF-8 byte length: 31 (fixstr) / 32 (str8) / 255 (str8) / 256 (str16)",
      "namespace": "t",
      "operation": "op",
      "args": [
        "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
        "ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
        "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
      ],
      "canonical_args_hex": "94bf61616161616161616161616161616161616161616161616161616161616161d9206262626262626262626262626262626262626262626262626262626262626262d9ff636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363da010064646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464646464",
      "args_hash": "9b750ae4a2ed646a51472aebbcffffade0f4633edbc8152cafcd2d00375d865b",
      "expected_key": "t:op:9b750ae4a2ed646a51472aebbcffffade0f4633edbc8152cafcd2d00375d865b"
    },
    {
      "name": "bin_width_ladder",
      "description": "Binary header boundaries: 255 bytes (bin8) / 256 bytes (bin16)",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$bytes": "ababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab"
        },
        {
          "$bytes": "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd"
        }
      ],
      "canonical_args_hex": "92c4ffabababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababc50100cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd",
      "args_hash": "0a888f5ac66954cd56155853f2f2e964a65dd26783e9fc4249395ca1f99f28c0",
      "expected_key": "t:op:0a888f5ac66954cd56155853f2f2e964a65dd26783e9fc4249395ca1f99f28c0"
    },
    {
      "name": "array_width_boundary",
      "description": "Array header boundary: 15 elements (fixarray) / 16 elements (array16)",
      "namespace": "t",
      "operation": "op",
      "args": [
        [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14
        ],
        [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15
        ]
      ],
      "canonical_args_hex": "929f000102030405060708090a0b0c0d0edc0010000102030405060708090a0b0c0d0e0f",
      "args_hash": "d121a3c3f0427c5df363068940c15d966120be41ea11d4befe62e3408a676130",
      "expected_key": "t:op:d121a3c3f0427c5df363068940c15d966120be41ea11d4befe62e3408a676130"
    },
    {
      "name": "map_width_boundary",
      "description": "Map header boundary: 15 keys (fixmap) / 16 keys (map16); zero-padded keys keep the sort order obvious",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "k00": 0,
          "k01": 1,
          "k02": 2,
          "k03": 3,
          "k04": 4,
          "k05": 5,
          "k06": 6,
          "k07": 7,
          "k08": 8,
          "k09": 9,
          "k10": 10,
          "k11": 11,
          "k12": 12,
          "k13": 13,
          "k14": 14
        },
        {
          "k00": 0,
          "k01": 1,
          "k02": 2,
          "k03": 3,
          "k04": 4,
          "k05": 5,
          "k06": 6,
          "k07": 7,
          "k08": 8,
          "k09": 9,
          "k10": 10,
          "k11": 11,
          "k12": 12,
          "k13": 13,
          "k14": 14,
          "k15": 15
        }
      ],
      "canonical_args_hex": "928fa36b303000a36b303101a36b303202a36b303303a36b303404a36b303505a36b303606a36b303707a36b303808a36b303909a36b31300aa36b31310ba36b31320ca36b31330da36b31340ede0010a36b303000a36b303101a36b303202a36b303303a36b303404a36b303505a36b303606a36b303707a36b303808a36b303909a36b31300aa36b31310ba36b31320ca36b31330da36b31340ea36b31350f",
      "args_hash": "fed444a7b22613e6ff38c05e96df352182f71c41e4db57b2b3e7f0389cabfe46",
      "expected_key": "t:op:fed444a7b22613e6ff38c05e96df352182f71c41e4db57b2b3e7f0389cabfe46"
    },
    {
      "name": "root_array16",
      "description": "16 arguments: the ROOT canonical argument array itself uses array16",
      "namespace": "t",
      "operation": "op",
      "args": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15
      ],
      "canonical_args_hex": "dc0010000102030405060708090a0b0c0d0e0f",
      "args_hash": "c55dd1f50e57b0dfbcd8827965516e2e33e7de2788f18d7d88d82575e34f2116",
      "expected_key": "t:op:c55dd1f50e57b0dfbcd8827965516e2e33e7de2788f18d7d88d82575e34f2116"
    },
    {
      "name": "bool_null",
      "description": "Booleans and null",
      "namespace": "t",
      "operation": "op",
      "args": [
        true,
        false,
        null
      ],
      "canonical_args_hex": "93c3c2c0",
      "args_hash": "1e364f6582ca4dc93b8bed0ff4413162cddafd52407517bff6248286cb863ac1",
      "expected_key": "t:op:1e364f6582ca4dc93b8bed0ff4413162cddafd52407517bff6248286cb863ac1"
    },
    {
      "name": "float_fractional",
      "description": "Non-integral float stays float64",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$float": "3.14"
        }
      ],
      "canonical_args_hex": "91cb40091eb851eb851f",
      "args_hash": "8a855804f9b7adf8f428c4f1c757c44262265a2d13be6b4242ab6556724011cd",
      "expected_key": "t:op:8a855804f9b7adf8f428c4f1c757c44262265a2d13be6b4242ab6556724011cd"
    },
    {
      "name": "float_integral_collapse",
      "description": "Number canonicalization: 2.0 encodes as int 2 (must equal single_int_two)",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$float": "2.0"
        }
      ],
      "canonical_args_hex": "9102",
      "args_hash": "6df5e966da1ba347f99784f56e50e2f570e775e54c9c9349dd8944cb7fe01ea7",
      "expected_key": "t:op:6df5e966da1ba347f99784f56e50e2f570e775e54c9c9349dd8944cb7fe01ea7"
    },
    {
      "name": "single_int_two",
      "description": "Int 2 \u2014 must produce the same key as float_integral_collapse",
      "namespace": "t",
      "operation": "op",
      "args": [
        2
      ],
      "canonical_args_hex": "9102",
      "args_hash": "6df5e966da1ba347f99784f56e50e2f570e775e54c9c9349dd8944cb7fe01ea7",
      "expected_key": "t:op:6df5e966da1ba347f99784f56e50e2f570e775e54c9c9349dd8944cb7fe01ea7"
    },
    {
      "name": "negative_zero",
      "description": "-0.0 is integral, collapses to int 0",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$float": "-0.0"
        }
      ],
      "canonical_args_hex": "9100",
      "args_hash": "f3255c8870de95dd7cf82fab94f78110361b999beea857dac7607a4a67522bda",
      "expected_key": "t:op:f3255c8870de95dd7cf82fab94f78110361b999beea857dac7607a4a67522bda"
    },
    {
      "name": "float_large_integral_out_of_range",
      "description": "Integral float 2^64 exceeds uint64 -> stays float64",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$float": "18446744073709551616"
        }
      ],
      "canonical_args_hex": "91cb43f0000000000000",
      "args_hash": "ab5d4f7d9ddd4a4daceb62a06b1765ab33e6db86aafd4e79ab6ad49f8a3960c8",
      "expected_key": "t:op:ab5d4f7d9ddd4a4daceb62a06b1765ab33e6db86aafd4e79ab6ad49f8a3960c8"
    },
    {
      "name": "map_key_sort_ascii",
      "description": "Map keys sorted by code point: 'A' (0x41) before 'a' (0x61) before 'b'",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "b": 2,
          "a": 1,
          "A": 3
        }
      ],
      "canonical_args_hex": "9183a14103a16101a16202",
      "args_hash": "355030356fd2716354d3c0518604658891794f80f4838202ef931424b51f3f29",
      "expected_key": "t:op:355030356fd2716354d3c0518604658891794f80f4838202ef931424b51f3f29"
    },
    {
      "name": "map_key_sort_supplementary",
      "description": "Code-point order trap: U+FF61 sorts before U+10000. JS UTF-16 code-unit sort gets this BACKWARDS (0xD800 < 0xFF61).",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "\ud800\udc00": 1,
          "\uff61": 2
        }
      ],
      "canonical_args_hex": "9182a3efbda102a4f090808001",
      "args_hash": "f732e0e1342939877b9991ccc7177e4ed974f9f84de464d225fc742e467dbf3f",
      "expected_key": "t:op:f732e0e1342939877b9991ccc7177e4ed974f9f84de464d225fc742e467dbf3f"
    },
    {
      "name": "nested_map_recursive_sort",
      "description": "Sorting applies at every nesting level",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "z": {
            "b": 1,
            "a": 2
          },
          "a": [
            1,
            2
          ]
        }
      ],
      "canonical_args_hex": "9182a161920102a17a82a16102a16201",
      "args_hash": "2be8ea89d36af856c225ff709cb4b892148cc336b47fcd9b255dc736f35780d4",
      "expected_key": "t:op:2be8ea89d36af856c225ff709cb4b892148cc336b47fcd9b255dc736f35780d4"
    },
    {
      "name": "set_int_sorted",
      "description": "Set {3,1,2} -> elements sorted by encoded bytes -> [1,2,3]",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$set": [
            3,
            1,
            2
          ]
        }
      ],
      "canonical_args_hex": "9193010203",
      "args_hash": "458a244b5b00f4244d52c7f1c5cd231355beae391eaf1d2e4bfee04d495b58b5",
      "expected_key": "t:op:458a244b5b00f4244d52c7f1c5cd231355beae391eaf1d2e4bfee04d495b58b5"
    },
    {
      "name": "set_heterogeneous",
      "description": "Set {'b', 10, 'a'} -> byte order puts int 10 (0x0a) before strings",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$set": [
            "b",
            10,
            "a"
          ]
        }
      ],
      "canonical_args_hex": "91930aa161a162",
      "args_hash": "6e2c172b9a9e966d3febc66a2a28c05a6ffabbd3b798bf341ec1d55ed73d6e4f",
      "expected_key": "t:op:6e2c172b9a9e966d3febc66a2a28c05a6ffabbd3b798bf341ec1d55ed73d6e4f"
    },
    {
      "name": "set_mixed_sign_order",
      "description": "Set {-5, 'a', 1.5}: encoded-byte order is 'a' (0xa1..), 1.5 (0xcb..), -5 (0xfb) \u2014 NOT numeric/type-grouped order. Kills 'sort naturally, ints first' implementations.",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$set": [
            -5,
            "a",
            {
              "$float": "1.5"
            }
          ]
        }
      ],
      "canonical_args_hex": "9193a161cb3ff8000000000000fb",
      "args_hash": "1f1a8fdd7221fac0fd57e7e5cd1ceec1c43eadd35570f6de63eb59ffc014a1e9",
      "expected_key": "t:op:1f1a8fdd7221fac0fd57e7e5cd1ceec1c43eadd35570f6de63eb59ffc014a1e9"
    },
    {
      "name": "float_collapse_lower_bound",
      "description": "Inclusive lower collapse bound: float -2^63 MUST collapse to the int64-min encoding (0xd3...), symmetric with the exclusive upper bound vector",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$float": "-9223372036854775808"
        }
      ],
      "canonical_args_hex": "91d38000000000000000",
      "args_hash": "2882730c0cc9df9bc2152c1833892075377b801a72a715434f103b694e4a5909",
      "expected_key": "t:op:2882730c0cc9df9bc2152c1833892075377b801a72a715434f103b694e4a5909"
    },
    {
      "name": "set_dedupe_canonicalization",
      "description": "Set {2, 2.0}: number canonicalization makes the encodings identical; dedupe by encoded bytes leaves a single int 2",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$set": [
            2,
            {
              "$float": "2.0"
            }
          ]
        }
      ],
      "canonical_args_hex": "919102",
      "args_hash": "0b32675997838bef03127b5e69d6c103d5f622676fd5006254fa36a36c9a828c",
      "expected_key": "t:op:0b32675997838bef03127b5e69d6c103d5f622676fd5006254fa36a36c9a828c"
    },
    {
      "name": "datetime_fractional",
      "description": "tz-aware datetime -> floor to micros -> one float64 division by 10^6",
      "namespace": "events",
      "operation": "get_by_time",
      "args": [
        {
          "$datetime": "2024-01-01T12:30:45.123456+00:00"
        }
      ],
      "canonical_args_hex": "91cb41d964ac1d47e6b4",
      "args_hash": "1b85c4d90f566c5df71ebd437c4f296c1a2d5567c9cc69edb026f804a134997b",
      "expected_key": "events:get_by_time:1b85c4d90f566c5df71ebd437c4f296c1a2d5567c9cc69edb026f804a134997b"
    },
    {
      "name": "datetime_whole_second",
      "description": "Whole-second datetime yields integral float64 -> collapses to int",
      "namespace": "events",
      "operation": "get_by_time",
      "args": [
        {
          "$datetime": "2024-01-01T00:00:00+00:00"
        }
      ],
      "canonical_args_hex": "91ce65920080",
      "args_hash": "b3504b56c162854b07071c4577f3c73f3ec615c8a3152928bf5c6dba086461c2",
      "expected_key": "events:get_by_time:b3504b56c162854b07071c4577f3c73f3ec615c8a3152928bf5c6dba086461c2"
    },
    {
      "name": "datetime_non_utc_offset",
      "description": "Non-UTC offset converts to the same instant (+05:30); key must equal datetime_fractional",
      "namespace": "events",
      "operation": "get_by_time",
      "args": [
        {
          "$datetime": "2024-01-01T18:00:45.123456+05:30"
        }
      ],
      "canonical_args_hex": "91cb41d964ac1d47e6b4",
      "args_hash": "1b85c4d90f566c5df71ebd437c4f296c1a2d5567c9cc69edb026f804a134997b",
      "expected_key": "events:get_by_time:1b85c4d90f566c5df71ebd437c4f296c1a2d5567c9cc69edb026f804a134997b"
    },
    {
      "name": "datetime_pre_epoch",
      "description": "Pre-epoch datetime: negative timestamp (-0.876544), microseconds floored toward negative infinity",
      "namespace": "events",
      "operation": "get_by_time",
      "args": [
        {
          "$datetime": "1969-12-31T23:59:59.123456+00:00"
        }
      ],
      "canonical_args_hex": "91cbbfec0ca600b02928",
      "args_hash": "821ed5d8a5c055d2e42cf1c1b3df57f7e99914a8245446cc16567e581c1c1630",
      "expected_key": "events:get_by_time:821ed5d8a5c055d2e42cf1c1b3df57f7e99914a8245446cc16567e581c1c1630"
    },
    {
      "name": "uuid_lowercased",
      "description": "UUID normalizes to lowercase hyphenated string (input was uppercase)",
      "namespace": "users",
      "operation": "get_by_uuid",
      "args": [
        {
          "$uuid": "550E8400-E29B-41D4-A716-446655440000"
        }
      ],
      "canonical_args_hex": "91d92435353065383430302d653239622d343164342d613731362d343436363535343430303030",
      "args_hash": "14821dfe8848465aa23db43cb83be508f51d9ac556479bcc78b8a522e268a62a",
      "expected_key": "users:get_by_uuid:14821dfe8848465aa23db43cb83be508f51d9ac556479bcc78b8a522e268a62a"
    },
    {
      "name": "bytes_bin",
      "description": "Bytes encode as msgpack bin (never str family)",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$bytes": "deadbeef"
        }
      ],
      "canonical_args_hex": "91c404deadbeef",
      "args_hash": "2ed8716bf7f1438057a9e8082b456c8566f95ed0dda11b1e16e6a1a74ebebfc0",
      "expected_key": "t:op:2ed8716bf7f1438057a9e8082b456c8566f95ed0dda11b1e16e6a1a74ebebfc0"
    },
    {
      "name": "issue_example_mixed",
      "description": "Issue #1 vector: (42, 'hello', {'b': 2, 'a': 1})",
      "namespace": "t",
      "operation": "op",
      "args": [
        42,
        "hello",
        {
          "b": 2,
          "a": 1
        }
      ],
      "canonical_args_hex": "932aa568656c6c6f82a16101a16202",
      "args_hash": "03a0edbae0c1b5816c431652268d1527730175cdc0b45807cb07e1025ff971f6",
      "expected_key": "t:op:03a0edbae0c1b5816c431652268d1527730175cdc0b45807cb07e1025ff971f6"
    },
    {
      "name": "reservation_scope",
      "description": "The ns/nsapi reservation is exact-match and namespace-only: namespace 'nsapix' (rejected by an ns* or nsapi* prefix match) and operation 'nsapi' stay valid",
      "namespace": "nsapix",
      "operation": "nsapi",
      "args": [
        1
      ],
      "canonical_args_hex": "9101",
      "args_hash": "405f09a3617bcc1425ea95b9840d9c2713e3ecebd5a3227abc599317b732e21a",
      "expected_key": "nsapix:nsapi:405f09a3617bcc1425ea95b9840d9c2713e3ecebd5a3227abc599317b732e21a"
    },
    {
      "name": "lone_dots_stay_valid",
      "description": "Only '..' is forbidden: a lone trailing '.' (namespace 'app.') and non-adjacent dots (operation 'users.fetch.by_id') stay valid",
      "namespace": "app.",
      "operation": "users.fetch.by_id",
      "args": [
        1
      ],
      "canonical_args_hex": "9101",
      "args_hash": "405f09a3617bcc1425ea95b9840d9c2713e3ecebd5a3227abc599317b732e21a",
      "expected_key": "app.:users.fetch.by_id:405f09a3617bcc1425ea95b9840d9c2713e3ecebd5a3227abc599317b732e21a"
    },
    {
      "name": "segment_max_length",
      "description": "Both segments at the 64-character limit (the longest interop key, 194 characters). The namespace starts with a digit and holds '-' and '_'; the operation starts with a digit and holds '.', '-' and '_'. A limit of 63, or a ban on a leading digit or on '-', rejects it",
      "namespace": "9-lives_9-lives_9-lives_9-lives_9-lives_9-lives_9-lives_9-lives_",
      "operation": "0.op-x_0.op-x_0.op-x_0.op-x_0.op-x_0.op-x_0.op-x_0.op-x_0.op-x_0",
      "args": [
        1
      ],
      "canonical_args_hex": "9101",
      "args_hash": "405f09a3617bcc1425ea95b9840d9c2713e3ecebd5a3227abc599317b732e21a",
      "expected_key": "9-lives_9-lives_9-lives_9-lives_9-lives_9-lives_9-lives_9-lives_:0.op-x_0.op-x_0.op-x_0.op-x_0.op-x_0.op-x_0.op-x_0.op-x_0.op-x_0:405f09a3617bcc1425ea95b9840d9c2713e3ecebd5a3227abc599317b732e21a"
    },
    {
      "name": "map_key_sort_case_across_letters",
      "description": "Code point order puts 'B' (0x42) before 'a' (0x61). A collator (Intl.Collator, localeCompare, with or without caseFirst 'upper') compares letters first and puts 'a' before 'B'",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "a": 1,
          "B": 2
        }
      ],
      "canonical_args_hex": "9182a14202a16101",
      "args_hash": "363d3a1b4c2b98dd8266eeb3c050d4da2b024d56afd817f9990b157f5410fdda",
      "expected_key": "t:op:363d3a1b4c2b98dd8266eeb3c050d4da2b024d56afd817f9990b157f5410fdda"
    },
    {
      "name": "map_key_sort_punctuation",
      "description": "Code point order puts 'a-b' ('-' is 0x2d) before 'a_b' ('_' is 0x5f). A collator puts 'a_b' first: Unicode collation orders '_' before '-'",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "a_b": 1,
          "a-b": 2
        }
      ],
      "canonical_args_hex": "9182a3612d6202a3615f6201",
      "args_hash": "a6c20006ddbdacea9a7e0307d4f99361c90420d16a82c47407eb5f73f0a4293d",
      "expected_key": "t:op:a6c20006ddbdacea9a7e0307d4f99361c90420d16a82c47407eb5f73f0a4293d"
    },
    {
      "name": "map_key_sort_shorter_key_later",
      "description": "Code point order puts 'ab' before the shorter 'b'. A length-first sort (shorter keys first, as canonical CBOR orders them, or by the encoded key with its header) puts 'b' first",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "b": 1,
          "ab": 2
        }
      ],
      "canonical_args_hex": "9182a2616202a16201",
      "args_hash": "2220a1361610d10954ee0e8e100974cc47239b041ca9419f67b6ffb62b2c79dc",
      "expected_key": "t:op:2220a1361610d10954ee0e8e100974cc47239b041ca9419f67b6ffb62b2c79dc"
    },
    {
      "name": "map_key_sort_supplementary_shorter",
      "description": "Code point order puts U+FF61 U+FF61 (6 UTF-8 bytes) before the shorter U+10000 (4 bytes). A length-first sort and a UTF-16 code-unit sort both put U+10000 first",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "\ud800\udc00": 1,
          "\uff61\uff61": 2
        }
      ],
      "canonical_args_hex": "9182a6efbda1efbda102a4f090808001",
      "args_hash": "5b4bdc0b139d14dc7e8099efaa9d556867b3d62145a553ad6c0e9913793f98e1",
      "expected_key": "t:op:5b4bdc0b139d14dc7e8099efaa9d556867b3d62145a553ad6c0e9913793f98e1"
    },
    {
      "name": "map_key_proto",
      "description": "'__proto__' is an ordinary string key. A JavaScript normalizer that copies keys by assignment (out[k] = v) sets the object's prototype instead, drops the key and mints the key of an empty map",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "__proto__": 1
        }
      ],
      "canonical_args_hex": "9181a95f5f70726f746f5f5f01",
      "args_hash": "f3e64f4b2df2a19ce1867746dd0a00a454fbd53aa47e0c245353b10e391174e6",
      "expected_key": "t:op:f3e64f4b2df2a19ce1867746dd0a00a454fbd53aa47e0c245353b10e391174e6"
    },
    {
      "name": "set_in_map_normalized",
      "description": "A set inside a map value holding a tz-aware datetime and an uppercase UUID: each element is normalized before it is encoded and sorted (the int timestamp 0xce.. sorts before the str 0xd9..). The valid twin of reject_naive_datetime_nested, so a set path that rejects every datetime fails it",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "when": {
            "$set": [
              {
                "$uuid": "550E8400-E29B-41D4-A716-446655440000"
              },
              {
                "$datetime": "2024-01-01T00:00:00+00:00"
              }
            ]
          }
        }
      ],
      "canonical_args_hex": "9181a47768656e92ce65920080d92435353065383430302d653239622d343164342d613731362d343436363535343430303030",
      "args_hash": "0e6034a1e41ef9d5b86c1931ca87b6bc28941dc8d286f5b4ff35914c8cb467a5",
      "expected_key": "t:op:0e6034a1e41ef9d5b86c1931ca87b6bc28941dc8d286f5b4ff35914c8cb467a5"
    },
    {
      "name": "int_beyond_float64_precision",
      "description": "2^53+1, -(2^53+1) and 2^63-1, then 2^53+1 again inside a list and a map value: integers inside int64 that a float64 cannot hold. A TypeScript SDK that turns a BigInt inside int64 into a Number rounds each one and mints a different key",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$int": "9007199254740993"
        },
        {
          "$int": "-9007199254740993"
        },
        {
          "$int": "9223372036854775807"
        },
        [
          {
            "$int": "9007199254740993"
          }
        ],
        {
          "id": {
            "$int": "9007199254740993"
          }
        }
      ],
      "canonical_args_hex": "95cf0020000000000001d3ffdfffffffffffffcf7fffffffffffffff91cf002000000000000181a26964cf0020000000000001",
      "args_hash": "9b0aeb160d3eff4897861f4304f02348acb15c93b0c3d7f34f1cc923c7cadebe",
      "expected_key": "t:op:9b0aeb160d3eff4897861f4304f02348acb15c93b0c3d7f34f1cc923c7cadebe"
    },
    {
      "name": "small_int_as_bigint",
      "description": "Small integers passed as {\"$int\": ...} (a BigInt in JavaScript) take the shortest form, the bytes the same plain integers produce. An encoder that writes every BigInt at the full 9-byte width mints a different key",
      "namespace": "t",
      "operation": "op",
      "args": [
        {
          "$int": "1"
        },
        {
          "$int": "-1"
        },
        {
          "$int": "300"
        }
      ],
      "canonical_args_hex": "9301ffcd012c",
      "args_hash": "ba16f28441500ea3ae1a8537233d44b5128111fdb629262e65a39c3b44390137",
      "expected_key": "t:op:ba16f28441500ea3ae1a8537233d44b5128111fdb629262e65a39c3b44390137"
    }
  ],
  "value_vectors": [
    {
      "name": "issue_example_object",
      "description": "Issue #1 round-trip vector (canonical: sorted keys)",
      "value": {
        "name": "alice",
        "age": 30
      },
      "canonical_msgpack_hex": "82a36167651ea46e616d65a5616c696365"
    },
    {
      "name": "float_value_stays_float64",
      "description": "VALUE profile: no number canonicalization, 2.0 stays float64",
      "value": {
        "$float": "2.0"
      },
      "canonical_msgpack_hex": "cb4000000000000000"
    },
    {
      "name": "mixed_array",
      "description": "Array value with mixed scalars",
      "value": [
        1,
        "two",
        {
          "$float": "3.5"
        },
        null,
        true
      ],
      "canonical_msgpack_hex": "9501a374776fcb400c000000000000c0c3"
    },
    {
      "name": "datetime_sentinel_value",
      "description": "Temporal VALUES use the wire-format.md sentinel map convention",
      "value": {
        "__datetime__": true,
        "value": "2024-01-01T12:30:45.123456+00:00"
      },
      "canonical_msgpack_hex": "82ac5f5f6461746574696d655f5fc3a576616c7565d920323032342d30312d30315431323a33303a34352e3132333435362b30303a3030"
    },
    {
      "name": "proto_key_value",
      "description": "A map whose key is '__proto__', an ordinary string key. A JavaScript reader or writer that sets keys by assignment changes the object's prototype instead and loses the entry",
      "value": {
        "__proto__": 1
      },
      "canonical_msgpack_hex": "81a95f5f70726f746f5f5f01"
    },
    {
      "name": "bom_strings_value",
      "description": "Strings that start with U+FEFF, one short and one of 300 characters: a reader keeps the character. A UTF-8 decoder left at its default (TextDecoder strips a leading BOM) drops it, and some MessagePack decoders use one only for longer strings",
      "value": [
        "\ufeffbom",
        "\ufeffxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      ],
      "canonical_msgpack_hex": "92a6efbbbf626f6dda012eefbbbf7878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878"
    }
  ],
  "error_vectors": [
    {
      "name": "reject_nan",
      "args": [
        {
          "$float": "nan"
        }
      ],
      "error": "NaN is not allowed"
    },
    {
      "name": "reject_infinity",
      "args": [
        {
          "$float": "1e999"
        }
      ],
      "error": "Infinity is not allowed (1e999 overflows to +inf in Python, JS, and Rust float parsers alike)"
    },
    {
      "name": "reject_negative_infinity",
      "args": [
        {
          "$float": "-1e999"
        }
      ],
      "error": "-Infinity is not allowed (independent vector: +Inf rejection does not imply -Inf rejection)"
    },
    {
      "name": "reject_int_overflow",
      "args": [
        {
          "$int": "18446744073709551616"
        }
      ],
      "error": "integer above 2^64-1"
    },
    {
      "name": "reject_int_underflow",
      "args": [
        {
          "$int": "-9223372036854775809"
        }
      ],
      "error": "integer below -2^63"
    },
    {
      "name": "reject_naive_datetime",
      "args": [
        {
          "$datetime": "2024-01-01T00:00:00"
        }
      ],
      "error": "naive datetime (no UTC offset)"
    },
    {
      "name": "reject_uppercase_namespace",
      "namespace": "Users",
      "operation": "get_user",
      "args": [],
      "error": "namespace must match the segment pattern"
    },
    {
      "name": "reject_colon_in_operation",
      "namespace": "users",
      "operation": "get:user",
      "args": [],
      "error": "operation must match the segment pattern"
    },
    {
      "name": "reject_trailing_newline",
      "namespace": "users\n",
      "operation": "get_user",
      "args": [],
      "error": "segment validation must be a FULL-string match (Python re.match + $ accepts a trailing newline; use fullmatch)"
    },
    {
      "name": "reject_reserved_namespace_ns",
      "namespace": "ns",
      "operation": "get_user",
      "args": [],
      "error": "namespace 'ns' is reserved: the server parses a key starting 'ns:' as namespace-prefixed (here it would scope the key to a namespace named 'get_user')"
    },
    {
      "name": "reject_reserved_namespace_nsapi",
      "namespace": "nsapi",
      "operation": "users.fetch_by_id",
      "args": [],
      "error": "namespace 'nsapi' is reserved: the server parses a key starting 'nsapi:' as namespace-prefixed (rejected whatever the operation, including one the server would 400 on for its '.')"
    },
    {
      "name": "reject_double_dot_namespace",
      "namespace": "a..b",
      "operation": "get_user",
      "args": [],
      "error": "namespace must not contain '..': the pattern admits it, but the server rejects '..' anywhere in a key"
    },
    {
      "name": "reject_double_dot_operation",
      "namespace": "users",
      "operation": "x..",
      "args": [],
      "error": "operation must not contain '..': the pattern admits it, but the server rejects '..' anywhere in a key (here at the end of the segment, which a check that skips the last pair misses)"
    },
    {
      "name": "reject_namespace_too_long",
      "namespace": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "operation": "get_user",
      "args": [],
      "error": "namespace is 65 characters; the limit is 64 (segment_max_length pins 64 as valid)"
    },
    {
      "name": "reject_operation_too_long",
      "namespace": "users",
      "operation": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
      "args": [],
      "error": "operation is 65 characters; the limit is 64"
    },
    {
      "name": "reject_leading_dot_namespace",
      "namespace": ".users",
      "operation": "get_user",
      "args": [],
      "error": "a segment must start with a letter or digit, not '.'"
    },
    {
      "name": "reject_leading_hyphen_operation",
      "namespace": "users",
      "operation": "-get_user",
      "args": [],
      "error": "a segment must start with a letter or digit, not '-'"
    },
    {
      "name": "reject_leading_underscore_operation",
      "namespace": "users",
      "operation": "_get_user",
      "args": [],
      "error": "a segment must start with a letter or digit, not '_' (a leading \\w admits it)"
    },
    {
      "name": "reject_empty_namespace",
      "namespace": "",
      "operation": "get_user",
      "args": [],
      "error": "a segment holds at least one character"
    },
    {
      "name": "reject_empty_operation",
      "namespace": "users",
      "operation": "",
      "args": [],
      "error": "a segment holds at least one character"
    },
    {
      "name": "reject_non_ascii_digit_namespace",
      "namespace": "users\u0663",
      "operation": "get_user",
      "args": [],
      "error": "U+0663 ARABIC-INDIC DIGIT THREE is not an ASCII digit (Unicode \\d, isdigit and isalnum admit it)"
    },
    {
      "name": "reject_non_ascii_letter_operation",
      "namespace": "users",
      "operation": "caf\u00e9",
      "args": [],
      "error": "U+00E9 is not an ASCII letter (a lowercase or alphanumeric test admits it)"
    },
    {
      "name": "reject_fullwidth_operation",
      "namespace": "users",
      "operation": "\uff47\uff45\uff54_user",
      "args": [],
      "error": "full-width letters are not ASCII: NFKC folds them to 'get_user', and a segment is never normalized"
    },
    {
      "name": "reject_slash_namespace",
      "namespace": "users/v2",
      "operation": "get_user",
      "args": [],
      "error": "'/' is not in the segment character set"
    },
    {
      "name": "reject_space_operation",
      "namespace": "users",
      "operation": "get user",
      "args": [],
      "error": "a space is not in the segment character set"
    },
    {
      "name": "reject_uppercase_operation",
      "namespace": "users",
      "operation": "getUser",
      "args": [],
      "error": "operation must be lowercase"
    },
    {
      "name": "reject_colon_in_namespace",
      "namespace": "users:v2",
      "operation": "get_user",
      "args": [],
      "error": "':' is not in the segment character set (it would add a key segment)"
    },
    {
      "name": "reject_trailing_newline_operation",
      "namespace": "users",
      "operation": "get_user\n",
      "args": [],
      "error": "segment validation must be a FULL-string match, on the operation as on the namespace"
    },
    {
      "name": "reject_naive_datetime_nested",
      "args": [
        {
          "when": {
            "$set": [
              {
                "$datetime": "2024-01-01T00:00:00"
              }
            ]
          }
        }
      ],
      "error": "naive datetime inside a set inside a map value"
    },
    {
      "name": "reject_nan_nested",
      "args": [
        [
          {
            "x": {
              "$float": "nan"
            }
          }
        ]
      ],
      "error": "NaN inside a map value inside a list"
    },
    {
      "name": "reject_int_overflow_in_list",
      "args": [
        [
          1,
          {
            "$int": "18446744073709551616"
          }
        ]
      ],
      "error": "integer above 2^64-1 inside a list"
    },
    {
      "name": "reject_int_underflow_in_map",
      "args": [
        {
          "id": {
            "$int": "-9223372036854775809"
          }
        }
      ],
      "error": "integer below -2^63 inside a map value"
    },
    {
      "name": "reject_int_overflow_in_map",
      "args": [
        {
          "id": {
            "$int": "18446744073709551616"
          }
        }
      ],
      "error": "integer above 2^64-1 inside a map value (with reject_int_underflow_in_list, each bound is pinned on both paths)"
    },
    {
      "name": "reject_int_underflow_in_list",
      "args": [
        [
          1,
          {
            "$int": "-9223372036854775809"
          }
        ]
      ],
      "error": "integer below -2^63 inside a list"
    }
  ],
  "reader_accept_vectors": [
    {
      "name": "reader_padded_int_widths",
      "description": "Integers in wider forms than the shortest: 42 as uint16, -1 as int32, 1 as uint64",
      "input_hex": "93cd002ad2ffffffffcf0000000000000001",
      "value": [
        42,
        -1,
        1
      ]
    },
    {
      "name": "reader_padded_headers",
      "description": "Headers wider than needed: an array16 of 3 holding 'abc' as str8, {'a': 1} as map16 and 2 bytes as bin16",
      "input_hex": "dc0003d903616263de0001a16101c50002dead",
      "value": [
        "abc",
        {
          "a": 1
        },
        {
          "$bytes": "dead"
        }
      ]
    },
    {
      "name": "reader_unsorted_map_keys",
      "description": "Map keys in the reverse of code point order",
      "input_hex": "82a16202a16101",
      "value": {
        "b": 2,
        "a": 1
      }
    },
    {
      "name": "reader_float32",
      "description": "1.5 as a float32 (0xca), which canonical writers never emit",
      "input_hex": "ca3fc00000",
      "value": {
        "$float": "1.5"
      }
    },
    {
      "name": "reader_non_string_map_key",
      "description": "{1: 42}: a map with an integer key. No tagged-JSON value can carry it; a reader must decode it without error (msgpack-python's unpackb needs strict_map_key=False)",
      "input_hex": "81012a"
    },
    {
      "name": "reader_ext_type",
      "description": "An application ext type (fixext1, type 1, payload 0x2a). No tagged-JSON value can carry it; a reader must decode it without error",
      "input_hex": "d4012a"
    }
  ],
  "reader_reject_vectors": [
    {
      "name": "reader_trailing_byte",
      "description": "The issue_example_object value followed by one 0x00 byte: a complete document and a trailing byte, with no CK frame prefix, so only the general trailing-bytes check rejects it. A reader that strips trailing NUL padding before a strict decode accepts it, so it fails this vector too",
      "input_hex": "82a36167651ea46e616d65a5616c69636500",
      "error": "trailing bytes after one complete document"
    }
  ],
  "aad_vectors": [
    {
      "name": "interop_key_aad",
      "description": "AAD v0x03 over an interop key; format=msgpack, compressed=False (always, in interop mode)",
      "tenant_id": "cross-sdk-test",
      "cache_key": "users:get_user:61598716255080080f6456eb065c2e51badfaa4320b0efe97469c29cffee8875",
      "format": "msgpack",
      "compressed": false,
      "aad_hex": "030000000e63726f73732d73646b2d746573740000004f75736572733a6765745f757365723a36313539383731363235353038303038306636343536656230363563326535316261646661613433323062306566653937343639633239636666656538383735000000076d73677061636b0000000546616c7365"
    }
  ],
  "encryption_vectors": [
    {
      "name": "interop_encryption_roundtrip",
      "description": "Full interop encryption round-trip: HKDF-SHA256 per spec/encryption.md (same master key + tenant as test-vectors/encryption.json, hence the same derived key), AES-256-GCM over the PLAIN MessagePack value bytes (no ByteStorage step) with the interop_key_aad AAD and a fixed nonce.",
      "master_key_hex": "6161616161616161616161616161616161616161616161616161616161616161",
      "tenant_id": "cross-sdk-test",
      "derived_key_fingerprint_hex": "96179a9bc881aa7ca83f04b78a66afd3",
      "cache_key": "users:get_user:61598716255080080f6456eb065c2e51badfaa4320b0efe97469c29cffee8875",
      "format": "msgpack",
      "compressed": false,
      "aad_hex": "030000000e63726f73732d73646b2d746573740000004f75736572733a6765745f757365723a36313539383731363235353038303038306636343536656230363563326535316261646661613433323062306566653937343639633239636666656538383735000000076d73677061636b0000000546616c7365",
      "plaintext_hex": "82a36167651ea46e616d65a5616c696365",
      "nonce_hex": "000102030405060708090a0b",
      "ciphertext_hex": "000102030405060708090a0b033caf732820ce189e1506f842aebf8cdb6a242eb08c55b6f5a91eb9007b3bd657",
      "ciphertext_layout": "nonce(12) || ciphertext || auth_tag(16)"
    }
  ]
}