fragility-engine 0.6.0__tar.gz

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 (183) hide show
  1. fragility_engine-0.6.0/LICENSE +202 -0
  2. fragility_engine-0.6.0/PKG-INFO +283 -0
  3. fragility_engine-0.6.0/README.md +248 -0
  4. fragility_engine-0.6.0/pyproject.toml +55 -0
  5. fragility_engine-0.6.0/setup.cfg +4 -0
  6. fragility_engine-0.6.0/src/fragility_engine/__init__.py +3 -0
  7. fragility_engine-0.6.0/src/fragility_engine/adversary/__init__.py +27 -0
  8. fragility_engine-0.6.0/src/fragility_engine/adversary/encoding.py +79 -0
  9. fragility_engine-0.6.0/src/fragility_engine/adversary/fitness.py +31 -0
  10. fragility_engine-0.6.0/src/fragility_engine/adversary/pareto.py +74 -0
  11. fragility_engine-0.6.0/src/fragility_engine/adversary/search.py +299 -0
  12. fragility_engine-0.6.0/src/fragility_engine/agents/__init__.py +3 -0
  13. fragility_engine-0.6.0/src/fragility_engine/agents/base.py +14 -0
  14. fragility_engine-0.6.0/src/fragility_engine/agents/stablecoin_agents.py +80 -0
  15. fragility_engine-0.6.0/src/fragility_engine/benchmarks/__init__.py +91 -0
  16. fragility_engine-0.6.0/src/fragility_engine/benchmarks/bundled_artifacts.py +82 -0
  17. fragility_engine-0.6.0/src/fragility_engine/benchmarks/certificate.py +120 -0
  18. fragility_engine-0.6.0/src/fragility_engine/benchmarks/coupled_fork.py +50 -0
  19. fragility_engine-0.6.0/src/fragility_engine/benchmarks/ensemble.py +1105 -0
  20. fragility_engine-0.6.0/src/fragility_engine/benchmarks/flagship.py +178 -0
  21. fragility_engine-0.6.0/src/fragility_engine/benchmarks/hypervolume.py +119 -0
  22. fragility_engine-0.6.0/src/fragility_engine/benchmarks/institutional_composite.py +350 -0
  23. fragility_engine-0.6.0/src/fragility_engine/benchmarks/manifest.py +267 -0
  24. fragility_engine-0.6.0/src/fragility_engine/benchmarks/manifest_inventory.py +26 -0
  25. fragility_engine-0.6.0/src/fragility_engine/benchmarks/stretch_presets.py +45 -0
  26. fragility_engine-0.6.0/src/fragility_engine/benchmarks/suite.py +429 -0
  27. fragility_engine-0.6.0/src/fragility_engine/byow/__init__.py +15 -0
  28. fragility_engine-0.6.0/src/fragility_engine/byow/check.py +40 -0
  29. fragility_engine-0.6.0/src/fragility_engine/byow/examples/__init__.py +51 -0
  30. fragility_engine-0.6.0/src/fragility_engine/byow/examples/capacity_pool.py +113 -0
  31. fragility_engine-0.6.0/src/fragility_engine/byow/examples/token_bucket.py +97 -0
  32. fragility_engine-0.6.0/src/fragility_engine/byow/rollout.py +68 -0
  33. fragility_engine-0.6.0/src/fragility_engine/cli/__init__.py +5 -0
  34. fragility_engine-0.6.0/src/fragility_engine/cli/main.py +267 -0
  35. fragility_engine-0.6.0/src/fragility_engine/coevolution/__init__.py +73 -0
  36. fragility_engine-0.6.0/src/fragility_engine/coevolution/alternating.py +444 -0
  37. fragility_engine-0.6.0/src/fragility_engine/coevolution/coupled_institution.py +149 -0
  38. fragility_engine-0.6.0/src/fragility_engine/coevolution/defender.py +332 -0
  39. fragility_engine-0.6.0/src/fragility_engine/coevolution/pareto_export.py +69 -0
  40. fragility_engine-0.6.0/src/fragility_engine/coevolution/thread_safe_template.py +54 -0
  41. fragility_engine-0.6.0/src/fragility_engine/explain/__init__.py +146 -0
  42. fragility_engine-0.6.0/src/fragility_engine/explain/counterfactual.py +608 -0
  43. fragility_engine-0.6.0/src/fragility_engine/explain/counterfactual_chain.py +260 -0
  44. fragility_engine-0.6.0/src/fragility_engine/explain/counterfactual_chain_aggregate.py +155 -0
  45. fragility_engine-0.6.0/src/fragility_engine/explain/counterfactual_chain_inventory_buffer.py +168 -0
  46. fragility_engine-0.6.0/src/fragility_engine/explain/counterfactual_chain_liquidity_ladder.py +168 -0
  47. fragility_engine-0.6.0/src/fragility_engine/explain/counterfactual_chain_resource_cascade.py +178 -0
  48. fragility_engine-0.6.0/src/fragility_engine/explain/counterfactual_chain_service_backlog.py +177 -0
  49. fragility_engine-0.6.0/src/fragility_engine/explain/explanation_dag.py +159 -0
  50. fragility_engine-0.6.0/src/fragility_engine/explain/interaction_summary.py +63 -0
  51. fragility_engine-0.6.0/src/fragility_engine/explain/merge_attribution.py +119 -0
  52. fragility_engine-0.6.0/src/fragility_engine/explain/minimal_collapse.py +101 -0
  53. fragility_engine-0.6.0/src/fragility_engine/explain/narration.py +259 -0
  54. fragility_engine-0.6.0/src/fragility_engine/explain/sweep.py +535 -0
  55. fragility_engine-0.6.0/src/fragility_engine/explain/trace.py +495 -0
  56. fragility_engine-0.6.0/src/fragility_engine/falsify/__init__.py +16 -0
  57. fragility_engine-0.6.0/src/fragility_engine/falsify/examples/__init__.py +44 -0
  58. fragility_engine-0.6.0/src/fragility_engine/falsify/examples/ranked_store.py +102 -0
  59. fragility_engine-0.6.0/src/fragility_engine/falsify/protocol.py +45 -0
  60. fragility_engine-0.6.0/src/fragility_engine/falsify/rollout.py +66 -0
  61. fragility_engine-0.6.0/src/fragility_engine/fel/__init__.py +27 -0
  62. fragility_engine-0.6.0/src/fragility_engine/fel/conventions.py +150 -0
  63. fragility_engine-0.6.0/src/fragility_engine/network/__init__.py +24 -0
  64. fragility_engine-0.6.0/src/fragility_engine/network/contagion.py +90 -0
  65. fragility_engine-0.6.0/src/fragility_engine/network/contagion_graph.py +77 -0
  66. fragility_engine-0.6.0/src/fragility_engine/network/graph_cli.py +36 -0
  67. fragility_engine-0.6.0/src/fragility_engine/network/neighbor_io.py +39 -0
  68. fragility_engine-0.6.0/src/fragility_engine/network/network_world_cli.py +77 -0
  69. fragility_engine-0.6.0/src/fragility_engine/network/topology.py +22 -0
  70. fragility_engine-0.6.0/src/fragility_engine/parallel_rollouts.py +66 -0
  71. fragility_engine-0.6.0/src/fragility_engine/runner.py +592 -0
  72. fragility_engine-0.6.0/src/fragility_engine/runner_resource_cascade_numba.py +411 -0
  73. fragility_engine-0.6.0/src/fragility_engine/types.py +52 -0
  74. fragility_engine-0.6.0/src/fragility_engine/world/__init__.py +22 -0
  75. fragility_engine-0.6.0/src/fragility_engine/world/base.py +35 -0
  76. fragility_engine-0.6.0/src/fragility_engine/world/inventory_buffer.py +106 -0
  77. fragility_engine-0.6.0/src/fragility_engine/world/liquidity_ladder.py +109 -0
  78. fragility_engine-0.6.0/src/fragility_engine/world/resource_cascade.py +111 -0
  79. fragility_engine-0.6.0/src/fragility_engine/world/service_backlog.py +104 -0
  80. fragility_engine-0.6.0/src/fragility_engine/world/stablecoin_network.py +231 -0
  81. fragility_engine-0.6.0/src/fragility_engine/world/stablecoin_peg.py +116 -0
  82. fragility_engine-0.6.0/src/fragility_engine.egg-info/PKG-INFO +283 -0
  83. fragility_engine-0.6.0/src/fragility_engine.egg-info/SOURCES.txt +181 -0
  84. fragility_engine-0.6.0/src/fragility_engine.egg-info/dependency_links.txt +1 -0
  85. fragility_engine-0.6.0/src/fragility_engine.egg-info/entry_points.txt +2 -0
  86. fragility_engine-0.6.0/src/fragility_engine.egg-info/requires.txt +13 -0
  87. fragility_engine-0.6.0/src/fragility_engine.egg-info/top_level.txt +1 -0
  88. fragility_engine-0.6.0/tests/test_attack_pareto_hypervolume.py +47 -0
  89. fragility_engine-0.6.0/tests/test_attribution_viewer_bundled.py +69 -0
  90. fragility_engine-0.6.0/tests/test_attribution_viewer_presets.py +30 -0
  91. fragility_engine-0.6.0/tests/test_benchmark_bundle_search_evaluator.py +19 -0
  92. fragility_engine-0.6.0/tests/test_benchmark_manifest.py +61 -0
  93. fragility_engine-0.6.0/tests/test_benchmark_perf_gate.py +50 -0
  94. fragility_engine-0.6.0/tests/test_benchmark_suite.py +47 -0
  95. fragility_engine-0.6.0/tests/test_bundle_integral_bands.py +56 -0
  96. fragility_engine-0.6.0/tests/test_bundled_explanation_dag.py +47 -0
  97. fragility_engine-0.6.0/tests/test_bundled_pareto_hypervolume.py +47 -0
  98. fragility_engine-0.6.0/tests/test_byow_cli_falsify.py +123 -0
  99. fragility_engine-0.6.0/tests/test_check_bundled_artifacts.py +27 -0
  100. fragility_engine-0.6.0/tests/test_check_flagship_bundled.py +20 -0
  101. fragility_engine-0.6.0/tests/test_check_manifest_digest.py +15 -0
  102. fragility_engine-0.6.0/tests/test_check_manifest_inventory.py +13 -0
  103. fragility_engine-0.6.0/tests/test_check_manifest_summary.py +9 -0
  104. fragility_engine-0.6.0/tests/test_coevolution_coupled_institution.py +28 -0
  105. fragility_engine-0.6.0/tests/test_coevolution_network.py +122 -0
  106. fragility_engine-0.6.0/tests/test_coevolution_pareto_export.py +40 -0
  107. fragility_engine-0.6.0/tests/test_coevolution_smoke.py +118 -0
  108. fragility_engine-0.6.0/tests/test_composite_demo_sample.py +41 -0
  109. fragility_engine-0.6.0/tests/test_composite_viewer_presets.py +35 -0
  110. fragility_engine-0.6.0/tests/test_contagion_bounded.py +35 -0
  111. fragility_engine-0.6.0/tests/test_counterfactual_api.py +42 -0
  112. fragility_engine-0.6.0/tests/test_counterfactual_chain.py +271 -0
  113. fragility_engine-0.6.0/tests/test_counterfactual_chain_aggregate.py +68 -0
  114. fragility_engine-0.6.0/tests/test_counterfactual_chain_inventory_buffer.py +70 -0
  115. fragility_engine-0.6.0/tests/test_counterfactual_chain_liquidity_ladder.py +62 -0
  116. fragility_engine-0.6.0/tests/test_counterfactual_chain_resource_cascade.py +105 -0
  117. fragility_engine-0.6.0/tests/test_counterfactual_chain_service_backlog.py +105 -0
  118. fragility_engine-0.6.0/tests/test_counterfactual_expanded.py +76 -0
  119. fragility_engine-0.6.0/tests/test_counterfactual_liquidity_ladder.py +66 -0
  120. fragility_engine-0.6.0/tests/test_counterfactual_network.py +50 -0
  121. fragility_engine-0.6.0/tests/test_counterfactual_network_interventions.py +151 -0
  122. fragility_engine-0.6.0/tests/test_counterfactual_resource_cascade.py +71 -0
  123. fragility_engine-0.6.0/tests/test_counterfactual_service_backlog.py +64 -0
  124. fragility_engine-0.6.0/tests/test_coupled_fork_certificate.py +42 -0
  125. fragility_engine-0.6.0/tests/test_coupled_fork_helpers.py +37 -0
  126. fragility_engine-0.6.0/tests/test_coupled_fork_manifest.py +35 -0
  127. fragility_engine-0.6.0/tests/test_coupled_fork_pareto.py +30 -0
  128. fragility_engine-0.6.0/tests/test_coupled_fork_pareto_search_golden.py +60 -0
  129. fragility_engine-0.6.0/tests/test_coupled_mutation_chain_dag.py +34 -0
  130. fragility_engine-0.6.0/tests/test_coupled_replay_viewer_contract.py +35 -0
  131. fragility_engine-0.6.0/tests/test_explain_merge_attribution.py +158 -0
  132. fragility_engine-0.6.0/tests/test_explain_sweep.py +197 -0
  133. fragility_engine-0.6.0/tests/test_explain_trace.py +30 -0
  134. fragility_engine-0.6.0/tests/test_explanation_dag.py +59 -0
  135. fragility_engine-0.6.0/tests/test_fel_conventions.py +66 -0
  136. fragility_engine-0.6.0/tests/test_fitness_attack_cost.py +38 -0
  137. fragility_engine-0.6.0/tests/test_flagship_bundled.py +64 -0
  138. fragility_engine-0.6.0/tests/test_flagship_demo.py +18 -0
  139. fragility_engine-0.6.0/tests/test_fragility_certificate.py +34 -0
  140. fragility_engine-0.6.0/tests/test_fragility_robustness_ensemble.py +191 -0
  141. fragility_engine-0.6.0/tests/test_fragility_surface.py +23 -0
  142. fragility_engine-0.6.0/tests/test_ga_budget_robustness.py +93 -0
  143. fragility_engine-0.6.0/tests/test_gce_run_coupled_mode.py +42 -0
  144. fragility_engine-0.6.0/tests/test_gce_run_server_auth.py +142 -0
  145. fragility_engine-0.6.0/tests/test_gce_workbench_status.py +27 -0
  146. fragility_engine-0.6.0/tests/test_genetic_improves.py +35 -0
  147. fragility_engine-0.6.0/tests/test_genetic_search_parallel.py +103 -0
  148. fragility_engine-0.6.0/tests/test_genetic_search_process_pool.py +19 -0
  149. fragility_engine-0.6.0/tests/test_hypervolume.py +31 -0
  150. fragility_engine-0.6.0/tests/test_institutional_composite.py +158 -0
  151. fragility_engine-0.6.0/tests/test_integral_and_recovery_fields.py +35 -0
  152. fragility_engine-0.6.0/tests/test_interaction_summary.py +58 -0
  153. fragility_engine-0.6.0/tests/test_inventory_buffer_rollout.py +27 -0
  154. fragility_engine-0.6.0/tests/test_liquidity_ladder_rollout.py +28 -0
  155. fragility_engine-0.6.0/tests/test_minimal_collapse.py +32 -0
  156. fragility_engine-0.6.0/tests/test_monte_carlo_parallel.py +40 -0
  157. fragility_engine-0.6.0/tests/test_narration.py +201 -0
  158. fragility_engine-0.6.0/tests/test_neighbor_list_topology.py +98 -0
  159. fragility_engine-0.6.0/tests/test_network_graph_cli.py +64 -0
  160. fragility_engine-0.6.0/tests/test_network_rollout.py +74 -0
  161. fragility_engine-0.6.0/tests/test_network_single_node_matches_aggregate.py +44 -0
  162. fragility_engine-0.6.0/tests/test_parallel_rollouts.py +50 -0
  163. fragility_engine-0.6.0/tests/test_pareto_collect.py +28 -0
  164. fragility_engine-0.6.0/tests/test_pareto_front_hypervolume_fixture.py +44 -0
  165. fragility_engine-0.6.0/tests/test_pareto_indices.py +12 -0
  166. fragility_engine-0.6.0/tests/test_pareto_viewer_presets.py +68 -0
  167. fragility_engine-0.6.0/tests/test_phase_o_stretch.py +62 -0
  168. fragility_engine-0.6.0/tests/test_plot_institutional_composite.py +166 -0
  169. fragility_engine-0.6.0/tests/test_replay_contract_inventory_buffer.py +18 -0
  170. fragility_engine-0.6.0/tests/test_replay_contract_liquidity_ladder.py +39 -0
  171. fragility_engine-0.6.0/tests/test_replay_contract_resource_cascade.py +42 -0
  172. fragility_engine-0.6.0/tests/test_replay_contract_service_backlog.py +42 -0
  173. fragility_engine-0.6.0/tests/test_replay_schema.py +50 -0
  174. fragility_engine-0.6.0/tests/test_replay_viewer_presets.py +77 -0
  175. fragility_engine-0.6.0/tests/test_resource_cascade_numba_parity.py +89 -0
  176. fragility_engine-0.6.0/tests/test_resource_cascade_rollout.py +66 -0
  177. fragility_engine-0.6.0/tests/test_rollout_determinism.py +28 -0
  178. fragility_engine-0.6.0/tests/test_runner_network_defender.py +35 -0
  179. fragility_engine-0.6.0/tests/test_scripts_cli_smoke.py +5014 -0
  180. fragility_engine-0.6.0/tests/test_scripts_help_smoke.py +34 -0
  181. fragility_engine-0.6.0/tests/test_service_backlog_rollout.py +52 -0
  182. fragility_engine-0.6.0/tests/test_thread_safe_template.py +86 -0
  183. fragility_engine-0.6.0/tests/test_validate_viewer_presets.py +20 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 David Peterson, Agentic Ops (https://agenticop.io)
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,283 @@
1
+ Metadata-Version: 2.4
2
+ Name: fragility-engine
3
+ Version: 0.6.0
4
+ Summary: Deterministic search and stress-style exploration over modular simulations, with JSON replay and benchmark checks.
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/AgenticOp-io/fragility-discovery-engine
7
+ Project-URL: Repository, https://github.com/AgenticOp-io/fragility-discovery-engine
8
+ Project-URL: Documentation, https://github.com/AgenticOp-io/fragility-discovery-engine/blob/main/docs/WHITEPAPER_INTRODUCTION.md
9
+ Project-URL: Issues, https://github.com/AgenticOp-io/fragility-discovery-engine/issues
10
+ Keywords: simulation,robustness,stress-testing,counterfactual,benchmark
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: Implementation :: CPython
20
+ Classifier: Topic :: Scientific/Engineering
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: numpy>=1.26
25
+ Requires-Dist: networkx>=3.2
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=8.0; extra == "dev"
28
+ Requires-Dist: ruff>=0.8.0; extra == "dev"
29
+ Requires-Dist: matplotlib>=3.8.0; extra == "dev"
30
+ Provides-Extra: viz
31
+ Requires-Dist: matplotlib>=3.8.0; extra == "viz"
32
+ Provides-Extra: accelerate
33
+ Requires-Dist: numba>=0.59; extra == "accelerate"
34
+ Dynamic: license-file
35
+
36
+ # Fragility Discovery Engine
37
+
38
+ **Agents / automated reviewers:** read [`AI_READ.md`](AI_READ.md) first (what this is, why it exists, how the loop works, common misreads).
39
+
40
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.20455688.svg)](https://doi.org/10.5281/zenodo.20455688)
41
+
42
+ **Releases / git tags:** [`RELEASING.md`](RELEASING.md) · **Latest:** [v0.6.0](https://github.com/AgenticOp-io/fragility-discovery-engine/releases/tag/v0.6.0) (BYOW CLI + falsification harness; wheel on GitHub Releases) · **FEL / Zenodo:** [fel-v0.1.1](https://github.com/AgenticOp-io/fragility-discovery-engine/releases/tag/fel-v0.1.1) · **Citation:** [`CITATION.cff`](CITATION.cff) · **Coupled multi-kernel work (fork policy):** [`docs/FORK_COUPLING_RESEARCH.md`](docs/FORK_COUPLING_RESEARCH.md) · **New minimal GCE VM:** [`docs/GCE_BOOTSTRAP.md`](docs/GCE_BOOTSTRAP.md)
43
+
44
+ **Directed search** (Monte Carlo and **genetic algorithms**) over modular discrete-time simulations — or **your own world** via [`docs/BRING_YOUR_OWN_WORLD.md`](docs/BRING_YOUR_OWN_WORLD.md). Export replay JSON, minimized failing schedules, and counterfactual attribution bundles.
45
+
46
+ **Install + BYOW CLI (v0.6.0):**
47
+
48
+ ```powershell
49
+ pip install fragility-engine
50
+ # or: pip install -e ".[dev]"
51
+ fragility search --example capacity-pool
52
+ fragility minimize --example capacity-pool
53
+ fragility falsify search --example ranked-store
54
+ fragility certify
55
+ ```
56
+
57
+ **Public demo** (browse-first; live runs are API-key gated): http://34.61.255.147/ · same VM as [hub.agenticop.io](https://hub.agenticop.io/) (Translation Hub) · [guardrails](docs/GCE_HTTPS_AND_AUTH.md)
58
+
59
+ **Documentation hub:** [`docs/README.md`](docs/README.md) — index by role (user, contributor, reviewer). **Hands-on guide:** [`docs/HOW_TO_USE.md`](docs/HOW_TO_USE.md) · **Architecture / reference:** [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md), [`docs/REFERENCE.md`](docs/REFERENCE.md) · **After clone:** [`docs/NEXT_STEPS.md`](docs/NEXT_STEPS.md) · **Install / Git:** [`docs/INSTALLATION.md`](docs/INSTALLATION.md) · **Whitepaper:** [`docs/WHITEPAPER.md`](docs/WHITEPAPER.md)
60
+
61
+ ## Supported platforms
62
+
63
+ **Validation:** run tests on **Windows** (`powershell -File scripts/ci_local.ps1`) or **GCE** (`bash scripts/gce_pull_and_test.sh` on the VM). GitHub Actions CI runs on **push/PR to `main`** and via `workflow_dispatch`.
64
+
65
+ ## Cite
66
+
67
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.20455688.svg)](https://doi.org/10.5281/zenodo.20455688)
68
+
69
+ - **Concept DOI (latest):** [10.5281/zenodo.20455688](https://doi.org/10.5281/zenodo.20455688)
70
+ - **v0.6.0 version:** [10.5281/zenodo.21303841](https://doi.org/10.5281/zenodo.21303841)
71
+ - **FEL snapshot:** [10.5281/zenodo.20455689](https://doi.org/10.5281/zenodo.20455689) (`fel-v0.1.1`)
72
+ - **Machine-readable:** [`CITATION.cff`](CITATION.cff)
73
+ - **Preprint:** [`docs/preprint/FEL_preprint_v0.1.md`](docs/preprint/FEL_preprint_v0.1.md)
74
+ - **Repro bundle:** `fragility certify` or `python scripts/run_flagship_demo.py`
75
+ - **Install:** `pip install fragility-engine` (PyPI, when published) or [GitHub Release wheel](https://github.com/AgenticOp-io/fragility-discovery-engine/releases/tag/v0.6.0)
76
+
77
+ ```bibtex
78
+ @software{peterson2026fde,
79
+ author = {David Peterson},
80
+ title = {Fragility Discovery Engine},
81
+ year = {2026},
82
+ doi = {10.5281/zenodo.20455688},
83
+ url = {https://doi.org/10.5281/zenodo.20455688}
84
+ }
85
+ ```
86
+
87
+ ## What this is / is not
88
+
89
+ | Is | Is not |
90
+ |----|--------|
91
+ | Deterministic stress-search **harness** + JSON evidence contracts | Calibrated model of any real institution |
92
+ | BYOW adapter for your steppable simulation | Drop-in prod risk engine |
93
+ | Counterfactual **re-run** attribution (FEL Δ conventions) | Causal identification / compliance sign-off |
94
+ | Six **toy oracles** for frozen regression CI | Seventh charter domain (closed) |
95
+
96
+ See [`BOUNDARIES.md`](BOUNDARIES.md) non-goals.
97
+
98
+ Build **sdist + wheel** locally with `python -m build` (or set `FRAGILITY_CI_LOCAL_BUILD=1` in `ci_local`). Core package code is pure Python; dependencies resolve via PyPI wheels (`numpy`, `networkx`, optional `numba`). Requires **CPython ≥ 3.11** ([`pyproject.toml`](pyproject.toml)).
99
+
100
+ ## Layout (core Python packages)
101
+
102
+ | Layer | Role |
103
+ |--------|------|
104
+ | `fragility_engine.world` | Domain physics only — no attacker concepts. |
105
+ | `fragility_engine.agents` | Behavior archetypes — `observe → decide → act`. |
106
+ | `fragility_engine.adversary` | Deterministic search (Monte Carlo + GA) over shock schedules. |
107
+ | `fragility_engine.explain` | Ablation, schedule minimization, **counterfactual** bundles, mutation chains, sweeps. |
108
+ | `fragility_engine.network` | ``ContagionGraph`` + topology; contagion uses **neighbor lists** (**O(edges)** per step, dense adjacency storage unchanged). |
109
+ | `fragility_engine.coevolution` | Alternating attacker/defender search; aggregate + network + `alternating_coevolution_rollout` hook for custom worlds. |
110
+
111
+ The **numerical core** is **deterministic** (fixed NumPy RNG seeds). LLM policies stay out until the core loop is proven.
112
+
113
+ **Scope creep guardrail:** read [`BOUNDARIES.md`](BOUNDARIES.md) before adding agents, graph models, multi-objective fitness, UI, or defender loops.
114
+
115
+ **Where we go next (aspirational):** [`ROADMAP_NEXT.md`](ROADMAP_NEXT.md). Phases **Q → R → S** shipped at **v0.6.0**. **Normative gates:** [`BOUNDARIES.md`](BOUNDARIES.md). **Operator checklist:** [`docs/NEXT_STEPS.md`](docs/NEXT_STEPS.md). **Agents:** [`AI_READ.md`](AI_READ.md).
116
+
117
+ **Phase J (second domain narrative):** [`docs/WHY_RESOURCE_CASCADE.md`](docs/WHY_RESOURCE_CASCADE.md) — why `ResourceCascadeWorld` exists and what we do *not* claim. Worked counterfactual commands: [`docs/resource_cascade_counterfactual_example.md`](docs/resource_cascade_counterfactual_example.md).
118
+
119
+ **Phase M (third domain narrative):** [`docs/WHY_SERVICE_BACKLOG.md`](docs/WHY_SERVICE_BACKLOG.md) — `ServiceBacklogWorld` + `simulation_mode` **`service_backlog`**; gate + replay table: [`docs/phase_m_third_reference_domain.md`](docs/phase_m_third_reference_domain.md). Counterfactual cookbook: [`docs/service_backlog_counterfactual_example.md`](docs/service_backlog_counterfactual_example.md).
120
+
121
+ **Phase N (fourth domain narrative):** [`docs/WHY_LIQUIDITY_LADDER.md`](docs/WHY_LIQUIDITY_LADDER.md) — `LiquidityLadderWorld` + `simulation_mode` **`liquidity_ladder`**; gate: [`docs/phase_n_liquidity_ladder.md`](docs/phase_n_liquidity_ladder.md). Counterfactual cookbook: [`docs/liquidity_ladder_counterfactual_example.md`](docs/liquidity_ladder_counterfactual_example.md).
122
+
123
+ **Phase O (sixth domain narrative):** [`docs/WHY_INVENTORY_BUFFER.md`](docs/WHY_INVENTORY_BUFFER.md) — `InventoryBufferWorld` + `simulation_mode` **`inventory_buffer`**; gate: [`docs/phase_o_stretch.md`](docs/phase_o_stretch.md). Counterfactual cookbook: [`docs/inventory_buffer_counterfactual_example.md`](docs/inventory_buffer_counterfactual_example.md).
124
+
125
+ **Toy-model scope:** all six reference worlds are deliberately simplified stress kernels — not calibrated to any real institution. See [`BOUNDARIES.md`](BOUNDARIES.md) non-goals and [`docs/AUDIT_RESOLUTION.md`](docs/AUDIT_RESOLUTION.md).
126
+
127
+ **Your system, not our toys:** the engine's value on a real problem comes from a world *you* write — a ~100-line adapter (`reset` / `step` / `state_vector` / `instability_score` / `is_collapsed`), after which search, minimization, attribution, and replay work unchanged. Tutorial + runnable example: [`docs/BRING_YOUR_OWN_WORLD.md`](docs/BRING_YOUR_OWN_WORLD.md), [`examples/bring_your_own_world.py`](examples/bring_your_own_world.py). Honest bar before you invest: the engine earns its keep only when the worst-case shock *ordering* is non-obvious — if the search merely rediscovers "everything at once is bad," it added nothing. The doc includes a one-day falsification test for exactly that.
128
+
129
+ **Reproducible benchmarks:** [`benchmarks/README.md`](benchmarks/README.md) — `python scripts/run_benchmark_suite.py --validate`. **Validation (Windows or GCE):** [`docs/INSTALLATION.md`](docs/INSTALLATION.md) — `pwsh -File scripts/ci_local.ps1` or `bash scripts/gce_pull_and_test.sh` on the VM.
130
+
131
+ **Paper-style walkthrough (one path):** [`docs/PAPER_APPENDIX_WORKFLOW.md`](docs/PAPER_APPENDIX_WORKFLOW.md) · **Scale / limits (honest):** [`docs/SCALE_AND_LIMITS.md`](docs/SCALE_AND_LIMITS.md) · **Citation JSON:** `fragility-certificate-v1` via `scripts/export_fragility_certificate.py` / `scripts/run_flagship_demo.py` · **Research frontiers (third domain, coupling):** [`docs/RESEARCH_FRONTIERS.md`](docs/RESEARCH_FRONTIERS.md).
132
+
133
+ ## Quick start
134
+
135
+ Follow **[`docs/HOW_TO_USE.md`](docs/HOW_TO_USE.md)** for a full tutorial layout; the steps below match the Windows fast path.
136
+
137
+ **Windows — install CPython with winget** (avoids the Microsoft Store `python.exe` stubs). Requires **Python ≥ 3.11** ([`pyproject.toml`](pyproject.toml)):
138
+
139
+ ```powershell
140
+ winget install Python.Python.3.12 --accept-package-agreements --accept-source-agreements
141
+ ```
142
+
143
+ Open a **new** terminal, then create a venv and install dev deps (use **`py -3.12`** if the launcher is on your `PATH`, or run **`python.exe`** from `%LocalAppData%\Programs\Python\` — e.g. `Python312-x64` on amd64):
144
+
145
+ ```powershell
146
+ cd C:\Users\david\projects\fragility-discovery-engine
147
+ py -3.12 -m venv .venv
148
+ .\.venv\Scripts\Activate.ps1
149
+ pip install -e ".[dev]"
150
+ # Optional Numba (`pip install -e ".[accelerate]"`): on Windows on ARM, prefer **x64** CPython under emulation (`Python312-x64`) so wheels match; see `.\scripts\install_accelerate_windows.ps1` and docs/phase_k_acceleration.md.
151
+ # Tests: use ``python -m pytest`` (Linux/macOS/GCE/CI). Only Windows venvs expose ``pytest.exe``; that shim does not exist on Unix.
152
+ python -m pytest -q
153
+ python scripts/week1_smoke.py
154
+ python scripts/run_ga_demo.py
155
+ ```
156
+
157
+ ### Google Compute Engine (Linux VM)
158
+
159
+ Use a small **Debian/Ubuntu** instance when you want Linux CI parity or heavier `pytest` runs. **Prefer git clone/pull on the VM** instead of uploading tarballs from your laptop.
160
+
161
+ **One-shot deploy** (public `main`; installs Python 3.11+ via `apt` if needed, shallow clone, venv, editable install):
162
+
163
+ ```bash
164
+ sudo apt-get update && sudo apt-get install -y git curl python3.11 python3.11-venv
165
+ curl -fsSL https://raw.githubusercontent.com/AgenticOp-io/fragility-discovery-engine/main/scripts/gce_git_deploy.sh | bash
166
+ ```
167
+
168
+ **Private repo:** `raw.githubusercontent.com` will **404** — copy both scripts from your laptop, then SSH (see [`docs/GCE_DEPLOY_KEY.md`](docs/GCE_DEPLOY_KEY.md)):
169
+
170
+ ```bash
171
+ gcloud compute scp scripts/gce_git_deploy.sh scripts/gce_remote_git_deploy.sh acs-hss-server:/tmp/ --zone=us-central1-a
172
+ gcloud compute ssh acs-hss-server --zone=us-central1-a --command='bash /tmp/gce_remote_git_deploy.sh'
173
+ ```
174
+
175
+ Run tests after install:
176
+
177
+ ```bash
178
+ curl -fsSL https://raw.githubusercontent.com/AgenticOp-io/fragility-discovery-engine/main/scripts/gce_git_deploy.sh | FRAGILITY_RUN_TESTS=1 bash
179
+ ```
180
+
181
+ Or after the first clone: `FRAGILITY_RUN_TESTS=1 bash ~/fragility-discovery-engine/scripts/gce_git_deploy.sh`
182
+
183
+ **Updates:** rerun the script from anywhere — it **`git pull`s** when `~/fragility-discovery-engine` already exists.
184
+
185
+ **Private repo:** use a **deploy key** (recommended): [`docs/GCE_DEPLOY_KEY.md`](docs/GCE_DEPLOY_KEY.md) — generate with [`scripts/generate_gce_deploy_key.ps1`](scripts/generate_gce_deploy_key.ps1), add `.pub` on GitHub, copy private key to the VM, then set `FRAGILITY_REPO_URL` + `GIT_SSH_COMMAND` as documented.
186
+
187
+ Alternatives: SSH agent forwarding, or HTTPS + token (avoid logging tokens; prefer deploy keys).
188
+
189
+ Optional env: `FRAGILITY_DEPLOY_DIR`, `FRAGILITY_BRANCH`, `FRAGILITY_PYTHON`, `FRAGILITY_SHALLOW=0` for full history — see header in [`scripts/gce_git_deploy.sh`](scripts/gce_git_deploy.sh).
190
+
191
+ To have **Cursor** run **on the VM**, use **Remote - SSH** and open the deploy directory as the workspace.
192
+
193
+ **winget** is Windows-only; on the VM use **`apt`** as above.
194
+
195
+ ## Scripts
196
+
197
+ | Script | Purpose |
198
+ |--------|---------|
199
+ | `scripts/week1_smoke.py` | Deterministic rollout smoke (`--export-replay`, `--initial-panic`, `--continue-after-collapse`) |
200
+ | `scripts/run_mc_demo.py` | Monte Carlo random schedules (`--export-replay`, `--continue-after-collapse`) |
201
+ | `scripts/export_minimized_replay.py` | Random collapsing schedule → greedy minimization → replay JSON; optional **`--minimization-report-out`** (JSON for `export_explanation_dag.py`) |
202
+ | `scripts/export_explanation_dag.py` | **`explanation-dag-v1`** from **`--from-counterfactual`** or **`--from-minimization-report`** |
203
+ | `scripts/run_ga_demo.py` | GA + greedy minimization (`--export-replay`, `--export-minimized-replay`, `--generations`, `--population-size`, `--seed`) |
204
+ | `scripts/run_resource_cascade_ga_demo.py` | Phase **J** scaffold: GA + minimization on **`ResourceCascadeWorld`** (`--initial-overload`, same export flags); see [`docs/phase_j_resource_cascade.md`](docs/phase_j_resource_cascade.md) |
205
+ | `scripts/run_service_backlog_ga_demo.py` | Phase **M** third domain: GA + minimization on **`ServiceBacklogWorld`** (`--initial-backlog`, same export flags); see [`docs/phase_m_third_reference_domain.md`](docs/phase_m_third_reference_domain.md), [`docs/WHY_SERVICE_BACKLOG.md`](docs/WHY_SERVICE_BACKLOG.md) |
206
+ | `scripts/run_liquidity_ladder_ga_demo.py` | Phase **N** fourth domain: GA + minimization on **`LiquidityLadderWorld`** (`--initial-margin`, same export flags); see [`docs/phase_n_liquidity_ladder.md`](docs/phase_n_liquidity_ladder.md), [`docs/WHY_LIQUIDITY_LADDER.md`](docs/WHY_LIQUIDITY_LADDER.md) |
207
+ | `scripts/run_network_demo.py` | GA on **graph contagion** (`--graph-kind`, `--neighbor-json` / `--neighbor-weights-json`, `--export-replay`, sizing flags) |
208
+ | `scripts/export_replay.py` | `replay.json`: **`--mode aggregate|network|resource_cascade|service_backlog|liquidity_ladder|inventory_buffer`** (domain-specific reset flags — see `--help`) |
209
+ | `scripts/fragility_surface.py` | CSV fragility grid; `--panic-*`, `--depeg-*`, `integral_instability` column |
210
+ | `scripts/run_coevolution.py` | Alternating attacker/defender GA: `--mode aggregate|network|resource_cascade|service_backlog|liquidity_ladder`, **`--initial-overload`** (cascade) / **`--initial-backlog`** (backlog) / **`--initial-margin`** (liquidity), `--continue-after-collapse`, topology flags or `--neighbor-json`, `--collect-attacker-pareto`, **`--export-pareto-json`** (viewer-ready `pareto-front-v1`), `--json-summary`, `--export-replay` |
211
+ | `scripts/export_coevolution_pareto.py` | Convert `--json-summary` output → `pareto_front.json` (`--from-summary`, `--out`) |
212
+ | `scripts/export_pareto_front.py` | `pareto_front.json`; **`--mode aggregate|network|resource_cascade|service_backlog|liquidity_ladder`** (**`--initial-overload`** / **`--initial-backlog`** / **`--initial-margin`**); topology / `--neighbor-json` for network; GA sizing `--horizon`, `--generations`, `--population-size`; `--export-replay` (+ `--replay-pareto-index`) |
213
+ | `scripts/find_cheap_collapse.py` | Cost-penalized GA (`--export-replay`) |
214
+ | `scripts/export_counterfactual.py` | Attribution JSON; **`--mode aggregate|network|resource_cascade|service_backlog|liquidity_ladder`**; cascade: `remove_steps`, **`initial_overload_shift`**, **`cascade_coupling_shift`**; backlog: `remove_steps`, **`initial_backlog_shift`**, **`process_rate_shift`**; liquidity: `remove_steps`, **`initial_margin_shift`**, **`delever_rate_shift`**; network shifts (`base_panic_shift`, …); cookbooks in `docs/*_counterfactual_example.md` |
215
+ | `scripts/export_counterfactual_chain.py` | Ordered mutation chain counterfactual + optional **`--emit-path-trace`** (`explanation-mutation-chain-path-v1`) |
216
+ | `scripts/export_resource_cascade_counterfactual_chain.py` | Phase **J**: **`ResourceCascadeWorld`** cumulative physics chain (`resource-cascade-mutation-chain-spec-v1`) + optional **`--emit-path-trace`** (`explanation-mutation-chain-path-resource-cascade-v1`) |
217
+ | `scripts/export_liquidity_ladder_counterfactual_chain.py` | Phase **N**: **`LiquidityLadderWorld`** cumulative physics chain (`liquidity-ladder-mutation-chain-spec-v1`) + optional **`--emit-path-trace`** (`explanation-mutation-chain-path-liquidity-ladder-v1`) |
218
+ | `scripts/export_resource_cascade_joint_attribution.py` | **`attribution-merge-v1`**: shared-baseline **remove_steps** + **`--second-branch`** **initial_overload_shift** or **cascade_coupling_shift** |
219
+ | `scripts/narrate_frozen_json.py` | Phase **L**: replay / Pareto / merge / epsilon-sweep JSON; **`--cite-digest`**; **`--json-out`** → **`narration-summary-v1`** (core narration lives in **`fragility_engine.explain.narration`**) |
220
+ | `scripts/export_llm_narration_prompt.py` | Phase **L**: **`llm-prompt-bundle-v1`**; **`--prompt-pack`** `narration_v1` \| `reviewer_memo_v1` \| `paper_appendix_v1`; optional **`--invoke-openai`** **`--max-tokens`** |
221
+ | `scripts/plot_replay_timeline.py` | Replay: **`metrics.price`** / **`metrics.instability`** vs timestep; **`fragility-plot-style-v1`** |
222
+ | `scripts/plot_epsilon_sweep.py` | **`counterfactual-epsilon-sweep-v1`** curve + collapse markers; **`fragility-plot-epsilon-sweep-style-v1`** |
223
+ | `scripts/plot_pareto_front.py` | **`pareto-front-v1`**: severity vs attack_cost; **`fragility-plot-pareto-style-v1`** |
224
+ | `scripts/plot_fragility_surface_csv.py` | **`fragility_surface.py`** CSV heatmap (**panic0** × **depeg_threshold**); **`fragility-plot-surface-style-v1`** |
225
+ | `scripts/plot_counterfactual_bars.py` | **`export_counterfactual`** JSON: grouped bars (**integral_instability**, **attack_cost**) baseline vs counterfactual; **`fragility-plot-counterfactual-style-v1`** |
226
+ | `scripts/merge_counterfactual_attribution.py` | Star-merge exports → **`attribution-merge-v1`** |
227
+ | `scripts/summarize_attribution_merge.py` | **`attribution-interaction-summary-v1`** (sum of branch deltas + disclaimer) |
228
+ | `scripts/frozen_json_digest.py` | SHA-256 fingerprints for frozen JSON (`--json-out`) |
229
+ | `scripts/compare_replays.py` | Print JSON diff of top-level replay metrics + **`metric_notes`** (price/headroom semantics); optional `--out` |
230
+ | `scripts/gce_git_deploy.sh` | **Linux VM / GCE:** `git clone` or `git pull`, venv, `pip install -e ".[dev]"` — curl (public) or `scp` + [`gce_remote_git_deploy.sh`](scripts/gce_remote_git_deploy.sh) (private) |
231
+ | `scripts/gce_clone_pull_and_test.sh` | **On VM:** clone (HTTPS or SSH if **`~/.ssh/gce_github_ed25519`** exists) + **`~/.ssh/config`** helper when bundled + pull + **`ruff`** + **`pytest`** (CI perf gate) |
232
+ | `scripts/gce_create_minimal.ps1` / `scripts/gce_create_minimal.sh` | **Bootstrap:** enable Compute API + **e2-micro** Ubuntu **24.04** VM; default **startup** installs **git**, **Python 3.12**, shallow **clone** + **`pip install -e ".[dev]"`** ([`docs/GCE_BOOTSTRAP.md`](docs/GCE_BOOTSTRAP.md)) |
233
+ | `scripts/gce_remote_git_deploy.sh` | VM-side wrapper: SSH env + apt + runs **`/tmp/gce_git_deploy.sh`** (upload both scripts for private GitHub) |
234
+ | `scripts/gce_pull_pytest.sh` | **On VM:** pull **`main`**, `pip install -e ".[dev]"`, **`python -m pytest -q`** only (deploy key env same as `gce_git_deploy.sh`) |
235
+ | `scripts/gce_bootstrap_pull_latest_pytest.sh` | **Bootstrap:** `scp` to VM **`/tmp/`**, then **`bash /tmp/gce_bootstrap_pull_latest_pytest.sh`** — pulls commit that adds `gce_pull_pytest.sh`, then runs it |
236
+ | `scripts/gce_pull_and_test.sh` | **On VM:** pull **`main`**, **`pip install -e ".[dev]"`**, **`ruff`**, **`pytest`** with CI perf gate (`FRAGILITY_PERF_GATE`) — see [`docs/GCE_DEPLOY_KEY.md`](docs/GCE_DEPLOY_KEY.md) |
237
+ | `scripts/gce_configure_git_ssh.sh` | **On VM:** idempotent **`~/.ssh/config`** for **`github.com`** + deploy key (`~/.ssh/gce_github_ed25519`); avoids **`GIT_SSH_COMMAND`** on every pull — see [`docs/GCE_DEPLOY_KEY.md`](docs/GCE_DEPLOY_KEY.md) |
238
+ | `scripts/gce_sync_vm.ps1` | **From Windows:** `scp` (LF-normalized) **`gce_configure_git_ssh.sh`** + **`gce_pull_and_test.sh`**, then **`gcloud compute ssh`** to run both. Args **`-Instance`** / **`-Zone`** or env **`FRAGILITY_GCE_*`** (see [`GCE_DEPLOY_KEY.md`](docs/GCE_DEPLOY_KEY.md) — single VM) |
239
+ | `scripts/generate_gce_deploy_key.ps1` | Create `.deploy/gce_github_ed25519` (+ `.pub`) for GitHub **Deploy keys** — see [`docs/GCE_DEPLOY_KEY.md`](docs/GCE_DEPLOY_KEY.md) |
240
+ | `scripts/install_accelerate_windows.ps1` | Windows **amd64** CPython: `pip install -e ".[dev,accelerate]"` (finds x64 Python / `py -3.12-64`; WoA uses built-in x64 emulation — same wheels as x64 PCs) |
241
+ | `scripts/regenerate_test_exports.ps1` / `scripts/regenerate_test_exports.sh` | Fill `artifacts/test_exports/` for browser QA (gitignored) |
242
+ | `scripts/regenerate_bundled_viewer_samples.py` | Regenerate checked-in `artifacts/replay_viewer/sample_*`, attribution merge, quad composite, flagship bundled JSON |
243
+ | `scripts/check_manifest_digest.py` | CI guard: `golden_metrics_sha256` must match `tests/fixtures/benchmarks/golden_metrics_sha256.txt` |
244
+ | `scripts/export_aggregate_counterfactual_chain.py` | Aggregate peg cumulative mutation chain + optional path trace |
245
+ | `scripts/plot_institutional_composite_bars.py` | Bar chart of per-branch `integral_instability` from institutional composite JSON |
246
+ | `scripts/benchmark_rollout.py` | Wall-clock: **`--bundle <bundle_id>`** (frozen suite IDs in [`benchmarks/README.md`](benchmarks/README.md)), **`--bundle-all`** (full suite JSON), or **ad-hoc** `--mode aggregate|network|resource_cascade|service_backlog|liquidity_ladder|inventory_buffer` (`--json`, **`workflow`** field) |
247
+ | `scripts/run_benchmark_suite.py` | Frozen benchmark suite (`--validate`, `--json`, **`--manifest-out`**, **`--bench-search`**) — see [`benchmarks/README.md`](benchmarks/README.md), charter Phase H in [`BOUNDARIES.md`](BOUNDARIES.md) |
248
+ | `scripts/ci_local.sh` | **Linux / macOS / WSL:** same checks as Windows `ci_local.ps1` (canonical validation path — not GitHub Actions on push) |
249
+ | `scripts/ci_local.ps1` | **Windows PowerShell:** canonical validation (ruff, pytest, manifest pins) |
250
+ | `scripts/run_flagship_demo.py` | **Flagship bundle:** short GA + `pareto_front.json` + **`fragility-certificate-v1`** under `artifacts/flagship/output` (see [`docs/PAPER_APPENDIX_WORKFLOW.md`](docs/PAPER_APPENDIX_WORKFLOW.md)) |
251
+ | `scripts/export_fragility_certificate.py` | Emit **`fragility-certificate-v1`** for digested JSON + env fingerprints (`--digest-json`, optional `--validate-bundles`) |
252
+ | `scripts/fragility_robustness_sweep.py` | Ensemble over **`graph_seed`** or **`--neighbor-json-list`**; physics **`--sweep-*`**; GA **`--ga-budget-sweep`**, **`--ga-population-sweep`** + **`--ga-fixed-generations`**, **`--ga-budget-2d`** — see [`benchmarks/README.md`](benchmarks/README.md) |
253
+ | `scripts/mechanism_design_policy_sweep.py` | Defender presets + inner GA; **`--eval-workers`**; **`fragility-mechanism-design-outer-v1`** |
254
+ | `scripts/institutional_composite_demo.py` | Decoupled multi-kernel composite: twin (**v1**), **`--triple`** (**v2**), **`--quad`** (**v3**), **`--penta`** (**v4**, + liquidity ladder); **`--out`** — see [`benchmarks/README.md`](benchmarks/README.md) |
255
+ | `scripts/export_liquidity_ladder_joint_attribution.py` | **`attribution-merge-v1`**: remove_steps + margin or delever branch — [`docs/liquidity_ladder_counterfactual_example.md`](docs/liquidity_ladder_counterfactual_example.md) |
256
+ | `scripts/counterfactual_epsilon_sweep.py` | **`--mode aggregate|network|resource_cascade|service_backlog|liquidity_ladder`**; axes **`initial_panic`** / **`initial_overload`** / **`initial_backlog`** / **`process_rate`** / **`initial_margin`** / **`delever_rate`** / network scalars; **`--emit-trace`** → `explanation-trace-v1`; [`docs/network_counterfactual_example.md`](docs/network_counterfactual_example.md), cascade cookbook [`docs/resource_cascade_counterfactual_example.md`](docs/resource_cascade_counterfactual_example.md), liquidity cookbook [`docs/liquidity_ladder_counterfactual_example.md`](docs/liquidity_ladder_counterfactual_example.md) |
257
+
258
+ **Plot scripts** (`plot_*.py`) require **`matplotlib`** (`pip install -e ".[dev]"` or **`.[viz]`**).
259
+
260
+ Static **replay** UI: `artifacts/replay_viewer/index.html` — timeline scrub, optional compare replay, hash routing (HTTP). **JSON contracts:** which files this page loads vs not — [`artifacts/replay_viewer/README.md`](artifacts/replay_viewer/README.md).
261
+
262
+ Local **bulk exports** for trying many scenarios in the browser: run `pwsh -File scripts/regenerate_test_exports.ps1` → writes under `artifacts/test_exports/` (gitignored). See `artifacts/README_test_exports.txt`.
263
+
264
+ Static **Pareto** UI: `artifacts/pareto_viewer/index.html` — load `pareto_front.json` (from `scripts/export_pareto_front.py`); bundled aggregate, network, resource cascade, service backlog, and liquidity ladder samples; HTTP **Presets** via `local_presets.json`; hover / click / arrows; optional hash `#src=…&archive=N`. Archive JSON includes `integral_instability` per point.
265
+
266
+ Static **attribution** UI: `artifacts/attribution_viewer/index.html` — `attribution-merge-v1` and mutation-chain path traces.
267
+
268
+ Static **composite** UI: `artifacts/composite_viewer/index.html` — institutional composite v1–v3 branch metrics (HTTP presets). Bundled demo map: [`docs/BUNDLED_ARTIFACTS.md`](docs/BUNDLED_ARTIFACTS.md).
269
+
270
+ ## Extending
271
+
272
+ - **Custom co-evolution:** implement a deterministic ``rollout_fn(schedule, seed, defender)`` and pass it to ``fragility_engine.coevolution.alternating_coevolution_rollout`` (see [`BOUNDARIES.md`](BOUNDARIES.md) Phase G).
273
+ - **Custom topology:** ``ContagionGraph.from_neighbor_lists([[...], ...])`` builds from adjacency lists (symmetrized by default). For **directed out-neighbor lists** without a dense matrix, pass JSON via ``--neighbor-json`` (optional ``--neighbor-weights-json``); replay metadata uses ``neighbor_lists_topology_meta`` (`storage: neighbor_lists`). Synthetic graphs still attach ``undirected_edges`` + ``storage: dense_adjacency``.
274
+ - **Perf gate:** set ``FRAGILITY_PERF_GATE=1`` and ``FRAGILITY_PERF_GATE_MS`` (240s default) when running ``python -m pytest`` locally or on GCE. Without those vars, ``tests/test_benchmark_perf_gate.py`` is skipped.
275
+ - **Numba parity:** CI runs a separate Ubuntu job that installs ``.[accelerate]`` and executes ``tests/test_resource_cascade_numba_parity.py`` (matrix jobs stay NumPy-only for speed and portability).
276
+
277
+ ## Week roadmap (suggested)
278
+
279
+ 1. CLI smoke + collapse metric — `scripts/week1_smoke.py`
280
+ 2. Evolutionary adversary — `scripts/run_ga_demo.py`
281
+ 3. Network contagion — `fragility_engine.network` + `StablecoinNetworkWorld`
282
+ 4. Replay JSON — `runner.rollout_to_replay_dict` (`schema_version` **0.4.0**, includes `events_lane`)
283
+ 5. Static replay / Pareto viewers (`artifacts/*/viewer`) consume frozen JSON; richer web UI remains optional.