stabilize 0.34.2__tar.gz → 0.34.4__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 (370) hide show
  1. {stabilize-0.34.2 → stabilize-0.34.4}/PKG-INFO +3 -1
  2. {stabilize-0.34.2 → stabilize-0.34.4}/pyproject.toml +60 -6
  3. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/__init__.py +114 -113
  4. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/assertions.py +25 -38
  5. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/audit.py +2 -4
  6. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/__init__.py +3 -1
  7. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/adoption.py +1 -1
  8. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/commands.py +11 -11
  9. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/config.py +2 -2
  10. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/grants.py +4 -4
  11. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/history_location.py +4 -2
  12. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/migrate.py +4 -2
  13. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/migretti_runner.py +5 -3
  14. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/queue_table_cli.py +4 -2
  15. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/tenancy_cli.py +4 -2
  16. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/conditions.py +12 -18
  17. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/context/__init__.py +2 -0
  18. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/context/stage_context.py +9 -21
  19. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/dag/__init__.py +5 -3
  20. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/dag/deferred_choice.py +2 -1
  21. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/dag/graph.py +14 -25
  22. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/dag/merge.py +1 -1
  23. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/dag/readiness.py +45 -57
  24. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/dag/topological.py +11 -18
  25. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/error_codes.py +4 -5
  26. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/__init__.py +2 -4
  27. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/chain.py +4 -1
  28. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/__init__.py +41 -43
  29. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/base.py +8 -10
  30. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/bus.py +20 -30
  31. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/projections/__init__.py +5 -4
  32. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/projections/base.py +9 -18
  33. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/projections/metrics.py +2 -4
  34. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/projections/timeline.py +24 -21
  35. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/recorder/__init__.py +3 -2
  36. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/recorder/base.py +8 -13
  37. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/recorder/composed.py +2 -4
  38. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/recorder/context.py +3 -6
  39. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/recorder/generic_events.py +1 -2
  40. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/recorder/instance.py +2 -4
  41. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/recorder/stage_events.py +8 -9
  42. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/recorder/task_events.py +1 -2
  43. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/recorder/workflow_events.py +2 -3
  44. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/replay.py +13 -21
  45. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/snapshots.py +12 -22
  46. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/__init__.py +8 -7
  47. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/interface.py +27 -34
  48. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/postgres/__init__.py +6 -5
  49. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/postgres/events.py +104 -116
  50. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/postgres/retention.py +16 -17
  51. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/postgres/schema.py +3 -2
  52. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/postgres/snapshots.py +41 -43
  53. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/postgres/store.py +63 -64
  54. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/postgres/subscriptions.py +46 -51
  55. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/__init__.py +3 -2
  56. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/events.py +9 -11
  57. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/retention.py +4 -2
  58. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/schema.py +3 -2
  59. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/snapshots.py +7 -8
  60. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/store.py +8 -8
  61. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/sqlite/subscriptions.py +4 -6
  62. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/subscriptions.py +36 -50
  63. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/txn_scope.py +4 -4
  64. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/exceptions.py +9 -24
  65. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/expressions.py +7 -9
  66. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/finalizers.py +5 -4
  67. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/__init__.py +18 -17
  68. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/add_multi_instance.py +5 -6
  69. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/base.py +11 -18
  70. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/cancel_region.py +5 -6
  71. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/cancel_stage.py +6 -7
  72. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/__init__.py +2 -0
  73. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/handler.py +6 -12
  74. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/split_logic.py +1 -3
  75. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/support.py +4 -2
  76. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/complete_task.py +6 -7
  77. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/complete_workflow.py +8 -11
  78. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/continue_parent_stage.py +5 -12
  79. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/jump_to_stage/__init__.py +3 -1
  80. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/jump_to_stage/handler.py +7 -13
  81. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/jump_to_stage/traversal.py +1 -1
  82. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/run_task/__init__.py +2 -0
  83. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/run_task/error.py +10 -69
  84. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/run_task/execution.py +4 -3
  85. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/run_task/handler.py +11 -19
  86. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/run_task/held_results.py +0 -2
  87. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/run_task/result.py +10 -12
  88. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/run_task/saving.py +3 -3
  89. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/signal_stage.py +38 -6
  90. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/skip_stage.py +6 -7
  91. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/__init__.py +2 -0
  92. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/conditions.py +6 -15
  93. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/handler.py +7 -21
  94. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/orchestration.py +18 -23
  95. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/planner.py +3 -6
  96. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/start_stage/starting.py +3 -5
  97. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/start_task.py +5 -6
  98. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/start_waiting_workflows.py +5 -6
  99. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/start_workflow.py +5 -6
  100. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/workflow_control.py +12 -17
  101. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/hitl.py +3 -4
  102. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/launcher.py +10 -20
  103. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/lifecycle.py +19 -43
  104. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/llm/__init__.py +6 -5
  105. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/llm/client.py +1 -2
  106. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/llm/tasks.py +5 -7
  107. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/llm/tools.py +7 -9
  108. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/logging.py +7 -5
  109. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/metrics.py +16 -13
  110. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/__init__.py +7 -5
  111. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/multi_instance.py +1 -2
  112. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/snapshot.py +1 -2
  113. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/stage/__init__.py +2 -0
  114. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/stage/engine_keys.py +0 -1
  115. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/stage/enums.py +4 -4
  116. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/stage/navigation.py +11 -22
  117. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/stage/stage.py +5 -9
  118. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/status.py +6 -8
  119. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/task.py +3 -6
  120. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/workflow.py +18 -30
  121. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/monitor/__init__.py +5 -5
  122. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/monitor/data.py +88 -91
  123. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/monitor/display/__init__.py +2 -0
  124. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/monitor/display/constants.py +2 -0
  125. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/monitor/display/fetcher.py +2 -1
  126. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/monitor/display/interaction.py +14 -18
  127. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/monitor/display/monitor.py +3 -4
  128. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/monitor/display/rendering.py +12 -9
  129. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/monitor/models.py +9 -7
  130. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/orchestrator.py +19 -28
  131. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/__init__.py +6 -4
  132. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/borrow.py +4 -2
  133. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/borrow_hook.py +9 -5
  134. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/committed_marks.py +4 -1
  135. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/connection.py +13 -18
  136. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/factory.py +19 -26
  137. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/postgres/__init__.py +2 -0
  138. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/postgres/converters.py +1 -1
  139. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/postgres/helpers.py +1 -2
  140. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/postgres/maintenance.py +19 -14
  141. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/postgres/operations.py +26 -27
  142. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/postgres/queries.py +74 -82
  143. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/postgres/signals.py +15 -8
  144. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/postgres/stage_query.py +3 -3
  145. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/postgres/store.py +79 -79
  146. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/postgres/transaction.py +5 -96
  147. stabilize-0.34.4/src/stabilize/persistence/postgres/transaction_signals.py +117 -0
  148. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/postgres/workflow_ops.py +35 -34
  149. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/schema_check.py +9 -7
  150. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/__init__.py +2 -0
  151. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/converters.py +1 -2
  152. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/helpers.py +4 -2
  153. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/migrations.py +20 -12
  154. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/operations.py +5 -3
  155. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/queries.py +4 -3
  156. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/schema.py +6 -3
  157. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/signals.py +5 -4
  158. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/__init__.py +2 -0
  159. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/queries.py +7 -10
  160. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/stage_ops.py +3 -3
  161. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/stage_query.py +2 -1
  162. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/store.py +10 -11
  163. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/store/workflow_crud.py +3 -3
  164. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/tenant_schema.py +27 -16
  165. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/transaction.py +5 -7
  166. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite/transaction_ops.py +8 -1
  167. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/store/__init__.py +6 -4
  168. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/store/criteria.py +18 -4
  169. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/store/interface.py +31 -81
  170. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/store/maintenance_defaults.py +7 -3
  171. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/store/query_defaults.py +2 -1
  172. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/store/signal_defaults.py +4 -4
  173. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/store/stage_criteria.py +3 -2
  174. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/store/transaction.py +6 -7
  175. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/task_lease.py +24 -7
  176. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/tenancy.py +4 -2
  177. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/transaction.py +14 -15
  178. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/__init__.py +21 -19
  179. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/dedup.py +12 -19
  180. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/dlq.py +31 -36
  181. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/interface.py +14 -30
  182. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/message_base.py +4 -8
  183. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/messages.py +61 -77
  184. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/postgres.py +25 -30
  185. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/postgres_lookups.py +41 -45
  186. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/processor/__init__.py +2 -0
  187. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/processor/config.py +1 -2
  188. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/processor/drain.py +11 -9
  189. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/processor/handler_base.py +3 -6
  190. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/processor/mixins.py +18 -14
  191. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/processor/processor.py +17 -27
  192. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/processor/redelivery.py +2 -2
  193. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/processor/retention.py +2 -2
  194. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/processor/submission.py +7 -9
  195. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/processor/synchronous.py +7 -11
  196. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/sqlite/__init__.py +4 -2
  197. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/sqlite/dlq.py +3 -3
  198. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/sqlite/lookups.py +4 -2
  199. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/sqlite/queue.py +15 -19
  200. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/sqlite/schema.py +4 -1
  201. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/sqlite/serialization.py +4 -2
  202. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/recovery.py +7 -10
  203. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/recovery_rules.py +4 -13
  204. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/reducers.py +1 -2
  205. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/resilience/__init__.py +3 -2
  206. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/resilience/bulkheads.py +14 -20
  207. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/resilience/circuits.py +13 -22
  208. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/resilience/config.py +3 -6
  209. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/resilience/executor.py +17 -18
  210. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/resilience/process_executor.py +20 -23
  211. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/resilience/timeouts.py +3 -5
  212. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/stages/__init__.py +4 -2
  213. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/stages/builder.py +13 -29
  214. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/stages/loop_builder.py +3 -7
  215. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/stages/multi_instance_builder.py +3 -10
  216. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/streaming.py +15 -14
  217. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/__init__.py +5 -3
  218. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/docker.py +8 -9
  219. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/docker_commands.py +11 -12
  220. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/handles.py +2 -1
  221. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/highway/__init__.py +2 -0
  222. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/highway/task.py +5 -12
  223. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/http/__init__.py +6 -4
  224. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/http/constants.py +2 -0
  225. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/http/guarded_opener.py +1 -1
  226. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/http/request.py +4 -3
  227. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/http/response.py +15 -15
  228. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/http/task.py +9 -11
  229. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/http/utils.py +5 -6
  230. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/interface.py +29 -54
  231. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/loop.py +11 -9
  232. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/python.py +18 -20
  233. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/registry.py +16 -27
  234. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/result.py +16 -30
  235. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/shell.py +23 -30
  236. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/ssh.py +9 -10
  237. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/sub_workflow.py +1 -2
  238. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/threads.py +4 -2
  239. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tracing.py +10 -15
  240. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/validation/__init__.py +7 -5
  241. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/validation/errors.py +1 -2
  242. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/validation/helpers.py +7 -8
  243. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/validation/schemas.py +2 -0
  244. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/validation/validator.py +33 -40
  245. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/verification.py +15 -35
  246. {stabilize-0.34.2 → stabilize-0.34.4}/.gitignore +0 -0
  247. {stabilize-0.34.2 → stabilize-0.34.4}/LICENSE +0 -0
  248. {stabilize-0.34.2 → stabilize-0.34.4}/README.md +0 -0
  249. {stabilize-0.34.2 → stabilize-0.34.4}/examples/__init__.py +0 -0
  250. {stabilize-0.34.2 → stabilize-0.34.4}/examples/agent_team/README.md +0 -0
  251. {stabilize-0.34.2 → stabilize-0.34.4}/examples/agent_team/main.py +0 -0
  252. {stabilize-0.34.2 → stabilize-0.34.4}/examples/agent_team/team_tasks.py +0 -0
  253. {stabilize-0.34.2 → stabilize-0.34.4}/examples/benchmark-overhead.py +0 -0
  254. {stabilize-0.34.2 → stabilize-0.34.4}/examples/docker-example.py +0 -0
  255. {stabilize-0.34.2 → stabilize-0.34.4}/examples/dynamic-routing-example.py +0 -0
  256. {stabilize-0.34.2 → stabilize-0.34.4}/examples/event-sourcing-example.py +0 -0
  257. {stabilize-0.34.2 → stabilize-0.34.4}/examples/golden-standard-expected-result.txt +0 -0
  258. {stabilize-0.34.2 → stabilize-0.34.4}/examples/golden-standard.py +0 -0
  259. {stabilize-0.34.2 → stabilize-0.34.4}/examples/highway-integration-example.py +0 -0
  260. {stabilize-0.34.2 → stabilize-0.34.4}/examples/http-example.py +0 -0
  261. {stabilize-0.34.2 → stabilize-0.34.4}/examples/incident_commander/README.md +0 -0
  262. {stabilize-0.34.2 → stabilize-0.34.4}/examples/incident_commander/incident_tasks.py +0 -0
  263. {stabilize-0.34.2 → stabilize-0.34.4}/examples/incident_commander/main.py +0 -0
  264. {stabilize-0.34.2 → stabilize-0.34.4}/examples/incident_commander/tools.py +0 -0
  265. {stabilize-0.34.2 → stabilize-0.34.4}/examples/lats-coding-agent.py +0 -0
  266. {stabilize-0.34.2 → stabilize-0.34.4}/examples/llama-example.py +0 -0
  267. {stabilize-0.34.2 → stabilize-0.34.4}/examples/llama_example_pipelines.py +0 -0
  268. {stabilize-0.34.2 → stabilize-0.34.4}/examples/llama_example_support.py +0 -0
  269. {stabilize-0.34.2 → stabilize-0.34.4}/examples/python-example.py +0 -0
  270. {stabilize-0.34.2 → stabilize-0.34.4}/examples/python_example_pipelines.py +0 -0
  271. {stabilize-0.34.2 → stabilize-0.34.4}/examples/python_servers.py +0 -0
  272. {stabilize-0.34.2 → stabilize-0.34.4}/examples/research_analyst/README.md +0 -0
  273. {stabilize-0.34.2 → stabilize-0.34.4}/examples/research_analyst/analyst_tasks.py +0 -0
  274. {stabilize-0.34.2 → stabilize-0.34.4}/examples/research_analyst/main.py +0 -0
  275. {stabilize-0.34.2 → stabilize-0.34.4}/examples/research_analyst/tools.py +0 -0
  276. {stabilize-0.34.2 → stabilize-0.34.4}/examples/shell-example.py +0 -0
  277. {stabilize-0.34.2 → stabilize-0.34.4}/examples/ssh-example.py +0 -0
  278. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01KDQ4N9QPJ6Q4MCV3V9GHWPV4_initial_schema.sql +0 -0
  279. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01KE39HEAN221S7AWNS4A0H750_add_performance_indexes.sql +0 -0
  280. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01KE4YJT2W8A6NBX5R7CQMJK84_add_dlq_table.sql +0 -0
  281. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01KE5ZQT3X9B7PCS8R8DRMLN85_add_processed_messages.sql +0 -0
  282. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01KE60R04X0C8QDTS9SEESMN96_add_task_version.sql +0 -0
  283. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01KFA6JDAS811CB5RKPD1FBAST_add_stage_version.sql +0 -0
  284. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01KGFG6RM7NRCJ2PPJ7FZAM0Y9_widen_message_id_column.sql +0 -0
  285. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01KGHWCP1M2QSDE3TN4GUBLV8A_add_workflow_control_flow_patterns.sql +0 -0
  286. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01KWHFBW2B5VZJENEA3D8Z2YPW_add_stage_claims.sql +0 -0
  287. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01KYTB6S57X765P3BJYY58H79Z_add_queue_task_id_index.sql +0 -0
  288. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M483DVR3DS980FHS8N754CWH_queue_bigint_ids_and_timestamptz.sql +0 -0
  289. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M4PAJCF82KCKYT5X4GMZH2XG_workflow_queue_table_and_stage_index.sql +0 -0
  290. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M4Q8VTM40WEC4HR2X31Q07A5_workflow_config_version.sql +0 -0
  291. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M4SVVY5XE3S18Y0CPQ8TATDP_purge_and_lookup_indexes.sql +0 -0
  292. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M64SFQG36NHV5KQ3SHH5Z832_event_store_tables.sql +0 -0
  293. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M64SFQGDVM97KQS2FFAJ72R5_task_leases.sql +0 -0
  294. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M67VCHWECA748FVXG88MF3YF_tenant_key.sql +0 -0
  295. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M684KJKQKEY9RG0RPEZ43GW1_tenant_indexes.sql +0 -0
  296. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M68BCSDHR6ECPVVESPS8WJC4_task_generation.sql +0 -0
  297. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M68FGEZVQR6KPAMW6P5N8B0E_recovery_activity.sql +0 -0
  298. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M68J0WB7ASSYV0JQYBA2KAQM_signal_delivery.sql +0 -0
  299. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M68P99JK1H6MC1W6RZ0SNHH0_definition_version.sql +0 -0
  300. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M68PK3W1DW3T8GZ3YKE3SVSJ_redelivery_budget.sql +0 -0
  301. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M68QC4M0YQASJV3NP98564RB_processed_at_timestamptz.sql +0 -0
  302. {stabilize-0.34.2 → stabilize-0.34.4}/migrations/01M68V88TB2FZ4AG6AH1QW3YY4_subscription_cursor.sql +0 -0
  303. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/driver.py +0 -0
  304. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/legacy_history.py +0 -0
  305. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/main.py +0 -0
  306. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/maintenance_commands.py +0 -0
  307. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/migrate_zone.py +0 -0
  308. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/migrations.py +0 -0
  309. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/prompt_text.py +0 -0
  310. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/prompt_text.txt +0 -0
  311. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/cli/schema_model.py +0 -0
  312. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/dag/readiness_types.py +0 -0
  313. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/definition_hash.py +0 -0
  314. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/base.py +0 -0
  315. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/delivery.py +0 -0
  316. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/permanent.py +0 -0
  317. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/sqlstates.py +0 -0
  318. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/store_errors.py +0 -0
  319. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/task.py +0 -0
  320. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/transient.py +0 -0
  321. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/utils.py +0 -0
  322. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/verification.py +0 -0
  323. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/errors/workflow.py +0 -0
  324. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/recorder/digests.py +0 -0
  325. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/retention.py +0 -0
  326. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/events/store/subscription_names.py +0 -0
  327. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/admission.py +0 -0
  328. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/cancel_hooks.py +0 -0
  329. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/deferred.py +0 -0
  330. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/fan_out.py +0 -0
  331. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/complete_stage/planner.py +0 -0
  332. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/defaults.py +0 -0
  333. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/deferred_choice.py +0 -0
  334. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/event_recording.py +0 -0
  335. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/jump_to_stage/reset.py +0 -0
  336. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/jump_to_stage/target.py +0 -0
  337. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/run_task/generation.py +0 -0
  338. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/run_task/guards.py +0 -0
  339. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/run_task/lease.py +0 -0
  340. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/run_task/verification.py +0 -0
  341. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/signal_cleanup.py +0 -0
  342. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/handlers/signal_refusal.py +0 -0
  343. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/maintenance.py +0 -0
  344. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/migrations/__init__.py +0 -0
  345. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/stage/completion_records.py +0 -0
  346. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/models/stage/definition.py +0 -0
  347. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/columns.py +0 -0
  348. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/control_states.py +0 -0
  349. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/floors.py +0 -0
  350. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/function_sources.py +0 -0
  351. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/pool_options.py +0 -0
  352. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/signal_scope.py +0 -0
  353. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/sqlite_config.py +0 -0
  354. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/store/ids.py +0 -0
  355. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/store/noop_transaction.py +0 -0
  356. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/store/owned_rows.py +0 -0
  357. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/persistence/task_state.py +0 -0
  358. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/py.typed +0 -0
  359. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/decode.py +0 -0
  360. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/message_contract.py +0 -0
  361. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/message_ids.py +0 -0
  362. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/ownership.py +0 -0
  363. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/queue/processor/lease_guard.py +0 -0
  364. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/recovery_age.py +0 -0
  365. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/recovery_plan.py +0 -0
  366. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/redaction.py +0 -0
  367. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/resilience/cancellation.py +0 -0
  368. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/builtins.py +0 -0
  369. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/highway/config.py +0 -0
  370. {stabilize-0.34.2 → stabilize-0.34.4}/src/stabilize/tasks/http/ssl_context.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: stabilize
3
- Version: 0.34.2
3
+ Version: 0.34.4
4
4
  Summary: Stabilize Workflow Orchestration - Agentic Parallel Workflows
5
5
  Project-URL: Homepage, https://github.com/rodmena-limited/stabilize
6
6
  Project-URL: Repository, https://github.com/rodmena-limited/stabilize
@@ -54,6 +54,8 @@ Requires-Dist: pyyaml>=6.0; extra == 'dev'
54
54
  Requires-Dist: ruff>=0.1; extra == 'dev'
55
55
  Requires-Dist: structlog>=24.0; extra == 'dev'
56
56
  Requires-Dist: testcontainers>=4.0; extra == 'dev'
57
+ Requires-Dist: types-psutil>=7.0; extra == 'dev'
58
+ Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
57
59
  Provides-Extra: observability
58
60
  Requires-Dist: opentelemetry-api>=1.20; extra == 'observability'
59
61
  Requires-Dist: opentelemetry-sdk>=1.20; extra == 'observability'
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stabilize"
3
- version = "0.34.2"
3
+ version = "0.34.4"
4
4
  description = "Stabilize Workflow Orchestration - Agentic Parallel Workflows"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -104,6 +104,8 @@ dev = [
104
104
  "testcontainers>=4.0",
105
105
  "ruff>=0.1",
106
106
  "mypy>=1.8",
107
+ "types-psutil>=7.0",
108
+ "types-PyYAML>=6.0",
107
109
  "structlog>=24.0",
108
110
  "opentelemetry-api>=1.20",
109
111
  "opentelemetry-sdk>=1.20",
@@ -141,20 +143,72 @@ line-length = 120
141
143
  target-version = "py311"
142
144
 
143
145
  [tool.ruff.lint]
144
- select = ["E", "F", "I", "N", "W", "UP"]
146
+ select = ["ALL"]
145
147
  ignore = [
146
- "N804", # First argument of a class method should be named `cls` - we use `mcs` for metaclasses
148
+ "COM812",
149
+ "ISC001",
150
+ "CPY001",
151
+ "D100",
152
+ "D101",
153
+ "D102",
154
+ "D103",
155
+ "D104",
156
+ "D105",
157
+ "D106",
158
+ "D107",
159
+ "ANN401",
160
+ "PLC0415",
161
+ "TRY003",
162
+ "EM101",
163
+ "EM102",
164
+ "FBT001",
165
+ "FBT002",
166
+ "FBT003",
167
+ "ARG001",
168
+ "ARG002",
169
+ "ARG005",
170
+ "C901",
171
+ "PLR0911",
172
+ "PLR0912",
173
+ "PLR0913",
174
+ "PLR0915",
175
+ "PLR0917",
176
+ "PLR2004",
177
+ "BLE001",
178
+ "SLF001",
179
+ "PLW0603",
180
+ "S603",
181
+ "S608",
182
+ "B027",
183
+ "TRY400",
184
+ "TRY301",
185
+ "TRY004",
147
186
  ]
148
187
 
188
+ [tool.ruff.lint.isort]
189
+ required-imports = ["from __future__ import annotations"]
190
+
191
+ [tool.ruff.lint.pydocstyle]
192
+ convention = "google"
193
+
149
194
  [tool.ruff.lint.per-file-ignores]
150
- # Examples use logging.basicConfig before imports intentionally to suppress noise
151
- # Also have hyphenated filenames which are not valid module names (not meant to be imported)
195
+ "src/stabilize/queue/messages.py" = ["TC001", "TC002", "TC003"]
196
+ "src/stabilize/queue/messages/*" = ["TC001", "TC002", "TC003"]
197
+ "src/stabilize/cli/*" = ["T201"]
198
+ "src/stabilize/models/stage/stage.py" = ["A002"]
199
+ "src/stabilize/tasks/http/request.py" = ["S310"]
200
+ "src/stabilize/tasks/highway/task.py" = ["S310"]
201
+ "src/stabilize/llm/client.py" = ["S310"]
202
+ "src/stabilize/tasks/docker.py" = ["S607"]
203
+ "src/stabilize/tasks/ssh.py" = ["S607"]
204
+ "!src/**" = ["A", "AIR", "ANN", "ARG", "ASYNC", "B", "BLE", "C4", "C90", "COM", "CPY", "D", "DJ", "DOC", "DTZ", "EM", "ERA", "EXE", "FA", "FAST", "FBT", "FIX", "FLY", "FURB", "G", "I002", "ICN", "INP", "INT", "ISC", "LOG", "NPY", "PD", "PERF", "PGH", "PIE", "PLC", "PLE", "PLR", "PLW", "PT", "PTH", "PYI", "Q", "RET", "RSE", "RUF", "S", "SIM", "SLF", "SLOT", "T10", "T20", "TC", "TD", "TID", "TRY", "YTT"]
152
205
  "examples/*" = ["E402", "N999", "E501"]
153
206
 
154
207
  [tool.mypy]
155
208
  python_version = "3.11"
156
209
  strict = true
157
- ignore_missing_imports = true
210
+ warn_unreachable = true
211
+ enable_error_code = ["ignore-without-code", "truthy-bool", "possibly-undefined"]
158
212
 
159
213
  [tool.pytest.ini_options]
160
214
  testpaths = ["tests"]
@@ -1,5 +1,4 @@
1
- """
2
- Stabilize - Highway Workflow Engine execution layer.
1
+ """Stabilize - Highway Workflow Engine execution layer.
3
2
 
4
3
  This package provides a message-driven DAG execution engine for running
5
4
  workflows with full support for:
@@ -13,7 +12,9 @@ workflows with full support for:
13
12
  - Configuration validation with JSON Schema
14
13
  """
15
14
 
16
- __version__ = "0.34.2"
15
+ from __future__ import annotations
16
+
17
+ __version__ = "0.34.4"
17
18
 
18
19
  # Assertion helpers
19
20
  from stabilize.assertions import (
@@ -198,148 +199,148 @@ from stabilize.verification import (
198
199
  )
199
200
 
200
201
  __all__ = [
201
- "current_tenant",
202
- # Core models
203
- "WorkflowStatus",
204
- "Workflow",
205
- "StageExecution",
206
- "TaskExecution",
202
+ "AddMultiInstanceHandler",
203
+ "ApprovalTask",
204
+ "CallableVerifier",
205
+ "CancelRegionHandler",
206
+ "CancelStageHandler",
207
+ # Cooperative cancellation
208
+ "CancellationToken",
209
+ "CompleteStageHandler",
210
+ "CompleteTaskHandler",
211
+ "CompleteWorkflowHandler",
212
+ # Conditions
213
+ "Condition",
214
+ "ConditionReason",
215
+ "ConditionSet",
216
+ "ConditionType",
217
+ "ConfigError",
218
+ "ContextError",
219
+ "ContinueParentStageHandler",
220
+ "DockerTask",
221
+ "HTTPTask",
222
+ "HighwayTask",
207
223
  "JoinType",
208
- "SplitType",
224
+ "JumpToStageHandler",
225
+ # Lifecycle management
226
+ "LifecycleManager",
209
227
  "MultiInstanceConfig",
210
228
  # Infrastructure
211
229
  "Orchestrator",
212
- "QueueProcessor",
213
- "Queue",
230
+ "OutputError",
231
+ "OutputVerifier",
232
+ "PermanentError",
214
233
  "PostgresQueue",
215
- "SqliteQueue",
216
- "WorkflowStore",
217
234
  "PostgresWorkflowStore",
235
+ "PreconditionError",
236
+ "PythonTask",
237
+ "Queue",
238
+ "QueueProcessor",
239
+ "RecoveryError",
240
+ "RecoveryResult",
241
+ "RetryableTask",
242
+ "RunTaskHandler",
243
+ "SSHTask",
244
+ "SchemaValidator",
245
+ "ShellTask",
246
+ "SignalStageHandler",
247
+ "SkipStageHandler",
248
+ "SplitType",
249
+ "SqliteQueue",
218
250
  "SqliteWorkflowStore",
251
+ # Assertions
252
+ "StabilizeError",
253
+ "StabilizeExpectedError",
254
+ "StabilizeFatalError",
219
255
  # Handlers
220
256
  "StabilizeHandler",
221
- "StartWorkflowHandler",
257
+ # Context helpers
258
+ "StageContext",
259
+ "StageExecution",
260
+ "StageNotReadyError",
222
261
  "StartStageHandler",
223
- "SkipStageHandler",
224
- "CancelStageHandler",
225
- "ContinueParentStageHandler",
226
- "JumpToStageHandler",
227
- "SignalStageHandler",
228
- "CancelRegionHandler",
229
- "AddMultiInstanceHandler",
230
262
  "StartTaskHandler",
231
263
  "StartWaitingWorkflowsHandler",
232
- "RunTaskHandler",
233
- "CompleteTaskHandler",
234
- "CompleteStageHandler",
235
- "CompleteWorkflowHandler",
264
+ "StartWorkflowHandler",
265
+ "StreamItem",
266
+ "SubWorkflowTask",
236
267
  # Tasks
237
268
  "Task",
238
- "RetryableTask",
239
- "TaskResult",
240
- # Cooperative cancellation
241
- "CancellationToken",
242
269
  "TaskCancelledError",
243
- "is_cancellation_requested",
244
- "raise_if_cancellation_requested",
270
+ "TaskError",
271
+ "TaskExecution",
245
272
  "TaskRegistry",
246
- "ShellTask",
247
- "HTTPTask",
248
- "DockerTask",
249
- "SSHTask",
250
- "HighwayTask",
251
- "PythonTask",
252
- "SubWorkflowTask",
253
- # Verifier registry
254
- "register_verifier",
255
- "get_verifier",
256
- "verifier",
273
+ "TaskResult",
274
+ # Error hierarchy
275
+ "TransientError",
276
+ "TransientVerificationError",
277
+ # Configuration validation
278
+ "ValidationError",
279
+ "VerificationError",
257
280
  # Verification
258
281
  "Verifier",
259
282
  "VerifyResult",
260
283
  "VerifyStatus",
261
- "OutputVerifier",
262
- "CallableVerifier",
263
- # Conditions
264
- "Condition",
265
- "ConditionSet",
266
- "ConditionType",
267
- "ConditionReason",
268
- # Context helpers
269
- "StageContext",
270
- # Assertions
271
- "StabilizeError",
272
- "StabilizeFatalError",
273
- "StabilizeExpectedError",
274
- "PreconditionError",
275
- "ContextError",
276
- "OutputError",
277
- "ConfigError",
278
- "VerificationError",
279
- "StageNotReadyError",
280
- "assert_true",
284
+ "Workflow",
285
+ # Recovery
286
+ "WorkflowRecovery",
287
+ # Core models
288
+ "WorkflowStatus",
289
+ "WorkflowStore",
290
+ # Agentic ergonomics (streaming / HITL / reducers)
291
+ "WorkflowStream",
292
+ "add_event",
293
+ "apply_output_reducers",
294
+ "approve",
295
+ "assert_config",
281
296
  "assert_context",
282
- "assert_context_type",
283
297
  "assert_context_in",
298
+ "assert_context_type",
299
+ "assert_no_upstream_failures",
300
+ "assert_non_empty",
301
+ "assert_not_none",
284
302
  "assert_output",
285
303
  "assert_output_type",
286
304
  "assert_stage_ready",
287
- "assert_no_upstream_failures",
288
- "assert_config",
305
+ "assert_true",
289
306
  "assert_verified",
290
- "assert_not_none",
291
- "assert_non_empty",
292
- # Configuration validation
293
- "ValidationError",
294
- "SchemaValidator",
295
- "validate_context",
296
- "validate_outputs",
297
- "is_valid",
298
- # Observability
299
- "configure_logging",
300
- "get_logger",
301
307
  "bind_context",
302
- "unbind_context",
303
308
  "clear_context",
304
- "workflow_logger",
305
- "stage_logger",
306
- "task_logger",
309
+ # Observability
310
+ "configure_logging",
307
311
  "configure_tracing",
312
+ "current_tenant",
313
+ "emit_progress",
314
+ "get_lifecycle_manager",
315
+ "get_logger",
316
+ "get_reducer",
317
+ "get_signal",
308
318
  "get_tracer",
309
- "trace_operation",
310
- "trace_workflow",
311
- "trace_stage",
312
- "trace_task",
313
- "trace_message_processing",
314
- "add_event",
315
- "set_attribute",
316
- # Error hierarchy
317
- "TransientError",
318
- "TransientVerificationError",
319
- "PermanentError",
320
- "TaskError",
321
- "RecoveryError",
322
- "is_transient",
319
+ "get_verifier",
320
+ "install_shutdown_handlers",
321
+ "is_cancellation_requested",
323
322
  "is_permanent",
324
- # Recovery
325
- "WorkflowRecovery",
326
- "RecoveryResult",
323
+ "is_transient",
324
+ "is_valid",
325
+ "raise_if_cancellation_requested",
327
326
  "recover_on_startup",
328
- # Lifecycle management
329
- "LifecycleManager",
330
- "get_lifecycle_manager",
331
- "set_lifecycle_manager",
332
- "install_shutdown_handlers",
333
- # Agentic ergonomics (streaming / HITL / reducers)
334
- "WorkflowStream",
335
- "StreamItem",
336
- "emit_progress",
337
- "ApprovalTask",
338
- "approve",
327
+ "register_reducer",
328
+ # Verifier registry
329
+ "register_verifier",
339
330
  "reject",
340
331
  "send_signal",
341
- "get_signal",
342
- "register_reducer",
343
- "get_reducer",
344
- "apply_output_reducers",
332
+ "set_attribute",
333
+ "set_lifecycle_manager",
334
+ "stage_logger",
335
+ "task_logger",
336
+ "trace_message_processing",
337
+ "trace_operation",
338
+ "trace_stage",
339
+ "trace_task",
340
+ "trace_workflow",
341
+ "unbind_context",
342
+ "validate_context",
343
+ "validate_outputs",
344
+ "verifier",
345
+ "workflow_logger",
345
346
  ]
@@ -1,5 +1,4 @@
1
- """
2
- Assertion helpers for validating preconditions and results.
1
+ """Assertion helpers for validating preconditions and results.
3
2
 
4
3
  This module provides assertion utilities that raise descriptive exceptions
5
4
  when conditions are not met. These are useful for:
@@ -45,27 +44,27 @@ T = TypeVar("T")
45
44
 
46
45
  # Re-export exceptions for backward compatibility
47
46
  __all__ = [
48
- "StabilizeError",
49
- "StabilizeFatalError",
50
- "StabilizeExpectedError",
51
- "PreconditionError",
47
+ "ConfigError",
52
48
  "ContextError",
53
49
  "OutputError",
54
- "ConfigError",
55
- "VerificationError",
50
+ "PreconditionError",
51
+ "StabilizeError",
52
+ "StabilizeExpectedError",
53
+ "StabilizeFatalError",
56
54
  "StageNotReadyError",
57
- "assert_true",
55
+ "VerificationError",
56
+ "assert_config",
58
57
  "assert_context",
59
- "assert_context_type",
60
58
  "assert_context_in",
59
+ "assert_context_type",
60
+ "assert_no_upstream_failures",
61
+ "assert_non_empty",
62
+ "assert_not_none",
61
63
  "assert_output",
62
64
  "assert_output_type",
63
65
  "assert_stage_ready",
64
- "assert_no_upstream_failures",
65
- "assert_config",
66
+ "assert_true",
66
67
  "assert_verified",
67
- "assert_not_none",
68
- "assert_non_empty",
69
68
  ]
70
69
 
71
70
 
@@ -75,8 +74,7 @@ __all__ = [
75
74
 
76
75
 
77
76
  def assert_true(condition: bool, message: str) -> None:
78
- """
79
- Assert that a condition is true.
77
+ """Assert that a condition is true.
80
78
 
81
79
  Args:
82
80
  condition: The condition to check
@@ -97,8 +95,7 @@ def assert_context(
97
95
  key: str,
98
96
  message: str | None = None,
99
97
  ) -> Any:
100
- """
101
- Assert that a context key exists and return its value.
98
+ """Assert that a context key exists and return its value.
102
99
 
103
100
  Args:
104
101
  stage: The stage execution
@@ -128,8 +125,7 @@ def assert_context_type(
128
125
  expected_type: type[T],
129
126
  message: str | None = None,
130
127
  ) -> T:
131
- """
132
- Assert that a context key exists and has the expected type.
128
+ """Assert that a context key exists and has the expected type.
133
129
 
134
130
  Args:
135
131
  stage: The stage execution
@@ -161,8 +157,7 @@ def assert_context_in(
161
157
  allowed_values: list[Any],
162
158
  message: str | None = None,
163
159
  ) -> Any:
164
- """
165
- Assert that a context value is in a list of allowed values.
160
+ """Assert that a context value is in a list of allowed values.
166
161
 
167
162
  Args:
168
163
  stage: The stage execution
@@ -193,8 +188,7 @@ def assert_output(
193
188
  key: str,
194
189
  message: str | None = None,
195
190
  ) -> Any:
196
- """
197
- Assert that an output key exists and return its value.
191
+ """Assert that an output key exists and return its value.
198
192
 
199
193
  Args:
200
194
  stage: The stage execution
@@ -224,8 +218,7 @@ def assert_output_type(
224
218
  expected_type: type[T],
225
219
  message: str | None = None,
226
220
  ) -> T:
227
- """
228
- Assert that an output key exists and has the expected type.
221
+ """Assert that an output key exists and has the expected type.
229
222
 
230
223
  Args:
231
224
  stage: The stage execution
@@ -255,8 +248,7 @@ def assert_stage_ready(
255
248
  stage: StageExecution,
256
249
  message: str | None = None,
257
250
  ) -> None:
258
- """
259
- Assert that all upstream stages have completed successfully.
251
+ """Assert that all upstream stages have completed successfully.
260
252
 
261
253
  Args:
262
254
  stage: The stage execution to check
@@ -279,8 +271,7 @@ def assert_no_upstream_failures(
279
271
  stage: StageExecution,
280
272
  message: str | None = None,
281
273
  ) -> None:
282
- """
283
- Assert that no upstream stages have failed.
274
+ """Assert that no upstream stages have failed.
284
275
 
285
276
  Args:
286
277
  stage: The stage execution to check
@@ -304,8 +295,7 @@ def assert_config(
304
295
  message: str,
305
296
  field: str | None = None,
306
297
  ) -> None:
307
- """
308
- Assert a configuration condition.
298
+ """Assert a configuration condition.
309
299
 
310
300
  Args:
311
301
  condition: The condition to check
@@ -327,8 +317,7 @@ def assert_verified(
327
317
  message: str,
328
318
  details: dict[str, Any] | None = None,
329
319
  ) -> None:
330
- """
331
- Assert a verification condition.
320
+ """Assert a verification condition.
332
321
 
333
322
  Args:
334
323
  condition: The condition to check
@@ -349,8 +338,7 @@ def assert_not_none(
349
338
  value: T | None,
350
339
  message: str,
351
340
  ) -> T:
352
- """
353
- Assert that a value is not None and return it.
341
+ """Assert that a value is not None and return it.
354
342
 
355
343
  Args:
356
344
  value: The value to check
@@ -374,8 +362,7 @@ def assert_non_empty(
374
362
  value: str | list[Any] | dict[str, Any],
375
363
  message: str,
376
364
  ) -> str | list[Any] | dict[str, Any]:
377
- """
378
- Assert that a value is not empty.
365
+ """Assert that a value is not empty.
379
366
 
380
367
  Works with strings, lists, and dicts.
381
368
 
@@ -1,5 +1,4 @@
1
- """
2
- Audit logging for Stabilize.
1
+ """Audit logging for Stabilize.
3
2
 
4
3
  Provides an immutable, structured audit trail for compliance-critical operations.
5
4
  Audits are distinct from operational logs:
@@ -96,8 +95,7 @@ def audit(
96
95
  details: dict[str, Any] | None = None,
97
96
  ip_address: str | None = None,
98
97
  ) -> None:
99
- """
100
- Record an audit event.
98
+ """Record an audit event.
101
99
 
102
100
  Args:
103
101
  event_type: Category (e.g., "WORKFLOW_LIFECYCLE", "SECURITY")
@@ -1,6 +1,8 @@
1
1
  """Stabilize CLI for database migrations and developer tools."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  from stabilize.cli.main import main
4
6
  from stabilize.cli.prompt_text import PROMPT_TEXT
5
7
 
6
- __all__ = ["main", "PROMPT_TEXT"]
8
+ __all__ = ["PROMPT_TEXT", "main"]
@@ -151,4 +151,4 @@ def adoption_level(models: list[MigrationModel], catalog: Catalog) -> int:
151
151
  def legacy_rows_for(shipped_plain: dict[str, str], level: int) -> dict[str, str]:
152
152
  """The stabilize_migrations rows the old runner would have recorded for the first *level* migrations."""
153
153
  names = sorted(shipped_plain)[:level]
154
- return {name: hashlib.md5(shipped_plain[name].encode()).hexdigest() for name in names}
154
+ return {name: hashlib.md5(shipped_plain[name].encode(), usedforsecurity=False).hexdigest() for name in names}
@@ -3,7 +3,6 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import sys
6
- from pathlib import Path
7
6
  from typing import TYPE_CHECKING, Any
8
7
 
9
8
  from stabilize.cli.config import (
@@ -40,6 +39,8 @@ __all__ = [
40
39
  ]
41
40
 
42
41
  if TYPE_CHECKING:
42
+ from pathlib import Path
43
+
43
44
  from stabilize.persistence.store import WorkflowStore
44
45
  from stabilize.queue import Queue
45
46
 
@@ -214,16 +215,15 @@ def mg_check_grants(role: str, db_url: str | None = None, config_path: Path | No
214
215
  params = connection_params(config)
215
216
  announce_driver(psycopg)
216
217
  try:
217
- with psycopg.connect(**params) as conn:
218
- with conn.cursor() as cur:
219
- if not schema:
220
- cur.execute("SELECT current_schema()")
221
- row = cur.fetchone()
222
- schema = row[0] if row else None
223
- if not schema:
224
- print("Error: no current schema; pass ?schema= in the database URL")
225
- sys.exit(2)
226
- report = check_role_grants(cur, role, schema, tables)
218
+ with psycopg.connect(**params) as conn, conn.cursor() as cur:
219
+ if not schema:
220
+ cur.execute("SELECT current_schema()")
221
+ row = cur.fetchone()
222
+ schema = row[0] if row else None
223
+ if not schema:
224
+ print("Error: no current schema; pass ?schema= in the database URL")
225
+ sys.exit(2)
226
+ report = check_role_grants(cur, role, schema, tables)
227
227
  except psycopg.Error as e:
228
228
  print(f"Database error: {redact_text(str(e))}")
229
229
  sys.exit(2)
@@ -9,7 +9,7 @@ from pathlib import Path
9
9
  from typing import TYPE_CHECKING
10
10
  from urllib.parse import parse_qs, quote, unquote, urlencode
11
11
 
12
- from stabilize.redaction import redact_db_url as redact_db_url
12
+ from stabilize.redaction import redact_db_url
13
13
 
14
14
  if TYPE_CHECKING:
15
15
  from typing import Any
@@ -88,7 +88,7 @@ def load_config(config_path: Path | None = None) -> dict[str, Any]:
88
88
  print("Set MG_DATABASE_URL instead")
89
89
  sys.exit(1)
90
90
  try:
91
- with open(config_path) as f:
91
+ with Path(config_path).open() as f:
92
92
  raw = yaml.safe_load(f)
93
93
  except OSError as exc:
94
94
  print(f"Error: cannot read {config_path}: {exc.strerror}")
@@ -129,10 +129,10 @@ def format_report(report: GrantReport) -> list[str]:
129
129
  lines = [f"{header}, {len(report.tables)} engine table(s) from the shipped migrations"]
130
130
  if not report.schema_usage:
131
131
  lines.append(f" MISSING USAGE on schema {report.schema}")
132
- for table in report.missing_tables:
133
- lines.append(
134
- f" MISSING table {report.schema}.{table} does not exist (migrations not applied, or wrong schema)"
135
- )
132
+ lines.extend(
133
+ f" MISSING table {report.schema}.{table} does not exist (migrations not applied, or wrong schema)"
134
+ for table in report.missing_tables
135
+ )
136
136
  for table, privileges in report.missing_privileges.items():
137
137
  lines.append(f" MISSING {', '.join(privileges)} on {report.schema}.{table}")
138
138
  for table, sequence in report.missing_sequences.items():
@@ -2,13 +2,15 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from collections.abc import Iterable, Mapping
6
5
  from dataclasses import dataclass, field
7
- from typing import Any
6
+ from typing import TYPE_CHECKING, Any
8
7
 
9
8
  from stabilize.cli.legacy_history import PLACEHOLDER_SQL, MigrettiState, TakeoverRefusedError
10
9
  from stabilize.cli.migrations import migretti_checksum
11
10
 
11
+ if TYPE_CHECKING:
12
+ from collections.abc import Iterable, Mapping
13
+
12
14
  DEFAULT_HISTORY_SCHEMA = "stabilize_history"
13
15
 
14
16