flux-sim-engine 0.2.0__py3-none-any.whl

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 (165) hide show
  1. flux_engine/__init__.py +22 -0
  2. flux_engine/_links.py +55 -0
  3. flux_engine/_vendor/__init__.py +5 -0
  4. flux_engine/_vendor/flux_spec/NOTICE +19 -0
  5. flux_engine/_vendor/flux_spec/VENDOR-NOTES.md +104 -0
  6. flux_engine/_vendor/flux_spec/__init__.py +9 -0
  7. flux_engine/_vendor/flux_spec/bundle.py +410 -0
  8. flux_engine/_vendor/flux_spec/enforce.py +316 -0
  9. flux_engine/_vendor/flux_spec/schema/flux-enforcement-0.5.0.json +121 -0
  10. flux_engine/_vendor/flux_spec/schema/flux-manifest-0.5.0.json +153 -0
  11. flux_engine/_vendor/flux_spec/schema/flux-schema-0.2.0.json +465 -0
  12. flux_engine/_vendor/flux_spec/schema/flux-schema-0.3.0.json +876 -0
  13. flux_engine/_vendor/flux_spec/schema/flux-schema-0.4.0.json +1601 -0
  14. flux_engine/_vendor/flux_spec/schema/flux-schema-0.4.1.json +1668 -0
  15. flux_engine/_vendor/flux_spec/schema/flux-schema-0.5.0.json +1669 -0
  16. flux_engine/_vendor/flux_spec/schema/flux-schema-latest.json +1669 -0
  17. flux_engine/_vendor/flux_spec/schema/flux-ui-hints-0.4.0.json +795 -0
  18. flux_engine/_vendor/flux_spec/schema/flux-ui-hints-0.4.1.json +852 -0
  19. flux_engine/_vendor/flux_spec/schema/flux-ui-hints-0.5.0.json +852 -0
  20. flux_engine/_vendor/flux_spec/validate.py +537 -0
  21. flux_engine/_vendor/flux_spec/vectors/enforcement-vectors.json +935 -0
  22. flux_engine/_vendor/flux_spec/vendor/fluid/fluid-schema-0.7.3.json +5234 -0
  23. flux_engine/_vendor/flux_spec/vendor/fluid/fluid-schema-0.7.4.json +5437 -0
  24. flux_engine/_vendor/flux_spec/vendor/fluid/fluid-schema-0.7.5.json +5498 -0
  25. flux_engine/_vocabulary.py +141 -0
  26. flux_engine/accuracy/__init__.py +5 -0
  27. flux_engine/accuracy/_scoring/__init__.py +24 -0
  28. flux_engine/accuracy/accuracy_record.py +96 -0
  29. flux_engine/accuracy/policy.py +158 -0
  30. flux_engine/accuracy/records.py +264 -0
  31. flux_engine/accuracy/store.py +169 -0
  32. flux_engine/api/__init__.py +163 -0
  33. flux_engine/api/accuracy.py +209 -0
  34. flux_engine/api/agentic.py +134 -0
  35. flux_engine/api/calibration.py +125 -0
  36. flux_engine/api/claims.py +93 -0
  37. flux_engine/api/digests.py +73 -0
  38. flux_engine/api/emit.py +78 -0
  39. flux_engine/api/expressions.py +72 -0
  40. flux_engine/api/fidelity.py +110 -0
  41. flux_engine/api/lineage.py +78 -0
  42. flux_engine/api/stages.py +242 -0
  43. flux_engine/api/verdict.py +108 -0
  44. flux_engine/calibrate/__init__.py +5 -0
  45. flux_engine/calibrate/declared.py +253 -0
  46. flux_engine/calibrate/provenance.py +113 -0
  47. flux_engine/cli/__init__.py +2146 -0
  48. flux_engine/cli/__main__.py +17 -0
  49. flux_engine/cli/_documents.py +226 -0
  50. flux_engine/cli/_hints.py +118 -0
  51. flux_engine/cli/_init.py +152 -0
  52. flux_engine/cli/_progress.py +124 -0
  53. flux_engine/concordance/__init__.py +127 -0
  54. flux_engine/concordance/boundary/__init__.py +78 -0
  55. flux_engine/concordance/boundary/merkle.py +287 -0
  56. flux_engine/concordance/boundary/slice.py +429 -0
  57. flux_engine/concordance/boundary/statistic.py +561 -0
  58. flux_engine/concordance/boundary/store.py +334 -0
  59. flux_engine/concordance/boundary/vault.py +357 -0
  60. flux_engine/concordance/compiler.py +542 -0
  61. flux_engine/concordance/errors.py +189 -0
  62. flux_engine/concordance/gate.py +525 -0
  63. flux_engine/concordance/predicate.py +1217 -0
  64. flux_engine/concordance/record.py +554 -0
  65. flux_engine/concordance/verifier.py +583 -0
  66. flux_engine/core/__init__.py +5 -0
  67. flux_engine/core/artifact.py +99 -0
  68. flux_engine/core/canonical.py +369 -0
  69. flux_engine/core/clock.py +437 -0
  70. flux_engine/core/digest.py +288 -0
  71. flux_engine/core/errors.py +277 -0
  72. flux_engine/core/fixedpoint.py +929 -0
  73. flux_engine/core/lrm.py +158 -0
  74. flux_engine/core/rng.py +736 -0
  75. flux_engine/core/seedtree.py +891 -0
  76. flux_engine/core/trace.py +423 -0
  77. flux_engine/describe.py +207 -0
  78. flux_engine/engine.py +257 -0
  79. flux_engine/evidence/__init__.py +5 -0
  80. flux_engine/evidence/pack.py +411 -0
  81. flux_engine/evidence/report.py +243 -0
  82. flux_engine/expr/__init__.py +133 -0
  83. flux_engine/expr/ast.py +312 -0
  84. flux_engine/expr/attrs.py +386 -0
  85. flux_engine/expr/check.py +278 -0
  86. flux_engine/expr/compile.py +322 -0
  87. flux_engine/expr/errors.py +256 -0
  88. flux_engine/expr/lexer.py +297 -0
  89. flux_engine/expr/parser.py +313 -0
  90. flux_engine/expr/types.py +177 -0
  91. flux_engine/generator/__init__.py +97 -0
  92. flux_engine/generator/families.py +325 -0
  93. flux_engine/generator/paths.py +227 -0
  94. flux_engine/generator/rows.py +918 -0
  95. flux_engine/generator/statistics.py +524 -0
  96. flux_engine/governance/__init__.py +87 -0
  97. flux_engine/governance/audit.py +307 -0
  98. flux_engine/governance/gate.py +334 -0
  99. flux_engine/governance/skills.py +220 -0
  100. flux_engine/governance/sovereignty.py +251 -0
  101. flux_engine/lineage/__init__.py +5 -0
  102. flux_engine/lineage/emitter.py +398 -0
  103. flux_engine/py.typed +0 -0
  104. flux_engine/runtime/__init__.py +153 -0
  105. flux_engine/runtime/campaign.py +407 -0
  106. flux_engine/runtime/cast.py +283 -0
  107. flux_engine/runtime/detector.py +222 -0
  108. flux_engine/runtime/errors.py +58 -0
  109. flux_engine/runtime/experiment.py +311 -0
  110. flux_engine/runtime/journey.py +383 -0
  111. flux_engine/runtime/jurisdiction.py +72 -0
  112. flux_engine/runtime/payloads.py +124 -0
  113. flux_engine/runtime/signals.py +334 -0
  114. flux_engine/runtime/temperature.py +156 -0
  115. flux_engine/seam/__init__.py +5 -0
  116. flux_engine/seam/attest.py +290 -0
  117. flux_engine/seam/conform.py +448 -0
  118. flux_engine/seam/contract.py +605 -0
  119. flux_engine/seam/emit.py +488 -0
  120. flux_engine/seam/mapping.py +299 -0
  121. flux_engine/seam/resolve.py +1087 -0
  122. flux_engine/seam/sinks.py +157 -0
  123. flux_engine/spec/__init__.py +134 -0
  124. flux_engine/spec/bundle.py +25 -0
  125. flux_engine/spec/enforce.py +31 -0
  126. flux_engine/spec/validate.py +28 -0
  127. flux_engine/stages/__init__.py +30 -0
  128. flux_engine/stages/apply.py +447 -0
  129. flux_engine/stages/errors.py +315 -0
  130. flux_engine/stages/layout.py +292 -0
  131. flux_engine/stages/pipeline.py +600 -0
  132. flux_engine/stages/plan.py +241 -0
  133. flux_engine/stages/replay.py +83 -0
  134. flux_engine/stages/run.py +208 -0
  135. flux_engine/stages/ship.py +934 -0
  136. flux_engine/stages/validate.py +93 -0
  137. flux_engine/stages/verify.py +1129 -0
  138. flux_engine/starter/__init__.py +161 -0
  139. flux_engine/starter/bundle/detector.flux.yml +15 -0
  140. flux_engine/starter/bundle/journey.flux.yml +23 -0
  141. flux_engine/starter/bundle/module.flux.yml +16 -0
  142. flux_engine/starter/bundle/payment-recovery.fluid.yml +30 -0
  143. flux_engine/starter/bundle/persona.flux.yml +26 -0
  144. flux_engine/starter/bundle/signal.flux.yml +13 -0
  145. flux_engine/starter/bundle/simulation.flux.yml +29 -0
  146. flux_engine/starter/bundle/taxonomy.flux.yml +17 -0
  147. flux_engine/starter/bundle/treatment.flux.yml +13 -0
  148. flux_engine/starter/bundle/world.flux.yml +20 -0
  149. flux_engine/verticals/__init__.py +85 -0
  150. flux_engine/verticals/telco.py +89 -0
  151. flux_engine/world/__init__.py +89 -0
  152. flux_engine/world/derived.py +195 -0
  153. flux_engine/world/errors.py +41 -0
  154. flux_engine/world/families.py +260 -0
  155. flux_engine/world/population.py +602 -0
  156. flux_engine/world/tracing.py +66 -0
  157. flux_engine/world/values.py +121 -0
  158. flux_sim_engine-0.2.0.dist-info/METADATA +108 -0
  159. flux_sim_engine-0.2.0.dist-info/RECORD +165 -0
  160. flux_sim_engine-0.2.0.dist-info/WHEEL +5 -0
  161. flux_sim_engine-0.2.0.dist-info/entry_points.txt +2 -0
  162. flux_sim_engine-0.2.0.dist-info/licenses/LICENSE +202 -0
  163. flux_sim_engine-0.2.0.dist-info/licenses/NOTICE +10 -0
  164. flux_sim_engine-0.2.0.dist-info/licenses/flux_engine/_vendor/flux_spec/NOTICE +19 -0
  165. flux_sim_engine-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,465 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "FLUX Complete Document Schema",
4
+ "description": "Open standard JSON Schema for the FLUX v0.2.0 declarative specification, including Horizon 2/3 behavioral extensions.",
5
+ "type": "object",
6
+ "required": [
7
+ "fluxVersion",
8
+ "kind",
9
+ "metadata",
10
+ "spec"
11
+ ],
12
+ "properties": {
13
+ "fluxVersion": {
14
+ "type": "string",
15
+ "const": "0.2.0",
16
+ "description": "The version of the FLUX specification this document targets."
17
+ },
18
+ "kind": {
19
+ "type": "string",
20
+ "enum": [
21
+ "World",
22
+ "Persona",
23
+ "Segment",
24
+ "Catalog",
25
+ "Offer",
26
+ "Channel",
27
+ "ConsentProfile",
28
+ "Playback",
29
+ "Journey",
30
+ "JourneyTaxonomy",
31
+ "Signal",
32
+ "Detector",
33
+ "Treatment",
34
+ "Campaign",
35
+ "Experiment",
36
+ "Module",
37
+ "VerticalPack",
38
+ "Blueprint",
39
+ "Simulation"
40
+ ],
41
+ "description": "The discriminator defining the family and behavior of this document."
42
+ },
43
+ "metadata": {
44
+ "type": "object",
45
+ "required": ["id", "name"],
46
+ "properties": {
47
+ "id": { "type": "string" },
48
+ "name": { "type": "string" },
49
+ "labels": {
50
+ "type": "object",
51
+ "additionalProperties": { "type": "string" }
52
+ }
53
+ }
54
+ },
55
+ "spec": {
56
+ "type": "object",
57
+ "description": "The kind-specific configuration block."
58
+ }
59
+ },
60
+ "allOf": [
61
+ {
62
+ "if": { "properties": { "kind": { "const": "World" } } },
63
+ "then": {
64
+ "properties": {
65
+ "spec": {
66
+ "type": "object",
67
+ "required": ["seed", "population"],
68
+ "properties": {
69
+ "seed": { "type": "integer", "description": "Deterministic PRNG seed." },
70
+ "vertical": { "type": "string" },
71
+ "population": {
72
+ "type": "object",
73
+ "required": ["size", "lifecycle_mix"],
74
+ "properties": {
75
+ "size": { "type": "integer", "minimum": 1 },
76
+ "lifecycle_mix": {
77
+ "type": "object",
78
+ "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ },
87
+ {
88
+ "if": { "properties": { "kind": { "const": "Persona" } } },
89
+ "then": {
90
+ "properties": {
91
+ "spec": {
92
+ "type": "object",
93
+ "properties": {
94
+ "demographics": { "type": "object" },
95
+ "skills": {
96
+ "type": "object",
97
+ "properties": {
98
+ "digital_fluency": { "type": "number", "minimum": 0, "maximum": 1 },
99
+ "financial_literacy": { "type": "number", "minimum": 0, "maximum": 1 },
100
+ "supply_chain_resilience": { "type": "number", "minimum": 0, "maximum": 1 }
101
+ }
102
+ },
103
+ "worldview": {
104
+ "type": "object",
105
+ "properties": {
106
+ "risk_tolerance": { "type": "string" },
107
+ "trust_in_institutions": { "type": "number", "minimum": 0, "maximum": 1 },
108
+ "trend_following": { "type": "number", "minimum": 0, "maximum": 1 }
109
+ }
110
+ },
111
+ "agentic_prompt": {
112
+ "type": "array",
113
+ "items": { "type": "string" }
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
119
+ },
120
+ {
121
+ "if": { "properties": { "kind": { "const": "Segment" } } },
122
+ "then": {
123
+ "properties": {
124
+ "spec": {
125
+ "type": "object",
126
+ "required": ["query"],
127
+ "properties": {
128
+ "query": { "type": "string", "description": "Expression to filter Personas." }
129
+ }
130
+ }
131
+ }
132
+ }
133
+ },
134
+ {
135
+ "if": { "properties": { "kind": { "const": "Catalog" } } },
136
+ "then": {
137
+ "properties": {
138
+ "spec": {
139
+ "type": "object",
140
+ "required": ["items"],
141
+ "properties": {
142
+ "items": {
143
+ "type": "array",
144
+ "items": {
145
+ "type": "object",
146
+ "required": ["sku", "name"],
147
+ "properties": {
148
+ "sku": { "type": "string" },
149
+ "name": { "type": "string" },
150
+ "attributes": { "type": "object" }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ },
159
+ {
160
+ "if": { "properties": { "kind": { "const": "Offer" } } },
161
+ "then": {
162
+ "properties": {
163
+ "spec": {
164
+ "type": "object",
165
+ "required": ["catalog_ref", "pricing"],
166
+ "properties": {
167
+ "catalog_ref": { "type": "string" },
168
+ "pricing": {
169
+ "type": "object",
170
+ "properties": {
171
+ "amount": { "type": "number" },
172
+ "currency": { "type": "string" }
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ }
179
+ },
180
+ {
181
+ "if": { "properties": { "kind": { "const": "Channel" } } },
182
+ "then": {
183
+ "properties": {
184
+ "spec": {
185
+ "type": "object",
186
+ "required": ["type"],
187
+ "properties": {
188
+ "type": { "type": "string", "enum": ["sms", "email", "push", "api_gateway", "in_app"] },
189
+ "rate_limit_per_second": { "type": "integer" }
190
+ }
191
+ }
192
+ }
193
+ }
194
+ },
195
+ {
196
+ "if": { "properties": { "kind": { "const": "ConsentProfile" } } },
197
+ "then": {
198
+ "properties": {
199
+ "spec": {
200
+ "type": "object",
201
+ "properties": {
202
+ "allowed_jurisdictions": { "type": "array", "items": { "type": "string" } },
203
+ "requires_explicit_opt_in": { "type": "boolean" },
204
+ "permitted_purposes": { "type": "array", "items": { "type": "string" } },
205
+ "blocked_purposes": { "type": "array", "items": { "type": "string" } }
206
+ }
207
+ }
208
+ }
209
+ }
210
+ },
211
+ {
212
+ "if": { "properties": { "kind": { "const": "Playback" } } },
213
+ "then": {
214
+ "properties": {
215
+ "spec": {
216
+ "type": "object",
217
+ "required": ["source_stream", "persona_mapping"],
218
+ "properties": {
219
+ "source_stream": { "type": "string", "description": "URI of historical telemetry." },
220
+ "persona_mapping": {
221
+ "type": "array",
222
+ "items": {
223
+ "type": "object",
224
+ "required": ["behavior_pattern", "map_to_persona"],
225
+ "properties": {
226
+ "behavior_pattern": { "type": "string" },
227
+ "map_to_persona": { "type": "string" }
228
+ }
229
+ }
230
+ }
231
+ }
232
+ }
233
+ }
234
+ }
235
+ },
236
+ {
237
+ "if": { "properties": { "kind": { "const": "Journey" } } },
238
+ "then": {
239
+ "properties": {
240
+ "spec": {
241
+ "type": "object",
242
+ "properties": {
243
+ "trigger": { "type": "object", "properties": { "signal": { "type": "string" } } },
244
+ "intervention": { "type": "object", "properties": { "action": { "type": "string" } } },
245
+ "persona_reactions": {
246
+ "type": "object",
247
+ "additionalProperties": {
248
+ "type": "object",
249
+ "properties": { "success_probability": { "type": "number", "minimum": 0, "maximum": 1 } }
250
+ }
251
+ }
252
+ }
253
+ }
254
+ }
255
+ }
256
+ },
257
+ {
258
+ "if": { "properties": { "kind": { "const": "JourneyTaxonomy" } } },
259
+ "then": {
260
+ "properties": {
261
+ "spec": {
262
+ "type": "object",
263
+ "required": ["states", "transitions"],
264
+ "properties": {
265
+ "states": { "type": "array", "items": { "type": "string" } },
266
+ "transitions": {
267
+ "type": "array",
268
+ "items": {
269
+ "type": "object",
270
+ "properties": { "from": { "type": "string" }, "to": { "type": "string" } }
271
+ }
272
+ }
273
+ }
274
+ }
275
+ }
276
+ }
277
+ },
278
+ {
279
+ "if": { "properties": { "kind": { "const": "Signal" } } },
280
+ "then": {
281
+ "properties": {
282
+ "spec": {
283
+ "type": "object",
284
+ "required": ["source", "payload_schema"],
285
+ "properties": {
286
+ "source": { "type": "string" },
287
+ "payload_schema": { "type": "string" }
288
+ }
289
+ }
290
+ }
291
+ }
292
+ },
293
+ {
294
+ "if": { "properties": { "kind": { "const": "Detector" } } },
295
+ "then": {
296
+ "properties": {
297
+ "spec": {
298
+ "type": "object",
299
+ "required": ["time_window_ms", "pattern"],
300
+ "properties": {
301
+ "time_window_ms": { "type": "integer" },
302
+ "pattern": { "type": "array", "items": { "type": "string" } }
303
+ }
304
+ }
305
+ }
306
+ }
307
+ },
308
+ {
309
+ "if": { "properties": { "kind": { "const": "Treatment" } } },
310
+ "then": {
311
+ "properties": {
312
+ "spec": {
313
+ "type": "object",
314
+ "required": ["action_type"],
315
+ "properties": {
316
+ "action_type": { "type": "string" },
317
+ "payload_template": { "type": "object" }
318
+ }
319
+ }
320
+ }
321
+ }
322
+ },
323
+ {
324
+ "if": { "properties": { "kind": { "const": "Campaign" } } },
325
+ "then": {
326
+ "properties": {
327
+ "spec": {
328
+ "type": "object",
329
+ "required": ["treatment_ref", "segment_ref", "channel_ref", "consent_ref"],
330
+ "properties": {
331
+ "treatment_ref": { "type": "string" },
332
+ "segment_ref": { "type": "string" },
333
+ "channel_ref": { "type": "string" },
334
+ "consent_ref": { "type": "string" }
335
+ }
336
+ }
337
+ }
338
+ }
339
+ },
340
+ {
341
+ "if": { "properties": { "kind": { "const": "Experiment" } } },
342
+ "then": {
343
+ "properties": {
344
+ "spec": {
345
+ "type": "object",
346
+ "required": ["variants"],
347
+ "properties": {
348
+ "variants": {
349
+ "type": "array",
350
+ "items": {
351
+ "type": "object",
352
+ "properties": {
353
+ "name": { "type": "string" },
354
+ "weight": { "type": "number", "minimum": 0, "maximum": 1 },
355
+ "treatment_ref": { "type": "string" }
356
+ }
357
+ }
358
+ }
359
+ }
360
+ }
361
+ }
362
+ }
363
+ },
364
+ {
365
+ "if": { "properties": { "kind": { "const": "Module" } } },
366
+ "then": {
367
+ "properties": {
368
+ "spec": {
369
+ "type": "object",
370
+ "required": ["resources"],
371
+ "properties": {
372
+ "resources": { "type": "array", "items": { "type": "string" } }
373
+ }
374
+ }
375
+ }
376
+ }
377
+ },
378
+ {
379
+ "if": { "properties": { "kind": { "const": "VerticalPack" } } },
380
+ "then": {
381
+ "properties": {
382
+ "spec": {
383
+ "type": "object",
384
+ "required": ["industry", "modules"],
385
+ "properties": {
386
+ "industry": { "type": "string" },
387
+ "modules": { "type": "array", "items": { "type": "string" } }
388
+ }
389
+ }
390
+ }
391
+ }
392
+ },
393
+ {
394
+ "if": { "properties": { "kind": { "const": "Blueprint" } } },
395
+ "then": {
396
+ "properties": {
397
+ "spec": {
398
+ "type": "object",
399
+ "required": ["topology"],
400
+ "properties": {
401
+ "topology": {
402
+ "type": "object",
403
+ "properties": {
404
+ "nodes": { "type": "array", "items": { "type": "string" } },
405
+ "edges": {
406
+ "type": "array",
407
+ "items": {
408
+ "type": "object",
409
+ "properties": {
410
+ "from": { "type": "string" },
411
+ "to": { "type": "string" }
412
+ }
413
+ }
414
+ }
415
+ }
416
+ }
417
+ }
418
+ }
419
+ }
420
+ }
421
+ },
422
+ {
423
+ "if": { "properties": { "kind": { "const": "Simulation" } } },
424
+ "then": {
425
+ "properties": {
426
+ "spec": {
427
+ "type": "object",
428
+ "required": ["world", "emits"],
429
+ "properties": {
430
+ "world": { "type": "string" },
431
+ "time_bounds": {
432
+ "type": "object",
433
+ "properties": {
434
+ "start": { "type": "string", "format": "date-time" },
435
+ "end": { "type": "string", "format": "date-time" }
436
+ }
437
+ },
438
+ "emits": {
439
+ "type": "array",
440
+ "description": "The critical FLUID contract handoff seam.",
441
+ "items": {
442
+ "type": "object",
443
+ "required": ["exposeId", "contract"],
444
+ "properties": {
445
+ "exposeId": { "type": "string" },
446
+ "contract": {
447
+ "type": "object",
448
+ "required": ["fluidVersion", "kind", "promise"],
449
+ "properties": {
450
+ "fluidVersion": { "type": "string" },
451
+ "kind": { "type": "string", "const": "DataProduct" },
452
+ "promise": { "type": "object" }
453
+ },
454
+ "additionalProperties": true
455
+ }
456
+ }
457
+ }
458
+ }
459
+ }
460
+ }
461
+ }
462
+ }
463
+ }
464
+ ]
465
+ }