faultray 1.2.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 (328) hide show
  1. faultray-1.2.0/.dockerignore +13 -0
  2. faultray-1.2.0/.github/ISSUE_TEMPLATE/bug_report.md +24 -0
  3. faultray-1.2.0/.github/ISSUE_TEMPLATE/feature_request.md +14 -0
  4. faultray-1.2.0/.github/pull_request_template.md +13 -0
  5. faultray-1.2.0/.github/workflows/ci.yml +63 -0
  6. faultray-1.2.0/.github/workflows/fly-deploy.yml +18 -0
  7. faultray-1.2.0/.github/workflows/infrasim-pr-check.yml +123 -0
  8. faultray-1.2.0/.github/workflows/release.yml +28 -0
  9. faultray-1.2.0/.github/workflows/resilience-gate.yml +195 -0
  10. faultray-1.2.0/.gitignore +15 -0
  11. faultray-1.2.0/CONTRIBUTING.md +81 -0
  12. faultray-1.2.0/Dockerfile +23 -0
  13. faultray-1.2.0/HANDOFF_CHAOSPROOF_IMPROVEMENTS.md +424 -0
  14. faultray-1.2.0/HANDOFF_CHAOSPROOF_V2.md +815 -0
  15. faultray-1.2.0/HANDOFF_CHAOSPROOF_V3_PRODUCT.md +727 -0
  16. faultray-1.2.0/LAUNCH.md +104 -0
  17. faultray-1.2.0/LICENSE +21 -0
  18. faultray-1.2.0/PKG-INFO +705 -0
  19. faultray-1.2.0/README.md +643 -0
  20. faultray-1.2.0/action.yml +60 -0
  21. faultray-1.2.0/docker-compose.yml +52 -0
  22. faultray-1.2.0/docs/InfraSim_System_Document.md +634 -0
  23. faultray-1.2.0/docs/api/graphql.md +148 -0
  24. faultray-1.2.0/docs/api/python-sdk.md +144 -0
  25. faultray-1.2.0/docs/api/rest.md +149 -0
  26. faultray-1.2.0/docs/cli/commands.md +138 -0
  27. faultray-1.2.0/docs/competitive-landscape-research.md +688 -0
  28. faultray-1.2.0/docs/concepts/five-layer-model.md +80 -0
  29. faultray-1.2.0/docs/concepts/how-it-works.md +77 -0
  30. faultray-1.2.0/docs/concepts/risk-scoring.md +89 -0
  31. faultray-1.2.0/docs/convert_doc.py +253 -0
  32. faultray-1.2.0/docs/enterprise/compliance.md +63 -0
  33. faultray-1.2.0/docs/enterprise/insurance.md +76 -0
  34. faultray-1.2.0/docs/enterprise/rbac.md +109 -0
  35. faultray-1.2.0/docs/getting-started/first-simulation.md +114 -0
  36. faultray-1.2.0/docs/getting-started/installation.md +58 -0
  37. faultray-1.2.0/docs/getting-started/quickstart.md +63 -0
  38. faultray-1.2.0/docs/index.md +50 -0
  39. faultray-1.2.0/docs/integrations/aws.md +104 -0
  40. faultray-1.2.0/docs/integrations/azure.md +66 -0
  41. faultray-1.2.0/docs/integrations/cicd.md +101 -0
  42. faultray-1.2.0/docs/integrations/gcp.md +70 -0
  43. faultray-1.2.0/docs/integrations/kubernetes.md +78 -0
  44. faultray-1.2.0/docs/integrations/slack.md +70 -0
  45. faultray-1.2.0/docs/integrations/terraform.md +67 -0
  46. faultray-1.2.0/examples/ci/.circleci-config.yml +57 -0
  47. faultray-1.2.0/examples/ci/.gitlab-ci.yml +34 -0
  48. faultray-1.2.0/examples/ci/Jenkinsfile +62 -0
  49. faultray-1.2.0/examples/demo-infra.yaml +139 -0
  50. faultray-1.2.0/examples/ecommerce-platform.yaml +811 -0
  51. faultray-1.2.0/examples/fintech-banking.yaml +706 -0
  52. faultray-1.2.0/examples/healthcare-ehr.yaml +667 -0
  53. faultray-1.2.0/examples/saas-multi-tenant.yaml +930 -0
  54. faultray-1.2.0/examples/sample-tfstate.json +100 -0
  55. faultray-1.2.0/examples/sdk_example.py +21 -0
  56. faultray-1.2.0/fly.toml +23 -0
  57. faultray-1.2.0/mkdocs.yml +40 -0
  58. faultray-1.2.0/pyproject.toml +100 -0
  59. faultray-1.2.0/render.yaml +9 -0
  60. faultray-1.2.0/src/infrasim/__init__.py +79 -0
  61. faultray-1.2.0/src/infrasim/ai/__init__.py +0 -0
  62. faultray-1.2.0/src/infrasim/ai/analyzer.py +636 -0
  63. faultray-1.2.0/src/infrasim/ai/architecture_advisor.py +1205 -0
  64. faultray-1.2.0/src/infrasim/ai/nl_to_infra.py +1059 -0
  65. faultray-1.2.0/src/infrasim/api/__init__.py +0 -0
  66. faultray-1.2.0/src/infrasim/api/auth.py +170 -0
  67. faultray-1.2.0/src/infrasim/api/billing.py +190 -0
  68. faultray-1.2.0/src/infrasim/api/database.py +265 -0
  69. faultray-1.2.0/src/infrasim/api/graphql_api.py +386 -0
  70. faultray-1.2.0/src/infrasim/api/insurance_api.py +562 -0
  71. faultray-1.2.0/src/infrasim/api/leaderboard.py +362 -0
  72. faultray-1.2.0/src/infrasim/api/oauth.py +189 -0
  73. faultray-1.2.0/src/infrasim/api/server.py +1736 -0
  74. faultray-1.2.0/src/infrasim/api/static/graph.js +319 -0
  75. faultray-1.2.0/src/infrasim/api/static/style.css +2125 -0
  76. faultray-1.2.0/src/infrasim/api/static/sw.js +66 -0
  77. faultray-1.2.0/src/infrasim/api/teams.py +481 -0
  78. faultray-1.2.0/src/infrasim/api/templates/advisor.html +422 -0
  79. faultray-1.2.0/src/infrasim/api/templates/analyze.html +186 -0
  80. faultray-1.2.0/src/infrasim/api/templates/base.html +261 -0
  81. faultray-1.2.0/src/infrasim/api/templates/blast_radius.html +1141 -0
  82. faultray-1.2.0/src/infrasim/api/templates/compliance.html +265 -0
  83. faultray-1.2.0/src/infrasim/api/templates/components.html +164 -0
  84. faultray-1.2.0/src/infrasim/api/templates/cost.html +121 -0
  85. faultray-1.2.0/src/infrasim/api/templates/dashboard.html +279 -0
  86. faultray-1.2.0/src/infrasim/api/templates/graph.html +89 -0
  87. faultray-1.2.0/src/infrasim/api/templates/landing.html +787 -0
  88. faultray-1.2.0/src/infrasim/api/templates/reports.html +132 -0
  89. faultray-1.2.0/src/infrasim/api/templates/security.html +149 -0
  90. faultray-1.2.0/src/infrasim/api/templates/settings.html +170 -0
  91. faultray-1.2.0/src/infrasim/api/templates/simulation.html +310 -0
  92. faultray-1.2.0/src/infrasim/api/widget.py +120 -0
  93. faultray-1.2.0/src/infrasim/cache.py +177 -0
  94. faultray-1.2.0/src/infrasim/ci/__init__.py +1 -0
  95. faultray-1.2.0/src/infrasim/ci/github_action.py +443 -0
  96. faultray-1.2.0/src/infrasim/ci/sarif_exporter.py +403 -0
  97. faultray-1.2.0/src/infrasim/cli/__init__.py +44 -0
  98. faultray-1.2.0/src/infrasim/cli/admin.py +862 -0
  99. faultray-1.2.0/src/infrasim/cli/advisor_cmd.py +395 -0
  100. faultray-1.2.0/src/infrasim/cli/analyze.py +248 -0
  101. faultray-1.2.0/src/infrasim/cli/auto_fix.py +151 -0
  102. faultray-1.2.0/src/infrasim/cli/autoscale_cmd.py +355 -0
  103. faultray-1.2.0/src/infrasim/cli/backtest.py +106 -0
  104. faultray-1.2.0/src/infrasim/cli/benchmark_cmd.py +281 -0
  105. faultray-1.2.0/src/infrasim/cli/config_cmd.py +93 -0
  106. faultray-1.2.0/src/infrasim/cli/daemon_cmd.py +110 -0
  107. faultray-1.2.0/src/infrasim/cli/diff_cmd.py +118 -0
  108. faultray-1.2.0/src/infrasim/cli/discovery.py +472 -0
  109. faultray-1.2.0/src/infrasim/cli/dna_cmd.py +124 -0
  110. faultray-1.2.0/src/infrasim/cli/drift_cmd.py +341 -0
  111. faultray-1.2.0/src/infrasim/cli/evaluate.py +1094 -0
  112. faultray-1.2.0/src/infrasim/cli/feeds.py +228 -0
  113. faultray-1.2.0/src/infrasim/cli/genome.py +585 -0
  114. faultray-1.2.0/src/infrasim/cli/history_cmd.py +132 -0
  115. faultray-1.2.0/src/infrasim/cli/main.py +412 -0
  116. faultray-1.2.0/src/infrasim/cli/marketplace_cmd.py +464 -0
  117. faultray-1.2.0/src/infrasim/cli/nl_command.py +210 -0
  118. faultray-1.2.0/src/infrasim/cli/ops.py +1292 -0
  119. faultray-1.2.0/src/infrasim/cli/predictive.py +363 -0
  120. faultray-1.2.0/src/infrasim/cli/quickstart.py +179 -0
  121. faultray-1.2.0/src/infrasim/cli/replay_cmd.py +567 -0
  122. faultray-1.2.0/src/infrasim/cli/simulate.py +420 -0
  123. faultray-1.2.0/src/infrasim/cli/sla_cmd.py +337 -0
  124. faultray-1.2.0/src/infrasim/cli/supply_chain_cmd.py +122 -0
  125. faultray-1.2.0/src/infrasim/cli/tf_check.py +422 -0
  126. faultray-1.2.0/src/infrasim/cli/timeline_cmd.py +376 -0
  127. faultray-1.2.0/src/infrasim/cli/twin_cmd.py +138 -0
  128. faultray-1.2.0/src/infrasim/config.py +119 -0
  129. faultray-1.2.0/src/infrasim/daemon.py +206 -0
  130. faultray-1.2.0/src/infrasim/differ.py +149 -0
  131. faultray-1.2.0/src/infrasim/discovery/__init__.py +0 -0
  132. faultray-1.2.0/src/infrasim/discovery/aws_scanner.py +1167 -0
  133. faultray-1.2.0/src/infrasim/discovery/azure_scanner.py +769 -0
  134. faultray-1.2.0/src/infrasim/discovery/flow_analyzer.py +290 -0
  135. faultray-1.2.0/src/infrasim/discovery/gcp_scanner.py +704 -0
  136. faultray-1.2.0/src/infrasim/discovery/k8s_scanner.py +568 -0
  137. faultray-1.2.0/src/infrasim/discovery/metric_calibrator.py +324 -0
  138. faultray-1.2.0/src/infrasim/discovery/prometheus.py +308 -0
  139. faultray-1.2.0/src/infrasim/discovery/prometheus_monitor.py +82 -0
  140. faultray-1.2.0/src/infrasim/discovery/scanner.py +193 -0
  141. faultray-1.2.0/src/infrasim/discovery/terraform.py +600 -0
  142. faultray-1.2.0/src/infrasim/features.py +48 -0
  143. faultray-1.2.0/src/infrasim/feeds/__init__.py +1 -0
  144. faultray-1.2.0/src/infrasim/feeds/analyzer.py +416 -0
  145. faultray-1.2.0/src/infrasim/feeds/fetcher.py +152 -0
  146. faultray-1.2.0/src/infrasim/feeds/sources.py +69 -0
  147. faultray-1.2.0/src/infrasim/feeds/store.py +139 -0
  148. faultray-1.2.0/src/infrasim/history.py +379 -0
  149. faultray-1.2.0/src/infrasim/i18n.py +79 -0
  150. faultray-1.2.0/src/infrasim/integrations/__init__.py +1 -0
  151. faultray-1.2.0/src/infrasim/integrations/datadog.py +122 -0
  152. faultray-1.2.0/src/infrasim/integrations/grafana.py +85 -0
  153. faultray-1.2.0/src/infrasim/integrations/incident_correlator.py +471 -0
  154. faultray-1.2.0/src/infrasim/integrations/issue_tracker.py +110 -0
  155. faultray-1.2.0/src/infrasim/integrations/opsgenie.py +61 -0
  156. faultray-1.2.0/src/infrasim/integrations/slack_bot.py +376 -0
  157. faultray-1.2.0/src/infrasim/integrations/terraform_provider.py +264 -0
  158. faultray-1.2.0/src/infrasim/integrations/webhooks.py +446 -0
  159. faultray-1.2.0/src/infrasim/licensing.py +76 -0
  160. faultray-1.2.0/src/infrasim/log_config.py +33 -0
  161. faultray-1.2.0/src/infrasim/marketplace/__init__.py +19 -0
  162. faultray-1.2.0/src/infrasim/marketplace/builtin_packages.py +1341 -0
  163. faultray-1.2.0/src/infrasim/marketplace/catalog.py +516 -0
  164. faultray-1.2.0/src/infrasim/marketplace.py +266 -0
  165. faultray-1.2.0/src/infrasim/model/__init__.py +0 -0
  166. faultray-1.2.0/src/infrasim/model/components.py +310 -0
  167. faultray-1.2.0/src/infrasim/model/demo.py +123 -0
  168. faultray-1.2.0/src/infrasim/model/dna.py +229 -0
  169. faultray-1.2.0/src/infrasim/model/graph.py +380 -0
  170. faultray-1.2.0/src/infrasim/model/loader.py +282 -0
  171. faultray-1.2.0/src/infrasim/plugins/__init__.py +5 -0
  172. faultray-1.2.0/src/infrasim/plugins/registry.py +129 -0
  173. faultray-1.2.0/src/infrasim/remediation/__init__.py +0 -0
  174. faultray-1.2.0/src/infrasim/remediation/auto_pipeline.py +344 -0
  175. faultray-1.2.0/src/infrasim/remediation/iac_exporter.py +1708 -0
  176. faultray-1.2.0/src/infrasim/remediation/iac_generator.py +863 -0
  177. faultray-1.2.0/src/infrasim/reporter/__init__.py +0 -0
  178. faultray-1.2.0/src/infrasim/reporter/compliance.py +438 -0
  179. faultray-1.2.0/src/infrasim/reporter/evidence_generator.py +513 -0
  180. faultray-1.2.0/src/infrasim/reporter/executive_report.py +625 -0
  181. faultray-1.2.0/src/infrasim/reporter/export.py +368 -0
  182. faultray-1.2.0/src/infrasim/reporter/html_report.py +308 -0
  183. faultray-1.2.0/src/infrasim/reporter/pdf_report.py +215 -0
  184. faultray-1.2.0/src/infrasim/reporter/report.py +144 -0
  185. faultray-1.2.0/src/infrasim/reporter/templates/report.html +509 -0
  186. faultray-1.2.0/src/infrasim/scoring.py +415 -0
  187. faultray-1.2.0/src/infrasim/simulator/__init__.py +0 -0
  188. faultray-1.2.0/src/infrasim/simulator/advisor_engine.py +407 -0
  189. faultray-1.2.0/src/infrasim/simulator/autoscaling_engine.py +339 -0
  190. faultray-1.2.0/src/infrasim/simulator/availability_model.py +485 -0
  191. faultray-1.2.0/src/infrasim/simulator/backtest_engine.py +139 -0
  192. faultray-1.2.0/src/infrasim/simulator/bayesian_model.py +236 -0
  193. faultray-1.2.0/src/infrasim/simulator/benchmarking.py +652 -0
  194. faultray-1.2.0/src/infrasim/simulator/capacity_engine.py +668 -0
  195. faultray-1.2.0/src/infrasim/simulator/carbon_engine.py +274 -0
  196. faultray-1.2.0/src/infrasim/simulator/cascade.py +701 -0
  197. faultray-1.2.0/src/infrasim/simulator/chaos_calendar.py +362 -0
  198. faultray-1.2.0/src/infrasim/simulator/chaos_genome.py +1286 -0
  199. faultray-1.2.0/src/infrasim/simulator/compliance_engine.py +703 -0
  200. faultray-1.2.0/src/infrasim/simulator/cost_engine.py +340 -0
  201. faultray-1.2.0/src/infrasim/simulator/digital_twin.py +286 -0
  202. faultray-1.2.0/src/infrasim/simulator/dr_engine.py +348 -0
  203. faultray-1.2.0/src/infrasim/simulator/drift_detector.py +982 -0
  204. faultray-1.2.0/src/infrasim/simulator/dynamic_engine.py +1091 -0
  205. faultray-1.2.0/src/infrasim/simulator/engine.py +296 -0
  206. faultray-1.2.0/src/infrasim/simulator/financial_risk.py +345 -0
  207. faultray-1.2.0/src/infrasim/simulator/gameday_engine.py +387 -0
  208. faultray-1.2.0/src/infrasim/simulator/incident_db.py +982 -0
  209. faultray-1.2.0/src/infrasim/simulator/incident_replay.py +812 -0
  210. faultray-1.2.0/src/infrasim/simulator/markov_model.py +278 -0
  211. faultray-1.2.0/src/infrasim/simulator/monte_carlo.py +276 -0
  212. faultray-1.2.0/src/infrasim/simulator/ops_engine.py +1914 -0
  213. faultray-1.2.0/src/infrasim/simulator/planner.py +670 -0
  214. faultray-1.2.0/src/infrasim/simulator/predictive_engine.py +347 -0
  215. faultray-1.2.0/src/infrasim/simulator/resilience_timeline.py +612 -0
  216. faultray-1.2.0/src/infrasim/simulator/scenarios.py +932 -0
  217. faultray-1.2.0/src/infrasim/simulator/security_engine.py +525 -0
  218. faultray-1.2.0/src/infrasim/simulator/sla_validator.py +788 -0
  219. faultray-1.2.0/src/infrasim/simulator/supply_chain_engine.py +371 -0
  220. faultray-1.2.0/src/infrasim/simulator/traffic.py +460 -0
  221. faultray-1.2.0/src/infrasim/simulator/whatif_engine.py +858 -0
  222. faultray-1.2.0/src/infrasim/telemetry.py +61 -0
  223. faultray-1.2.0/tests/__init__.py +0 -0
  224. faultray-1.2.0/tests/test_advisor_engine.py +420 -0
  225. faultray-1.2.0/tests/test_ai_analyzer.py +493 -0
  226. faultray-1.2.0/tests/test_api_extended.py +1381 -0
  227. faultray-1.2.0/tests/test_api_server.py +246 -0
  228. faultray-1.2.0/tests/test_auth.py +228 -0
  229. faultray-1.2.0/tests/test_auto_pipeline.py +355 -0
  230. faultray-1.2.0/tests/test_autoscaling_engine.py +263 -0
  231. faultray-1.2.0/tests/test_availability_model.py +656 -0
  232. faultray-1.2.0/tests/test_aws_scanner.py +1204 -0
  233. faultray-1.2.0/tests/test_azure_scanner.py +613 -0
  234. faultray-1.2.0/tests/test_bayesian_model.py +320 -0
  235. faultray-1.2.0/tests/test_cache.py +235 -0
  236. faultray-1.2.0/tests/test_capacity_engine.py +129 -0
  237. faultray-1.2.0/tests/test_carbon_engine.py +212 -0
  238. faultray-1.2.0/tests/test_cascade.py +364 -0
  239. faultray-1.2.0/tests/test_cascade_extended.py +1305 -0
  240. faultray-1.2.0/tests/test_chaos_genome.py +957 -0
  241. faultray-1.2.0/tests/test_ci_gate.py +535 -0
  242. faultray-1.2.0/tests/test_cli.py +309 -0
  243. faultray-1.2.0/tests/test_cli_extended.py +1573 -0
  244. faultray-1.2.0/tests/test_compliance.py +180 -0
  245. faultray-1.2.0/tests/test_compliance_engine.py +376 -0
  246. faultray-1.2.0/tests/test_config.py +146 -0
  247. faultray-1.2.0/tests/test_cost_engine.py +543 -0
  248. faultray-1.2.0/tests/test_coverage_gaps.py +2099 -0
  249. faultray-1.2.0/tests/test_custom_scoring.py +483 -0
  250. faultray-1.2.0/tests/test_daemon.py +172 -0
  251. faultray-1.2.0/tests/test_database.py +351 -0
  252. faultray-1.2.0/tests/test_differ.py +325 -0
  253. faultray-1.2.0/tests/test_dna.py +213 -0
  254. faultray-1.2.0/tests/test_dr_engine.py +353 -0
  255. faultray-1.2.0/tests/test_drift_detector.py +1114 -0
  256. faultray-1.2.0/tests/test_dry_run.py +152 -0
  257. faultray-1.2.0/tests/test_dynamic_cli.py +182 -0
  258. faultray-1.2.0/tests/test_dynamic_engine_extended.py +1129 -0
  259. faultray-1.2.0/tests/test_executive_report.py +609 -0
  260. faultray-1.2.0/tests/test_export_formats.py +273 -0
  261. faultray-1.2.0/tests/test_features.py +85 -0
  262. faultray-1.2.0/tests/test_feeds.py +162 -0
  263. faultray-1.2.0/tests/test_fetcher.py +289 -0
  264. faultray-1.2.0/tests/test_final_coverage.py +1109 -0
  265. faultray-1.2.0/tests/test_final_coverage_r2.py +422 -0
  266. faultray-1.2.0/tests/test_financial_risk.py +229 -0
  267. faultray-1.2.0/tests/test_flow_analyzer.py +274 -0
  268. faultray-1.2.0/tests/test_gameday_engine.py +587 -0
  269. faultray-1.2.0/tests/test_gcp_scanner.py +923 -0
  270. faultray-1.2.0/tests/test_graph.py +38 -0
  271. faultray-1.2.0/tests/test_graphql_api.py +254 -0
  272. faultray-1.2.0/tests/test_history.py +425 -0
  273. faultray-1.2.0/tests/test_html_report.py +219 -0
  274. faultray-1.2.0/tests/test_i18n.py +100 -0
  275. faultray-1.2.0/tests/test_iac_generator.py +731 -0
  276. faultray-1.2.0/tests/test_incident_correlator.py +352 -0
  277. faultray-1.2.0/tests/test_incident_replay.py +619 -0
  278. faultray-1.2.0/tests/test_insurance_api.py +366 -0
  279. faultray-1.2.0/tests/test_integration_workflows.py +716 -0
  280. faultray-1.2.0/tests/test_iteration1_features.py +616 -0
  281. faultray-1.2.0/tests/test_k8s_scanner.py +828 -0
  282. faultray-1.2.0/tests/test_leaderboard.py +163 -0
  283. faultray-1.2.0/tests/test_licensing.py +121 -0
  284. faultray-1.2.0/tests/test_loader.py +295 -0
  285. faultray-1.2.0/tests/test_markov_model.py +269 -0
  286. faultray-1.2.0/tests/test_metric_calibrator.py +299 -0
  287. faultray-1.2.0/tests/test_monte_carlo.py +255 -0
  288. faultray-1.2.0/tests/test_new_features.py +982 -0
  289. faultray-1.2.0/tests/test_nl_to_infra.py +612 -0
  290. faultray-1.2.0/tests/test_notifications_extended.py +331 -0
  291. faultray-1.2.0/tests/test_oauth.py +140 -0
  292. faultray-1.2.0/tests/test_ops_engine.py +230 -0
  293. faultray-1.2.0/tests/test_pdf_export.py +180 -0
  294. faultray-1.2.0/tests/test_performance.py +251 -0
  295. faultray-1.2.0/tests/test_planner.py +430 -0
  296. faultray-1.2.0/tests/test_plugins.py +150 -0
  297. faultray-1.2.0/tests/test_predictive_engine.py +309 -0
  298. faultray-1.2.0/tests/test_prometheus.py +423 -0
  299. faultray-1.2.0/tests/test_prometheus_monitor.py +119 -0
  300. faultray-1.2.0/tests/test_pwa.py +146 -0
  301. faultray-1.2.0/tests/test_quickstart.py +353 -0
  302. faultray-1.2.0/tests/test_rbac.py +410 -0
  303. faultray-1.2.0/tests/test_report.py +244 -0
  304. faultray-1.2.0/tests/test_resilience_timeline.py +584 -0
  305. faultray-1.2.0/tests/test_resilience_v2.py +296 -0
  306. faultray-1.2.0/tests/test_scanner.py +441 -0
  307. faultray-1.2.0/tests/test_scenarios.py +121 -0
  308. faultray-1.2.0/tests/test_scenarios_extended.py +538 -0
  309. faultray-1.2.0/tests/test_schema_version.py +151 -0
  310. faultray-1.2.0/tests/test_sdk.py +103 -0
  311. faultray-1.2.0/tests/test_security_engine.py +547 -0
  312. faultray-1.2.0/tests/test_sla_validator.py +753 -0
  313. faultray-1.2.0/tests/test_slack_bot.py +291 -0
  314. faultray-1.2.0/tests/test_supply_chain.py +241 -0
  315. faultray-1.2.0/tests/test_teams.py +277 -0
  316. faultray-1.2.0/tests/test_telemetry.py +105 -0
  317. faultray-1.2.0/tests/test_terraform.py +604 -0
  318. faultray-1.2.0/tests/test_terraform_provider.py +267 -0
  319. faultray-1.2.0/tests/test_three_layer_model.py +369 -0
  320. faultray-1.2.0/tests/test_traffic.py +148 -0
  321. faultray-1.2.0/tests/test_traffic_extended.py +447 -0
  322. faultray-1.2.0/tests/test_vscode_extension.py +168 -0
  323. faultray-1.2.0/tests/test_webhooks.py +215 -0
  324. faultray-1.2.0/tests/test_whatif_engine.py +116 -0
  325. faultray-1.2.0/tests/test_whatif_engine_extended.py +611 -0
  326. faultray-1.2.0/tests/test_widget.py +83 -0
  327. faultray-1.2.0/vscode-extension/README.md +69 -0
  328. faultray-1.2.0/vscode-extension/src/extension.ts +100 -0
@@ -0,0 +1,13 @@
1
+ .git
2
+ .venv
3
+ __pycache__
4
+ *.pyc
5
+ *.pyo
6
+ .pytest_cache
7
+ .ruff_cache
8
+ dist
9
+ build
10
+ *.egg-info
11
+ .env
12
+ node_modules
13
+ docs/*.docx
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug in FaultRay
4
+ labels: bug
5
+ ---
6
+
7
+ ## Description
8
+ A clear description of the bug.
9
+
10
+ ## Steps to Reproduce
11
+ 1. ...
12
+ 2. ...
13
+
14
+ ## Expected Behavior
15
+ What should happen.
16
+
17
+ ## Actual Behavior
18
+ What actually happens.
19
+
20
+ ## Environment
21
+ - OS:
22
+ - Python version:
23
+ - FaultRay version:
24
+ - Installation method (pip/docker/source):
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a new feature
4
+ labels: enhancement
5
+ ---
6
+
7
+ ## Problem
8
+ What problem does this solve?
9
+
10
+ ## Proposed Solution
11
+ How should it work?
12
+
13
+ ## Alternatives Considered
14
+ Other approaches you've considered.
@@ -0,0 +1,13 @@
1
+ ## Summary
2
+ Brief description of changes.
3
+
4
+ ## Changes
5
+ - ...
6
+
7
+ ## Testing
8
+ - [ ] Tests added/updated
9
+ - [ ] `pytest tests/ -v` passes
10
+ - [ ] `ruff check src/ tests/` passes
11
+
12
+ ## Related Issues
13
+ Closes #
@@ -0,0 +1,63 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Set up Python 3.12
15
+ uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.12"
18
+
19
+ - name: Install dependencies
20
+ run: |
21
+ python -m pip install --upgrade pip
22
+ pip install -e ".[dev]"
23
+
24
+ - name: Lint with ruff
25
+ run: ruff check src/ tests/
26
+
27
+ - name: Run tests
28
+ run: |
29
+ pytest -v --tb=short 2>&1 | tee test-output.txt
30
+ # Extract and display test count summary
31
+ echo ""
32
+ echo "=========================================="
33
+ echo "TEST SUMMARY"
34
+ echo "=========================================="
35
+ grep -E "^(FAILED|PASSED|ERROR|=)" test-output.txt | tail -5
36
+ echo "=========================================="
37
+ # Fail the build if pytest exited non-zero (any test failed)
38
+ exit ${PIPESTATUS[0]}
39
+
40
+ - name: Run tests with coverage
41
+ if: always() && steps.*.outcome != 'failure'
42
+ run: |
43
+ pip install pytest-cov
44
+ pytest --cov=infrasim --cov-report=xml --cov-report=term-missing
45
+
46
+ - name: Upload coverage
47
+ if: always()
48
+ uses: codecov/codecov-action@v4
49
+ with:
50
+ file: ./coverage.xml
51
+ continue-on-error: true
52
+
53
+ docker:
54
+ runs-on: ubuntu-latest
55
+ needs: test
56
+ steps:
57
+ - uses: actions/checkout@v4
58
+
59
+ - name: Build Docker image
60
+ run: docker build -t infrasim:test .
61
+
62
+ - name: Test Docker image
63
+ run: docker run --rm infrasim:test infrasim --help
@@ -0,0 +1,18 @@
1
+ # See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
2
+
3
+ name: Fly Deploy
4
+ on:
5
+ push:
6
+ branches:
7
+ - main
8
+ jobs:
9
+ deploy:
10
+ name: Deploy app
11
+ runs-on: ubuntu-latest
12
+ concurrency: deploy-group # optional: ensure only one action runs at a time
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: superfly/flyctl-actions/setup-flyctl@master
16
+ - run: flyctl deploy --remote-only
17
+ env:
18
+ FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
@@ -0,0 +1,123 @@
1
+ name: FaultRay Infrastructure Check
2
+
3
+ on:
4
+ pull_request:
5
+ paths:
6
+ - '**/*.yaml'
7
+ - '**/*.yml'
8
+ - '**/terraform/**'
9
+ - '**/*.tf'
10
+ - '**/infrasim*.yaml'
11
+ - '**/faultray*.yaml'
12
+
13
+ permissions:
14
+ pull-requests: write
15
+ contents: read
16
+
17
+ jobs:
18
+ faultray-check:
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: '3.11'
27
+
28
+ - name: Install FaultRay
29
+ run: pip install faultray # or pip install -e . if in same repo
30
+
31
+ - name: Find infrastructure YAML files
32
+ id: find-yaml
33
+ run: |
34
+ # Find FaultRay/InfraSim YAML files in the PR
35
+ FILES=$(find . -name 'faultray*.yaml' -o -name 'infrasim*.yaml' -o -name 'faultray*.yml' -o -name 'infrasim*.yml' -o -name 'infrastructure*.yaml' | head -5)
36
+ if [ -z "$FILES" ]; then
37
+ echo "No FaultRay YAML files found"
38
+ echo "found=false" >> $GITHUB_OUTPUT
39
+ else
40
+ echo "found=true" >> $GITHUB_OUTPUT
41
+ echo "files=$FILES" >> $GITHUB_OUTPUT
42
+ echo "first_file=$(echo $FILES | head -1)" >> $GITHUB_OUTPUT
43
+ fi
44
+
45
+ - name: Run FaultRay simulation
46
+ if: steps.find-yaml.outputs.found == 'true'
47
+ run: |
48
+ FILE="${{ steps.find-yaml.outputs.first_file }}"
49
+ echo "Running FaultRay on $FILE..."
50
+
51
+ # Run simulation with JSON output
52
+ faultray load "$FILE"
53
+ faultray simulate --json faultray-results.json 2>&1 | tee faultray-output.txt
54
+
55
+ # Run AI analysis
56
+ faultray analyze "$FILE" --json 2>&1 | tee faultray-analysis.txt
57
+
58
+ - name: Comment PR with results
59
+ if: steps.find-yaml.outputs.found == 'true'
60
+ uses: actions/github-script@v7
61
+ with:
62
+ script: |
63
+ const fs = require('fs');
64
+
65
+ let output = '';
66
+ try { output = fs.readFileSync('faultray-output.txt', 'utf8'); } catch(e) {}
67
+ let analysis = '';
68
+ try { analysis = fs.readFileSync('faultray-analysis.txt', 'utf8'); } catch(e) {}
69
+
70
+ // Parse key metrics from output
71
+ const lines = output.split('\n');
72
+ const resilienceLine = lines.find(l => l.includes('Resilience'));
73
+ const criticalLine = lines.find(l => l.includes('CRITICAL') || l.includes('Critical'));
74
+
75
+ const body = `## FaultRay Chaos Simulation Report
76
+
77
+ ${resilienceLine ? '**' + resilienceLine.trim() + '**' : ''}
78
+ ${criticalLine ? criticalLine.trim() : ''}
79
+
80
+ <details>
81
+ <summary>Full Simulation Output</summary>
82
+
83
+ \`\`\`
84
+ ${output.substring(0, 3000)}
85
+ \`\`\`
86
+ </details>
87
+
88
+ <details>
89
+ <summary>AI Analysis & Recommendations</summary>
90
+
91
+ \`\`\`
92
+ ${analysis.substring(0, 3000)}
93
+ \`\`\`
94
+ </details>
95
+
96
+ ---
97
+ *Powered by [FaultRay](https://github.com/mattyopon/infrasim) -- Zero-Risk Infrastructure Chaos Simulation*`;
98
+
99
+ // Find existing FaultRay comment to update
100
+ const { data: comments } = await github.rest.issues.listComments({
101
+ owner: context.repo.owner,
102
+ repo: context.repo.repo,
103
+ issue_number: context.issue.number,
104
+ });
105
+
106
+ const existingComment = comments.find(c =>
107
+ c.body.includes('FaultRay Chaos Simulation Report'));
108
+
109
+ if (existingComment) {
110
+ await github.rest.issues.updateComment({
111
+ owner: context.repo.owner,
112
+ repo: context.repo.repo,
113
+ comment_id: existingComment.id,
114
+ body: body,
115
+ });
116
+ } else {
117
+ await github.rest.issues.createComment({
118
+ owner: context.repo.owner,
119
+ repo: context.repo.repo,
120
+ issue_number: context.issue.number,
121
+ body: body,
122
+ });
123
+ }
@@ -0,0 +1,28 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ id-token: write
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.11"
20
+
21
+ - name: Install build tools
22
+ run: pip install build
23
+
24
+ - name: Build package
25
+ run: python -m build
26
+
27
+ - name: Publish to PyPI
28
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,195 @@
1
+ name: ChaosProof Resilience Gate
2
+ on:
3
+ pull_request:
4
+ paths:
5
+ - '**/*.yaml'
6
+ - '**/*.yml'
7
+ - '**/*.tf'
8
+ - '**/infrastructure/**'
9
+ - 'examples/**'
10
+ push:
11
+ branches: [main]
12
+ workflow_dispatch:
13
+ inputs:
14
+ min_score:
15
+ description: 'Minimum resilience score (0-100)'
16
+ required: false
17
+ default: '60'
18
+ type: string
19
+ infrastructure_file:
20
+ description: 'Path to infrastructure YAML file'
21
+ required: false
22
+ default: 'examples/demo-infra.yaml'
23
+ type: string
24
+
25
+ env:
26
+ MIN_SCORE: '60'
27
+ MAX_CRITICAL: '0'
28
+ INFRA_FILE: 'examples/demo-infra.yaml'
29
+
30
+ jobs:
31
+ resilience-check:
32
+ runs-on: ubuntu-latest
33
+ permissions:
34
+ contents: read
35
+ pull-requests: write
36
+ security-events: write
37
+ steps:
38
+ - uses: actions/checkout@v4
39
+
40
+ - uses: actions/setup-python@v5
41
+ with:
42
+ python-version: '3.12'
43
+
44
+ - name: Install FaultRay
45
+ run: |
46
+ pip install -e .
47
+
48
+ - name: Run Resilience Analysis
49
+ id: resilience
50
+ run: |
51
+ set -euo pipefail
52
+
53
+ # Use workflow_dispatch inputs if available, otherwise use env defaults
54
+ INFRA_FILE="${{ github.event.inputs.infrastructure_file || env.INFRA_FILE }}"
55
+ MIN_SCORE="${{ github.event.inputs.min_score || env.MIN_SCORE }}"
56
+
57
+ # Verify infrastructure file exists
58
+ if [ ! -f "$INFRA_FILE" ]; then
59
+ echo "::error::Infrastructure file not found: $INFRA_FILE"
60
+ exit 1
61
+ fi
62
+
63
+ # Run FaultRay simulation
64
+ faultray analyze "$INFRA_FILE" --json > results.json 2>/dev/null || \
65
+ faultray simulate --model "$INFRA_FILE" --json > results.json
66
+
67
+ # Extract metrics
68
+ SCORE=$(python3 -c "import json; print(json.load(open('results.json')).get('resilience_score', 0))")
69
+ CRITICAL=$(python3 -c "import json; print(json.load(open('results.json')).get('critical', 0))")
70
+ WARNING=$(python3 -c "import json; print(json.load(open('results.json')).get('warning', 0))")
71
+ PASSED=$(python3 -c "import json; print(json.load(open('results.json')).get('passed', 0))")
72
+
73
+ # Set outputs
74
+ echo "resilience_score=$SCORE" >> $GITHUB_OUTPUT
75
+ echo "critical_count=$CRITICAL" >> $GITHUB_OUTPUT
76
+ echo "warning_count=$WARNING" >> $GITHUB_OUTPUT
77
+ echo "passed_count=$PASSED" >> $GITHUB_OUTPUT
78
+
79
+ # Check thresholds
80
+ FAILED=0
81
+
82
+ if [ "$(echo "$SCORE < $MIN_SCORE" | bc -l)" -eq 1 ]; then
83
+ echo "::error::Resilience score $SCORE is below minimum $MIN_SCORE"
84
+ FAILED=1
85
+ fi
86
+
87
+ if [ "$CRITICAL" -gt ${{ env.MAX_CRITICAL }} ]; then
88
+ echo "::error::$CRITICAL critical findings exceed maximum ${{ env.MAX_CRITICAL }}"
89
+ FAILED=1
90
+ fi
91
+
92
+ if [ "$FAILED" -eq 1 ]; then
93
+ exit 1
94
+ fi
95
+
96
+ echo "Resilience gate passed: score=$SCORE, critical=$CRITICAL"
97
+
98
+ - name: Run SLA Validation
99
+ if: always()
100
+ run: |
101
+ INFRA_FILE="${{ github.event.inputs.infrastructure_file || env.INFRA_FILE }}"
102
+ faultray sla-validate "$INFRA_FILE" --target 99.9 --json > sla-results.json 2>/dev/null || true
103
+ if [ -f sla-results.json ]; then
104
+ echo "SLA Validation Results:"
105
+ cat sla-results.json
106
+ fi
107
+
108
+ - name: Generate SARIF Report
109
+ if: always()
110
+ run: |
111
+ set -euo pipefail
112
+ python3 -c "
113
+ import json
114
+ from infrasim.ci.sarif_exporter import SARIFExporter
115
+ results = json.load(open('results.json'))
116
+ sarif = SARIFExporter.from_json_results(results)
117
+ with open('results.sarif', 'w') as f:
118
+ json.dump(sarif, f, indent=2)
119
+ " || echo "SARIF generation skipped"
120
+
121
+ - name: Post PR Comment
122
+ if: github.event_name == 'pull_request' && always()
123
+ uses: actions/github-script@v7
124
+ with:
125
+ script: |
126
+ const fs = require('fs');
127
+ let results;
128
+ try {
129
+ results = JSON.parse(fs.readFileSync('results.json', 'utf8'));
130
+ } catch (e) {
131
+ console.log('No results file found, skipping PR comment');
132
+ return;
133
+ }
134
+ const score = results.resilience_score || 0;
135
+ const critical = results.critical || 0;
136
+ const warning = results.warning || 0;
137
+ const passed = results.passed || 0;
138
+ const total = results.total_scenarios || 0;
139
+
140
+ const scoreEmoji = score >= 80 ? '\u2705' : score >= 60 ? '\u26a0\ufe0f' : '\u274c';
141
+ const statusText = critical === 0 ? 'PASSED' : 'FAILED';
142
+ const statusEmoji = critical === 0 ? '\u2705' : '\u274c';
143
+
144
+ const body = `## ${statusEmoji} ChaosProof Resilience Gate: ${statusText}
145
+
146
+ | Metric | Value |
147
+ |--------|-------|
148
+ | ${scoreEmoji} Resilience Score | **${score}/100** |
149
+ | Critical Findings | ${critical} |
150
+ | Warnings | ${warning} |
151
+ | Passed Scenarios | ${passed}/${total} |
152
+
153
+ ---
154
+ *Generated by [FaultRay](https://github.com/faultray/faultray) Resilience Gate*`;
155
+
156
+ const { data: comments } = await github.rest.issues.listComments({
157
+ owner: context.repo.owner,
158
+ repo: context.repo.repo,
159
+ issue_number: context.issue.number,
160
+ });
161
+
162
+ const botComment = comments.find(c =>
163
+ c.body.includes('ChaosProof Resilience Gate')
164
+ );
165
+
166
+ if (botComment) {
167
+ await github.rest.issues.updateComment({
168
+ owner: context.repo.owner,
169
+ repo: context.repo.repo,
170
+ comment_id: botComment.id,
171
+ body: body,
172
+ });
173
+ } else {
174
+ await github.rest.issues.createComment({
175
+ owner: context.repo.owner,
176
+ repo: context.repo.repo,
177
+ issue_number: context.issue.number,
178
+ body: body,
179
+ });
180
+ }
181
+
182
+ - name: Upload SARIF
183
+ if: always() && hashFiles('results.sarif') != ''
184
+ uses: github/codeql-action/upload-sarif@v3
185
+ with:
186
+ sarif_file: results.sarif
187
+ continue-on-error: true
188
+
189
+ - name: Upload Baseline Artifact
190
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
191
+ uses: actions/upload-artifact@v4
192
+ with:
193
+ name: resilience-baseline
194
+ path: results.json
195
+ retention-days: 90
@@ -0,0 +1,15 @@
1
+ __pycache__/
2
+ *.pyc
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ *.json
8
+ !pyproject.toml
9
+ !examples/*.json
10
+ .ruff_cache/
11
+ .pytest_cache/
12
+ infrasim-model.json
13
+ *.docx
14
+ .claude/worktrees/
15
+ .coverage
@@ -0,0 +1,81 @@
1
+ # Contributing to FaultRay
2
+
3
+ Thank you for your interest in contributing to FaultRay!
4
+
5
+ # FaultRay へのコントリビューション
6
+
7
+ FaultRay への貢献に興味を持っていただきありがとうございます!
8
+
9
+ ## Quick Start / クイックスタート
10
+
11
+ ```bash
12
+ # Clone the repository
13
+ git clone https://github.com/mattyopon/infrasim.git
14
+ cd faultray
15
+
16
+ # Create virtual environment
17
+ python -m venv .venv
18
+ source .venv/bin/activate # Linux/Mac
19
+ # .venv\Scripts\activate # Windows
20
+
21
+ # Install in development mode
22
+ pip install -e ".[dev]"
23
+
24
+ # Run tests
25
+ pytest tests/ -v
26
+
27
+ # Run linter
28
+ ruff check src/ tests/
29
+
30
+ # Run the demo
31
+ faultray demo
32
+ ```
33
+
34
+ ## Development Guidelines / 開発ガイドライン
35
+
36
+ ### Code Style
37
+ - Python 3.11+
38
+ - Linter: ruff
39
+ - Type hints required for public functions
40
+ - Docstrings for public classes and functions
41
+
42
+ ### Testing
43
+ - All new features must include tests
44
+ - Run `pytest tests/ -v` before submitting
45
+ - Target: maintain 89+ test coverage
46
+
47
+ ### Commit Messages
48
+ - Use conventional commits: `feat:`, `fix:`, `docs:`, `test:`, `refactor:`
49
+ - Include version bump in feat/fix commits (e.g., `feat: FaultRay vX.Y - description`)
50
+
51
+ ### Pull Requests
52
+ 1. Fork the repository
53
+ 2. Create a feature branch (`git checkout -b feat/my-feature`)
54
+ 3. Make your changes with tests
55
+ 4. Run `pytest` and `ruff check`
56
+ 5. Submit a PR with a clear description
57
+
58
+ ## Architecture Overview / アーキテクチャ概要
59
+
60
+ ```
61
+ src/infrasim/
62
+ ├── cli.py # CLI entry point (Typer)
63
+ ├── model/ # Infrastructure graph model (NetworkX)
64
+ ├── simulator/ # 5 simulation engines
65
+ │ ├── engine.py # Static simulation orchestrator
66
+ │ ├── cascade.py # Cascade failure propagation
67
+ │ ├── scenarios.py # 30-category scenario generator
68
+ │ ├── dynamic_engine.py # Time-stepped simulation
69
+ │ ├── ops_engine.py # Multi-day operational simulation
70
+ │ ├── traffic.py # 10 traffic pattern models
71
+ │ ├── whatif_engine.py # Parameter sweep analysis
72
+ │ └── capacity_engine.py # Capacity planning
73
+ ├── discovery/ # Infrastructure discovery
74
+ ├── feeds/ # Security news feed integration
75
+ ├── api/ # FastAPI web dashboard
76
+ └── reporter/ # Report generation (HTML, CLI)
77
+ ```
78
+
79
+ ## License / ライセンス
80
+
81
+ MIT License — see [LICENSE](LICENSE) for details.
@@ -0,0 +1,23 @@
1
+ FROM python:3.11-slim AS base
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y --no-install-recommends \
7
+ gcc \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Copy project files
11
+ COPY pyproject.toml ./
12
+ COPY src/ ./src/
13
+ COPY README.md ./
14
+
15
+ # Install the package
16
+ RUN pip install --no-cache-dir -e .
17
+
18
+ # Create data directory for feed storage
19
+ RUN mkdir -p /root/.faultray
20
+
21
+ # Default: run web dashboard
22
+ EXPOSE 8000
23
+ CMD ["faultray", "serve", "--host", "0.0.0.0", "--port", "8000"]