stabilize 0.34.2__tar.gz → 0.34.3__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.3}/PKG-INFO +1 -1
  2. {stabilize-0.34.2 → stabilize-0.34.3}/pyproject.toml +1 -1
  3. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/__init__.py +1 -1
  4. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/run_task/result.py +1 -0
  5. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/signal_stage.py +33 -0
  6. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/postgres/transaction.py +2 -90
  7. stabilize-0.34.3/src/stabilize/persistence/postgres/transaction_signals.py +117 -0
  8. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/transaction_ops.py +6 -0
  9. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/store/transaction.py +4 -0
  10. {stabilize-0.34.2 → stabilize-0.34.3}/.gitignore +0 -0
  11. {stabilize-0.34.2 → stabilize-0.34.3}/LICENSE +0 -0
  12. {stabilize-0.34.2 → stabilize-0.34.3}/README.md +0 -0
  13. {stabilize-0.34.2 → stabilize-0.34.3}/examples/__init__.py +0 -0
  14. {stabilize-0.34.2 → stabilize-0.34.3}/examples/agent_team/README.md +0 -0
  15. {stabilize-0.34.2 → stabilize-0.34.3}/examples/agent_team/main.py +0 -0
  16. {stabilize-0.34.2 → stabilize-0.34.3}/examples/agent_team/team_tasks.py +0 -0
  17. {stabilize-0.34.2 → stabilize-0.34.3}/examples/benchmark-overhead.py +0 -0
  18. {stabilize-0.34.2 → stabilize-0.34.3}/examples/docker-example.py +0 -0
  19. {stabilize-0.34.2 → stabilize-0.34.3}/examples/dynamic-routing-example.py +0 -0
  20. {stabilize-0.34.2 → stabilize-0.34.3}/examples/event-sourcing-example.py +0 -0
  21. {stabilize-0.34.2 → stabilize-0.34.3}/examples/golden-standard-expected-result.txt +0 -0
  22. {stabilize-0.34.2 → stabilize-0.34.3}/examples/golden-standard.py +0 -0
  23. {stabilize-0.34.2 → stabilize-0.34.3}/examples/highway-integration-example.py +0 -0
  24. {stabilize-0.34.2 → stabilize-0.34.3}/examples/http-example.py +0 -0
  25. {stabilize-0.34.2 → stabilize-0.34.3}/examples/incident_commander/README.md +0 -0
  26. {stabilize-0.34.2 → stabilize-0.34.3}/examples/incident_commander/incident_tasks.py +0 -0
  27. {stabilize-0.34.2 → stabilize-0.34.3}/examples/incident_commander/main.py +0 -0
  28. {stabilize-0.34.2 → stabilize-0.34.3}/examples/incident_commander/tools.py +0 -0
  29. {stabilize-0.34.2 → stabilize-0.34.3}/examples/lats-coding-agent.py +0 -0
  30. {stabilize-0.34.2 → stabilize-0.34.3}/examples/llama-example.py +0 -0
  31. {stabilize-0.34.2 → stabilize-0.34.3}/examples/llama_example_pipelines.py +0 -0
  32. {stabilize-0.34.2 → stabilize-0.34.3}/examples/llama_example_support.py +0 -0
  33. {stabilize-0.34.2 → stabilize-0.34.3}/examples/python-example.py +0 -0
  34. {stabilize-0.34.2 → stabilize-0.34.3}/examples/python_example_pipelines.py +0 -0
  35. {stabilize-0.34.2 → stabilize-0.34.3}/examples/python_servers.py +0 -0
  36. {stabilize-0.34.2 → stabilize-0.34.3}/examples/research_analyst/README.md +0 -0
  37. {stabilize-0.34.2 → stabilize-0.34.3}/examples/research_analyst/analyst_tasks.py +0 -0
  38. {stabilize-0.34.2 → stabilize-0.34.3}/examples/research_analyst/main.py +0 -0
  39. {stabilize-0.34.2 → stabilize-0.34.3}/examples/research_analyst/tools.py +0 -0
  40. {stabilize-0.34.2 → stabilize-0.34.3}/examples/shell-example.py +0 -0
  41. {stabilize-0.34.2 → stabilize-0.34.3}/examples/ssh-example.py +0 -0
  42. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01KDQ4N9QPJ6Q4MCV3V9GHWPV4_initial_schema.sql +0 -0
  43. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01KE39HEAN221S7AWNS4A0H750_add_performance_indexes.sql +0 -0
  44. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01KE4YJT2W8A6NBX5R7CQMJK84_add_dlq_table.sql +0 -0
  45. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01KE5ZQT3X9B7PCS8R8DRMLN85_add_processed_messages.sql +0 -0
  46. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01KE60R04X0C8QDTS9SEESMN96_add_task_version.sql +0 -0
  47. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01KFA6JDAS811CB5RKPD1FBAST_add_stage_version.sql +0 -0
  48. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01KGFG6RM7NRCJ2PPJ7FZAM0Y9_widen_message_id_column.sql +0 -0
  49. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01KGHWCP1M2QSDE3TN4GUBLV8A_add_workflow_control_flow_patterns.sql +0 -0
  50. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01KWHFBW2B5VZJENEA3D8Z2YPW_add_stage_claims.sql +0 -0
  51. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01KYTB6S57X765P3BJYY58H79Z_add_queue_task_id_index.sql +0 -0
  52. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M483DVR3DS980FHS8N754CWH_queue_bigint_ids_and_timestamptz.sql +0 -0
  53. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M4PAJCF82KCKYT5X4GMZH2XG_workflow_queue_table_and_stage_index.sql +0 -0
  54. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M4Q8VTM40WEC4HR2X31Q07A5_workflow_config_version.sql +0 -0
  55. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M4SVVY5XE3S18Y0CPQ8TATDP_purge_and_lookup_indexes.sql +0 -0
  56. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M64SFQG36NHV5KQ3SHH5Z832_event_store_tables.sql +0 -0
  57. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M64SFQGDVM97KQS2FFAJ72R5_task_leases.sql +0 -0
  58. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M67VCHWECA748FVXG88MF3YF_tenant_key.sql +0 -0
  59. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M684KJKQKEY9RG0RPEZ43GW1_tenant_indexes.sql +0 -0
  60. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M68BCSDHR6ECPVVESPS8WJC4_task_generation.sql +0 -0
  61. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M68FGEZVQR6KPAMW6P5N8B0E_recovery_activity.sql +0 -0
  62. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M68J0WB7ASSYV0JQYBA2KAQM_signal_delivery.sql +0 -0
  63. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M68P99JK1H6MC1W6RZ0SNHH0_definition_version.sql +0 -0
  64. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M68PK3W1DW3T8GZ3YKE3SVSJ_redelivery_budget.sql +0 -0
  65. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M68QC4M0YQASJV3NP98564RB_processed_at_timestamptz.sql +0 -0
  66. {stabilize-0.34.2 → stabilize-0.34.3}/migrations/01M68V88TB2FZ4AG6AH1QW3YY4_subscription_cursor.sql +0 -0
  67. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/assertions.py +0 -0
  68. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/audit.py +0 -0
  69. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/__init__.py +0 -0
  70. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/adoption.py +0 -0
  71. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/commands.py +0 -0
  72. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/config.py +0 -0
  73. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/driver.py +0 -0
  74. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/grants.py +0 -0
  75. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/history_location.py +0 -0
  76. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/legacy_history.py +0 -0
  77. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/main.py +0 -0
  78. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/maintenance_commands.py +0 -0
  79. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/migrate.py +0 -0
  80. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/migrate_zone.py +0 -0
  81. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/migrations.py +0 -0
  82. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/migretti_runner.py +0 -0
  83. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/prompt_text.py +0 -0
  84. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/prompt_text.txt +0 -0
  85. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/queue_table_cli.py +0 -0
  86. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/schema_model.py +0 -0
  87. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/cli/tenancy_cli.py +0 -0
  88. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/conditions.py +0 -0
  89. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/context/__init__.py +0 -0
  90. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/context/stage_context.py +0 -0
  91. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/dag/__init__.py +0 -0
  92. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/dag/deferred_choice.py +0 -0
  93. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/dag/graph.py +0 -0
  94. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/dag/merge.py +0 -0
  95. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/dag/readiness.py +0 -0
  96. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/dag/readiness_types.py +0 -0
  97. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/dag/topological.py +0 -0
  98. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/definition_hash.py +0 -0
  99. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/error_codes.py +0 -0
  100. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/__init__.py +0 -0
  101. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/base.py +0 -0
  102. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/chain.py +0 -0
  103. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/delivery.py +0 -0
  104. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/permanent.py +0 -0
  105. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/sqlstates.py +0 -0
  106. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/store_errors.py +0 -0
  107. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/task.py +0 -0
  108. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/transient.py +0 -0
  109. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/utils.py +0 -0
  110. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/verification.py +0 -0
  111. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/errors/workflow.py +0 -0
  112. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/__init__.py +0 -0
  113. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/base.py +0 -0
  114. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/bus.py +0 -0
  115. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/projections/__init__.py +0 -0
  116. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/projections/base.py +0 -0
  117. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/projections/metrics.py +0 -0
  118. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/projections/timeline.py +0 -0
  119. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/recorder/__init__.py +0 -0
  120. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/recorder/base.py +0 -0
  121. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/recorder/composed.py +0 -0
  122. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/recorder/context.py +0 -0
  123. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/recorder/digests.py +0 -0
  124. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/recorder/generic_events.py +0 -0
  125. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/recorder/instance.py +0 -0
  126. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/recorder/stage_events.py +0 -0
  127. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/recorder/task_events.py +0 -0
  128. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/recorder/workflow_events.py +0 -0
  129. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/replay.py +0 -0
  130. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/snapshots.py +0 -0
  131. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/__init__.py +0 -0
  132. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/interface.py +0 -0
  133. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/postgres/__init__.py +0 -0
  134. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/postgres/events.py +0 -0
  135. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/postgres/retention.py +0 -0
  136. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/postgres/schema.py +0 -0
  137. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/postgres/snapshots.py +0 -0
  138. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/postgres/store.py +0 -0
  139. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/postgres/subscriptions.py +0 -0
  140. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/retention.py +0 -0
  141. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/sqlite/__init__.py +0 -0
  142. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/sqlite/events.py +0 -0
  143. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/sqlite/retention.py +0 -0
  144. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/sqlite/schema.py +0 -0
  145. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/sqlite/snapshots.py +0 -0
  146. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/sqlite/store.py +0 -0
  147. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/sqlite/subscriptions.py +0 -0
  148. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/store/subscription_names.py +0 -0
  149. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/subscriptions.py +0 -0
  150. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/events/txn_scope.py +0 -0
  151. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/exceptions.py +0 -0
  152. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/expressions.py +0 -0
  153. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/finalizers.py +0 -0
  154. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/__init__.py +0 -0
  155. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/add_multi_instance.py +0 -0
  156. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/admission.py +0 -0
  157. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/base.py +0 -0
  158. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/cancel_hooks.py +0 -0
  159. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/cancel_region.py +0 -0
  160. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/cancel_stage.py +0 -0
  161. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/complete_stage/__init__.py +0 -0
  162. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/complete_stage/deferred.py +0 -0
  163. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/complete_stage/fan_out.py +0 -0
  164. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/complete_stage/handler.py +0 -0
  165. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/complete_stage/planner.py +0 -0
  166. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/complete_stage/split_logic.py +0 -0
  167. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/complete_stage/support.py +0 -0
  168. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/complete_task.py +0 -0
  169. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/complete_workflow.py +0 -0
  170. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/continue_parent_stage.py +0 -0
  171. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/defaults.py +0 -0
  172. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/deferred_choice.py +0 -0
  173. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/event_recording.py +0 -0
  174. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/jump_to_stage/__init__.py +0 -0
  175. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/jump_to_stage/handler.py +0 -0
  176. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/jump_to_stage/reset.py +0 -0
  177. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/jump_to_stage/target.py +0 -0
  178. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/jump_to_stage/traversal.py +0 -0
  179. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/run_task/__init__.py +0 -0
  180. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/run_task/error.py +0 -0
  181. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/run_task/execution.py +0 -0
  182. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/run_task/generation.py +0 -0
  183. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/run_task/guards.py +0 -0
  184. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/run_task/handler.py +0 -0
  185. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/run_task/held_results.py +0 -0
  186. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/run_task/lease.py +0 -0
  187. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/run_task/saving.py +0 -0
  188. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/run_task/verification.py +0 -0
  189. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/signal_cleanup.py +0 -0
  190. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/signal_refusal.py +0 -0
  191. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/skip_stage.py +0 -0
  192. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/start_stage/__init__.py +0 -0
  193. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/start_stage/conditions.py +0 -0
  194. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/start_stage/handler.py +0 -0
  195. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/start_stage/orchestration.py +0 -0
  196. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/start_stage/planner.py +0 -0
  197. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/start_stage/starting.py +0 -0
  198. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/start_task.py +0 -0
  199. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/start_waiting_workflows.py +0 -0
  200. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/start_workflow.py +0 -0
  201. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/handlers/workflow_control.py +0 -0
  202. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/hitl.py +0 -0
  203. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/launcher.py +0 -0
  204. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/lifecycle.py +0 -0
  205. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/llm/__init__.py +0 -0
  206. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/llm/client.py +0 -0
  207. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/llm/tasks.py +0 -0
  208. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/llm/tools.py +0 -0
  209. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/logging.py +0 -0
  210. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/maintenance.py +0 -0
  211. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/metrics.py +0 -0
  212. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/migrations/__init__.py +0 -0
  213. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/__init__.py +0 -0
  214. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/multi_instance.py +0 -0
  215. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/snapshot.py +0 -0
  216. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/stage/__init__.py +0 -0
  217. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/stage/completion_records.py +0 -0
  218. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/stage/definition.py +0 -0
  219. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/stage/engine_keys.py +0 -0
  220. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/stage/enums.py +0 -0
  221. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/stage/navigation.py +0 -0
  222. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/stage/stage.py +0 -0
  223. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/status.py +0 -0
  224. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/task.py +0 -0
  225. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/models/workflow.py +0 -0
  226. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/monitor/__init__.py +0 -0
  227. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/monitor/data.py +0 -0
  228. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/monitor/display/__init__.py +0 -0
  229. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/monitor/display/constants.py +0 -0
  230. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/monitor/display/fetcher.py +0 -0
  231. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/monitor/display/interaction.py +0 -0
  232. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/monitor/display/monitor.py +0 -0
  233. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/monitor/display/rendering.py +0 -0
  234. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/monitor/models.py +0 -0
  235. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/orchestrator.py +0 -0
  236. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/__init__.py +0 -0
  237. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/borrow.py +0 -0
  238. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/borrow_hook.py +0 -0
  239. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/columns.py +0 -0
  240. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/committed_marks.py +0 -0
  241. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/connection.py +0 -0
  242. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/control_states.py +0 -0
  243. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/factory.py +0 -0
  244. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/floors.py +0 -0
  245. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/function_sources.py +0 -0
  246. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/pool_options.py +0 -0
  247. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/postgres/__init__.py +0 -0
  248. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/postgres/converters.py +0 -0
  249. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/postgres/helpers.py +0 -0
  250. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/postgres/maintenance.py +0 -0
  251. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/postgres/operations.py +0 -0
  252. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/postgres/queries.py +0 -0
  253. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/postgres/signals.py +0 -0
  254. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/postgres/stage_query.py +0 -0
  255. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/postgres/store.py +0 -0
  256. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/postgres/workflow_ops.py +0 -0
  257. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/schema_check.py +0 -0
  258. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/signal_scope.py +0 -0
  259. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/__init__.py +0 -0
  260. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/converters.py +0 -0
  261. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/helpers.py +0 -0
  262. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/migrations.py +0 -0
  263. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/operations.py +0 -0
  264. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/queries.py +0 -0
  265. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/schema.py +0 -0
  266. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/signals.py +0 -0
  267. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/store/__init__.py +0 -0
  268. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/store/queries.py +0 -0
  269. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/store/stage_ops.py +0 -0
  270. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/store/stage_query.py +0 -0
  271. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/store/store.py +0 -0
  272. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/store/workflow_crud.py +0 -0
  273. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/tenant_schema.py +0 -0
  274. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite/transaction.py +0 -0
  275. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/sqlite_config.py +0 -0
  276. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/store/__init__.py +0 -0
  277. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/store/criteria.py +0 -0
  278. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/store/ids.py +0 -0
  279. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/store/interface.py +0 -0
  280. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/store/maintenance_defaults.py +0 -0
  281. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/store/noop_transaction.py +0 -0
  282. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/store/owned_rows.py +0 -0
  283. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/store/query_defaults.py +0 -0
  284. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/store/signal_defaults.py +0 -0
  285. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/store/stage_criteria.py +0 -0
  286. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/task_lease.py +0 -0
  287. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/task_state.py +0 -0
  288. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/tenancy.py +0 -0
  289. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/persistence/transaction.py +0 -0
  290. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/py.typed +0 -0
  291. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/__init__.py +0 -0
  292. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/decode.py +0 -0
  293. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/dedup.py +0 -0
  294. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/dlq.py +0 -0
  295. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/interface.py +0 -0
  296. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/message_base.py +0 -0
  297. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/message_contract.py +0 -0
  298. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/message_ids.py +0 -0
  299. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/messages.py +0 -0
  300. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/ownership.py +0 -0
  301. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/postgres.py +0 -0
  302. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/postgres_lookups.py +0 -0
  303. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/processor/__init__.py +0 -0
  304. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/processor/config.py +0 -0
  305. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/processor/drain.py +0 -0
  306. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/processor/handler_base.py +0 -0
  307. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/processor/lease_guard.py +0 -0
  308. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/processor/mixins.py +0 -0
  309. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/processor/processor.py +0 -0
  310. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/processor/redelivery.py +0 -0
  311. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/processor/retention.py +0 -0
  312. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/processor/submission.py +0 -0
  313. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/processor/synchronous.py +0 -0
  314. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/sqlite/__init__.py +0 -0
  315. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/sqlite/dlq.py +0 -0
  316. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/sqlite/lookups.py +0 -0
  317. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/sqlite/queue.py +0 -0
  318. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/sqlite/schema.py +0 -0
  319. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/queue/sqlite/serialization.py +0 -0
  320. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/recovery.py +0 -0
  321. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/recovery_age.py +0 -0
  322. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/recovery_plan.py +0 -0
  323. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/recovery_rules.py +0 -0
  324. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/redaction.py +0 -0
  325. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/reducers.py +0 -0
  326. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/resilience/__init__.py +0 -0
  327. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/resilience/bulkheads.py +0 -0
  328. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/resilience/cancellation.py +0 -0
  329. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/resilience/circuits.py +0 -0
  330. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/resilience/config.py +0 -0
  331. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/resilience/executor.py +0 -0
  332. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/resilience/process_executor.py +0 -0
  333. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/resilience/timeouts.py +0 -0
  334. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/stages/__init__.py +0 -0
  335. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/stages/builder.py +0 -0
  336. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/stages/loop_builder.py +0 -0
  337. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/stages/multi_instance_builder.py +0 -0
  338. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/streaming.py +0 -0
  339. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/__init__.py +0 -0
  340. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/builtins.py +0 -0
  341. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/docker.py +0 -0
  342. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/docker_commands.py +0 -0
  343. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/handles.py +0 -0
  344. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/highway/__init__.py +0 -0
  345. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/highway/config.py +0 -0
  346. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/highway/task.py +0 -0
  347. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/http/__init__.py +0 -0
  348. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/http/constants.py +0 -0
  349. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/http/guarded_opener.py +0 -0
  350. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/http/request.py +0 -0
  351. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/http/response.py +0 -0
  352. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/http/ssl_context.py +0 -0
  353. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/http/task.py +0 -0
  354. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/http/utils.py +0 -0
  355. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/interface.py +0 -0
  356. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/loop.py +0 -0
  357. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/python.py +0 -0
  358. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/registry.py +0 -0
  359. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/result.py +0 -0
  360. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/shell.py +0 -0
  361. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/ssh.py +0 -0
  362. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tasks/sub_workflow.py +0 -0
  363. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/threads.py +0 -0
  364. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/tracing.py +0 -0
  365. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/validation/__init__.py +0 -0
  366. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/validation/errors.py +0 -0
  367. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/validation/helpers.py +0 -0
  368. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/validation/schemas.py +0 -0
  369. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/validation/validator.py +0 -0
  370. {stabilize-0.34.2 → stabilize-0.34.3}/src/stabilize/verification.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.3
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stabilize"
3
- version = "0.34.2"
3
+ version = "0.34.3"
4
4
  description = "Stabilize Workflow Orchestration - Agentic Parallel Workflows"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -13,7 +13,7 @@ workflows with full support for:
13
13
  - Configuration validation with JSON Schema
14
14
  """
15
15
 
16
- __version__ = "0.34.2"
16
+ __version__ = "0.34.3"
17
17
 
18
18
  # Assertion helpers
19
19
  from stabilize.assertions import (
@@ -213,6 +213,7 @@ def _handle_suspended(
213
213
 
214
214
  def resume_or_wait(txn: StoreTransaction) -> list[tuple[Message, float | None]]:
215
215
  nonlocal resumed
216
+ txn.lock_stage(stage.id)
216
217
  for key in signal_keys:
217
218
  stage.context.pop(key, None)
218
219
  stage.context.update(before)
@@ -161,6 +161,39 @@ class SignalStageHandler(StabilizeHandler[SignalStage]):
161
161
  )
162
162
 
163
163
  with self.repository.transaction(self.queue) as txn:
164
+ if txn.lock_stage(stage.id) == WorkflowStatus.SUSPENDED.name:
165
+ logger.info(
166
+ "Stage %s suspended while signal '%s' was being buffered; delivering it",
167
+ stage.name,
168
+ message.signal_name,
169
+ )
170
+ row_id = message.signal_row_id
171
+ if row_id is None and store_backed:
172
+ row_id = (
173
+ txn.buffer_signal(
174
+ stage.execution.id,
175
+ stage.ref_id,
176
+ message.signal_name,
177
+ message.signal_data,
178
+ user=message.user,
179
+ persistent=True,
180
+ )
181
+ or None
182
+ )
183
+ txn.push_message(
184
+ SignalStage(
185
+ execution_type=message.execution_type,
186
+ execution_id=message.execution_id,
187
+ stage_id=message.stage_id,
188
+ signal_name=message.signal_name,
189
+ signal_data=message.signal_data,
190
+ persistent=True,
191
+ user=message.user,
192
+ signal_row_id=row_id,
193
+ )
194
+ )
195
+ self.mark_in(txn, message, "SignalStage")
196
+ return
164
197
  if message.signal_row_id is None:
165
198
  stored = 0
166
199
  if store_backed:
@@ -2,11 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- import json
6
5
  import logging
7
6
  from typing import TYPE_CHECKING, Any
8
7
 
9
8
  from stabilize.errors.delivery import DuplicateDeliveryError
9
+ from stabilize.persistence.postgres.transaction_signals import PostgresSignalTransactionMixin
10
10
  from stabilize.persistence.store import StoreTransaction
11
11
  from stabilize.persistence.task_state import Captured, capture, commit_captured, versions
12
12
  from stabilize.persistence.tenancy import refuse_foreign_row
@@ -24,7 +24,7 @@ logger = logging.getLogger(__name__)
24
24
  ADMISSION_LOCK_CLASS = 0x5354424C
25
25
 
26
26
 
27
- class PostgresTransaction(StoreTransaction):
27
+ class PostgresTransaction(PostgresSignalTransactionMixin, StoreTransaction):
28
28
  """Atomic transaction spanning store and queue operations for PostgreSQL.
29
29
 
30
30
  This transaction ensures true database-level atomicity for all operations.
@@ -318,94 +318,6 @@ class PostgresTransaction(StoreTransaction):
318
318
  "DELETE FROM stage_executions WHERE id = %(stage_id)s AND stabilize_tenant = %(tenant)s", params
319
319
  )
320
320
 
321
- def _discard_if_complete(self, stage: StageExecution) -> None:
322
- if not stage.status.is_complete or not self._store.supports_signal_storage():
323
- return
324
- with self._conn.cursor() as cur:
325
- cur.execute(
326
- "DELETE FROM workflow_signals WHERE consumed = FALSE AND stabilize_tenant = %(tenant)s "
327
- "AND stage_ref_id = %(ref)s AND execution_id = (SELECT execution_id FROM stage_executions "
328
- "WHERE id = %(stage_id)s AND stabilize_tenant = %(tenant)s)",
329
- {"tenant": self._tenant, "ref": stage.ref_id, "stage_id": stage.id},
330
- )
331
- dropped = int(cur.rowcount or 0)
332
- if dropped:
333
- logger.warning(
334
- "Discarded %d pending signal(s) on stage %s entering %s", dropped, stage.id, stage.status.name
335
- )
336
-
337
- def consume_signal(
338
- self,
339
- execution_id: str,
340
- stage_ref_id: str,
341
- signal_name: str | None = None,
342
- *,
343
- row_id: int | None = None,
344
- ) -> dict[str, Any] | None:
345
- clauses = ""
346
- params: dict[str, Any] = {"e": execution_id, "s": stage_ref_id, "tenant": self._tenant}
347
- if signal_name:
348
- clauses += " AND signal_name = %(name)s"
349
- params["name"] = signal_name
350
- if row_id is not None:
351
- clauses += " AND id = %(row_id)s"
352
- params["row_id"] = row_id
353
- with self._conn.cursor() as cur:
354
- cur.execute(
355
- "UPDATE workflow_signals SET consumed = TRUE, consumed_at = NOW() WHERE id = ("
356
- "SELECT id FROM workflow_signals WHERE execution_id = %(e)s AND stage_ref_id = %(s)s "
357
- f"AND stabilize_tenant = %(tenant)s AND consumed = FALSE{clauses} "
358
- "ORDER BY id FOR UPDATE SKIP LOCKED LIMIT 1) RETURNING signal_name, signal_data",
359
- params,
360
- )
361
- row = cur.fetchone()
362
- if not row:
363
- return None
364
- if isinstance(row, dict):
365
- return {"signal_name": row["signal_name"], "signal_data": row["signal_data"] or {}}
366
- return {"signal_name": row[0], "signal_data": row[1] or {}}
367
-
368
- def buffer_signal(
369
- self,
370
- execution_id: str,
371
- stage_ref_id: str,
372
- signal_name: str,
373
- signal_data: dict[str, Any] | None = None,
374
- *,
375
- consumed: bool = False,
376
- user: str = "",
377
- persistent: bool = True,
378
- ) -> int:
379
- with self._conn.cursor() as cur:
380
- cur.execute(
381
- "INSERT INTO workflow_signals (execution_id, stage_ref_id, signal_name, signal_data, consumed, "
382
- "consumed_at, signal_user, persistent, stabilize_tenant) VALUES (%(e)s, %(s)s, %(n)s, %(d)s, %(c)s, "
383
- "CASE WHEN %(c)s THEN NOW() ELSE NULL END, %(u)s, %(p)s, %(tenant)s) RETURNING id",
384
- {
385
- "e": execution_id,
386
- "s": stage_ref_id,
387
- "n": signal_name,
388
- "d": json.dumps(signal_data or {}, default=str),
389
- "c": consumed,
390
- "u": user,
391
- "p": persistent,
392
- "tenant": self._tenant,
393
- },
394
- )
395
- row = cur.fetchone()
396
- if not row:
397
- return 0
398
- return int(row["id"] if isinstance(row, dict) else row[0])
399
-
400
- def discard_signals(self, execution_id: str, stage_ref_id: str) -> int:
401
- with self._conn.cursor() as cur:
402
- cur.execute(
403
- "DELETE FROM workflow_signals WHERE execution_id = %(e)s AND stage_ref_id = %(s)s "
404
- "AND consumed = FALSE AND stabilize_tenant = %(tenant)s",
405
- {"e": execution_id, "s": stage_ref_id, "tenant": self._tenant},
406
- )
407
- return int(cur.rowcount or 0)
408
-
409
321
  def try_lock_recovery(self, key: str) -> bool:
410
322
  with self._conn.cursor() as cur:
411
323
  cur.execute(
@@ -0,0 +1,117 @@
1
+ """Signal rows and the stage row lock on the transaction's own connection (PostgreSQL)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import logging
7
+ from typing import TYPE_CHECKING, Any
8
+
9
+ if TYPE_CHECKING:
10
+ from stabilize.models.stage import StageExecution
11
+
12
+ logger = logging.getLogger(__name__)
13
+
14
+
15
+ class PostgresSignalTransactionMixin:
16
+ _conn: Any
17
+ _tenant: str
18
+ _store: Any
19
+
20
+ def _discard_if_complete(self, stage: StageExecution) -> None:
21
+ if not stage.status.is_complete or not self._store.supports_signal_storage():
22
+ return
23
+ with self._conn.cursor() as cur:
24
+ cur.execute(
25
+ "DELETE FROM workflow_signals WHERE consumed = FALSE AND stabilize_tenant = %(tenant)s "
26
+ "AND stage_ref_id = %(ref)s AND execution_id = (SELECT execution_id FROM stage_executions "
27
+ "WHERE id = %(stage_id)s AND stabilize_tenant = %(tenant)s)",
28
+ {"tenant": self._tenant, "ref": stage.ref_id, "stage_id": stage.id},
29
+ )
30
+ dropped = int(cur.rowcount or 0)
31
+ if dropped:
32
+ logger.warning(
33
+ "Discarded %d pending signal(s) on stage %s entering %s", dropped, stage.id, stage.status.name
34
+ )
35
+
36
+ def lock_stage(self, stage_id: str) -> str | None:
37
+ with self._conn.cursor() as cur:
38
+ cur.execute(
39
+ "SELECT status FROM stage_executions WHERE id = %(id)s AND stabilize_tenant = %(tenant)s FOR UPDATE",
40
+ {"id": stage_id, "tenant": self._tenant},
41
+ )
42
+ row = cur.fetchone()
43
+ if row is None:
44
+ return None
45
+ return str(row["status"] if isinstance(row, dict) else row[0])
46
+
47
+ def consume_signal(
48
+ self,
49
+ execution_id: str,
50
+ stage_ref_id: str,
51
+ signal_name: str | None = None,
52
+ *,
53
+ row_id: int | None = None,
54
+ ) -> dict[str, Any] | None:
55
+ clauses = ""
56
+ params: dict[str, Any] = {"e": execution_id, "s": stage_ref_id, "tenant": self._tenant}
57
+ if signal_name:
58
+ clauses += " AND signal_name = %(name)s"
59
+ params["name"] = signal_name
60
+ if row_id is not None:
61
+ clauses += " AND id = %(row_id)s"
62
+ params["row_id"] = row_id
63
+ with self._conn.cursor() as cur:
64
+ cur.execute(
65
+ "UPDATE workflow_signals SET consumed = TRUE, consumed_at = NOW() WHERE id = ("
66
+ "SELECT id FROM workflow_signals WHERE execution_id = %(e)s AND stage_ref_id = %(s)s "
67
+ f"AND stabilize_tenant = %(tenant)s AND consumed = FALSE{clauses} "
68
+ "ORDER BY id FOR UPDATE SKIP LOCKED LIMIT 1) RETURNING signal_name, signal_data",
69
+ params,
70
+ )
71
+ row = cur.fetchone()
72
+ if not row:
73
+ return None
74
+ if isinstance(row, dict):
75
+ return {"signal_name": row["signal_name"], "signal_data": row["signal_data"] or {}}
76
+ return {"signal_name": row[0], "signal_data": row[1] or {}}
77
+
78
+ def buffer_signal(
79
+ self,
80
+ execution_id: str,
81
+ stage_ref_id: str,
82
+ signal_name: str,
83
+ signal_data: dict[str, Any] | None = None,
84
+ *,
85
+ consumed: bool = False,
86
+ user: str = "",
87
+ persistent: bool = True,
88
+ ) -> int:
89
+ with self._conn.cursor() as cur:
90
+ cur.execute(
91
+ "INSERT INTO workflow_signals (execution_id, stage_ref_id, signal_name, signal_data, consumed, "
92
+ "consumed_at, signal_user, persistent, stabilize_tenant) VALUES (%(e)s, %(s)s, %(n)s, %(d)s, %(c)s, "
93
+ "CASE WHEN %(c)s THEN NOW() ELSE NULL END, %(u)s, %(p)s, %(tenant)s) RETURNING id",
94
+ {
95
+ "e": execution_id,
96
+ "s": stage_ref_id,
97
+ "n": signal_name,
98
+ "d": json.dumps(signal_data or {}, default=str),
99
+ "c": consumed,
100
+ "u": user,
101
+ "p": persistent,
102
+ "tenant": self._tenant,
103
+ },
104
+ )
105
+ row = cur.fetchone()
106
+ if not row:
107
+ return 0
108
+ return int(row["id"] if isinstance(row, dict) else row[0])
109
+
110
+ def discard_signals(self, execution_id: str, stage_ref_id: str) -> int:
111
+ with self._conn.cursor() as cur:
112
+ cur.execute(
113
+ "DELETE FROM workflow_signals WHERE execution_id = %(e)s AND stage_ref_id = %(s)s "
114
+ "AND consumed = FALSE AND stabilize_tenant = %(tenant)s",
115
+ {"e": execution_id, "s": stage_ref_id, "tenant": self._tenant},
116
+ )
117
+ return int(cur.rowcount or 0)
@@ -105,6 +105,12 @@ class SqliteTransactionOps:
105
105
  ).fetchall()
106
106
  return [str(r[0]) for r in rows]
107
107
 
108
+ def lock_stage(self, stage_id: str) -> str | None:
109
+ row = self._conn.execute(
110
+ "SELECT status FROM stage_executions WHERE id = ? AND stabilize_tenant = ?", (stage_id, self._tenant)
111
+ ).fetchone()
112
+ return None if row is None else str(row[0])
113
+
108
114
  def consume_signal(
109
115
  self,
110
116
  execution_id: str,
@@ -131,6 +131,10 @@ class StoreTransaction(ABC):
131
131
  """Delete a synthetic stage, its tasks, its claims and its queued messages."""
132
132
  raise NotImplementedError(f"{type(self).__name__} cannot remove stages")
133
133
 
134
+ def lock_stage(self, stage_id: str) -> str | None:
135
+ """Lock the stage row until this transaction ends and return its status name; None when unsupported."""
136
+ return None
137
+
134
138
  def consume_signal(
135
139
  self,
136
140
  execution_id: str,
File without changes
File without changes
File without changes