standard_flags 0.2.2 → 0.3.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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +158 -0
  3. data/README.md +566 -35
  4. data/conformance/README.md +166 -0
  5. data/conformance/bucket_vectors.json +46 -0
  6. data/conformance/guards_and_errors.json +35 -0
  7. data/conformance/legacy_env.json +38 -0
  8. data/conformance/legacy_exact.json +90 -0
  9. data/conformance/operations/write_path.json +723 -0
  10. data/conformance/permanent_flags.json +38 -0
  11. data/conformance/resolution.json +68 -0
  12. data/conformance/runtime/client.json +1431 -0
  13. data/conformance/runtime/rules.json +1305 -0
  14. data/conformance/schema/fixture.schema.json +1340 -0
  15. data/conformance/versions/legacy_ranges.json +183 -0
  16. data/conformance/versions/version_ranges.json +503 -0
  17. data/conformance/wire/client_state.json +1905 -0
  18. data/conformance/wire/delivery.json +1541 -0
  19. data/lib/standard_flags/audience.rb +49 -0
  20. data/lib/standard_flags/client.rb +157 -0
  21. data/lib/standard_flags/config.rb +21 -0
  22. data/lib/standard_flags/context.rb +70 -17
  23. data/lib/standard_flags/controller.rb +92 -10
  24. data/lib/standard_flags/definition.rb +71 -8
  25. data/lib/standard_flags/delivery.rb +195 -0
  26. data/lib/standard_flags/errors.rb +33 -0
  27. data/lib/standard_flags/job.rb +12 -1
  28. data/lib/standard_flags/mcp/flags.rb +3 -3
  29. data/lib/standard_flags/mcp/gating.rb +151 -0
  30. data/lib/standard_flags/mcp.rb +64 -5
  31. data/lib/standard_flags/notifiers/logger.rb +4 -0
  32. data/lib/standard_flags/ofrep/controller.rb +211 -0
  33. data/lib/standard_flags/ofrep.rb +115 -0
  34. data/lib/standard_flags/open_feature/provider.rb +1 -1
  35. data/lib/standard_flags/operations/rules.rb +17 -4
  36. data/lib/standard_flags/operations/validation.rb +25 -4
  37. data/lib/standard_flags/operations.rb +0 -2
  38. data/lib/standard_flags/payload.rb +8 -3
  39. data/lib/standard_flags/registry.rb +157 -12
  40. data/lib/standard_flags/runtime/cache.rb +1 -0
  41. data/lib/standard_flags/runtime/resolver.rb +26 -17
  42. data/lib/standard_flags/runtime/values.rb +8 -1
  43. data/lib/standard_flags/runtime.rb +42 -1
  44. data/lib/standard_flags/semantic_version.rb +141 -0
  45. data/lib/standard_flags/subscribers.rb +3 -0
  46. data/lib/standard_flags/testing.rb +4 -2
  47. data/lib/standard_flags/tooling.rb +25 -3
  48. data/lib/standard_flags/version.rb +1 -1
  49. data/lib/standard_flags/version_range.rb +309 -0
  50. data/lib/standard_flags.rb +38 -4
  51. metadata +24 -1
@@ -0,0 +1,1340 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/rarebit-one/standard_flags/main/conformance/schema/fixture.schema.json",
4
+ "title": "standard_flags conformance fixture",
5
+ "description": "Every file under conformance/ (except schema/) validates against this schema. `suite` picks the case shape; `scope` says who runs it: `server` cases (ENV pins, legacy variables, runtime rules, the write path, bucketing, RubyGems ranges) run only in server evaluators, `wire` cases also run in client libraries. A case may override its file's scope. Fixture format version 1.",
6
+ "type": "object",
7
+ "required": [
8
+ "description",
9
+ "suite",
10
+ "scope"
11
+ ],
12
+ "properties": {
13
+ "description": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "suite": {
18
+ "enum": [
19
+ "evaluation",
20
+ "runtime",
21
+ "operations",
22
+ "bucket_vectors",
23
+ "version_ranges",
24
+ "legacy_ranges",
25
+ "delivery",
26
+ "client_state"
27
+ ]
28
+ },
29
+ "scope": {
30
+ "$ref": "#/$defs/scope"
31
+ }
32
+ },
33
+ "allOf": [
34
+ {
35
+ "if": {
36
+ "properties": {
37
+ "suite": {
38
+ "const": "evaluation"
39
+ }
40
+ }
41
+ },
42
+ "then": {
43
+ "$ref": "#/$defs/evaluation_suite"
44
+ }
45
+ },
46
+ {
47
+ "if": {
48
+ "properties": {
49
+ "suite": {
50
+ "const": "runtime"
51
+ }
52
+ }
53
+ },
54
+ "then": {
55
+ "$ref": "#/$defs/runtime_suite"
56
+ }
57
+ },
58
+ {
59
+ "if": {
60
+ "properties": {
61
+ "suite": {
62
+ "const": "operations"
63
+ }
64
+ }
65
+ },
66
+ "then": {
67
+ "$ref": "#/$defs/operations_suite"
68
+ }
69
+ },
70
+ {
71
+ "if": {
72
+ "properties": {
73
+ "suite": {
74
+ "const": "bucket_vectors"
75
+ }
76
+ }
77
+ },
78
+ "then": {
79
+ "$ref": "#/$defs/bucket_vectors_suite"
80
+ }
81
+ },
82
+ {
83
+ "if": {
84
+ "properties": {
85
+ "suite": {
86
+ "const": "version_ranges"
87
+ }
88
+ }
89
+ },
90
+ "then": {
91
+ "$ref": "#/$defs/version_ranges_suite"
92
+ }
93
+ },
94
+ {
95
+ "if": {
96
+ "properties": {
97
+ "suite": {
98
+ "const": "legacy_ranges"
99
+ }
100
+ }
101
+ },
102
+ "then": {
103
+ "$ref": "#/$defs/legacy_ranges_suite"
104
+ }
105
+ },
106
+ {
107
+ "if": {
108
+ "properties": {
109
+ "suite": {
110
+ "const": "delivery"
111
+ }
112
+ }
113
+ },
114
+ "then": {
115
+ "$ref": "#/$defs/delivery_suite"
116
+ }
117
+ },
118
+ {
119
+ "if": {
120
+ "properties": {
121
+ "suite": {
122
+ "const": "client_state"
123
+ }
124
+ }
125
+ },
126
+ "then": {
127
+ "$ref": "#/$defs/client_state_suite"
128
+ }
129
+ }
130
+ ],
131
+ "$defs": {
132
+ "scope": {
133
+ "enum": [
134
+ "server",
135
+ "wire"
136
+ ]
137
+ },
138
+ "flag_key": {
139
+ "type": "string",
140
+ "pattern": "^[a-z][a-z0-9_]*$"
141
+ },
142
+ "wire_name": {
143
+ "type": "string",
144
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$"
145
+ },
146
+ "date": {
147
+ "type": "string",
148
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
149
+ },
150
+ "flag_value": {
151
+ "type": [
152
+ "boolean",
153
+ "string",
154
+ "null"
155
+ ]
156
+ },
157
+ "env_vars": {
158
+ "type": "object",
159
+ "additionalProperties": {
160
+ "type": "string"
161
+ }
162
+ },
163
+ "client": {
164
+ "description": "The calling client as given: platform, version, build.",
165
+ "type": "object",
166
+ "properties": {
167
+ "platform": {
168
+ "type": "string"
169
+ },
170
+ "version": {
171
+ "type": "string"
172
+ },
173
+ "build": {
174
+ "type": [
175
+ "string",
176
+ "integer"
177
+ ]
178
+ }
179
+ },
180
+ "additionalProperties": false
181
+ },
182
+ "context": {
183
+ "type": "object",
184
+ "properties": {
185
+ "units": {
186
+ "type": "object",
187
+ "additionalProperties": {
188
+ "type": "string"
189
+ }
190
+ },
191
+ "client": {
192
+ "$ref": "#/$defs/client"
193
+ },
194
+ "segments": {
195
+ "type": "array",
196
+ "items": {
197
+ "type": "string"
198
+ }
199
+ }
200
+ },
201
+ "additionalProperties": false
202
+ },
203
+ "platform_versions": {
204
+ "type": "object",
205
+ "minProperties": 1,
206
+ "additionalProperties": {
207
+ "type": "string"
208
+ }
209
+ },
210
+ "flag": {
211
+ "type": "object",
212
+ "required": [
213
+ "kind",
214
+ "key",
215
+ "owner"
216
+ ],
217
+ "properties": {
218
+ "kind": {
219
+ "enum": [
220
+ "flag",
221
+ "kill_switch",
222
+ "mode",
223
+ "experiment",
224
+ "compat"
225
+ ]
226
+ },
227
+ "key": {
228
+ "$ref": "#/$defs/flag_key"
229
+ },
230
+ "owner": {
231
+ "type": "string"
232
+ },
233
+ "description": {
234
+ "type": "string"
235
+ },
236
+ "default": {},
237
+ "env": {
238
+ "oneOf": [
239
+ {
240
+ "type": "string"
241
+ },
242
+ {
243
+ "type": "array",
244
+ "items": {
245
+ "type": "string"
246
+ }
247
+ }
248
+ ]
249
+ },
250
+ "inverted": {
251
+ "type": "boolean"
252
+ },
253
+ "legacy_parser": {
254
+ "enum": [
255
+ "strict",
256
+ "exact"
257
+ ]
258
+ },
259
+ "legacy_true": {
260
+ "oneOf": [
261
+ {
262
+ "type": "string"
263
+ },
264
+ {
265
+ "type": "array",
266
+ "items": {
267
+ "type": "string"
268
+ }
269
+ }
270
+ ]
271
+ },
272
+ "forbidden_in": {
273
+ "oneOf": [
274
+ {
275
+ "type": "string"
276
+ },
277
+ {
278
+ "type": "array",
279
+ "items": {
280
+ "type": "string"
281
+ }
282
+ }
283
+ ]
284
+ },
285
+ "fail": {},
286
+ "expose": {
287
+ "description": "audience => wire name, or a list of wire names (aliases).",
288
+ "type": "object",
289
+ "additionalProperties": {
290
+ "oneOf": [
291
+ {
292
+ "$ref": "#/$defs/wire_name"
293
+ },
294
+ {
295
+ "type": "array",
296
+ "minItems": 1,
297
+ "uniqueItems": true,
298
+ "items": {
299
+ "$ref": "#/$defs/wire_name"
300
+ }
301
+ }
302
+ ]
303
+ }
304
+ },
305
+ "min_client": {
306
+ "$ref": "#/$defs/platform_versions"
307
+ },
308
+ "unit": {
309
+ "type": "string"
310
+ },
311
+ "remove_by": {
312
+ "$ref": "#/$defs/date"
313
+ },
314
+ "final": {},
315
+ "permanent": {
316
+ "type": "boolean"
317
+ },
318
+ "bucketing": {
319
+ "type": "object",
320
+ "required": [
321
+ "version",
322
+ "salt"
323
+ ],
324
+ "properties": {
325
+ "version": {
326
+ "type": "integer"
327
+ },
328
+ "salt": {
329
+ "type": "string"
330
+ }
331
+ },
332
+ "additionalProperties": false
333
+ },
334
+ "preset": {
335
+ "enum": [
336
+ "sensor",
337
+ "cutover",
338
+ "shadow"
339
+ ]
340
+ },
341
+ "values": {
342
+ "type": "array",
343
+ "items": {
344
+ "type": "string"
345
+ }
346
+ },
347
+ "variants": {
348
+ "type": "array",
349
+ "items": {
350
+ "type": "string"
351
+ }
352
+ }
353
+ },
354
+ "additionalProperties": false
355
+ },
356
+ "tombstone": {
357
+ "type": "object",
358
+ "required": [
359
+ "key",
360
+ "removed"
361
+ ],
362
+ "properties": {
363
+ "key": {
364
+ "$ref": "#/$defs/flag_key"
365
+ },
366
+ "removed": {
367
+ "$ref": "#/$defs/date"
368
+ },
369
+ "serve": {
370
+ "description": "audience => { wire name => static value }, served with reason STATIC.",
371
+ "type": "object",
372
+ "minProperties": 1,
373
+ "additionalProperties": {
374
+ "type": "object",
375
+ "minProperties": 1,
376
+ "propertyNames": {
377
+ "$ref": "#/$defs/wire_name"
378
+ },
379
+ "additionalProperties": {
380
+ "type": [
381
+ "boolean",
382
+ "string"
383
+ ]
384
+ }
385
+ }
386
+ },
387
+ "until": {
388
+ "$ref": "#/$defs/date"
389
+ },
390
+ "until_clients": {
391
+ "$ref": "#/$defs/platform_versions"
392
+ }
393
+ },
394
+ "additionalProperties": false
395
+ },
396
+ "registry": {
397
+ "type": "object",
398
+ "required": [
399
+ "flags"
400
+ ],
401
+ "properties": {
402
+ "units": {
403
+ "type": "array",
404
+ "items": {
405
+ "type": "string"
406
+ }
407
+ },
408
+ "flags": {
409
+ "type": "array",
410
+ "items": {
411
+ "$ref": "#/$defs/flag"
412
+ }
413
+ },
414
+ "tombstones": {
415
+ "type": "array",
416
+ "items": {
417
+ "$ref": "#/$defs/tombstone"
418
+ }
419
+ }
420
+ },
421
+ "additionalProperties": false
422
+ },
423
+ "evaluation_expected": {
424
+ "type": "object",
425
+ "required": [
426
+ "value",
427
+ "variant",
428
+ "reason"
429
+ ],
430
+ "properties": {
431
+ "value": {
432
+ "$ref": "#/$defs/flag_value"
433
+ },
434
+ "variant": {
435
+ "type": [
436
+ "string",
437
+ "null"
438
+ ]
439
+ },
440
+ "reason": {
441
+ "type": "string"
442
+ },
443
+ "error_code": {
444
+ "type": [
445
+ "string",
446
+ "null"
447
+ ]
448
+ },
449
+ "source_env_var": {
450
+ "type": [
451
+ "string",
452
+ "null"
453
+ ]
454
+ },
455
+ "rule_id": {
456
+ "type": [
457
+ "string",
458
+ "null"
459
+ ]
460
+ }
461
+ },
462
+ "additionalProperties": false
463
+ },
464
+ "rule": {
465
+ "type": "object",
466
+ "required": [
467
+ "key"
468
+ ],
469
+ "properties": {
470
+ "key": {
471
+ "$ref": "#/$defs/flag_key"
472
+ },
473
+ "status": {
474
+ "type": "string"
475
+ },
476
+ "percentage_bps": {
477
+ "type": [
478
+ "integer",
479
+ "null"
480
+ ]
481
+ },
482
+ "rollout_value": {
483
+ "type": [
484
+ "string",
485
+ "null"
486
+ ]
487
+ },
488
+ "variant_weights": {
489
+ "type": "object"
490
+ },
491
+ "fallthrough_value": {
492
+ "type": [
493
+ "string",
494
+ "null"
495
+ ]
496
+ },
497
+ "stop_value": {
498
+ "type": [
499
+ "string",
500
+ "null"
501
+ ]
502
+ },
503
+ "conditions": {
504
+ "description": "Any JSON: some cases store a malformed shape on purpose."
505
+ },
506
+ "cohorts": {},
507
+ "salt": {
508
+ "type": "string"
509
+ },
510
+ "hash_version": {
511
+ "type": "integer"
512
+ }
513
+ },
514
+ "additionalProperties": false
515
+ },
516
+ "cohort": {
517
+ "type": "object",
518
+ "required": [
519
+ "key",
520
+ "unit"
521
+ ],
522
+ "properties": {
523
+ "key": {
524
+ "type": "string"
525
+ },
526
+ "unit": {
527
+ "type": "string"
528
+ },
529
+ "archived": {
530
+ "type": "boolean"
531
+ }
532
+ },
533
+ "additionalProperties": false
534
+ },
535
+ "membership": {
536
+ "type": "object",
537
+ "required": [
538
+ "unit",
539
+ "unit_key",
540
+ "value"
541
+ ],
542
+ "properties": {
543
+ "rule": {
544
+ "type": "string"
545
+ },
546
+ "cohort": {
547
+ "type": "string"
548
+ },
549
+ "unit": {
550
+ "type": "string"
551
+ },
552
+ "unit_key": {
553
+ "type": "string"
554
+ },
555
+ "value": {
556
+ "type": "string"
557
+ },
558
+ "expires_at": {
559
+ "type": "string"
560
+ }
561
+ },
562
+ "additionalProperties": false
563
+ },
564
+ "stored_state": {
565
+ "properties": {
566
+ "rules": {
567
+ "type": "array",
568
+ "items": {
569
+ "$ref": "#/$defs/rule"
570
+ }
571
+ },
572
+ "cohorts": {
573
+ "type": "array",
574
+ "items": {
575
+ "$ref": "#/$defs/cohort"
576
+ }
577
+ },
578
+ "memberships": {
579
+ "type": "array",
580
+ "items": {
581
+ "$ref": "#/$defs/membership"
582
+ }
583
+ }
584
+ }
585
+ },
586
+ "evaluation_suite": {
587
+ "required": [
588
+ "registry",
589
+ "cases"
590
+ ],
591
+ "properties": {
592
+ "registry": {
593
+ "$ref": "#/$defs/registry"
594
+ },
595
+ "cases": {
596
+ "type": "array",
597
+ "minItems": 1,
598
+ "items": {
599
+ "type": "object",
600
+ "required": [
601
+ "name",
602
+ "flag",
603
+ "environment",
604
+ "expected"
605
+ ],
606
+ "properties": {
607
+ "name": {
608
+ "type": "string"
609
+ },
610
+ "scope": {
611
+ "$ref": "#/$defs/scope"
612
+ },
613
+ "flag": {
614
+ "type": "string"
615
+ },
616
+ "environment": {
617
+ "type": "string"
618
+ },
619
+ "env_vars": {
620
+ "$ref": "#/$defs/env_vars"
621
+ },
622
+ "strict": {
623
+ "type": "boolean"
624
+ },
625
+ "expected": {
626
+ "$ref": "#/$defs/evaluation_expected"
627
+ }
628
+ },
629
+ "additionalProperties": false
630
+ }
631
+ }
632
+ }
633
+ },
634
+ "runtime_suite": {
635
+ "required": [
636
+ "registry",
637
+ "cases"
638
+ ],
639
+ "properties": {
640
+ "registry": {
641
+ "$ref": "#/$defs/registry"
642
+ },
643
+ "cases": {
644
+ "type": "array",
645
+ "minItems": 1,
646
+ "items": {
647
+ "type": "object",
648
+ "required": [
649
+ "name",
650
+ "flag",
651
+ "environment",
652
+ "expected"
653
+ ],
654
+ "allOf": [
655
+ {
656
+ "$ref": "#/$defs/stored_state"
657
+ }
658
+ ],
659
+ "properties": {
660
+ "name": {
661
+ "type": "string"
662
+ },
663
+ "scope": {
664
+ "$ref": "#/$defs/scope"
665
+ },
666
+ "flag": {
667
+ "type": "string"
668
+ },
669
+ "environment": {
670
+ "type": "string"
671
+ },
672
+ "env_vars": {
673
+ "$ref": "#/$defs/env_vars"
674
+ },
675
+ "context": {
676
+ "$ref": "#/$defs/context"
677
+ },
678
+ "rules": true,
679
+ "cohorts": true,
680
+ "memberships": true,
681
+ "expected": {
682
+ "$ref": "#/$defs/evaluation_expected"
683
+ }
684
+ },
685
+ "additionalProperties": false
686
+ }
687
+ }
688
+ }
689
+ },
690
+ "operations_suite": {
691
+ "required": [
692
+ "registry",
693
+ "cases"
694
+ ],
695
+ "properties": {
696
+ "registry": {
697
+ "$ref": "#/$defs/registry"
698
+ },
699
+ "cases": {
700
+ "type": "array",
701
+ "minItems": 1,
702
+ "items": {
703
+ "type": "object",
704
+ "required": [
705
+ "name",
706
+ "steps",
707
+ "checks"
708
+ ],
709
+ "properties": {
710
+ "name": {
711
+ "type": "string"
712
+ },
713
+ "scope": {
714
+ "$ref": "#/$defs/scope"
715
+ },
716
+ "env_vars": {
717
+ "$ref": "#/$defs/env_vars"
718
+ },
719
+ "steps": {
720
+ "type": "array",
721
+ "items": {
722
+ "type": "object",
723
+ "required": [
724
+ "op"
725
+ ],
726
+ "properties": {
727
+ "op": {
728
+ "type": "string"
729
+ },
730
+ "target": {
731
+ "type": "string"
732
+ },
733
+ "args": {
734
+ "type": "object"
735
+ },
736
+ "fails": {},
737
+ "expected_revision": {
738
+ "type": "integer"
739
+ }
740
+ },
741
+ "additionalProperties": false
742
+ }
743
+ },
744
+ "checks": {
745
+ "type": "array",
746
+ "items": {
747
+ "type": "object",
748
+ "required": [
749
+ "flag",
750
+ "environment",
751
+ "expected"
752
+ ],
753
+ "properties": {
754
+ "flag": {
755
+ "type": "string"
756
+ },
757
+ "environment": {
758
+ "type": "string"
759
+ },
760
+ "context": {
761
+ "$ref": "#/$defs/context"
762
+ },
763
+ "expected": {
764
+ "$ref": "#/$defs/evaluation_expected"
765
+ }
766
+ },
767
+ "additionalProperties": false
768
+ }
769
+ }
770
+ },
771
+ "additionalProperties": false
772
+ }
773
+ }
774
+ }
775
+ },
776
+ "bucket_vectors_suite": {
777
+ "required": [
778
+ "vectors"
779
+ ],
780
+ "properties": {
781
+ "vectors": {
782
+ "type": "array",
783
+ "minItems": 1,
784
+ "items": {
785
+ "type": "object",
786
+ "required": [
787
+ "version",
788
+ "salt",
789
+ "unit_key",
790
+ "bucket"
791
+ ],
792
+ "properties": {
793
+ "version": {
794
+ "enum": [
795
+ 1,
796
+ 2
797
+ ]
798
+ },
799
+ "decision": {
800
+ "type": "string"
801
+ },
802
+ "salt": {
803
+ "type": [
804
+ "string",
805
+ "null"
806
+ ]
807
+ },
808
+ "unit_key": {
809
+ "type": [
810
+ "string",
811
+ "null"
812
+ ]
813
+ },
814
+ "bucket": {
815
+ "type": [
816
+ "integer",
817
+ "null"
818
+ ],
819
+ "minimum": 0,
820
+ "maximum": 9999
821
+ }
822
+ },
823
+ "additionalProperties": false
824
+ }
825
+ }
826
+ }
827
+ },
828
+ "version_ranges_suite": {
829
+ "required": [
830
+ "cases",
831
+ "invalid_ranges"
832
+ ],
833
+ "properties": {
834
+ "cases": {
835
+ "type": "array",
836
+ "minItems": 1,
837
+ "items": {
838
+ "type": "object",
839
+ "required": [
840
+ "range",
841
+ "version",
842
+ "matched"
843
+ ],
844
+ "properties": {
845
+ "range": {
846
+ "type": "string"
847
+ },
848
+ "version": {
849
+ "type": [
850
+ "string",
851
+ "null"
852
+ ],
853
+ "description": "null: no client version."
854
+ },
855
+ "matched": {
856
+ "type": "boolean"
857
+ },
858
+ "server_matched": {
859
+ "type": "boolean",
860
+ "description": "What the Ruby server's read path gives, when it differs from matched (clients ignore it)."
861
+ }
862
+ },
863
+ "additionalProperties": false
864
+ }
865
+ },
866
+ "invalid_ranges": {
867
+ "type": "array",
868
+ "items": {
869
+ "type": "string"
870
+ }
871
+ },
872
+ "build_cases": {
873
+ "type": "array",
874
+ "items": {
875
+ "type": "object",
876
+ "required": [
877
+ "range",
878
+ "build",
879
+ "matched"
880
+ ],
881
+ "properties": {
882
+ "range": {
883
+ "type": "string"
884
+ },
885
+ "build": {
886
+ "type": [
887
+ "string",
888
+ "integer",
889
+ "null"
890
+ ]
891
+ },
892
+ "matched": {
893
+ "type": "boolean"
894
+ }
895
+ },
896
+ "additionalProperties": false
897
+ }
898
+ },
899
+ "invalid_build_ranges": {
900
+ "type": "array",
901
+ "items": {
902
+ "type": "string"
903
+ }
904
+ }
905
+ }
906
+ },
907
+ "ofrep_entry": {
908
+ "oneOf": [
909
+ {
910
+ "type": "object",
911
+ "required": [
912
+ "key",
913
+ "value",
914
+ "reason",
915
+ "variant"
916
+ ],
917
+ "properties": {
918
+ "key": {
919
+ "$ref": "#/$defs/wire_name"
920
+ },
921
+ "value": {
922
+ "type": [
923
+ "boolean",
924
+ "string"
925
+ ]
926
+ },
927
+ "reason": {
928
+ "enum": [
929
+ "STATIC",
930
+ "DEFAULT",
931
+ "TARGETING_MATCH",
932
+ "SPLIT",
933
+ "DISABLED",
934
+ "ENV_PIN",
935
+ "KILL_SWITCH"
936
+ ]
937
+ },
938
+ "variant": {
939
+ "type": "string"
940
+ }
941
+ },
942
+ "additionalProperties": false
943
+ },
944
+ {
945
+ "type": "object",
946
+ "required": [
947
+ "key",
948
+ "errorCode",
949
+ "errorDetails"
950
+ ],
951
+ "properties": {
952
+ "key": {
953
+ "$ref": "#/$defs/wire_name"
954
+ },
955
+ "errorCode": {
956
+ "enum": [
957
+ "PARSE_ERROR",
958
+ "TARGETING_KEY_MISSING",
959
+ "INVALID_CONTEXT",
960
+ "GENERAL"
961
+ ]
962
+ },
963
+ "errorDetails": {
964
+ "type": "string"
965
+ }
966
+ },
967
+ "additionalProperties": false
968
+ }
969
+ ]
970
+ },
971
+ "delivery_suite": {
972
+ "required": [
973
+ "registry",
974
+ "cases",
975
+ "environment",
976
+ "today",
977
+ "never_on_wire"
978
+ ],
979
+ "properties": {
980
+ "registry": {
981
+ "$ref": "#/$defs/registry"
982
+ },
983
+ "environment": {
984
+ "type": "string"
985
+ },
986
+ "today": {
987
+ "$ref": "#/$defs/date"
988
+ },
989
+ "never_on_wire": {
990
+ "type": "array",
991
+ "items": {
992
+ "type": "string",
993
+ "minLength": 1
994
+ }
995
+ },
996
+ "cases": {
997
+ "type": "array",
998
+ "minItems": 1,
999
+ "items": {
1000
+ "type": "object",
1001
+ "required": [
1002
+ "name",
1003
+ "audience",
1004
+ "expected"
1005
+ ],
1006
+ "allOf": [
1007
+ {
1008
+ "$ref": "#/$defs/stored_state"
1009
+ }
1010
+ ],
1011
+ "properties": {
1012
+ "name": {
1013
+ "type": "string"
1014
+ },
1015
+ "scope": {
1016
+ "$ref": "#/$defs/scope"
1017
+ },
1018
+ "audience": {
1019
+ "type": "string"
1020
+ },
1021
+ "environment": {
1022
+ "type": "string"
1023
+ },
1024
+ "today": {
1025
+ "$ref": "#/$defs/date"
1026
+ },
1027
+ "env_vars": {
1028
+ "$ref": "#/$defs/env_vars"
1029
+ },
1030
+ "context": {
1031
+ "$ref": "#/$defs/context"
1032
+ },
1033
+ "rules": true,
1034
+ "cohorts": true,
1035
+ "memberships": true,
1036
+ "etag_same_as": {
1037
+ "type": "string"
1038
+ },
1039
+ "etag_differs_from": {
1040
+ "type": "array",
1041
+ "items": {
1042
+ "type": "string"
1043
+ }
1044
+ },
1045
+ "expected": {
1046
+ "type": "object",
1047
+ "required": [
1048
+ "flags",
1049
+ "etag"
1050
+ ],
1051
+ "properties": {
1052
+ "flags": {
1053
+ "type": "array",
1054
+ "items": {
1055
+ "$ref": "#/$defs/ofrep_entry"
1056
+ }
1057
+ },
1058
+ "etag": {
1059
+ "type": "string",
1060
+ "pattern": "^[0-9a-f]{64}$"
1061
+ }
1062
+ },
1063
+ "additionalProperties": false
1064
+ }
1065
+ },
1066
+ "additionalProperties": false
1067
+ }
1068
+ }
1069
+ }
1070
+ },
1071
+ "declared_flag": {
1072
+ "type": "object",
1073
+ "required": [
1074
+ "type",
1075
+ "default"
1076
+ ],
1077
+ "properties": {
1078
+ "type": {
1079
+ "enum": [
1080
+ "boolean",
1081
+ "string"
1082
+ ]
1083
+ },
1084
+ "default": {
1085
+ "type": [
1086
+ "boolean",
1087
+ "string"
1088
+ ]
1089
+ },
1090
+ "values": {
1091
+ "type": "array",
1092
+ "items": {
1093
+ "type": "string"
1094
+ }
1095
+ },
1096
+ "ceiling": {
1097
+ "type": "boolean"
1098
+ }
1099
+ },
1100
+ "additionalProperties": false,
1101
+ "if": {
1102
+ "properties": {
1103
+ "type": {
1104
+ "const": "boolean"
1105
+ }
1106
+ }
1107
+ },
1108
+ "then": {
1109
+ "properties": {
1110
+ "default": {
1111
+ "type": "boolean"
1112
+ },
1113
+ "values": false
1114
+ }
1115
+ },
1116
+ "else": {
1117
+ "properties": {
1118
+ "default": {
1119
+ "type": "string"
1120
+ },
1121
+ "ceiling": false
1122
+ }
1123
+ }
1124
+ },
1125
+ "read": {
1126
+ "type": "object",
1127
+ "required": [
1128
+ "state",
1129
+ "value",
1130
+ "reason"
1131
+ ],
1132
+ "properties": {
1133
+ "state": {
1134
+ "enum": [
1135
+ "on",
1136
+ "off",
1137
+ "loaded",
1138
+ "not_loaded"
1139
+ ]
1140
+ },
1141
+ "value": {
1142
+ "type": [
1143
+ "boolean",
1144
+ "string"
1145
+ ]
1146
+ },
1147
+ "reason": {
1148
+ "type": [
1149
+ "string",
1150
+ "null"
1151
+ ]
1152
+ }
1153
+ },
1154
+ "additionalProperties": false
1155
+ },
1156
+ "client_state_step": {
1157
+ "type": "object",
1158
+ "required": [
1159
+ "expected"
1160
+ ],
1161
+ "oneOf": [
1162
+ {
1163
+ "required": [
1164
+ "payload"
1165
+ ]
1166
+ },
1167
+ {
1168
+ "required": [
1169
+ "raw"
1170
+ ]
1171
+ },
1172
+ {
1173
+ "required": [
1174
+ "not_modified"
1175
+ ]
1176
+ }
1177
+ ],
1178
+ "properties": {
1179
+ "payload": {},
1180
+ "raw": {
1181
+ "type": "string"
1182
+ },
1183
+ "not_modified": {
1184
+ "const": true
1185
+ },
1186
+ "expected": {
1187
+ "type": "object",
1188
+ "required": [
1189
+ "accepted",
1190
+ "version",
1191
+ "reads"
1192
+ ],
1193
+ "properties": {
1194
+ "accepted": {
1195
+ "type": "boolean"
1196
+ },
1197
+ "version": {
1198
+ "type": [
1199
+ "string",
1200
+ "null"
1201
+ ]
1202
+ },
1203
+ "reads": {
1204
+ "type": "object",
1205
+ "additionalProperties": {
1206
+ "$ref": "#/$defs/read"
1207
+ }
1208
+ }
1209
+ },
1210
+ "additionalProperties": false
1211
+ }
1212
+ },
1213
+ "additionalProperties": false
1214
+ },
1215
+ "client_state_suite": {
1216
+ "required": [
1217
+ "limits",
1218
+ "declared",
1219
+ "cases"
1220
+ ],
1221
+ "properties": {
1222
+ "limits": {
1223
+ "type": "object",
1224
+ "required": [
1225
+ "max_bytes",
1226
+ "max_flags"
1227
+ ],
1228
+ "properties": {
1229
+ "max_bytes": {
1230
+ "type": "integer",
1231
+ "minimum": 1
1232
+ },
1233
+ "max_flags": {
1234
+ "type": "integer",
1235
+ "minimum": 1
1236
+ }
1237
+ },
1238
+ "additionalProperties": false
1239
+ },
1240
+ "declared": {
1241
+ "type": "object",
1242
+ "propertyNames": {
1243
+ "$ref": "#/$defs/wire_name"
1244
+ },
1245
+ "additionalProperties": {
1246
+ "$ref": "#/$defs/declared_flag"
1247
+ }
1248
+ },
1249
+ "cases": {
1250
+ "type": "array",
1251
+ "minItems": 1,
1252
+ "items": {
1253
+ "type": "object",
1254
+ "required": [
1255
+ "name",
1256
+ "steps"
1257
+ ],
1258
+ "properties": {
1259
+ "name": {
1260
+ "type": "string"
1261
+ },
1262
+ "scope": {
1263
+ "$ref": "#/$defs/scope"
1264
+ },
1265
+ "declared": {
1266
+ "type": "object",
1267
+ "additionalProperties": {
1268
+ "$ref": "#/$defs/declared_flag"
1269
+ }
1270
+ },
1271
+ "steps": {
1272
+ "type": "array",
1273
+ "minItems": 1,
1274
+ "items": {
1275
+ "$ref": "#/$defs/client_state_step"
1276
+ }
1277
+ }
1278
+ },
1279
+ "additionalProperties": false
1280
+ }
1281
+ }
1282
+ }
1283
+ },
1284
+ "legacy_ranges_suite": {
1285
+ "description": "Server only: version ranges stored by 0.2.x in RubyGems syntax, as Gem::Requirement evaluates them.",
1286
+ "required": [
1287
+ "translations",
1288
+ "cases"
1289
+ ],
1290
+ "properties": {
1291
+ "translations": {
1292
+ "type": "array",
1293
+ "items": {
1294
+ "type": "object",
1295
+ "required": [
1296
+ "range",
1297
+ "neutral"
1298
+ ],
1299
+ "properties": {
1300
+ "range": {
1301
+ "type": "string"
1302
+ },
1303
+ "neutral": {
1304
+ "type": [
1305
+ "string",
1306
+ "null"
1307
+ ]
1308
+ }
1309
+ },
1310
+ "additionalProperties": false
1311
+ }
1312
+ },
1313
+ "cases": {
1314
+ "type": "array",
1315
+ "minItems": 1,
1316
+ "items": {
1317
+ "type": "object",
1318
+ "required": [
1319
+ "range",
1320
+ "version",
1321
+ "matched"
1322
+ ],
1323
+ "properties": {
1324
+ "range": {
1325
+ "type": "string"
1326
+ },
1327
+ "version": {
1328
+ "type": "string"
1329
+ },
1330
+ "matched": {
1331
+ "type": "boolean"
1332
+ }
1333
+ },
1334
+ "additionalProperties": false
1335
+ }
1336
+ }
1337
+ }
1338
+ }
1339
+ }
1340
+ }