standard_flags 0.3.0 → 0.4.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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +188 -0
  3. data/README.md +531 -59
  4. data/conformance/README.md +152 -3
  5. data/conformance/legacy_env.json +7 -1
  6. data/conformance/schema/fixture.schema.json +390 -21
  7. data/conformance/schema/manifest.schema.json +347 -0
  8. data/conformance/upgrade/client_status_server.json +297 -0
  9. data/conformance/wire/client_state.json +2115 -2
  10. data/conformance/wire/client_status.json +359 -0
  11. data/conformance/wire/manifest_check.json +5713 -0
  12. data/lib/generators/standard_flags/install/templates/initializer.rb.tt +4 -1
  13. data/lib/generators/standard_flags/migrations/migrations_generator.rb +37 -9
  14. data/lib/generators/standard_flags/migrations/templates/create_standard_flags_compat_stats.rb.tt +17 -0
  15. data/lib/standard_flags/client_app.rb +229 -0
  16. data/lib/standard_flags/client_status/controller.rb +59 -0
  17. data/lib/standard_flags/client_status.rb +110 -0
  18. data/lib/standard_flags/config.rb +18 -1
  19. data/lib/standard_flags/controller.rb +110 -5
  20. data/lib/standard_flags/definition.rb +37 -35
  21. data/lib/standard_flags/diagnostics.rb +61 -3
  22. data/lib/standard_flags/env_pin.rb +5 -15
  23. data/lib/standard_flags/errors.rb +31 -0
  24. data/lib/standard_flags/evaluator.rb +1 -0
  25. data/lib/standard_flags/mcp/flags.rb +12 -1
  26. data/lib/standard_flags/open_feature/provider.rb +2 -1
  27. data/lib/standard_flags/parser.rb +0 -16
  28. data/lib/standard_flags/registry.rb +46 -4
  29. data/lib/standard_flags/runtime/active_record_store.rb +64 -0
  30. data/lib/standard_flags/runtime/compat_tracker.rb +228 -0
  31. data/lib/standard_flags/runtime/memory_store.rb +20 -0
  32. data/lib/standard_flags/runtime/models.rb +6 -0
  33. data/lib/standard_flags/runtime/store.rb +18 -0
  34. data/lib/standard_flags/runtime.rb +33 -3
  35. data/lib/standard_flags/stores/app_store.rb +172 -0
  36. data/lib/standard_flags/stores.rb +37 -0
  37. data/lib/standard_flags/tooling/kotlin.rb +319 -0
  38. data/lib/standard_flags/tooling/manifest.rb +401 -0
  39. data/lib/standard_flags/tooling/manifest_check.rb +355 -0
  40. data/lib/standard_flags/tooling.rb +150 -55
  41. data/lib/standard_flags/version.rb +1 -1
  42. data/lib/standard_flags.rb +3 -0
  43. data/lib/tasks/standard_flags.rake +47 -0
  44. metadata +15 -2
  45. data/conformance/legacy_exact.json +0 -90
@@ -0,0 +1,359 @@
1
+ {
2
+ "description": "GET /client/status: the client registry, the platforms the server recognises, the calling client's X-Client-* header values and today's UTC date in; the status payload out. Clients use `expected` as golden payloads for their upgrade-state parsing. ENV pins and store lookups, which only the server has, are in upgrade/client_status_server.json.",
3
+ "suite": "client_status",
4
+ "scope": "wire",
5
+ "client_platforms": [
6
+ "android",
7
+ "ios",
8
+ "web",
9
+ "desktop"
10
+ ],
11
+ "today": "2026-12-03",
12
+ "clients": [
13
+ {
14
+ "name": "android_app",
15
+ "platform": "android",
16
+ "min_version": "0.4.0",
17
+ "since": "2026-12-01",
18
+ "grace_days": 7,
19
+ "recommended": "0.5.0",
20
+ "available": "0.5.0",
21
+ "store_url": "https://example.com/store/android"
22
+ },
23
+ {
24
+ "name": "ios_app",
25
+ "platform": "ios",
26
+ "min_version": "2.0.0",
27
+ "since": "2026-11-01",
28
+ "grace_days": 7,
29
+ "recommended": "2.1.0",
30
+ "available": "1.9.0",
31
+ "store_url": "https://example.com/store/ios"
32
+ },
33
+ {
34
+ "name": "desktop_app",
35
+ "platform": "desktop",
36
+ "recommended": "3.0.0"
37
+ },
38
+ {
39
+ "name": "kiosk_android",
40
+ "platform": "android",
41
+ "group": "kiosk",
42
+ "min_version": "1.2.0",
43
+ "since": "2026-12-03",
44
+ "grace_days": 0
45
+ }
46
+ ],
47
+ "cases": [
48
+ {
49
+ "name": "no client headers: unknown, never told to upgrade",
50
+ "client": {},
51
+ "expected": {
52
+ "status": "unknown",
53
+ "platform": null,
54
+ "version": null,
55
+ "min_version": null,
56
+ "recommended": null,
57
+ "enforce_at": null,
58
+ "store_url": null
59
+ }
60
+ },
61
+ {
62
+ "name": "a platform this app doesn't recognise: unknown",
63
+ "client": {
64
+ "platform": "watch",
65
+ "version": "0.1.0"
66
+ },
67
+ "expected": {
68
+ "status": "unknown",
69
+ "platform": null,
70
+ "version": "0.1.0",
71
+ "min_version": null,
72
+ "recommended": null,
73
+ "enforce_at": null,
74
+ "store_url": null
75
+ }
76
+ },
77
+ {
78
+ "name": "a known platform without a version: unknown, with the platform's versions and store URL",
79
+ "client": {
80
+ "platform": "android"
81
+ },
82
+ "expected": {
83
+ "status": "unknown",
84
+ "platform": "android",
85
+ "version": null,
86
+ "min_version": "0.4.0",
87
+ "recommended": "0.5.0",
88
+ "enforce_at": null,
89
+ "store_url": "https://example.com/store/android"
90
+ }
91
+ },
92
+ {
93
+ "name": "a version that doesn't parse is dropped: unknown",
94
+ "client": {
95
+ "platform": "android",
96
+ "version": "v0.3"
97
+ },
98
+ "expected": {
99
+ "status": "unknown",
100
+ "platform": "android",
101
+ "version": null,
102
+ "min_version": "0.4.0",
103
+ "recommended": "0.5.0",
104
+ "enforce_at": null,
105
+ "store_url": "https://example.com/store/android"
106
+ }
107
+ },
108
+ {
109
+ "name": "below the minimum during the grace window: recommended, with enforce_at",
110
+ "client": {
111
+ "platform": "android",
112
+ "version": "0.3.9"
113
+ },
114
+ "expected": {
115
+ "status": "upgrade_recommended",
116
+ "platform": "android",
117
+ "version": "0.3.9",
118
+ "min_version": "0.4.0",
119
+ "recommended": "0.5.0",
120
+ "enforce_at": "2026-12-08",
121
+ "store_url": "https://example.com/store/android"
122
+ }
123
+ },
124
+ {
125
+ "name": "the last day of the grace window",
126
+ "client": {
127
+ "platform": "android",
128
+ "version": "0.3.9"
129
+ },
130
+ "today": "2026-12-07",
131
+ "expected": {
132
+ "status": "upgrade_recommended",
133
+ "platform": "android",
134
+ "version": "0.3.9",
135
+ "min_version": "0.4.0",
136
+ "recommended": "0.5.0",
137
+ "enforce_at": "2026-12-08",
138
+ "store_url": "https://example.com/store/android"
139
+ }
140
+ },
141
+ {
142
+ "name": "enforcement starts on enforce_at (since + grace)",
143
+ "client": {
144
+ "platform": "android",
145
+ "version": "0.3.9"
146
+ },
147
+ "today": "2026-12-08",
148
+ "expected": {
149
+ "status": "upgrade_required",
150
+ "platform": "android",
151
+ "version": "0.3.9",
152
+ "min_version": "0.4.0",
153
+ "recommended": "0.5.0",
154
+ "enforce_at": "2026-12-08",
155
+ "store_url": "https://example.com/store/android"
156
+ }
157
+ },
158
+ {
159
+ "name": "a prerelease of exactly the minimum meets it (a beta or TestFlight build of the required release)",
160
+ "client": {
161
+ "platform": "android",
162
+ "version": "0.4.0-rc.1"
163
+ },
164
+ "today": "2026-12-08",
165
+ "expected": {
166
+ "status": "upgrade_recommended",
167
+ "platform": "android",
168
+ "version": "0.4.0-rc.1",
169
+ "min_version": "0.4.0",
170
+ "recommended": "0.5.0",
171
+ "enforce_at": null,
172
+ "store_url": "https://example.com/store/android"
173
+ }
174
+ },
175
+ {
176
+ "name": "a prerelease of an older version is below the minimum",
177
+ "client": {
178
+ "platform": "android",
179
+ "version": "0.3.10-beta.1"
180
+ },
181
+ "today": "2026-12-08",
182
+ "expected": {
183
+ "status": "upgrade_required",
184
+ "platform": "android",
185
+ "version": "0.3.10-beta.1",
186
+ "min_version": "0.4.0",
187
+ "recommended": "0.5.0",
188
+ "enforce_at": "2026-12-08",
189
+ "store_url": "https://example.com/store/android"
190
+ }
191
+ },
192
+ {
193
+ "name": "a prerelease of exactly the recommended version meets it",
194
+ "client": {
195
+ "platform": "android",
196
+ "version": "0.5.0-beta.2"
197
+ },
198
+ "expected": {
199
+ "status": "ok",
200
+ "platform": "android",
201
+ "version": "0.5.0-beta.2",
202
+ "min_version": "0.4.0",
203
+ "recommended": "0.5.0",
204
+ "enforce_at": null,
205
+ "store_url": "https://example.com/store/android"
206
+ }
207
+ },
208
+ {
209
+ "name": "at the minimum but below recommended: recommended, no enforce_at",
210
+ "client": {
211
+ "platform": "android",
212
+ "version": "0.4"
213
+ },
214
+ "today": "2026-12-08",
215
+ "expected": {
216
+ "status": "upgrade_recommended",
217
+ "platform": "android",
218
+ "version": "0.4.0",
219
+ "min_version": "0.4.0",
220
+ "recommended": "0.5.0",
221
+ "enforce_at": null,
222
+ "store_url": "https://example.com/store/android"
223
+ }
224
+ },
225
+ {
226
+ "name": "at recommended: ok; build metadata is ignored",
227
+ "client": {
228
+ "platform": "Android",
229
+ "version": "0.5.0+412",
230
+ "build": "412"
231
+ },
232
+ "expected": {
233
+ "status": "ok",
234
+ "platform": "android",
235
+ "version": "0.5.0",
236
+ "min_version": "0.4.0",
237
+ "recommended": "0.5.0",
238
+ "enforce_at": null,
239
+ "store_url": "https://example.com/store/android"
240
+ }
241
+ },
242
+ {
243
+ "name": "store ceiling: the minimum and recommended are never above the newest version in the store",
244
+ "client": {
245
+ "platform": "ios",
246
+ "version": "1.9.0"
247
+ },
248
+ "expected": {
249
+ "status": "ok",
250
+ "platform": "ios",
251
+ "version": "1.9.0",
252
+ "min_version": "1.9.0",
253
+ "recommended": "1.9.0",
254
+ "enforce_at": null,
255
+ "store_url": "https://example.com/store/ios"
256
+ }
257
+ },
258
+ {
259
+ "name": "store ceiling: below the capped minimum after the grace window is required",
260
+ "client": {
261
+ "platform": "ios",
262
+ "version": "1.8.5"
263
+ },
264
+ "expected": {
265
+ "status": "upgrade_required",
266
+ "platform": "ios",
267
+ "version": "1.8.5",
268
+ "min_version": "1.9.0",
269
+ "recommended": "1.9.0",
270
+ "enforce_at": "2026-11-08",
271
+ "store_url": "https://example.com/store/ios"
272
+ }
273
+ },
274
+ {
275
+ "name": "recommended only (no minimum): below it is recommended",
276
+ "client": {
277
+ "platform": "desktop",
278
+ "version": "2.9.9"
279
+ },
280
+ "expected": {
281
+ "status": "upgrade_recommended",
282
+ "platform": "desktop",
283
+ "version": "2.9.9",
284
+ "min_version": null,
285
+ "recommended": "3.0.0",
286
+ "enforce_at": null,
287
+ "store_url": null
288
+ }
289
+ },
290
+ {
291
+ "name": "a recognised platform with no client declared: ok, nothing to enforce",
292
+ "client": {
293
+ "platform": "web",
294
+ "version": "1.0.0"
295
+ },
296
+ "expected": {
297
+ "status": "ok",
298
+ "platform": "web",
299
+ "version": "1.0.0",
300
+ "min_version": null,
301
+ "recommended": null,
302
+ "enforce_at": null,
303
+ "store_url": null
304
+ }
305
+ },
306
+ {
307
+ "name": "a client group picks its own client for the platform; grace 0 enforces from since",
308
+ "client": {
309
+ "platform": "android",
310
+ "version": "1.1.0"
311
+ },
312
+ "group": "kiosk",
313
+ "expected": {
314
+ "status": "upgrade_required",
315
+ "platform": "android",
316
+ "version": "1.1.0",
317
+ "min_version": "1.2.0",
318
+ "recommended": null,
319
+ "enforce_at": "2026-12-03",
320
+ "store_url": null
321
+ }
322
+ },
323
+ {
324
+ "name": "the day before since + grace 0",
325
+ "client": {
326
+ "platform": "android",
327
+ "version": "1.1.0"
328
+ },
329
+ "group": "kiosk",
330
+ "today": "2026-12-02",
331
+ "expected": {
332
+ "status": "upgrade_recommended",
333
+ "platform": "android",
334
+ "version": "1.1.0",
335
+ "min_version": "1.2.0",
336
+ "recommended": null,
337
+ "enforce_at": "2026-12-03",
338
+ "store_url": null
339
+ }
340
+ },
341
+ {
342
+ "name": "a group with no client for the platform: ok",
343
+ "client": {
344
+ "platform": "ios",
345
+ "version": "0.1.0"
346
+ },
347
+ "group": "kiosk",
348
+ "expected": {
349
+ "status": "ok",
350
+ "platform": "ios",
351
+ "version": "0.1.0",
352
+ "min_version": null,
353
+ "recommended": null,
354
+ "enforce_at": null,
355
+ "store_url": null
356
+ }
357
+ }
358
+ ]
359
+ }