netherframe.core 0.9.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (561) hide show
  1. netherframe/core/__init__.py +140 -0
  2. netherframe/core/autoscope.py +59 -0
  3. netherframe/core/backends/__init__.py +51 -0
  4. netherframe/core/backends/backend_bootstrap.py +132 -0
  5. netherframe/core/backends/backend_chain.py +663 -0
  6. netherframe/core/backends/backend_chain_models.py +67 -0
  7. netherframe/core/backends/backend_chain_policy.py +137 -0
  8. netherframe/core/backends/backend_config.py +198 -0
  9. netherframe/core/backends/backend_literals.py +94 -0
  10. netherframe/core/backends/backend_registry.py +411 -0
  11. netherframe/core/backends/document_state_backend.py +211 -0
  12. netherframe/core/backends/graph_authorization.py +102 -0
  13. netherframe/core/backends/graph_baseline.py +78 -0
  14. netherframe/core/backends/graph_checkpoint.py +227 -0
  15. netherframe/core/backends/graph_completion.py +106 -0
  16. netherframe/core/backends/graph_diagnostics.py +210 -0
  17. netherframe/core/backends/graph_edges.py +244 -0
  18. netherframe/core/backends/graph_errored_state.py +151 -0
  19. netherframe/core/backends/graph_execution_rows.py +82 -0
  20. netherframe/core/backends/graph_footprints.py +279 -0
  21. netherframe/core/backends/graph_history.py +115 -0
  22. netherframe/core/backends/graph_identity.py +315 -0
  23. netherframe/core/backends/graph_inputs.py +250 -0
  24. netherframe/core/backends/graph_kept_return.py +98 -0
  25. netherframe/core/backends/graph_leases.py +185 -0
  26. netherframe/core/backends/graph_merge.py +79 -0
  27. netherframe/core/backends/graph_migration.py +181 -0
  28. netherframe/core/backends/graph_moves.py +417 -0
  29. netherframe/core/backends/graph_object_guard.py +334 -0
  30. netherframe/core/backends/graph_ownership.py +116 -0
  31. netherframe/core/backends/graph_plan_basis.py +243 -0
  32. netherframe/core/backends/graph_plan_guard.py +174 -0
  33. netherframe/core/backends/graph_planning.py +528 -0
  34. netherframe/core/backends/graph_planning_context.py +94 -0
  35. netherframe/core/backends/graph_planning_rounds.py +351 -0
  36. netherframe/core/backends/graph_planning_selection.py +298 -0
  37. netherframe/core/backends/graph_recovery.py +516 -0
  38. netherframe/core/backends/graph_retention.py +51 -0
  39. netherframe/core/backends/graph_settings.py +99 -0
  40. netherframe/core/backends/graph_state.py +905 -0
  41. netherframe/core/backends/graph_state_engine.py +1861 -0
  42. netherframe/core/backends/local_backend.py +511 -0
  43. netherframe/core/backends/lock_heartbeat.py +47 -0
  44. netherframe/core/backends/state_backend.py +149 -0
  45. netherframe/core/backends/state_engine.py +41 -0
  46. netherframe/core/backends/state_engine_runtime.py +630 -0
  47. netherframe/core/backends/state_lock.py +45 -0
  48. netherframe/core/backends/state_models.py +504 -0
  49. netherframe/core/config/__init__.py +35 -0
  50. netherframe/core/config/config.py +24 -0
  51. netherframe/core/config/config_discovery.py +150 -0
  52. netherframe/core/config/config_normalization.py +315 -0
  53. netherframe/core/config/config_parsing.py +44 -0
  54. netherframe/core/config/config_values.py +79 -0
  55. netherframe/core/config/hybrid_settings.py +81 -0
  56. netherframe/core/config/ignore_changes.py +170 -0
  57. netherframe/core/config/normalization_coercion.py +142 -0
  58. netherframe/core/config/normalization_types.py +171 -0
  59. netherframe/core/config/types.py +21 -0
  60. netherframe/core/constructs/__init__.py +27 -0
  61. netherframe/core/constructs/app_stack.py +1178 -0
  62. netherframe/core/constructs/app_synthesis.py +203 -0
  63. netherframe/core/constructs/attributes.py +156 -0
  64. netherframe/core/constructs/backend_base.py +389 -0
  65. netherframe/core/constructs/base_construct.py +318 -0
  66. netherframe/core/constructs/cross_stack_refs.py +267 -0
  67. netherframe/core/constructs/framework_settings.py +20 -0
  68. netherframe/core/constructs/generated_value.py +78 -0
  69. netherframe/core/constructs/infrastructure.py +148 -0
  70. netherframe/core/constructs/infrastructure_policy.py +27 -0
  71. netherframe/core/constructs/infrastructure_support.py +286 -0
  72. netherframe/core/constructs/meta.py +431 -0
  73. netherframe/core/constructs/provider_construct.py +290 -0
  74. netherframe/core/constructs/resolution.py +76 -0
  75. netherframe/core/constructs/resources.py +869 -0
  76. netherframe/core/constructs/specialized_resources.py +349 -0
  77. netherframe/core/constructs/stack_bound.py +37 -0
  78. netherframe/core/constructs/stack_registry.py +96 -0
  79. netherframe/core/constructs/stack_synthesis.py +321 -0
  80. netherframe/core/constructs/utilities.py +7 -0
  81. netherframe/core/context.py +81 -0
  82. netherframe/core/drift/__init__.py +140 -0
  83. netherframe/core/drift/analysis_core.py +41 -0
  84. netherframe/core/drift/detector.py +343 -0
  85. netherframe/core/drift/errors.py +29 -0
  86. netherframe/core/drift/import_id.py +116 -0
  87. netherframe/core/drift/legacy_adapter.py +154 -0
  88. netherframe/core/drift/locate.py +99 -0
  89. netherframe/core/drift/models.py +52 -0
  90. netherframe/core/drift/provider_clients.py +70 -0
  91. netherframe/core/drift/provider_utils.py +202 -0
  92. netherframe/core/drift/resource_analysis.py +173 -0
  93. netherframe/core/drift/resource_parser.py +207 -0
  94. netherframe/core/drift/state_comparison.py +152 -0
  95. netherframe/core/drift/transformer.py +265 -0
  96. netherframe/core/exceptions.py +192 -0
  97. netherframe/core/execution/__init__.py +25 -0
  98. netherframe/core/execution/adoption.py +235 -0
  99. netherframe/core/execution/approval.py +159 -0
  100. netherframe/core/execution/deferred_scheduling.py +258 -0
  101. netherframe/core/execution/graph_apply_preparation.py +158 -0
  102. netherframe/core/execution/graph_deferrals.py +68 -0
  103. netherframe/core/execution/graph_destroy_preparation.py +139 -0
  104. netherframe/core/execution/graph_import_preparation.py +133 -0
  105. netherframe/core/execution/graph_inputs.py +82 -0
  106. netherframe/core/execution/graph_intent_manifest.py +236 -0
  107. netherframe/core/execution/graph_move_preparation.py +102 -0
  108. netherframe/core/execution/graph_noop.py +35 -0
  109. netherframe/core/execution/graph_plan_artifact.py +471 -0
  110. netherframe/core/execution/graph_plan_coverage.py +415 -0
  111. netherframe/core/execution/graph_plan_review.py +195 -0
  112. netherframe/core/execution/graph_planning_candidate.py +261 -0
  113. netherframe/core/execution/graph_planning_frontend.py +158 -0
  114. netherframe/core/execution/graph_planning_values.py +169 -0
  115. netherframe/core/execution/graph_state_migration.py +184 -0
  116. netherframe/core/execution/hybrid.py +309 -0
  117. netherframe/core/execution/hybrid_adoption.py +450 -0
  118. netherframe/core/execution/hybrid_apply.py +1264 -0
  119. netherframe/core/execution/hybrid_data_sources.py +211 -0
  120. netherframe/core/execution/hybrid_ephemeral.py +342 -0
  121. netherframe/core/execution/hybrid_graph_state.py +827 -0
  122. netherframe/core/execution/hybrid_plan.py +799 -0
  123. netherframe/core/execution/hybrid_planning.py +1937 -0
  124. netherframe/core/execution/hybrid_providers.py +1098 -0
  125. netherframe/core/execution/hybrid_refresh.py +408 -0
  126. netherframe/core/execution/hybrid_results.py +141 -0
  127. netherframe/core/execution/hybrid_runtime_checks.py +274 -0
  128. netherframe/core/execution/hybrid_state_ops.py +564 -0
  129. netherframe/core/execution/mode.py +21 -0
  130. netherframe/core/execution/plan_artifacts.py +31 -0
  131. netherframe/core/execution/planning_scope.py +109 -0
  132. netherframe/core/execution/provenance_report.py +731 -0
  133. netherframe/core/functions/__init__.py +39 -0
  134. netherframe/core/functions/catalog_support.py +74 -0
  135. netherframe/core/functions/function_base.py +193 -0
  136. netherframe/core/functions/functions.py +81 -0
  137. netherframe/core/functions/legacy_registry.py +92 -0
  138. netherframe/core/infrastructure/__init__.py +10 -0
  139. netherframe/core/infrastructure/discovery.py +350 -0
  140. netherframe/core/infrastructure/resource_introspection.py +244 -0
  141. netherframe/core/infrastructure/validation.py +149 -0
  142. netherframe/core/linting/__init__.py +27 -0
  143. netherframe/core/linting/core.py +280 -0
  144. netherframe/core/linting/graph.py +100 -0
  145. netherframe/core/linting/plugins.py +38 -0
  146. netherframe/core/logging.py +37 -0
  147. netherframe/core/logging_controls.py +121 -0
  148. netherframe/core/logging_formatting.py +78 -0
  149. netherframe/core/logging_setup.py +202 -0
  150. netherframe/core/logging_state.py +43 -0
  151. netherframe/core/logging_wrapper.py +222 -0
  152. netherframe/core/orchestration/__init__.py +38 -0
  153. netherframe/core/orchestration/app_script_generation.py +596 -0
  154. netherframe/core/orchestration/event_loop.py +146 -0
  155. netherframe/core/orchestration/execution_models.py +188 -0
  156. netherframe/core/orchestration/execution_slots.py +204 -0
  157. netherframe/core/orchestration/execution_strategies.py +287 -0
  158. netherframe/core/orchestration/graph_authorization.py +72 -0
  159. netherframe/core/orchestration/graph_completion.py +246 -0
  160. netherframe/core/orchestration/graph_creations.py +122 -0
  161. netherframe/core/orchestration/graph_normalization.py +262 -0
  162. netherframe/core/orchestration/phased_artifacts.py +764 -0
  163. netherframe/core/orchestration/planned_changes.py +245 -0
  164. netherframe/core/orchestration/progress_reporting.py +109 -0
  165. netherframe/core/orchestration/resource_operations.py +1406 -0
  166. netherframe/core/orchestration/stack_ordering.py +72 -0
  167. netherframe/core/orchestration/state_shaping.py +1138 -0
  168. netherframe/core/orchestration/unified_orchestrator.py +618 -0
  169. netherframe/core/phases/__init__.py +35 -0
  170. netherframe/core/phases/analyzer.py +121 -0
  171. netherframe/core/phases/cycle_analysis.py +162 -0
  172. netherframe/core/phases/cycle_breaking.py +32 -0
  173. netherframe/core/phases/dependency_extraction.py +143 -0
  174. netherframe/core/phases/dependency_graph.py +118 -0
  175. netherframe/core/phases/graph_algorithms.py +402 -0
  176. netherframe/core/phases/models.py +268 -0
  177. netherframe/core/phases/omission.py +83 -0
  178. netherframe/core/phases/parallel_groups.py +37 -0
  179. netherframe/core/phases/planner.py +236 -0
  180. netherframe/core/phases/serialization.py +56 -0
  181. netherframe/core/phases/stack_dependency_plan.py +89 -0
  182. netherframe/core/providers/__init__.py +22 -0
  183. netherframe/core/providers/builtin_provider.py +367 -0
  184. netherframe/core/providers/generators.py +248 -0
  185. netherframe/core/providers/graph_identity.py +222 -0
  186. netherframe/core/providers/graph_planning.py +173 -0
  187. netherframe/core/providers/plan_reuse.py +106 -0
  188. netherframe/core/providers/provider_address.py +248 -0
  189. netherframe/core/providers/provider_binary_resolver.py +128 -0
  190. netherframe/core/providers/provider_handshake.py +146 -0
  191. netherframe/core/providers/provider_lifecycle.py +153 -0
  192. netherframe/core/providers/provider_loader.py +478 -0
  193. netherframe/core/providers/provider_models.py +89 -0
  194. netherframe/core/providers/provider_operation_context.py +291 -0
  195. netherframe/core/providers/provider_protocol.py +431 -0
  196. netherframe/core/providers/provider_registry.py +334 -0
  197. netherframe/core/providers/provider_resolution.py +298 -0
  198. netherframe/core/providers/provider_resource_operations.py +609 -0
  199. netherframe/core/providers/provider_rpc_support.py +91 -0
  200. netherframe/core/providers/provider_schema.py +210 -0
  201. netherframe/core/providers/provider_session.py +58 -0
  202. netherframe/core/providers/provider_session_io.py +101 -0
  203. netherframe/core/providers/provider_session_models.py +31 -0
  204. netherframe/core/providers/provider_session_shutdown.py +67 -0
  205. netherframe/core/providers/provider_session_startup.py +182 -0
  206. netherframe/core/providers/provider_settings.py +32 -0
  207. netherframe/core/providers/provider_supplemental_operations.py +492 -0
  208. netherframe/core/providers/provider_value_shaper.py +75 -0
  209. netherframe/core/providers/state_normalization.py +57 -0
  210. netherframe/core/providers/state_refresh.py +105 -0
  211. netherframe/core/providers/tls_generators.py +521 -0
  212. netherframe/core/py.typed +0 -0
  213. netherframe/core/runtime/__init__.py +39 -0
  214. netherframe/core/runtime/hybrid_runtime.py +710 -0
  215. netherframe/core/runtime/runtime.py +59 -0
  216. netherframe/core/runtime/runtime_api.py +173 -0
  217. netherframe/core/runtime/runtime_binding.py +46 -0
  218. netherframe/core/runtime/runtime_command.py +64 -0
  219. netherframe/core/runtime/terraform_runtime.py +262 -0
  220. netherframe/core/runtime/terraform_runtime_binding.py +47 -0
  221. netherframe/core/runtime/terraform_runtime_query.py +62 -0
  222. netherframe/core/serialization/__init__.py +51 -0
  223. netherframe/core/serialization/caching_v2.py +155 -0
  224. netherframe/core/serialization/cty_msgpack.py +819 -0
  225. netherframe/core/serialization/json_encoder.py +81 -0
  226. netherframe/core/serialization/message_encoding.py +174 -0
  227. netherframe/core/serialization/message_value_utils.py +44 -0
  228. netherframe/core/serialization/orjson_compat.py +103 -0
  229. netherframe/core/serialization/schema_cache.py +468 -0
  230. netherframe/core/serialization/schema_utils.py +159 -0
  231. netherframe/core/serialization/stack_config_builder.py +222 -0
  232. netherframe/core/serialization/unknown_values.py +192 -0
  233. netherframe/core/state_migration.py +15 -0
  234. netherframe/core/state_migration_backend.py +223 -0
  235. netherframe/core/state_migration_conversion.py +234 -0
  236. netherframe/core/state_migration_inspection.py +147 -0
  237. netherframe/core/state_migration_types.py +9 -0
  238. netherframe/core/synthesis/__init__.py +21 -0
  239. netherframe/core/synthesis/hcl_blocks.py +149 -0
  240. netherframe/core/synthesis/hcl_formatting.py +148 -0
  241. netherframe/core/synthesis/hcl_writer.py +408 -0
  242. netherframe/core/synthesis/import_generator.py +172 -0
  243. netherframe/core/synthesis/references.py +95 -0
  244. netherframe/core/synthesis/stack_artifacts.py +143 -0
  245. netherframe/core/synthesis/validation_reports.py +46 -0
  246. netherframe/core/testing/__init__.py +1 -0
  247. netherframe/core/testing/env.py +13 -0
  248. netherframe/core/testing/fakecloud.py +622 -0
  249. netherframe/core/testing/graph_memory.py +1476 -0
  250. netherframe/core/testing/graph_scenarios.py +377 -0
  251. netherframe/core/testing/log_capture.py +34 -0
  252. netherframe/core/testing/patching.py +17 -0
  253. netherframe/core/testing/provider_test_helpers.py +33 -0
  254. netherframe/core/testing/pytest_fakecloud.py +59 -0
  255. netherframe/core/testing/pytest_workspace.py +78 -0
  256. netherframe/core/testing/schema_cache.py +44 -0
  257. netherframe/core/testing/state_backend_contract.py +556 -0
  258. netherframe/core/testing/terraform_cache.py +41 -0
  259. netherframe/core/values/__init__.py +12 -0
  260. netherframe/core/values/address.py +345 -0
  261. netherframe/core/values/basic_resolver.py +133 -0
  262. netherframe/core/values/compiled.py +318 -0
  263. netherframe/core/values/ephemeral_values.py +37 -0
  264. netherframe/core/values/expressions.py +1112 -0
  265. netherframe/core/values/hcl_expressions.py +272 -0
  266. netherframe/core/values/intent.py +141 -0
  267. netherframe/core/values/observation_cache.py +90 -0
  268. netherframe/core/values/provenance.py +545 -0
  269. netherframe/core/values/read_scopes.py +73 -0
  270. netherframe/core/values/resolver.py +37 -0
  271. netherframe/core/values/runtime_impl.py +168 -0
  272. netherframe/core/values/runtime_value.py +129 -0
  273. netherframe/core/values/runtime_value_ops.py +454 -0
  274. netherframe/core/values/runtime_value_wrapped.py +9 -0
  275. netherframe/core/values/terraform_operations.py +851 -0
  276. netherframe/core/values/terraform_syntax.py +396 -0
  277. netherframe/core/values/tokens.py +95 -0
  278. netherframe_core-0.9.1.data/purelib/netherframe_nf_alias.pth +1 -0
  279. netherframe_core-0.9.1.dist-info/METADATA +115 -0
  280. netherframe_core-0.9.1.dist-info/RECORD +561 -0
  281. netherframe_core-0.9.1.dist-info/WHEEL +4 -0
  282. netherframe_core-0.9.1.dist-info/entry_points.txt +3 -0
  283. netherframe_core-0.9.1.dist-info/licenses/LICENSE +21 -0
  284. netherframe_nf_alias/__init__.py +82 -0
  285. nf/core/__init__.py +4 -0
  286. nf/core/autoscope.py +4 -0
  287. nf/core/backends/__init__.py +4 -0
  288. nf/core/backends/backend_bootstrap.py +4 -0
  289. nf/core/backends/backend_chain.py +4 -0
  290. nf/core/backends/backend_chain_models.py +4 -0
  291. nf/core/backends/backend_chain_policy.py +4 -0
  292. nf/core/backends/backend_config.py +4 -0
  293. nf/core/backends/backend_literals.py +4 -0
  294. nf/core/backends/backend_registry.py +4 -0
  295. nf/core/backends/document_state_backend.py +4 -0
  296. nf/core/backends/graph_authorization.py +4 -0
  297. nf/core/backends/graph_baseline.py +4 -0
  298. nf/core/backends/graph_checkpoint.py +4 -0
  299. nf/core/backends/graph_completion.py +4 -0
  300. nf/core/backends/graph_diagnostics.py +4 -0
  301. nf/core/backends/graph_edges.py +4 -0
  302. nf/core/backends/graph_errored_state.py +4 -0
  303. nf/core/backends/graph_execution_rows.py +4 -0
  304. nf/core/backends/graph_footprints.py +4 -0
  305. nf/core/backends/graph_history.py +4 -0
  306. nf/core/backends/graph_identity.py +4 -0
  307. nf/core/backends/graph_inputs.py +4 -0
  308. nf/core/backends/graph_kept_return.py +4 -0
  309. nf/core/backends/graph_leases.py +4 -0
  310. nf/core/backends/graph_merge.py +4 -0
  311. nf/core/backends/graph_migration.py +4 -0
  312. nf/core/backends/graph_moves.py +4 -0
  313. nf/core/backends/graph_object_guard.py +4 -0
  314. nf/core/backends/graph_ownership.py +4 -0
  315. nf/core/backends/graph_plan_basis.py +4 -0
  316. nf/core/backends/graph_plan_guard.py +4 -0
  317. nf/core/backends/graph_planning.py +4 -0
  318. nf/core/backends/graph_planning_context.py +4 -0
  319. nf/core/backends/graph_planning_rounds.py +4 -0
  320. nf/core/backends/graph_planning_selection.py +4 -0
  321. nf/core/backends/graph_recovery.py +4 -0
  322. nf/core/backends/graph_retention.py +4 -0
  323. nf/core/backends/graph_settings.py +4 -0
  324. nf/core/backends/graph_state.py +4 -0
  325. nf/core/backends/graph_state_engine.py +4 -0
  326. nf/core/backends/local_backend.py +4 -0
  327. nf/core/backends/lock_heartbeat.py +4 -0
  328. nf/core/backends/state_backend.py +4 -0
  329. nf/core/backends/state_engine.py +4 -0
  330. nf/core/backends/state_engine_runtime.py +4 -0
  331. nf/core/backends/state_lock.py +4 -0
  332. nf/core/backends/state_models.py +4 -0
  333. nf/core/config/__init__.py +4 -0
  334. nf/core/config/config.py +4 -0
  335. nf/core/config/config_discovery.py +4 -0
  336. nf/core/config/config_normalization.py +4 -0
  337. nf/core/config/config_parsing.py +4 -0
  338. nf/core/config/config_values.py +4 -0
  339. nf/core/config/hybrid_settings.py +4 -0
  340. nf/core/config/ignore_changes.py +4 -0
  341. nf/core/config/normalization_coercion.py +4 -0
  342. nf/core/config/normalization_types.py +4 -0
  343. nf/core/config/types.py +4 -0
  344. nf/core/constructs/__init__.py +4 -0
  345. nf/core/constructs/app_stack.py +4 -0
  346. nf/core/constructs/app_synthesis.py +4 -0
  347. nf/core/constructs/attributes.py +4 -0
  348. nf/core/constructs/backend_base.py +4 -0
  349. nf/core/constructs/base_construct.py +4 -0
  350. nf/core/constructs/cross_stack_refs.py +4 -0
  351. nf/core/constructs/framework_settings.py +4 -0
  352. nf/core/constructs/generated_value.py +4 -0
  353. nf/core/constructs/infrastructure.py +4 -0
  354. nf/core/constructs/infrastructure_policy.py +4 -0
  355. nf/core/constructs/infrastructure_support.py +4 -0
  356. nf/core/constructs/meta.py +4 -0
  357. nf/core/constructs/provider_construct.py +4 -0
  358. nf/core/constructs/resolution.py +4 -0
  359. nf/core/constructs/resources.py +4 -0
  360. nf/core/constructs/specialized_resources.py +4 -0
  361. nf/core/constructs/stack_bound.py +4 -0
  362. nf/core/constructs/stack_registry.py +4 -0
  363. nf/core/constructs/stack_synthesis.py +4 -0
  364. nf/core/constructs/utilities.py +4 -0
  365. nf/core/context.py +4 -0
  366. nf/core/drift/__init__.py +4 -0
  367. nf/core/drift/analysis_core.py +4 -0
  368. nf/core/drift/detector.py +4 -0
  369. nf/core/drift/errors.py +4 -0
  370. nf/core/drift/import_id.py +4 -0
  371. nf/core/drift/legacy_adapter.py +4 -0
  372. nf/core/drift/locate.py +4 -0
  373. nf/core/drift/models.py +4 -0
  374. nf/core/drift/provider_clients.py +4 -0
  375. nf/core/drift/provider_utils.py +4 -0
  376. nf/core/drift/resource_analysis.py +4 -0
  377. nf/core/drift/resource_parser.py +4 -0
  378. nf/core/drift/state_comparison.py +4 -0
  379. nf/core/drift/transformer.py +4 -0
  380. nf/core/exceptions.py +4 -0
  381. nf/core/execution/__init__.py +4 -0
  382. nf/core/execution/adoption.py +4 -0
  383. nf/core/execution/approval.py +4 -0
  384. nf/core/execution/deferred_scheduling.py +4 -0
  385. nf/core/execution/graph_apply_preparation.py +4 -0
  386. nf/core/execution/graph_deferrals.py +4 -0
  387. nf/core/execution/graph_destroy_preparation.py +4 -0
  388. nf/core/execution/graph_import_preparation.py +4 -0
  389. nf/core/execution/graph_inputs.py +4 -0
  390. nf/core/execution/graph_intent_manifest.py +4 -0
  391. nf/core/execution/graph_move_preparation.py +4 -0
  392. nf/core/execution/graph_noop.py +4 -0
  393. nf/core/execution/graph_plan_artifact.py +4 -0
  394. nf/core/execution/graph_plan_coverage.py +4 -0
  395. nf/core/execution/graph_plan_review.py +4 -0
  396. nf/core/execution/graph_planning_candidate.py +4 -0
  397. nf/core/execution/graph_planning_frontend.py +4 -0
  398. nf/core/execution/graph_planning_values.py +4 -0
  399. nf/core/execution/graph_state_migration.py +4 -0
  400. nf/core/execution/hybrid.py +4 -0
  401. nf/core/execution/hybrid_adoption.py +4 -0
  402. nf/core/execution/hybrid_apply.py +4 -0
  403. nf/core/execution/hybrid_data_sources.py +4 -0
  404. nf/core/execution/hybrid_ephemeral.py +4 -0
  405. nf/core/execution/hybrid_graph_state.py +4 -0
  406. nf/core/execution/hybrid_plan.py +4 -0
  407. nf/core/execution/hybrid_planning.py +4 -0
  408. nf/core/execution/hybrid_providers.py +4 -0
  409. nf/core/execution/hybrid_refresh.py +4 -0
  410. nf/core/execution/hybrid_results.py +4 -0
  411. nf/core/execution/hybrid_runtime_checks.py +4 -0
  412. nf/core/execution/hybrid_state_ops.py +4 -0
  413. nf/core/execution/mode.py +4 -0
  414. nf/core/execution/plan_artifacts.py +4 -0
  415. nf/core/execution/planning_scope.py +4 -0
  416. nf/core/execution/provenance_report.py +4 -0
  417. nf/core/functions/__init__.py +4 -0
  418. nf/core/functions/catalog_support.py +4 -0
  419. nf/core/functions/function_base.py +4 -0
  420. nf/core/functions/functions.py +4 -0
  421. nf/core/functions/legacy_registry.py +4 -0
  422. nf/core/infrastructure/__init__.py +4 -0
  423. nf/core/infrastructure/discovery.py +4 -0
  424. nf/core/infrastructure/resource_introspection.py +4 -0
  425. nf/core/infrastructure/validation.py +4 -0
  426. nf/core/linting/__init__.py +4 -0
  427. nf/core/linting/core.py +4 -0
  428. nf/core/linting/graph.py +4 -0
  429. nf/core/linting/plugins.py +4 -0
  430. nf/core/logging.py +4 -0
  431. nf/core/logging_controls.py +4 -0
  432. nf/core/logging_formatting.py +4 -0
  433. nf/core/logging_setup.py +4 -0
  434. nf/core/logging_state.py +4 -0
  435. nf/core/logging_wrapper.py +4 -0
  436. nf/core/orchestration/__init__.py +4 -0
  437. nf/core/orchestration/app_script_generation.py +4 -0
  438. nf/core/orchestration/event_loop.py +4 -0
  439. nf/core/orchestration/execution_models.py +4 -0
  440. nf/core/orchestration/execution_slots.py +4 -0
  441. nf/core/orchestration/execution_strategies.py +4 -0
  442. nf/core/orchestration/graph_authorization.py +4 -0
  443. nf/core/orchestration/graph_completion.py +4 -0
  444. nf/core/orchestration/graph_creations.py +4 -0
  445. nf/core/orchestration/graph_normalization.py +4 -0
  446. nf/core/orchestration/phased_artifacts.py +4 -0
  447. nf/core/orchestration/planned_changes.py +4 -0
  448. nf/core/orchestration/progress_reporting.py +4 -0
  449. nf/core/orchestration/resource_operations.py +4 -0
  450. nf/core/orchestration/stack_ordering.py +4 -0
  451. nf/core/orchestration/state_shaping.py +4 -0
  452. nf/core/orchestration/unified_orchestrator.py +4 -0
  453. nf/core/phases/__init__.py +4 -0
  454. nf/core/phases/analyzer.py +4 -0
  455. nf/core/phases/cycle_analysis.py +4 -0
  456. nf/core/phases/cycle_breaking.py +4 -0
  457. nf/core/phases/dependency_extraction.py +4 -0
  458. nf/core/phases/dependency_graph.py +4 -0
  459. nf/core/phases/graph_algorithms.py +4 -0
  460. nf/core/phases/models.py +4 -0
  461. nf/core/phases/omission.py +4 -0
  462. nf/core/phases/parallel_groups.py +4 -0
  463. nf/core/phases/planner.py +4 -0
  464. nf/core/phases/serialization.py +4 -0
  465. nf/core/phases/stack_dependency_plan.py +4 -0
  466. nf/core/providers/__init__.py +4 -0
  467. nf/core/providers/builtin_provider.py +4 -0
  468. nf/core/providers/generators.py +4 -0
  469. nf/core/providers/graph_identity.py +4 -0
  470. nf/core/providers/graph_planning.py +4 -0
  471. nf/core/providers/plan_reuse.py +4 -0
  472. nf/core/providers/provider_address.py +4 -0
  473. nf/core/providers/provider_binary_resolver.py +4 -0
  474. nf/core/providers/provider_handshake.py +4 -0
  475. nf/core/providers/provider_lifecycle.py +4 -0
  476. nf/core/providers/provider_loader.py +4 -0
  477. nf/core/providers/provider_models.py +4 -0
  478. nf/core/providers/provider_operation_context.py +4 -0
  479. nf/core/providers/provider_protocol.py +4 -0
  480. nf/core/providers/provider_registry.py +4 -0
  481. nf/core/providers/provider_resolution.py +4 -0
  482. nf/core/providers/provider_resource_operations.py +4 -0
  483. nf/core/providers/provider_rpc_support.py +4 -0
  484. nf/core/providers/provider_schema.py +4 -0
  485. nf/core/providers/provider_session.py +4 -0
  486. nf/core/providers/provider_session_io.py +4 -0
  487. nf/core/providers/provider_session_models.py +4 -0
  488. nf/core/providers/provider_session_shutdown.py +4 -0
  489. nf/core/providers/provider_session_startup.py +4 -0
  490. nf/core/providers/provider_settings.py +4 -0
  491. nf/core/providers/provider_supplemental_operations.py +4 -0
  492. nf/core/providers/provider_value_shaper.py +4 -0
  493. nf/core/providers/state_normalization.py +4 -0
  494. nf/core/providers/state_refresh.py +4 -0
  495. nf/core/providers/tls_generators.py +4 -0
  496. nf/core/py.typed +0 -0
  497. nf/core/runtime/__init__.py +4 -0
  498. nf/core/runtime/hybrid_runtime.py +4 -0
  499. nf/core/runtime/runtime.py +4 -0
  500. nf/core/runtime/runtime_api.py +4 -0
  501. nf/core/runtime/runtime_binding.py +4 -0
  502. nf/core/runtime/runtime_command.py +4 -0
  503. nf/core/runtime/terraform_runtime.py +4 -0
  504. nf/core/runtime/terraform_runtime_binding.py +4 -0
  505. nf/core/runtime/terraform_runtime_query.py +4 -0
  506. nf/core/serialization/__init__.py +4 -0
  507. nf/core/serialization/caching_v2.py +4 -0
  508. nf/core/serialization/cty_msgpack.py +4 -0
  509. nf/core/serialization/json_encoder.py +4 -0
  510. nf/core/serialization/message_encoding.py +4 -0
  511. nf/core/serialization/message_value_utils.py +4 -0
  512. nf/core/serialization/orjson_compat.py +4 -0
  513. nf/core/serialization/schema_cache.py +4 -0
  514. nf/core/serialization/schema_utils.py +4 -0
  515. nf/core/serialization/stack_config_builder.py +4 -0
  516. nf/core/serialization/unknown_values.py +4 -0
  517. nf/core/state_migration.py +4 -0
  518. nf/core/state_migration_backend.py +4 -0
  519. nf/core/state_migration_conversion.py +4 -0
  520. nf/core/state_migration_inspection.py +4 -0
  521. nf/core/state_migration_types.py +4 -0
  522. nf/core/synthesis/__init__.py +4 -0
  523. nf/core/synthesis/hcl_blocks.py +4 -0
  524. nf/core/synthesis/hcl_formatting.py +4 -0
  525. nf/core/synthesis/hcl_writer.py +4 -0
  526. nf/core/synthesis/import_generator.py +4 -0
  527. nf/core/synthesis/references.py +4 -0
  528. nf/core/synthesis/stack_artifacts.py +4 -0
  529. nf/core/synthesis/validation_reports.py +4 -0
  530. nf/core/testing/__init__.py +4 -0
  531. nf/core/testing/env.py +4 -0
  532. nf/core/testing/fakecloud.py +4 -0
  533. nf/core/testing/graph_memory.py +4 -0
  534. nf/core/testing/graph_scenarios.py +4 -0
  535. nf/core/testing/log_capture.py +4 -0
  536. nf/core/testing/patching.py +4 -0
  537. nf/core/testing/provider_test_helpers.py +4 -0
  538. nf/core/testing/pytest_fakecloud.py +4 -0
  539. nf/core/testing/pytest_workspace.py +4 -0
  540. nf/core/testing/schema_cache.py +4 -0
  541. nf/core/testing/state_backend_contract.py +4 -0
  542. nf/core/testing/terraform_cache.py +4 -0
  543. nf/core/values/__init__.py +4 -0
  544. nf/core/values/address.py +4 -0
  545. nf/core/values/basic_resolver.py +4 -0
  546. nf/core/values/compiled.py +4 -0
  547. nf/core/values/ephemeral_values.py +4 -0
  548. nf/core/values/expressions.py +4 -0
  549. nf/core/values/hcl_expressions.py +4 -0
  550. nf/core/values/intent.py +4 -0
  551. nf/core/values/observation_cache.py +4 -0
  552. nf/core/values/provenance.py +4 -0
  553. nf/core/values/read_scopes.py +4 -0
  554. nf/core/values/resolver.py +4 -0
  555. nf/core/values/runtime_impl.py +4 -0
  556. nf/core/values/runtime_value.py +4 -0
  557. nf/core/values/runtime_value_ops.py +4 -0
  558. nf/core/values/runtime_value_wrapped.py +4 -0
  559. nf/core/values/terraform_operations.py +4 -0
  560. nf/core/values/terraform_syntax.py +4 -0
  561. nf/core/values/tokens.py +4 -0
@@ -0,0 +1,140 @@
1
+ """Netherframe Core package facade."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING, Any, TypeVar
6
+
7
+ # Special type for preprocessor control
8
+ T = TypeVar("T")
9
+
10
+ if TYPE_CHECKING:
11
+ from contextlib import AbstractContextManager
12
+ from netherframe.core.autoscope import autoscope
13
+ from netherframe.core.backends.backend_chain import (
14
+ BackendBootstrapAction,
15
+ BackendBootstrapResult,
16
+ BackendChain,
17
+ BackendDecision,
18
+ BackendSelection,
19
+ ConditionalBackend,
20
+ )
21
+ from netherframe.core.constructs.app_stack import App, Stack
22
+ from netherframe.core.constructs.backend_base import LocalBackend
23
+ from netherframe.core.constructs.base_construct import BaseConstruct as Construct
24
+ from netherframe.core.constructs.framework_settings import BackendSettings, ProviderSettings
25
+ from netherframe.core.constructs.generated_value import GeneratedValue
26
+ from netherframe.core.constructs.infrastructure import Output, Variable
27
+ from netherframe.core.constructs.meta import Condition, DataLifecycleRules, LifecycleRules
28
+ from netherframe.core.constructs.resources import DataSource, Provider, Resource
29
+ from netherframe.core.functions.functions import Fn
30
+ from netherframe.core.values.runtime_value import RuntimeValue
31
+
32
+ # `name: Bind = Construct(...)` declares `name` with no particular type (a bare generic alias
33
+ # is `Bind[Any]`), so checkers accept it; `name: Bind[Vpc] = Vpc(...)` keeps the type.
34
+ type Bind[BoundT] = BoundT
35
+
36
+ BindContext: AbstractContextManager[None]
37
+ else:
38
+ # At runtime, use metaclasses that return the original type
39
+ class BindMeta(type):
40
+ """Metaclass for the Bind type marker."""
41
+
42
+ def __getitem__(cls, type_hint: type[T]) -> type[T]:
43
+ """Return the original type when indexed.
44
+
45
+ This makes Bind[SomeType] return SomeType at runtime,
46
+ acting as a transparent marker for the preprocessor.
47
+ """
48
+ return type_hint
49
+
50
+ class Bind(metaclass=BindMeta):
51
+ """Runtime marker class for explicit variable binding.
52
+
53
+ This class serves as a marker for the preprocessor to understand
54
+ when variable names should be injected into construct instantiations.
55
+ At runtime, Bind[T] returns T directly, making it transparent.
56
+
57
+ Example usage:
58
+ # Type checker sees: Resource (with full autocomplete)
59
+ # Preprocessor sees: Bind annotation (triggers wrapping)
60
+ # Runtime gets: Resource (transparent)
61
+ my_resource: Bind = Resource(nf_type="aws_s3_bucket")
62
+ my_vpc: Bind[Vpc] = Vpc(cidr_block="10.0.0.0/16")
63
+ """
64
+
65
+ class _BindContext:
66
+ """No-op context manager used by the preprocessor as a binding marker."""
67
+
68
+ def __enter__(self) -> None:
69
+ return None
70
+
71
+ def __exit__(self, *args: object) -> None:
72
+ return None
73
+
74
+ def __call__(self) -> _BindContext:
75
+ return self
76
+
77
+ BindContext = _BindContext()
78
+
79
+ from netherframe.core.autoscope import autoscope
80
+ from netherframe.core.backends.backend_chain import (
81
+ BackendBootstrapAction,
82
+ BackendBootstrapResult,
83
+ BackendChain,
84
+ BackendDecision,
85
+ BackendSelection,
86
+ ConditionalBackend,
87
+ )
88
+ from netherframe.core.constructs.app_stack import App, Stack
89
+ from netherframe.core.constructs.backend_base import LocalBackend
90
+ from netherframe.core.constructs.base_construct import BaseConstruct as Construct
91
+ from netherframe.core.constructs.framework_settings import BackendSettings, ProviderSettings
92
+ from netherframe.core.constructs.generated_value import GeneratedValue
93
+ from netherframe.core.constructs.infrastructure import Output, Variable
94
+ from netherframe.core.constructs.meta import Condition, DataLifecycleRules, LifecycleRules
95
+ from netherframe.core.constructs.resources import DataSource, Provider, Resource
96
+ from netherframe.core.values.runtime_value import RuntimeValue
97
+
98
+
99
+ __all__ = [
100
+ # Core constructs
101
+ "App",
102
+ "Stack",
103
+ "Resource",
104
+ "DataSource",
105
+ "Provider",
106
+ "ProviderSettings",
107
+ "GeneratedValue",
108
+ "Output",
109
+ "Variable",
110
+ "Construct",
111
+ # Meta-arguments
112
+ "LifecycleRules",
113
+ "DataLifecycleRules",
114
+ "Condition",
115
+ "Fn",
116
+ "RuntimeValue",
117
+ "autoscope",
118
+ # Backends
119
+ "BackendChain",
120
+ "BackendBootstrapAction",
121
+ "BackendBootstrapResult",
122
+ "BackendDecision",
123
+ "BackendSelection",
124
+ "ConditionalBackend",
125
+ "LocalBackend",
126
+ "BackendSettings",
127
+ # Preprocessor control
128
+ "Bind",
129
+ "BindContext",
130
+ ]
131
+
132
+
133
+ def __getattr__(name: str) -> Any:
134
+ # Fn comes from the installed legacy function catalog; resolve it on first use
135
+ # so importing netherframe.core does not require a catalog package.
136
+ if name == "Fn":
137
+ from netherframe.core.functions.functions import Fn
138
+
139
+ return Fn
140
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
@@ -0,0 +1,59 @@
1
+ """Autoscope decorator for automatic scope detection."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import functools
6
+ from typing import Any, Protocol, cast
7
+
8
+
9
+ class _InitAssignable(Protocol):
10
+ __init__: Any
11
+
12
+
13
+ def autoscope[T](cls: type[T]) -> type[T]:
14
+ """Decorator that automatically detects and injects scope for construct classes.
15
+
16
+ This decorator wraps the __init__ method of a class to automatically detect
17
+ the current scope from the context stack when nf_scope is not provided.
18
+
19
+ The ``__init__`` of an ``App`` or ``Stack`` subclass also makes the construct the current
20
+ scope once it is set up (``super().__init__`` has run) until ``__init__`` returns, as
21
+ ``with self:`` would: constructs created in its body default to ``nf_scope=self``.
22
+
23
+ Args:
24
+ cls: The class to decorate
25
+
26
+ Returns:
27
+ The decorated class
28
+
29
+ """
30
+ original_init = cls.__init__
31
+
32
+ def inject_scope(kwargs: dict[str, Any]) -> None:
33
+ # If nf_scope is not provided, try to get from context
34
+ if "nf_scope" not in kwargs:
35
+ # Import here to avoid circular imports
36
+ from netherframe.core.constructs.base_construct import BaseConstruct
37
+
38
+ # Try to get current scope from context
39
+ current_scope = BaseConstruct._current_scope()
40
+ if current_scope:
41
+ kwargs["nf_scope"] = current_scope
42
+
43
+ @functools.wraps(original_init)
44
+ def wrapped_init(self: Any, *args: Any, **kwargs: Any) -> None:
45
+ inject_scope(kwargs)
46
+ original_init(self, *args, **kwargs)
47
+
48
+ @functools.wraps(original_init)
49
+ def wrapped_scope_init(self: Any, *args: Any, **kwargs: Any) -> None:
50
+ from netherframe.core.constructs.base_construct import BaseConstruct
51
+
52
+ inject_scope(kwargs)
53
+ BaseConstruct._run_scoping_init(self, original_init, args, kwargs)
54
+
55
+ # Organizational constructs hold the constructs created in their body; resources hold none
56
+ scopes_children = bool(getattr(cls, "_is_app", False) or getattr(cls, "_is_stack", False))
57
+ init_target = cast("_InitAssignable", cls)
58
+ init_target.__init__ = wrapped_scope_init if scopes_children else wrapped_init
59
+ return cls
@@ -0,0 +1,51 @@
1
+ """Backends package facade."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .backend_bootstrap import (
6
+ BackendBootstrapManager,
7
+ BackendBootstrapper,
8
+ BackendResources,
9
+ )
10
+ from .backend_chain import BackendChain, ConditionalBackend, build_backend_chain_from_config
11
+ from .backend_config import BackendAutoDetector, BackendConfig, BackendConfigManager
12
+ from .backend_registry import BackendRegistry, backend_construct, state_backend
13
+ from .state_engine import (
14
+ BackendType,
15
+ LocalBackendConfig,
16
+ LocalStateBackend,
17
+ PostgreSQLBackendConfig,
18
+ ResourceState,
19
+ S3BackendConfig,
20
+ State,
21
+ StateBackend,
22
+ StateChange,
23
+ StateEngine,
24
+ StateVersion,
25
+ )
26
+
27
+ __all__ = [
28
+ "BackendAutoDetector",
29
+ "BackendBootstrapManager",
30
+ "BackendBootstrapper",
31
+ "BackendChain",
32
+ "BackendConfig",
33
+ "BackendConfigManager",
34
+ "BackendRegistry",
35
+ "BackendResources",
36
+ "BackendType",
37
+ "ConditionalBackend",
38
+ "LocalBackendConfig",
39
+ "LocalStateBackend",
40
+ "PostgreSQLBackendConfig",
41
+ "ResourceState",
42
+ "S3BackendConfig",
43
+ "State",
44
+ "StateBackend",
45
+ "StateChange",
46
+ "StateEngine",
47
+ "StateVersion",
48
+ "backend_construct",
49
+ "build_backend_chain_from_config",
50
+ "state_backend",
51
+ ]
@@ -0,0 +1,132 @@
1
+ """Backend bootstrapping functionality - provider-agnostic core abstractions."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abc import ABC, abstractmethod
6
+ from dataclasses import asdict, dataclass
7
+ from typing import Any, ClassVar
8
+
9
+ from netherframe.core.exceptions import ConfigurationError
10
+ from netherframe.core.logging import get_logger
11
+
12
+ logger = get_logger(__name__)
13
+
14
+
15
+ @dataclass
16
+ class BackendResources:
17
+ """Information about resources created for backend storage.
18
+
19
+ This is a generic container that can hold any backend-specific resource information.
20
+ Providers should extend this or use it directly with their specific fields.
21
+ """
22
+
23
+ def to_dict(self) -> dict[str, Any]:
24
+ """Convert to dictionary, excluding None values."""
25
+ return {k: v for k, v in asdict(self).items() if v is not None}
26
+
27
+
28
+ class BackendBootstrapper(ABC):
29
+ """Abstract base class for backend bootstrappers.
30
+
31
+ Provider-specific packages should implement this interface to provide
32
+ backend resource bootstrapping functionality.
33
+ """
34
+
35
+ @abstractmethod
36
+ def bootstrap(self) -> BackendResources:
37
+ """Bootstrap all backend resources.
38
+
39
+ Returns:
40
+ BackendResources with information about created resources
41
+
42
+ """
43
+
44
+ @abstractmethod
45
+ def validate(self) -> bool:
46
+ """Validate that all required backend resources exist.
47
+
48
+ Returns:
49
+ True if all resources exist, False otherwise
50
+
51
+ """
52
+
53
+
54
+ class BackendBootstrapManager:
55
+ """Manager for backend bootstrappers.
56
+
57
+ This allows provider packages to register their bootstrappers.
58
+ """
59
+
60
+ _bootstrappers: ClassVar[dict[str, type[BackendBootstrapper]]] = {}
61
+
62
+ @classmethod
63
+ def register_bootstrapper(
64
+ cls,
65
+ backend_type: str,
66
+ bootstrapper_class: type[BackendBootstrapper],
67
+ ) -> None:
68
+ """Register a bootstrapper for a backend type.
69
+
70
+ This should be called by provider packages to register their bootstrappers.
71
+ For example, aws-backends would register S3BackendBootstrapper for "s3".
72
+
73
+ Args:
74
+ backend_type: The backend type (e.g., "s3", "gcs", "azurerm")
75
+ bootstrapper_class: The bootstrapper class to register
76
+
77
+ """
78
+ cls._bootstrappers[backend_type] = bootstrapper_class
79
+ logger.debug("Registered bootstrapper for backend type: %s", backend_type)
80
+
81
+ @classmethod
82
+ def get_bootstrapper(cls, backend_type: str, **kwargs: Any) -> BackendBootstrapper:
83
+ """Get a bootstrapper instance for a backend type.
84
+
85
+ Args:
86
+ backend_type: The backend type
87
+ **kwargs: Arguments to pass to the bootstrapper constructor
88
+
89
+ Returns:
90
+ Bootstrapper instance
91
+
92
+ Raises:
93
+ ConfigurationError: If no bootstrapper is registered for the backend type
94
+
95
+ """
96
+ if backend_type not in cls._bootstrappers:
97
+ raise ConfigurationError(
98
+ f"No bootstrapper registered for backend type: {backend_type}. Available types: {list(cls._bootstrappers.keys())}",
99
+ )
100
+
101
+ bootstrapper_class = cls._bootstrappers[backend_type]
102
+ return bootstrapper_class(**kwargs)
103
+
104
+ @classmethod
105
+ def bootstrap_backend(cls, backend_type: str, **kwargs: Any) -> BackendResources:
106
+ """Bootstrap a backend and return resource information.
107
+
108
+ Convenience method that gets the bootstrapper and calls bootstrap().
109
+
110
+ Args:
111
+ backend_type: The backend type
112
+ **kwargs: Arguments to pass to the bootstrapper
113
+
114
+ Returns:
115
+ BackendResources with information about created resources
116
+
117
+ """
118
+ bootstrapper = cls.get_bootstrapper(backend_type, **kwargs)
119
+ return bootstrapper.bootstrap()
120
+
121
+ @classmethod
122
+ def is_bootstrapper_available(cls, backend_type: str) -> bool:
123
+ """Check if a bootstrapper is available for a backend type.
124
+
125
+ Args:
126
+ backend_type: The backend type to check
127
+
128
+ Returns:
129
+ True if a bootstrapper is registered, False otherwise
130
+
131
+ """
132
+ return backend_type in cls._bootstrappers