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,1541 @@
1
+ {
2
+ "description": "Delivery: a registry, a context (units, client) and stored rules in; the OFREP entries a client audience is told, and their ETag, out. Entries are ordered by key (the wire name). Every alias of a flag carries the same evaluation; a flag with min_client is withheld from a client on a listed platform below the minimum, on a listed platform with an unknown version, or with no platform; a tombstone's static wires are served (reason STATIC) through `until` (a UTC date) and to clients below `until_clients`, and to clients of unknown version or of a platform it doesn't list. An errored flag is an OFREP evaluationFailure. The etag is the SHA-256 (lowercase hex) of the RFC 8785 (JCS) canonical JSON (keys sorted, no whitespace, strings as raw UTF-8 with only the escapes JCS requires; no numbers occur) of {\"audience\": <audience>, \"flags\": <entries>}. etag_same_as / etag_differs_from name earlier cases. Servers produce these; clients can use each expected body as a golden OFREP payload. No case's payload may contain any string in never_on_wire.",
3
+ "suite": "delivery",
4
+ "scope": "wire",
5
+ "environment": "production",
6
+ "today": "2026-12-01",
7
+ "never_on_wire": [
8
+ "internal_only",
9
+ "new_checkout",
10
+ "strict_gates",
11
+ "home_hero",
12
+ "broken_flag",
13
+ "STANDARD_FLAGS_",
14
+ "ACME_AI_DISABLED",
15
+ "acct_a",
16
+ "acct_b",
17
+ "acct_c",
18
+ "rule_id",
19
+ "source_env_var",
20
+ "allow",
21
+ "fallthrough",
22
+ "kiosk_theme",
23
+ "banner_v1"
24
+ ],
25
+ "registry": {
26
+ "units": [
27
+ "account"
28
+ ],
29
+ "flags": [
30
+ {
31
+ "kind": "kill_switch",
32
+ "key": "ai",
33
+ "owner": "assistant",
34
+ "env": [
35
+ "ACME_AI_DISABLED"
36
+ ],
37
+ "inverted": true,
38
+ "expose": {
39
+ "mobile": [
40
+ "chat_enabled",
41
+ "insights_enabled"
42
+ ],
43
+ "web": "ai"
44
+ }
45
+ },
46
+ {
47
+ "kind": "flag",
48
+ "key": "new_checkout",
49
+ "owner": "payments",
50
+ "remove_by": "2027-01-01",
51
+ "final": true,
52
+ "unit": "account",
53
+ "expose": {
54
+ "mobile": "checkoutV2"
55
+ },
56
+ "min_client": {
57
+ "android": "0.4.0",
58
+ "ios": "0.4.0"
59
+ }
60
+ },
61
+ {
62
+ "kind": "mode",
63
+ "key": "strict_gates",
64
+ "owner": "platform",
65
+ "preset": "sensor",
66
+ "expose": {
67
+ "mobile": "gates"
68
+ }
69
+ },
70
+ {
71
+ "kind": "experiment",
72
+ "key": "home_hero",
73
+ "owner": "growth",
74
+ "variants": [
75
+ "control",
76
+ "savings"
77
+ ],
78
+ "unit": "account",
79
+ "expose": {
80
+ "mobile": "homeHero"
81
+ }
82
+ },
83
+ {
84
+ "kind": "flag",
85
+ "key": "broken_flag",
86
+ "owner": "platform",
87
+ "remove_by": "2027-01-01",
88
+ "final": true,
89
+ "expose": {
90
+ "mobile": "brokenFlag"
91
+ }
92
+ },
93
+ {
94
+ "kind": "flag",
95
+ "key": "internal_only",
96
+ "owner": "platform",
97
+ "remove_by": "2027-01-01",
98
+ "final": true,
99
+ "unit": "account"
100
+ },
101
+ {
102
+ "kind": "experiment",
103
+ "key": "kiosk_theme",
104
+ "owner": "growth",
105
+ "variants": [
106
+ "contrôle",
107
+ "café"
108
+ ],
109
+ "expose": {
110
+ "kiosk": "theme"
111
+ }
112
+ }
113
+ ],
114
+ "tombstones": [
115
+ {
116
+ "key": "chat_v1",
117
+ "removed": "2026-11-01",
118
+ "serve": {
119
+ "mobile": {
120
+ "chat_v1": false,
121
+ "chatMode": "legacy"
122
+ }
123
+ },
124
+ "until": "2027-03-01",
125
+ "until_clients": {
126
+ "android": "0.6.0"
127
+ }
128
+ },
129
+ {
130
+ "key": "old_banner",
131
+ "removed": "2026-01-01"
132
+ },
133
+ {
134
+ "key": "banner_v1",
135
+ "removed": "2026-11-01",
136
+ "serve": {
137
+ "kiosk": {
138
+ "bannerText": "Grüße 
 \u0001 \" / \\  – ok"
139
+ }
140
+ },
141
+ "until": "2027-03-01"
142
+ }
143
+ ]
144
+ },
145
+ "cases": [
146
+ {
147
+ "name": "a client that sends nothing gets aliases and static wires but no min_client flag",
148
+ "audience": "mobile",
149
+ "context": {
150
+ "units": {
151
+ "account": "acct_a"
152
+ },
153
+ "client": {}
154
+ },
155
+ "expected": {
156
+ "flags": [
157
+ {
158
+ "key": "brokenFlag",
159
+ "value": false,
160
+ "reason": "DEFAULT",
161
+ "variant": "off"
162
+ },
163
+ {
164
+ "key": "chatMode",
165
+ "value": "legacy",
166
+ "reason": "STATIC",
167
+ "variant": "legacy"
168
+ },
169
+ {
170
+ "key": "chat_enabled",
171
+ "value": true,
172
+ "reason": "DEFAULT",
173
+ "variant": "on"
174
+ },
175
+ {
176
+ "key": "chat_v1",
177
+ "value": false,
178
+ "reason": "STATIC",
179
+ "variant": "off"
180
+ },
181
+ {
182
+ "key": "gates",
183
+ "value": "off",
184
+ "reason": "DEFAULT",
185
+ "variant": "off"
186
+ },
187
+ {
188
+ "key": "homeHero",
189
+ "value": "control",
190
+ "reason": "DEFAULT",
191
+ "variant": "control"
192
+ },
193
+ {
194
+ "key": "insights_enabled",
195
+ "value": true,
196
+ "reason": "DEFAULT",
197
+ "variant": "on"
198
+ }
199
+ ],
200
+ "etag": "8f2706a498ed2b077d8c6d99ca03cbc8bb0d03d160882c798e64271798fc217c"
201
+ }
202
+ },
203
+ {
204
+ "name": "an android build at the minimum gets the min_client flag",
205
+ "audience": "mobile",
206
+ "context": {
207
+ "units": {
208
+ "account": "acct_a"
209
+ },
210
+ "client": {
211
+ "platform": "android",
212
+ "version": "0.4.0"
213
+ }
214
+ },
215
+ "expected": {
216
+ "flags": [
217
+ {
218
+ "key": "brokenFlag",
219
+ "value": false,
220
+ "reason": "DEFAULT",
221
+ "variant": "off"
222
+ },
223
+ {
224
+ "key": "chatMode",
225
+ "value": "legacy",
226
+ "reason": "STATIC",
227
+ "variant": "legacy"
228
+ },
229
+ {
230
+ "key": "chat_enabled",
231
+ "value": true,
232
+ "reason": "DEFAULT",
233
+ "variant": "on"
234
+ },
235
+ {
236
+ "key": "chat_v1",
237
+ "value": false,
238
+ "reason": "STATIC",
239
+ "variant": "off"
240
+ },
241
+ {
242
+ "key": "checkoutV2",
243
+ "value": false,
244
+ "reason": "DEFAULT",
245
+ "variant": "off"
246
+ },
247
+ {
248
+ "key": "gates",
249
+ "value": "off",
250
+ "reason": "DEFAULT",
251
+ "variant": "off"
252
+ },
253
+ {
254
+ "key": "homeHero",
255
+ "value": "control",
256
+ "reason": "DEFAULT",
257
+ "variant": "control"
258
+ },
259
+ {
260
+ "key": "insights_enabled",
261
+ "value": true,
262
+ "reason": "DEFAULT",
263
+ "variant": "on"
264
+ }
265
+ ],
266
+ "etag": "4b2eec86554cc58a8193f835194c8bf275384eaf4b9afa50aab1a960055dd564"
267
+ }
268
+ },
269
+ {
270
+ "name": "an older android build doesn't",
271
+ "audience": "mobile",
272
+ "context": {
273
+ "units": {
274
+ "account": "acct_a"
275
+ },
276
+ "client": {
277
+ "platform": "android",
278
+ "version": "0.3.9"
279
+ }
280
+ },
281
+ "etag_same_as": "a client that sends nothing gets aliases and static wires but no min_client flag",
282
+ "expected": {
283
+ "flags": [
284
+ {
285
+ "key": "brokenFlag",
286
+ "value": false,
287
+ "reason": "DEFAULT",
288
+ "variant": "off"
289
+ },
290
+ {
291
+ "key": "chatMode",
292
+ "value": "legacy",
293
+ "reason": "STATIC",
294
+ "variant": "legacy"
295
+ },
296
+ {
297
+ "key": "chat_enabled",
298
+ "value": true,
299
+ "reason": "DEFAULT",
300
+ "variant": "on"
301
+ },
302
+ {
303
+ "key": "chat_v1",
304
+ "value": false,
305
+ "reason": "STATIC",
306
+ "variant": "off"
307
+ },
308
+ {
309
+ "key": "gates",
310
+ "value": "off",
311
+ "reason": "DEFAULT",
312
+ "variant": "off"
313
+ },
314
+ {
315
+ "key": "homeHero",
316
+ "value": "control",
317
+ "reason": "DEFAULT",
318
+ "variant": "control"
319
+ },
320
+ {
321
+ "key": "insights_enabled",
322
+ "value": true,
323
+ "reason": "DEFAULT",
324
+ "variant": "on"
325
+ }
326
+ ],
327
+ "etag": "8f2706a498ed2b077d8c6d99ca03cbc8bb0d03d160882c798e64271798fc217c"
328
+ }
329
+ },
330
+ {
331
+ "name": "a prerelease of the minimum is older than it",
332
+ "audience": "mobile",
333
+ "context": {
334
+ "client": {
335
+ "platform": "android",
336
+ "version": "0.4.0-rc.1"
337
+ }
338
+ },
339
+ "expected": {
340
+ "flags": [
341
+ {
342
+ "key": "brokenFlag",
343
+ "value": false,
344
+ "reason": "DEFAULT",
345
+ "variant": "off"
346
+ },
347
+ {
348
+ "key": "chatMode",
349
+ "value": "legacy",
350
+ "reason": "STATIC",
351
+ "variant": "legacy"
352
+ },
353
+ {
354
+ "key": "chat_enabled",
355
+ "value": true,
356
+ "reason": "DEFAULT",
357
+ "variant": "on"
358
+ },
359
+ {
360
+ "key": "chat_v1",
361
+ "value": false,
362
+ "reason": "STATIC",
363
+ "variant": "off"
364
+ },
365
+ {
366
+ "key": "gates",
367
+ "value": "off",
368
+ "reason": "DEFAULT",
369
+ "variant": "off"
370
+ },
371
+ {
372
+ "key": "homeHero",
373
+ "value": "control",
374
+ "reason": "DEFAULT",
375
+ "variant": "control"
376
+ },
377
+ {
378
+ "key": "insights_enabled",
379
+ "value": true,
380
+ "reason": "DEFAULT",
381
+ "variant": "on"
382
+ }
383
+ ],
384
+ "etag": "8f2706a498ed2b077d8c6d99ca03cbc8bb0d03d160882c798e64271798fc217c"
385
+ }
386
+ },
387
+ {
388
+ "name": "a listed platform with no version is an unknown build",
389
+ "audience": "mobile",
390
+ "context": {
391
+ "client": {
392
+ "platform": "android"
393
+ }
394
+ },
395
+ "expected": {
396
+ "flags": [
397
+ {
398
+ "key": "brokenFlag",
399
+ "value": false,
400
+ "reason": "DEFAULT",
401
+ "variant": "off"
402
+ },
403
+ {
404
+ "key": "chatMode",
405
+ "value": "legacy",
406
+ "reason": "STATIC",
407
+ "variant": "legacy"
408
+ },
409
+ {
410
+ "key": "chat_enabled",
411
+ "value": true,
412
+ "reason": "DEFAULT",
413
+ "variant": "on"
414
+ },
415
+ {
416
+ "key": "chat_v1",
417
+ "value": false,
418
+ "reason": "STATIC",
419
+ "variant": "off"
420
+ },
421
+ {
422
+ "key": "gates",
423
+ "value": "off",
424
+ "reason": "DEFAULT",
425
+ "variant": "off"
426
+ },
427
+ {
428
+ "key": "homeHero",
429
+ "value": "control",
430
+ "reason": "DEFAULT",
431
+ "variant": "control"
432
+ },
433
+ {
434
+ "key": "insights_enabled",
435
+ "value": true,
436
+ "reason": "DEFAULT",
437
+ "variant": "on"
438
+ }
439
+ ],
440
+ "etag": "8f2706a498ed2b077d8c6d99ca03cbc8bb0d03d160882c798e64271798fc217c"
441
+ }
442
+ },
443
+ {
444
+ "name": "a version that doesn't parse is an unknown build",
445
+ "audience": "mobile",
446
+ "context": {
447
+ "client": {
448
+ "platform": "ios",
449
+ "version": "four"
450
+ }
451
+ },
452
+ "expected": {
453
+ "flags": [
454
+ {
455
+ "key": "brokenFlag",
456
+ "value": false,
457
+ "reason": "DEFAULT",
458
+ "variant": "off"
459
+ },
460
+ {
461
+ "key": "chatMode",
462
+ "value": "legacy",
463
+ "reason": "STATIC",
464
+ "variant": "legacy"
465
+ },
466
+ {
467
+ "key": "chat_enabled",
468
+ "value": true,
469
+ "reason": "DEFAULT",
470
+ "variant": "on"
471
+ },
472
+ {
473
+ "key": "chat_v1",
474
+ "value": false,
475
+ "reason": "STATIC",
476
+ "variant": "off"
477
+ },
478
+ {
479
+ "key": "gates",
480
+ "value": "off",
481
+ "reason": "DEFAULT",
482
+ "variant": "off"
483
+ },
484
+ {
485
+ "key": "homeHero",
486
+ "value": "control",
487
+ "reason": "DEFAULT",
488
+ "variant": "control"
489
+ },
490
+ {
491
+ "key": "insights_enabled",
492
+ "value": true,
493
+ "reason": "DEFAULT",
494
+ "variant": "on"
495
+ }
496
+ ],
497
+ "etag": "8f2706a498ed2b077d8c6d99ca03cbc8bb0d03d160882c798e64271798fc217c"
498
+ }
499
+ },
500
+ {
501
+ "name": "a platform min_client doesn't list is unaffected",
502
+ "audience": "mobile",
503
+ "context": {
504
+ "client": {
505
+ "platform": "web"
506
+ }
507
+ },
508
+ "expected": {
509
+ "flags": [
510
+ {
511
+ "key": "brokenFlag",
512
+ "value": false,
513
+ "reason": "DEFAULT",
514
+ "variant": "off"
515
+ },
516
+ {
517
+ "key": "chatMode",
518
+ "value": "legacy",
519
+ "reason": "STATIC",
520
+ "variant": "legacy"
521
+ },
522
+ {
523
+ "key": "chat_enabled",
524
+ "value": true,
525
+ "reason": "DEFAULT",
526
+ "variant": "on"
527
+ },
528
+ {
529
+ "key": "chat_v1",
530
+ "value": false,
531
+ "reason": "STATIC",
532
+ "variant": "off"
533
+ },
534
+ {
535
+ "key": "checkoutV2",
536
+ "value": false,
537
+ "reason": "DEFAULT",
538
+ "variant": "off"
539
+ },
540
+ {
541
+ "key": "gates",
542
+ "value": "off",
543
+ "reason": "DEFAULT",
544
+ "variant": "off"
545
+ },
546
+ {
547
+ "key": "homeHero",
548
+ "value": "control",
549
+ "reason": "DEFAULT",
550
+ "variant": "control"
551
+ },
552
+ {
553
+ "key": "insights_enabled",
554
+ "value": true,
555
+ "reason": "DEFAULT",
556
+ "variant": "on"
557
+ }
558
+ ],
559
+ "etag": "4b2eec86554cc58a8193f835194c8bf275384eaf4b9afa50aab1a960055dd564"
560
+ }
561
+ },
562
+ {
563
+ "name": "an unrecognised platform (stored as \"unknown\") is an unknown build",
564
+ "audience": "mobile",
565
+ "context": {
566
+ "client": {
567
+ "platform": "unknown",
568
+ "version": "9.0.0"
569
+ }
570
+ },
571
+ "etag_same_as": "a client that sends nothing gets aliases and static wires but no min_client flag",
572
+ "expected": {
573
+ "flags": [
574
+ {
575
+ "key": "brokenFlag",
576
+ "value": false,
577
+ "reason": "DEFAULT",
578
+ "variant": "off"
579
+ },
580
+ {
581
+ "key": "chatMode",
582
+ "value": "legacy",
583
+ "reason": "STATIC",
584
+ "variant": "legacy"
585
+ },
586
+ {
587
+ "key": "chat_enabled",
588
+ "value": true,
589
+ "reason": "DEFAULT",
590
+ "variant": "on"
591
+ },
592
+ {
593
+ "key": "chat_v1",
594
+ "value": false,
595
+ "reason": "STATIC",
596
+ "variant": "off"
597
+ },
598
+ {
599
+ "key": "gates",
600
+ "value": "off",
601
+ "reason": "DEFAULT",
602
+ "variant": "off"
603
+ },
604
+ {
605
+ "key": "homeHero",
606
+ "value": "control",
607
+ "reason": "DEFAULT",
608
+ "variant": "control"
609
+ },
610
+ {
611
+ "key": "insights_enabled",
612
+ "value": true,
613
+ "reason": "DEFAULT",
614
+ "variant": "on"
615
+ }
616
+ ],
617
+ "etag": "8f2706a498ed2b077d8c6d99ca03cbc8bb0d03d160882c798e64271798fc217c"
618
+ }
619
+ },
620
+ {
621
+ "name": "a kill switch pinned off serves KILL_SWITCH on every alias",
622
+ "audience": "mobile",
623
+ "env_vars": {
624
+ "STANDARD_FLAGS_AI": "off"
625
+ },
626
+ "context": {
627
+ "client": {
628
+ "platform": "ios",
629
+ "version": "1.0.0"
630
+ }
631
+ },
632
+ "expected": {
633
+ "flags": [
634
+ {
635
+ "key": "brokenFlag",
636
+ "value": false,
637
+ "reason": "DEFAULT",
638
+ "variant": "off"
639
+ },
640
+ {
641
+ "key": "chatMode",
642
+ "value": "legacy",
643
+ "reason": "STATIC",
644
+ "variant": "legacy"
645
+ },
646
+ {
647
+ "key": "chat_enabled",
648
+ "value": false,
649
+ "reason": "KILL_SWITCH",
650
+ "variant": "off"
651
+ },
652
+ {
653
+ "key": "chat_v1",
654
+ "value": false,
655
+ "reason": "STATIC",
656
+ "variant": "off"
657
+ },
658
+ {
659
+ "key": "checkoutV2",
660
+ "value": false,
661
+ "reason": "DEFAULT",
662
+ "variant": "off"
663
+ },
664
+ {
665
+ "key": "gates",
666
+ "value": "off",
667
+ "reason": "DEFAULT",
668
+ "variant": "off"
669
+ },
670
+ {
671
+ "key": "homeHero",
672
+ "value": "control",
673
+ "reason": "DEFAULT",
674
+ "variant": "control"
675
+ },
676
+ {
677
+ "key": "insights_enabled",
678
+ "value": false,
679
+ "reason": "KILL_SWITCH",
680
+ "variant": "off"
681
+ }
682
+ ],
683
+ "etag": "4a6e43c57f6a9048be283fc2f566e1a2ed22f75d51580e1fbd9710b3d17d4966"
684
+ }
685
+ },
686
+ {
687
+ "name": "a legacy variable reads as KILL_SWITCH too, and its name never leaves",
688
+ "audience": "mobile",
689
+ "env_vars": {
690
+ "ACME_AI_DISABLED": "true"
691
+ },
692
+ "context": {
693
+ "client": {
694
+ "platform": "ios",
695
+ "version": "1.0.0"
696
+ }
697
+ },
698
+ "etag_same_as": "a kill switch pinned off serves KILL_SWITCH on every alias",
699
+ "expected": {
700
+ "flags": [
701
+ {
702
+ "key": "brokenFlag",
703
+ "value": false,
704
+ "reason": "DEFAULT",
705
+ "variant": "off"
706
+ },
707
+ {
708
+ "key": "chatMode",
709
+ "value": "legacy",
710
+ "reason": "STATIC",
711
+ "variant": "legacy"
712
+ },
713
+ {
714
+ "key": "chat_enabled",
715
+ "value": false,
716
+ "reason": "KILL_SWITCH",
717
+ "variant": "off"
718
+ },
719
+ {
720
+ "key": "chat_v1",
721
+ "value": false,
722
+ "reason": "STATIC",
723
+ "variant": "off"
724
+ },
725
+ {
726
+ "key": "checkoutV2",
727
+ "value": false,
728
+ "reason": "DEFAULT",
729
+ "variant": "off"
730
+ },
731
+ {
732
+ "key": "gates",
733
+ "value": "off",
734
+ "reason": "DEFAULT",
735
+ "variant": "off"
736
+ },
737
+ {
738
+ "key": "homeHero",
739
+ "value": "control",
740
+ "reason": "DEFAULT",
741
+ "variant": "control"
742
+ },
743
+ {
744
+ "key": "insights_enabled",
745
+ "value": false,
746
+ "reason": "KILL_SWITCH",
747
+ "variant": "off"
748
+ }
749
+ ],
750
+ "etag": "4a6e43c57f6a9048be283fc2f566e1a2ed22f75d51580e1fbd9710b3d17d4966"
751
+ }
752
+ },
753
+ {
754
+ "name": "an ENV pin serves ENV_PIN",
755
+ "audience": "mobile",
756
+ "env_vars": {
757
+ "STANDARD_FLAGS_STRICT_GATES": "on"
758
+ },
759
+ "context": {
760
+ "client": {
761
+ "platform": "ios",
762
+ "version": "1.0.0"
763
+ }
764
+ },
765
+ "expected": {
766
+ "flags": [
767
+ {
768
+ "key": "brokenFlag",
769
+ "value": false,
770
+ "reason": "DEFAULT",
771
+ "variant": "off"
772
+ },
773
+ {
774
+ "key": "chatMode",
775
+ "value": "legacy",
776
+ "reason": "STATIC",
777
+ "variant": "legacy"
778
+ },
779
+ {
780
+ "key": "chat_enabled",
781
+ "value": true,
782
+ "reason": "DEFAULT",
783
+ "variant": "on"
784
+ },
785
+ {
786
+ "key": "chat_v1",
787
+ "value": false,
788
+ "reason": "STATIC",
789
+ "variant": "off"
790
+ },
791
+ {
792
+ "key": "checkoutV2",
793
+ "value": false,
794
+ "reason": "DEFAULT",
795
+ "variant": "off"
796
+ },
797
+ {
798
+ "key": "gates",
799
+ "value": "on",
800
+ "reason": "ENV_PIN",
801
+ "variant": "on"
802
+ },
803
+ {
804
+ "key": "homeHero",
805
+ "value": "control",
806
+ "reason": "DEFAULT",
807
+ "variant": "control"
808
+ },
809
+ {
810
+ "key": "insights_enabled",
811
+ "value": true,
812
+ "reason": "DEFAULT",
813
+ "variant": "on"
814
+ }
815
+ ],
816
+ "etag": "452f76c68a7ca41ad055a6457124cca53d9792b2d41e227c6473b4fc3b742da9"
817
+ }
818
+ },
819
+ {
820
+ "name": "static wires stop at until_clients for that platform",
821
+ "audience": "mobile",
822
+ "context": {
823
+ "client": {
824
+ "platform": "android",
825
+ "version": "0.6.0"
826
+ }
827
+ },
828
+ "expected": {
829
+ "flags": [
830
+ {
831
+ "key": "brokenFlag",
832
+ "value": false,
833
+ "reason": "DEFAULT",
834
+ "variant": "off"
835
+ },
836
+ {
837
+ "key": "chat_enabled",
838
+ "value": true,
839
+ "reason": "DEFAULT",
840
+ "variant": "on"
841
+ },
842
+ {
843
+ "key": "checkoutV2",
844
+ "value": false,
845
+ "reason": "DEFAULT",
846
+ "variant": "off"
847
+ },
848
+ {
849
+ "key": "gates",
850
+ "value": "off",
851
+ "reason": "DEFAULT",
852
+ "variant": "off"
853
+ },
854
+ {
855
+ "key": "homeHero",
856
+ "value": "control",
857
+ "reason": "DEFAULT",
858
+ "variant": "control"
859
+ },
860
+ {
861
+ "key": "insights_enabled",
862
+ "value": true,
863
+ "reason": "DEFAULT",
864
+ "variant": "on"
865
+ }
866
+ ],
867
+ "etag": "5998d5080309e329cf49fa7d89ac90e13c26159d1457045cf2167b3bee0fa6d1"
868
+ }
869
+ },
870
+ {
871
+ "name": "static wires keep serving a platform until_clients doesn't list",
872
+ "audience": "mobile",
873
+ "context": {
874
+ "client": {
875
+ "platform": "ios",
876
+ "version": "9.0.0"
877
+ }
878
+ },
879
+ "expected": {
880
+ "flags": [
881
+ {
882
+ "key": "brokenFlag",
883
+ "value": false,
884
+ "reason": "DEFAULT",
885
+ "variant": "off"
886
+ },
887
+ {
888
+ "key": "chatMode",
889
+ "value": "legacy",
890
+ "reason": "STATIC",
891
+ "variant": "legacy"
892
+ },
893
+ {
894
+ "key": "chat_enabled",
895
+ "value": true,
896
+ "reason": "DEFAULT",
897
+ "variant": "on"
898
+ },
899
+ {
900
+ "key": "chat_v1",
901
+ "value": false,
902
+ "reason": "STATIC",
903
+ "variant": "off"
904
+ },
905
+ {
906
+ "key": "checkoutV2",
907
+ "value": false,
908
+ "reason": "DEFAULT",
909
+ "variant": "off"
910
+ },
911
+ {
912
+ "key": "gates",
913
+ "value": "off",
914
+ "reason": "DEFAULT",
915
+ "variant": "off"
916
+ },
917
+ {
918
+ "key": "homeHero",
919
+ "value": "control",
920
+ "reason": "DEFAULT",
921
+ "variant": "control"
922
+ },
923
+ {
924
+ "key": "insights_enabled",
925
+ "value": true,
926
+ "reason": "DEFAULT",
927
+ "variant": "on"
928
+ }
929
+ ],
930
+ "etag": "4b2eec86554cc58a8193f835194c8bf275384eaf4b9afa50aab1a960055dd564"
931
+ }
932
+ },
933
+ {
934
+ "name": "static wires are served through until",
935
+ "audience": "mobile",
936
+ "today": "2027-03-01",
937
+ "context": {
938
+ "client": {
939
+ "platform": "ios",
940
+ "version": "1.0.0"
941
+ }
942
+ },
943
+ "expected": {
944
+ "flags": [
945
+ {
946
+ "key": "brokenFlag",
947
+ "value": false,
948
+ "reason": "DEFAULT",
949
+ "variant": "off"
950
+ },
951
+ {
952
+ "key": "chatMode",
953
+ "value": "legacy",
954
+ "reason": "STATIC",
955
+ "variant": "legacy"
956
+ },
957
+ {
958
+ "key": "chat_enabled",
959
+ "value": true,
960
+ "reason": "DEFAULT",
961
+ "variant": "on"
962
+ },
963
+ {
964
+ "key": "chat_v1",
965
+ "value": false,
966
+ "reason": "STATIC",
967
+ "variant": "off"
968
+ },
969
+ {
970
+ "key": "checkoutV2",
971
+ "value": false,
972
+ "reason": "DEFAULT",
973
+ "variant": "off"
974
+ },
975
+ {
976
+ "key": "gates",
977
+ "value": "off",
978
+ "reason": "DEFAULT",
979
+ "variant": "off"
980
+ },
981
+ {
982
+ "key": "homeHero",
983
+ "value": "control",
984
+ "reason": "DEFAULT",
985
+ "variant": "control"
986
+ },
987
+ {
988
+ "key": "insights_enabled",
989
+ "value": true,
990
+ "reason": "DEFAULT",
991
+ "variant": "on"
992
+ }
993
+ ],
994
+ "etag": "4b2eec86554cc58a8193f835194c8bf275384eaf4b9afa50aab1a960055dd564"
995
+ }
996
+ },
997
+ {
998
+ "name": "static wires are gone the day after until",
999
+ "audience": "mobile",
1000
+ "today": "2027-03-02",
1001
+ "context": {
1002
+ "client": {
1003
+ "platform": "ios",
1004
+ "version": "1.0.0"
1005
+ }
1006
+ },
1007
+ "expected": {
1008
+ "flags": [
1009
+ {
1010
+ "key": "brokenFlag",
1011
+ "value": false,
1012
+ "reason": "DEFAULT",
1013
+ "variant": "off"
1014
+ },
1015
+ {
1016
+ "key": "chat_enabled",
1017
+ "value": true,
1018
+ "reason": "DEFAULT",
1019
+ "variant": "on"
1020
+ },
1021
+ {
1022
+ "key": "checkoutV2",
1023
+ "value": false,
1024
+ "reason": "DEFAULT",
1025
+ "variant": "off"
1026
+ },
1027
+ {
1028
+ "key": "gates",
1029
+ "value": "off",
1030
+ "reason": "DEFAULT",
1031
+ "variant": "off"
1032
+ },
1033
+ {
1034
+ "key": "homeHero",
1035
+ "value": "control",
1036
+ "reason": "DEFAULT",
1037
+ "variant": "control"
1038
+ },
1039
+ {
1040
+ "key": "insights_enabled",
1041
+ "value": true,
1042
+ "reason": "DEFAULT",
1043
+ "variant": "on"
1044
+ }
1045
+ ],
1046
+ "etag": "5998d5080309e329cf49fa7d89ac90e13c26159d1457045cf2167b3bee0fa6d1"
1047
+ }
1048
+ },
1049
+ {
1050
+ "name": "an errored flag is an evaluationFailure and the rest still evaluate",
1051
+ "audience": "mobile",
1052
+ "context": {
1053
+ "client": {
1054
+ "platform": "ios",
1055
+ "version": "1.0.0"
1056
+ }
1057
+ },
1058
+ "rules": [
1059
+ {
1060
+ "key": "broken_flag",
1061
+ "status": "running",
1062
+ "fallthrough_value": "maybe"
1063
+ }
1064
+ ],
1065
+ "expected": {
1066
+ "flags": [
1067
+ {
1068
+ "key": "brokenFlag",
1069
+ "errorCode": "PARSE_ERROR",
1070
+ "errorDetails": "the flag could not be evaluated; use the code default"
1071
+ },
1072
+ {
1073
+ "key": "chatMode",
1074
+ "value": "legacy",
1075
+ "reason": "STATIC",
1076
+ "variant": "legacy"
1077
+ },
1078
+ {
1079
+ "key": "chat_enabled",
1080
+ "value": true,
1081
+ "reason": "DEFAULT",
1082
+ "variant": "on"
1083
+ },
1084
+ {
1085
+ "key": "chat_v1",
1086
+ "value": false,
1087
+ "reason": "STATIC",
1088
+ "variant": "off"
1089
+ },
1090
+ {
1091
+ "key": "checkoutV2",
1092
+ "value": false,
1093
+ "reason": "DEFAULT",
1094
+ "variant": "off"
1095
+ },
1096
+ {
1097
+ "key": "gates",
1098
+ "value": "off",
1099
+ "reason": "DEFAULT",
1100
+ "variant": "off"
1101
+ },
1102
+ {
1103
+ "key": "homeHero",
1104
+ "value": "control",
1105
+ "reason": "DEFAULT",
1106
+ "variant": "control"
1107
+ },
1108
+ {
1109
+ "key": "insights_enabled",
1110
+ "value": true,
1111
+ "reason": "DEFAULT",
1112
+ "variant": "on"
1113
+ }
1114
+ ],
1115
+ "etag": "8441ee3acf67b97d6b19c10349bd92eaa8d7174000d2c416a66df055c8251596"
1116
+ }
1117
+ },
1118
+ {
1119
+ "name": "a variant split serves SPLIT",
1120
+ "audience": "mobile",
1121
+ "context": {
1122
+ "units": {
1123
+ "account": "acct_a"
1124
+ },
1125
+ "client": {
1126
+ "platform": "ios",
1127
+ "version": "1.0.0"
1128
+ }
1129
+ },
1130
+ "rules": [
1131
+ {
1132
+ "key": "home_hero",
1133
+ "status": "running",
1134
+ "variant_weights": {
1135
+ "control": 0,
1136
+ "savings": 10000
1137
+ }
1138
+ }
1139
+ ],
1140
+ "expected": {
1141
+ "flags": [
1142
+ {
1143
+ "key": "brokenFlag",
1144
+ "value": false,
1145
+ "reason": "DEFAULT",
1146
+ "variant": "off"
1147
+ },
1148
+ {
1149
+ "key": "chatMode",
1150
+ "value": "legacy",
1151
+ "reason": "STATIC",
1152
+ "variant": "legacy"
1153
+ },
1154
+ {
1155
+ "key": "chat_enabled",
1156
+ "value": true,
1157
+ "reason": "DEFAULT",
1158
+ "variant": "on"
1159
+ },
1160
+ {
1161
+ "key": "chat_v1",
1162
+ "value": false,
1163
+ "reason": "STATIC",
1164
+ "variant": "off"
1165
+ },
1166
+ {
1167
+ "key": "checkoutV2",
1168
+ "value": false,
1169
+ "reason": "DEFAULT",
1170
+ "variant": "off"
1171
+ },
1172
+ {
1173
+ "key": "gates",
1174
+ "value": "off",
1175
+ "reason": "DEFAULT",
1176
+ "variant": "off"
1177
+ },
1178
+ {
1179
+ "key": "homeHero",
1180
+ "value": "savings",
1181
+ "reason": "SPLIT",
1182
+ "variant": "savings"
1183
+ },
1184
+ {
1185
+ "key": "insights_enabled",
1186
+ "value": true,
1187
+ "reason": "DEFAULT",
1188
+ "variant": "on"
1189
+ }
1190
+ ],
1191
+ "etag": "f994141d0d0cbcd74ba19e8f5bf0cc673c66488fb28f61b1f36e460e191d5a8f"
1192
+ }
1193
+ },
1194
+ {
1195
+ "name": "user A, a member of the rule, gets TARGETING_MATCH",
1196
+ "audience": "mobile",
1197
+ "context": {
1198
+ "units": {
1199
+ "account": "acct_a"
1200
+ },
1201
+ "client": {
1202
+ "platform": "android",
1203
+ "version": "1.0.0"
1204
+ }
1205
+ },
1206
+ "rules": [
1207
+ {
1208
+ "key": "new_checkout",
1209
+ "status": "running"
1210
+ }
1211
+ ],
1212
+ "memberships": [
1213
+ {
1214
+ "rule": "new_checkout",
1215
+ "unit": "account",
1216
+ "unit_key": "acct_a",
1217
+ "value": "on"
1218
+ }
1219
+ ],
1220
+ "expected": {
1221
+ "flags": [
1222
+ {
1223
+ "key": "brokenFlag",
1224
+ "value": false,
1225
+ "reason": "DEFAULT",
1226
+ "variant": "off"
1227
+ },
1228
+ {
1229
+ "key": "chat_enabled",
1230
+ "value": true,
1231
+ "reason": "DEFAULT",
1232
+ "variant": "on"
1233
+ },
1234
+ {
1235
+ "key": "checkoutV2",
1236
+ "value": true,
1237
+ "reason": "TARGETING_MATCH",
1238
+ "variant": "on"
1239
+ },
1240
+ {
1241
+ "key": "gates",
1242
+ "value": "off",
1243
+ "reason": "DEFAULT",
1244
+ "variant": "off"
1245
+ },
1246
+ {
1247
+ "key": "homeHero",
1248
+ "value": "control",
1249
+ "reason": "DEFAULT",
1250
+ "variant": "control"
1251
+ },
1252
+ {
1253
+ "key": "insights_enabled",
1254
+ "value": true,
1255
+ "reason": "DEFAULT",
1256
+ "variant": "on"
1257
+ }
1258
+ ],
1259
+ "etag": "f9bb90225cc20c97de6894c1adbd16938a378903c5ca6243e519935a8a2d54db"
1260
+ }
1261
+ },
1262
+ {
1263
+ "name": "user B on the same client gets other answers and another ETag",
1264
+ "audience": "mobile",
1265
+ "context": {
1266
+ "units": {
1267
+ "account": "acct_b"
1268
+ },
1269
+ "client": {
1270
+ "platform": "android",
1271
+ "version": "1.0.0"
1272
+ }
1273
+ },
1274
+ "rules": [
1275
+ {
1276
+ "key": "new_checkout",
1277
+ "status": "running"
1278
+ }
1279
+ ],
1280
+ "memberships": [
1281
+ {
1282
+ "rule": "new_checkout",
1283
+ "unit": "account",
1284
+ "unit_key": "acct_a",
1285
+ "value": "on"
1286
+ }
1287
+ ],
1288
+ "etag_differs_from": [
1289
+ "user A, a member of the rule, gets TARGETING_MATCH"
1290
+ ],
1291
+ "expected": {
1292
+ "flags": [
1293
+ {
1294
+ "key": "brokenFlag",
1295
+ "value": false,
1296
+ "reason": "DEFAULT",
1297
+ "variant": "off"
1298
+ },
1299
+ {
1300
+ "key": "chat_enabled",
1301
+ "value": true,
1302
+ "reason": "DEFAULT",
1303
+ "variant": "on"
1304
+ },
1305
+ {
1306
+ "key": "checkoutV2",
1307
+ "value": false,
1308
+ "reason": "DEFAULT",
1309
+ "variant": "off"
1310
+ },
1311
+ {
1312
+ "key": "gates",
1313
+ "value": "off",
1314
+ "reason": "DEFAULT",
1315
+ "variant": "off"
1316
+ },
1317
+ {
1318
+ "key": "homeHero",
1319
+ "value": "control",
1320
+ "reason": "DEFAULT",
1321
+ "variant": "control"
1322
+ },
1323
+ {
1324
+ "key": "insights_enabled",
1325
+ "value": true,
1326
+ "reason": "DEFAULT",
1327
+ "variant": "on"
1328
+ }
1329
+ ],
1330
+ "etag": "5998d5080309e329cf49fa7d89ac90e13c26159d1457045cf2167b3bee0fa6d1"
1331
+ }
1332
+ },
1333
+ {
1334
+ "name": "user C with the same answers as user B has the same ETag",
1335
+ "audience": "mobile",
1336
+ "context": {
1337
+ "units": {
1338
+ "account": "acct_c"
1339
+ },
1340
+ "client": {
1341
+ "platform": "android",
1342
+ "version": "1.0.0"
1343
+ }
1344
+ },
1345
+ "rules": [
1346
+ {
1347
+ "key": "new_checkout",
1348
+ "status": "running"
1349
+ }
1350
+ ],
1351
+ "memberships": [
1352
+ {
1353
+ "rule": "new_checkout",
1354
+ "unit": "account",
1355
+ "unit_key": "acct_a",
1356
+ "value": "on"
1357
+ }
1358
+ ],
1359
+ "etag_same_as": "user B on the same client gets other answers and another ETag",
1360
+ "expected": {
1361
+ "flags": [
1362
+ {
1363
+ "key": "brokenFlag",
1364
+ "value": false,
1365
+ "reason": "DEFAULT",
1366
+ "variant": "off"
1367
+ },
1368
+ {
1369
+ "key": "chat_enabled",
1370
+ "value": true,
1371
+ "reason": "DEFAULT",
1372
+ "variant": "on"
1373
+ },
1374
+ {
1375
+ "key": "checkoutV2",
1376
+ "value": false,
1377
+ "reason": "DEFAULT",
1378
+ "variant": "off"
1379
+ },
1380
+ {
1381
+ "key": "gates",
1382
+ "value": "off",
1383
+ "reason": "DEFAULT",
1384
+ "variant": "off"
1385
+ },
1386
+ {
1387
+ "key": "homeHero",
1388
+ "value": "control",
1389
+ "reason": "DEFAULT",
1390
+ "variant": "control"
1391
+ },
1392
+ {
1393
+ "key": "insights_enabled",
1394
+ "value": true,
1395
+ "reason": "DEFAULT",
1396
+ "variant": "on"
1397
+ }
1398
+ ],
1399
+ "etag": "5998d5080309e329cf49fa7d89ac90e13c26159d1457045cf2167b3bee0fa6d1"
1400
+ }
1401
+ },
1402
+ {
1403
+ "name": "user B on an older build gets another ETag",
1404
+ "audience": "mobile",
1405
+ "context": {
1406
+ "units": {
1407
+ "account": "acct_b"
1408
+ },
1409
+ "client": {
1410
+ "platform": "android",
1411
+ "version": "0.3.0"
1412
+ }
1413
+ },
1414
+ "rules": [
1415
+ {
1416
+ "key": "new_checkout",
1417
+ "status": "running"
1418
+ }
1419
+ ],
1420
+ "memberships": [
1421
+ {
1422
+ "rule": "new_checkout",
1423
+ "unit": "account",
1424
+ "unit_key": "acct_a",
1425
+ "value": "on"
1426
+ }
1427
+ ],
1428
+ "etag_differs_from": [
1429
+ "user B on the same client gets other answers and another ETag"
1430
+ ],
1431
+ "expected": {
1432
+ "flags": [
1433
+ {
1434
+ "key": "brokenFlag",
1435
+ "value": false,
1436
+ "reason": "DEFAULT",
1437
+ "variant": "off"
1438
+ },
1439
+ {
1440
+ "key": "chatMode",
1441
+ "value": "legacy",
1442
+ "reason": "STATIC",
1443
+ "variant": "legacy"
1444
+ },
1445
+ {
1446
+ "key": "chat_enabled",
1447
+ "value": true,
1448
+ "reason": "DEFAULT",
1449
+ "variant": "on"
1450
+ },
1451
+ {
1452
+ "key": "chat_v1",
1453
+ "value": false,
1454
+ "reason": "STATIC",
1455
+ "variant": "off"
1456
+ },
1457
+ {
1458
+ "key": "gates",
1459
+ "value": "off",
1460
+ "reason": "DEFAULT",
1461
+ "variant": "off"
1462
+ },
1463
+ {
1464
+ "key": "homeHero",
1465
+ "value": "control",
1466
+ "reason": "DEFAULT",
1467
+ "variant": "control"
1468
+ },
1469
+ {
1470
+ "key": "insights_enabled",
1471
+ "value": true,
1472
+ "reason": "DEFAULT",
1473
+ "variant": "on"
1474
+ }
1475
+ ],
1476
+ "etag": "8f2706a498ed2b077d8c6d99ca03cbc8bb0d03d160882c798e64271798fc217c"
1477
+ }
1478
+ },
1479
+ {
1480
+ "name": "the web audience sees only its own wire names",
1481
+ "audience": "web",
1482
+ "context": {
1483
+ "client": {
1484
+ "platform": "web"
1485
+ }
1486
+ },
1487
+ "expected": {
1488
+ "flags": [
1489
+ {
1490
+ "key": "ai",
1491
+ "value": true,
1492
+ "reason": "DEFAULT",
1493
+ "variant": "on"
1494
+ }
1495
+ ],
1496
+ "etag": "0c3424e5d2f22fff4dde0fd3fae946ede76349591eba28e16f7b51295fae78a6"
1497
+ }
1498
+ },
1499
+ {
1500
+ "name": "an audience nothing exposes to is empty",
1501
+ "audience": "device",
1502
+ "context": {
1503
+ "client": {
1504
+ "platform": "android",
1505
+ "version": "1.0.0"
1506
+ }
1507
+ },
1508
+ "expected": {
1509
+ "flags": [],
1510
+ "etag": "1781c217b9f951e02bf72944c316a4b15ebe46cd716ae064ed535e6334963763"
1511
+ }
1512
+ },
1513
+ {
1514
+ "name": "non-ASCII and control characters are hashed as RFC 8785 writes them (raw UTF-8; \\u0001 escaped in lowercase hex; U+2028, DEL and / left raw)",
1515
+ "audience": "kiosk",
1516
+ "context": {
1517
+ "client": {
1518
+ "platform": "ios",
1519
+ "version": "1.0.0"
1520
+ }
1521
+ },
1522
+ "expected": {
1523
+ "flags": [
1524
+ {
1525
+ "key": "bannerText",
1526
+ "value": "Grüße 
 \u0001 \" / \\  – ok",
1527
+ "reason": "STATIC",
1528
+ "variant": "Grüße 
 \u0001 \" / \\  – ok"
1529
+ },
1530
+ {
1531
+ "key": "theme",
1532
+ "value": "contrôle",
1533
+ "reason": "DEFAULT",
1534
+ "variant": "contrôle"
1535
+ }
1536
+ ],
1537
+ "etag": "685dcdadc6ad8a840d7d73ce4c7aef2f885590541be03d58c253000b9ea9e484"
1538
+ }
1539
+ }
1540
+ ]
1541
+ }