durable-workflow 2.29.0__tar.gz → 2.31.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. {durable_workflow-2.29.0/src/durable_workflow.egg-info → durable_workflow-2.31.0}/PKG-INFO +1 -1
  2. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/pyproject.toml +3 -3
  3. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/replay_clock.py +130 -25
  4. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/workflow.py +66 -44
  5. {durable_workflow-2.29.0 → durable_workflow-2.31.0/src/durable_workflow.egg-info}/PKG-INFO +1 -1
  6. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow.egg-info/SOURCES.txt +2 -0
  7. durable_workflow-2.31.0/tests/test_business_replay_clock_condition.py +283 -0
  8. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_business_replay_clock_parallel.py +81 -13
  9. durable_workflow-2.31.0/tests/test_business_replay_clock_selection.py +111 -0
  10. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_replay_clock.py +17 -8
  11. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_replay_regression_corpus.py +6 -0
  12. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/LICENSE +0 -0
  13. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/README.md +0 -0
  14. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/setup.cfg +0 -0
  15. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/__init__.py +0 -0
  16. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_activity_checkpoint.py +0 -0
  17. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_activity_lease.py +0 -0
  18. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_activity_process.py +0 -0
  19. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_avro.py +0 -0
  20. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_cancellation_scope.py +0 -0
  21. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_cancellation_scope_history.py +0 -0
  22. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_capabilities_digest.py +0 -0
  23. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_condition_fingerprint.py +0 -0
  24. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_condition_input_order.py +0 -0
  25. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_continue_as_new.py +0 -0
  26. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_cooperative_cancellation.py +0 -0
  27. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_failure_reporting.py +0 -0
  28. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_metric_routes.py +0 -0
  29. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_parallel_group_policy.py +0 -0
  30. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_payload_protection.py +0 -0
  31. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_poll_transport.py +0 -0
  32. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_prepared_local_activity.py +0 -0
  33. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_query_task_authority.py +0 -0
  34. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_response_limit.py +0 -0
  35. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_sticky_workflow_cache.py +0 -0
  36. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_timeout_cleanup.py +0 -0
  37. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/_typed_values.py +0 -0
  38. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/activity.py +0 -0
  39. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/auth_composition.py +0 -0
  40. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/cancellation.py +0 -0
  41. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/client.py +0 -0
  42. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/errors.py +0 -0
  43. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/external_storage.py +0 -0
  44. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/external_task_input.py +0 -0
  45. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/external_task_result.py +0 -0
  46. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/history_bundle_verify.py +0 -0
  47. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/interceptors.py +0 -0
  48. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/invocable.py +0 -0
  49. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/metrics.py +0 -0
  50. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/nexus.py +0 -0
  51. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/prepared_payload.py +0 -0
  52. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/py.typed +0 -0
  53. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/python_conformance.py +0 -0
  54. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/replay_clock_math.py +0 -0
  55. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/replay_conformance.py +0 -0
  56. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/replay_verify.py +0 -0
  57. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/retry_policy.py +0 -0
  58. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/serializer.py +0 -0
  59. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/server_compatibility.json +0 -0
  60. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/sync.py +0 -0
  61. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/telemetry.py +0 -0
  62. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/telemetry_carrier.py +0 -0
  63. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/testing.py +0 -0
  64. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/worker.py +0 -0
  65. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/worker_session.py +0 -0
  66. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/worker_status.py +0 -0
  67. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow/workflow_updates_conformance.py +0 -0
  68. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow.egg-info/dependency_links.txt +0 -0
  69. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow.egg-info/entry_points.txt +0 -0
  70. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow.egg-info/requires.txt +0 -0
  71. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/src/durable_workflow.egg-info/top_level.txt +0 -0
  72. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_acceptance_authority.py +0 -0
  73. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_acceptance_consumer.py +0 -0
  74. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_acceptance_entry.py +0 -0
  75. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_cancellation_policies.py +0 -0
  76. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_checkpoint.py +0 -0
  77. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_context.py +0 -0
  78. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_exponential_retry.py +0 -0
  79. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_heartbeat_authority.py +0 -0
  80. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_heartbeat_unavailable.py +0 -0
  81. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_identity.py +0 -0
  82. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_install_inventory.py +0 -0
  83. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_lease_authority.py +0 -0
  84. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_lease_renewal.py +0 -0
  85. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_lease_worker.py +0 -0
  86. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_process.py +0 -0
  87. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_retry_cap_cell.py +0 -0
  88. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_retry_info.py +0 -0
  89. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_run_closed_refusal.py +0 -0
  90. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_activity_worker_lost.py +0 -0
  91. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_auth_composition.py +0 -0
  92. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_avro_value_benchmark.py +0 -0
  93. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_avro_value_protocol.py +0 -0
  94. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_business_replay_clock.py +0 -0
  95. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_business_replay_clock_child.py +0 -0
  96. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_business_replay_clock_entry.py +0 -0
  97. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_business_replay_clock_query_attestation.py +0 -0
  98. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_business_replay_clock_redrive.py +0 -0
  99. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_business_replay_clock_sequence_claims.py +0 -0
  100. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_cancellation_cause.py +0 -0
  101. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_cancellation_context.py +0 -0
  102. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_cancellation_remaining_time.py +0 -0
  103. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_cancellation_scope_admission.py +0 -0
  104. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_cancellation_scope_authoring.py +0 -0
  105. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_cancellation_scope_boundary.py +0 -0
  106. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_cancellation_scope_opening.py +0 -0
  107. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_capabilities_digest.py +0 -0
  108. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_capabilities_digest_unknown.py +0 -0
  109. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_checkpointed_batch_example.py +0 -0
  110. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_child_workflow_policies.py +0 -0
  111. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_ci_checkout.py +0 -0
  112. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_ci_integration_endpoint.py +0 -0
  113. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_client.py +0 -0
  114. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_client_iterators.py +0 -0
  115. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_client_payload_protection.py +0 -0
  116. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_client_telemetry.py +0 -0
  117. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_client_timeouts.py +0 -0
  118. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_coalescing_signal_timer_replay.py +0 -0
  119. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_codec_regression_corpus.py +0 -0
  120. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_command_keys_acceptance.py +0 -0
  121. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_command_keys_captured_inputs.py +0 -0
  122. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_command_keys_container_ownership.py +0 -0
  123. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_command_keys_workspace.py +0 -0
  124. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_committed_cancellation_scope_descendants.py +0 -0
  125. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_committed_cancellation_scope_groups.py +0 -0
  126. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_committed_cancellation_scope_history.py +0 -0
  127. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_committed_cancellation_scope_replay.py +0 -0
  128. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_completion_size_limit.py +0 -0
  129. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_condition_fingerprint.py +0 -0
  130. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_condition_occurrence_id.py +0 -0
  131. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_condition_replay_drift.py +0 -0
  132. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_continue_as_new_target.py +0 -0
  133. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_control_plane_parity_fixtures.py +0 -0
  134. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_cooperative_cancellation.py +0 -0
  135. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_cooperative_cancellation_client.py +0 -0
  136. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_cooperative_cancellation_worker.py +0 -0
  137. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_cooperative_remote_worker.py +0 -0
  138. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_docs_release_channel.py +0 -0
  139. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_docstring_cross_references.py +0 -0
  140. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_durable_selection.py +0 -0
  141. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_empty_callback_failure.py +0 -0
  142. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_errors.py +0 -0
  143. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_external_storage.py +0 -0
  144. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_external_task_input.py +0 -0
  145. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_external_task_result.py +0 -0
  146. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_failure_reporting.py +0 -0
  147. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_generator_lifecycle.py +0 -0
  148. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_golden_history_replay.py +0 -0
  149. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_history_bundle_pruned.py +0 -0
  150. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_history_bundle_schema2.py +0 -0
  151. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_history_bundle_verify.py +0 -0
  152. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_history_event_contract.py +0 -0
  153. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_invocable.py +0 -0
  154. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_local_activity_backoff.py +0 -0
  155. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_local_failure_reporting.py +0 -0
  156. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_message_streams.py +0 -0
  157. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_metric_routes.py +0 -0
  158. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_metrics.py +0 -0
  159. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_native_timer_redrive_cell.py +0 -0
  160. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_native_timer_redrive_clock.py +0 -0
  161. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_nexus_durable_wait.py +0 -0
  162. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_nexus_namespace.py +0 -0
  163. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_nexus_wire.py +0 -0
  164. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_order_processing_example.py +0 -0
  165. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_ordered_condition_input.py +0 -0
  166. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_parallel_completion_order_replay.py +0 -0
  167. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_parallel_failure_order.py +0 -0
  168. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_parallel_group_boundaries.py +0 -0
  169. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_parallel_group_policy.py +0 -0
  170. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_parallel_member_failure_open_siblings.py +0 -0
  171. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_parallel_saga_authoring.py +0 -0
  172. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_patch_history.py +0 -0
  173. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_payload_policy_refresh.py +0 -0
  174. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_payload_protection.py +0 -0
  175. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_pending_operation_replay.py +0 -0
  176. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_physical_command_key_readback.py +0 -0
  177. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_poll_failure_backoff.py +0 -0
  178. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_poll_transport.py +0 -0
  179. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_portal_source_split.py +0 -0
  180. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_prepared_local_activity_client.py +0 -0
  181. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_prepared_local_activity_groups.py +0 -0
  182. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_prepared_local_activity_policies.py +0 -0
  183. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_prepared_local_activity_worker.py +0 -0
  184. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_protected_workflow_replay.py +0 -0
  185. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_public_boundary_scanner.py +0 -0
  186. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_publish_workflow_isolation.py +0 -0
  187. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_published_activity_acceptance.py +0 -0
  188. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_published_pagination_evidence.py +0 -0
  189. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_pypi_project_surface.py +0 -0
  190. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_python_conformance.py +0 -0
  191. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_queries.py +0 -0
  192. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_query_task_authority.py +0 -0
  193. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_query_timeout_retry.py +0 -0
  194. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_quiesced_snapshot.py +0 -0
  195. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_readme_quickstart.py +0 -0
  196. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_redrive_call_ledger.py +0 -0
  197. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_redrive_replay.py +0 -0
  198. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_redrive_successor_evidence.py +0 -0
  199. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_registration_ambiguity.py +0 -0
  200. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_release_metadata.py +0 -0
  201. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_release_promotion.py +0 -0
  202. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_replay.py +0 -0
  203. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_replay_conformance.py +0 -0
  204. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_replay_verify.py +0 -0
  205. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_response_body_limit.py +0 -0
  206. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_result_continue_as_new.py +0 -0
  207. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_retry_cap_download.py +0 -0
  208. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_retry_cap_workflow.py +0 -0
  209. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_retry_policy.py +0 -0
  210. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_run_activities.py +0 -0
  211. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_run_cancellation_scope_replay.py +0 -0
  212. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_run_closed_settlement_replay.py +0 -0
  213. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_runtime_external_payload_transport.py +0 -0
  214. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_schedule_origin.py +0 -0
  215. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_schedules.py +0 -0
  216. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_scoped_run_cancellation_context.py +0 -0
  217. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_sdk_metrics_contract.py +0 -0
  218. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_search_attribute_replay_identity.py +0 -0
  219. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_serializer.py +0 -0
  220. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_signal_external_workflow.py +0 -0
  221. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_signal_with_start.py +0 -0
  222. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_signals.py +0 -0
  223. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_sleep.py +0 -0
  224. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_standalone_activity_client.py +0 -0
  225. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_static_credential_validation.py +0 -0
  226. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_sticky_execution.py +0 -0
  227. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_sticky_history_suffix.py +0 -0
  228. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_storage_admission.py +0 -0
  229. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_sync.py +0 -0
  230. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_sync_activities.py +0 -0
  231. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_synthetic_command_key_readback.py +0 -0
  232. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_telemetry.py +0 -0
  233. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_telemetry_carrier.py +0 -0
  234. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_testing_failures.py +0 -0
  235. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_testing_harness.py +0 -0
  236. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_testing_nexus.py +0 -0
  237. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_threaded_heartbeat_example.py +0 -0
  238. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_timeout_cleanup.py +0 -0
  239. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_tls_trust.py +0 -0
  240. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_transport_diagnostics.py +0 -0
  241. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_typed_values.py +0 -0
  242. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_typed_workflow_values.py +0 -0
  243. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_update_outcome.py +0 -0
  244. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_update_signal_condition_replay.py +0 -0
  245. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_updates.py +0 -0
  246. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_wait_condition.py +0 -0
  247. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker.py +0 -0
  248. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker_deregistration.py +0 -0
  249. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker_observation.py +0 -0
  250. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker_session.py +0 -0
  251. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker_startup_buffered.py +0 -0
  252. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker_startup_raw.py +0 -0
  253. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker_startup_read_budget.py +0 -0
  254. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker_startup_snapshot.py +0 -0
  255. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker_status.py +0 -0
  256. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker_telemetry_wire.py +0 -0
  257. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker_transient_5xx_retry.py +0 -0
  258. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_worker_transient_runtime.py +0 -0
  259. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_workflow_entry_arguments.py +0 -0
  260. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_workflow_entrypoint_validation.py +0 -0
  261. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_workflow_handler_validation.py +0 -0
  262. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_workflow_identity.py +0 -0
  263. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_workflow_result_timeout.py +0 -0
  264. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_workflow_streams.py +0 -0
  265. {durable_workflow-2.29.0 → durable_workflow-2.31.0}/tests/test_workflow_updates_conformance.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: durable-workflow
3
- Version: 2.29.0
3
+ Version: 2.31.0
4
4
  Summary: Python client and worker SDK for Durable Workflow Cloud and self-hosted Server
5
5
  Author: Durable Workflow Contributors
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "durable-workflow"
7
- version = "2.29.0"
7
+ version = "2.31.0"
8
8
  description = "Python client and worker SDK for Durable Workflow Cloud and self-hosted Server"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -82,8 +82,8 @@ durable-workflow-replay-conformance = "durable_workflow.replay_conformance:main"
82
82
  durable-workflow-workflow-updates-conformance = "durable_workflow.workflow_updates_conformance:main"
83
83
 
84
84
  [tool.durable-workflow]
85
- product-train = "2.29.0"
86
- registry-version = "2.29.0"
85
+ product-train = "2.31.0"
86
+ registry-version = "2.31.0"
87
87
  supported-server-versions = "2.8.0"
88
88
  supported-server-release-baselines = { "2" = "2.8.0", "3" = "3.0.0" }
89
89
  worker-protocol-version = "1.20"
@@ -14,6 +14,7 @@ from dataclasses import dataclass
14
14
  from datetime import datetime, timezone
15
15
  from typing import Any, ParamSpec, TypeGuard, TypeVar
16
16
 
17
+ from ._condition_input_order import marked as _ordered_condition
17
18
  from .errors import ReplayClockUnavailable
18
19
  from .replay_clock_math import canonical_milliseconds, from_canonical_milliseconds
19
20
 
@@ -37,6 +38,11 @@ _GroupMember = tuple[int | None, int, str | int, Sequence[Mapping[str, Any]] | N
37
38
  ENTRY_SCHEMA = "durable-workflow.worker-replay-clock/v1"
38
39
  _ENTRY_SOURCES = frozenset({"run_started_at", "redrive_replayed_started_at"})
39
40
  _ENTRY_INSTANT = re.compile(r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{6}Z", re.ASCII)
41
+ _CONDITION_ROWS = frozenset({
42
+ "ConditionWaitOpened", "ConditionWaitSatisfied", "ConditionWaitTimedOut", "ConditionWaitCancelled",
43
+ "TimerScheduled", "TimerFired", "TimerCancelled",
44
+ })
45
+ _SCALAR_GROUP_FIELDS = ("parallel_group", "parallel_group_id", "selection_group", *_SELECTION_FIELDS)
40
46
 
41
47
 
42
48
  @dataclass(frozen=True)
@@ -247,16 +253,23 @@ def _group_event_time(event: Mapping[str, Any], *, public_history: bool = False)
247
253
 
248
254
 
249
255
  def _group_time(
250
- events: Sequence[Mapping[str, Any]], failed_member: int | None, success_kind: str,
256
+ events: Sequence[tuple[Mapping[str, Any], str]], failed_member: int | None,
251
257
  ) -> datetime | None:
252
258
  candidates: list[tuple[int, datetime, int]] = []
253
- for offset, event in enumerate(events):
259
+ for offset, (event, success_kind) in enumerate(events):
254
260
  failed = _kind(event) != success_kind
255
261
  if failed != (failed_member is not None):
256
262
  if failed:
257
263
  return None
258
264
  continue # Successful siblings do not choose the failure clock.
259
- time = _group_event_time(event, public_history=success_kind in {"TimerFired", "ChildRunCompleted"})
265
+ # Native's public history projects recorded_at as timestamp for every
266
+ # event type. A bare activity timestamp without that row shape is
267
+ # still insufficient to prove the consumed instant.
268
+ sequence = event.get("sequence")
269
+ native_export = type(sequence) is int and sequence > 0 and "principal" in event
270
+ time = _group_event_time(
271
+ event, public_history=native_export or success_kind in {"TimerFired", "ChildRunCompleted"},
272
+ )
260
273
  milliseconds = canonical_milliseconds(time) if time is not None else None
261
274
  if time is None or milliseconds is None:
262
275
  return None
@@ -311,6 +324,9 @@ class BusinessReplayClock:
311
324
  # group carries it into the next resume without consuming history.
312
325
  self._pending_entry = True
313
326
  self._current_entry = False
327
+ # What the last resumed segment could read when it yielded. A condition
328
+ # wait that consumes no clock boundary resumes with exactly this value.
329
+ self._yielded: tuple[tuple[int | None, datetime | None], bool] = ((None, None), False)
314
330
  # A query or validation rebuild whose task does not attest the entry
315
331
  # carrier cannot know what the workflow task's entry read returned.
316
332
  self.entry_unattested = False
@@ -392,6 +408,7 @@ class BusinessReplayClock:
392
408
  self._current, self._pending = self._pending, (None, None)
393
409
  entry, self._pending_entry = self._pending_entry, False
394
410
  self._current_entry = entry
411
+ self._yielded = (self._current, entry)
395
412
  with execution_scope(owner, self._current[1], entry=entry):
396
413
  return function(*args)
397
414
 
@@ -413,44 +430,132 @@ class BusinessReplayClock:
413
430
  self._pending = self._current
414
431
  self._pending_entry = self._current_entry
415
432
 
433
+ def keep_condition_prior(self) -> None:
434
+ """A satisfied or non-advancing condition resumes with its yield's value.
435
+
436
+ External workers' Servers record ``ConditionWaitSatisfied`` and an
437
+ ordered timeout only when the resuming task completes, after workflow
438
+ code has run. Neither time exists on the first execution, so neither
439
+ is read on replay: the clock keeps what the waiting code last saw,
440
+ including an unavailable value and its entry attestation.
441
+ """
442
+ self._pending, self._pending_entry = self._yielded
443
+
444
+ def observe_condition_timeout(self, wait_id: Any, *, reconstruction: bool) -> None:
445
+ """Use the condition-timeout ``TimerFired`` that ended this physical wait.
446
+
447
+ The Server records that fire before the resuming task, so the first
448
+ execution and every replay read the same instant. A Core
449
+ ``ConditionWaitTimedOut`` is accepted only at that same instant;
450
+ another time, like an ordered-input timeout the worker resolved
451
+ itself, keeps the prior value. Unproved evidence is unavailable.
452
+ """
453
+ self._pending, self._pending_entry = (None, None), False
454
+ if not _identity(wait_id):
455
+ return
456
+ rows: dict[str, list[int]] = {}
457
+ for index, event in enumerate(self.events):
458
+ payload = event.get("payload")
459
+ if isinstance(payload, Mapping) and payload.get("condition_wait_id") == wait_id:
460
+ kind = _kind(event)
461
+ if kind not in _CONDITION_ROWS:
462
+ return
463
+ rows.setdefault(kind, []).append(index)
464
+ opened, scheduled, fired, timed_out = (rows.get(kind, []) for kind in (
465
+ "ConditionWaitOpened", "TimerScheduled", "TimerFired", "ConditionWaitTimedOut"))
466
+ if (len(opened) != 1 or len(scheduled) != 1 or len(fired) != 1 or len(timed_out) > 1
467
+ or any(rows.get(kind) for kind in ("ConditionWaitSatisfied", "ConditionWaitCancelled", "TimerCancelled"))
468
+ or not opened[0] < scheduled[0] < fired[0] or timed_out and timed_out[0] < fired[0]):
469
+ return
470
+ opening = self.events[opened[0]]["payload"]
471
+ sequence = _sequence(opening)
472
+ timer = self.events[scheduled[0]]["payload"].get("timer_id")
473
+ if sequence is None or not _identity(timer):
474
+ return
475
+ for index in (*opened, *scheduled, *fired, *timed_out):
476
+ body = self.events[index]["payload"]
477
+ is_timer = _kind(self.events[index]) in ("TimerScheduled", "TimerFired")
478
+ if (_sequence(body) != sequence or any(key in body for key in _REUSE_FIELDS)
479
+ or any(body.get(field) is not None for field in _SCALAR_GROUP_FIELDS)
480
+ or body.get("parallel_group_path") not in (None, [])
481
+ or body.get("cancellation_scope_id") not in (None, "root")
482
+ or (is_timer and (body.get("timer_kind") != "condition_timeout" or body.get("timer_id") != timer))
483
+ or (not is_timer and "timer_id" in body and body["timer_id"] != timer)):
484
+ return
485
+ if self._redrive_declared and (self._resume_step is None or sequence < self._resume_step):
486
+ return
487
+ if _ordered_condition(opening):
488
+ self.keep_condition_prior()
489
+ return
490
+ time = _time(_recorded_value(self.events[fired[0]]))
491
+ if time is None:
492
+ return
493
+ if timed_out:
494
+ if _time(_recorded_value(self.events[timed_out[0]])) != time:
495
+ self.keep_condition_prior()
496
+ return
497
+ elif reconstruction:
498
+ # Core's query replay needs the explicit resolution; a fire alone
499
+ # grants no callback authority there.
500
+ return
501
+ self._pending = (None, time)
502
+
503
+ def observe_selection(self, marker_index: int, terminal_index: int | None, base_sequence: int) -> None:
504
+ """Use the matched decision when it follows its unique winner terminal."""
505
+ self._pending = (None, None)
506
+ if terminal_index is None or terminal_index >= marker_index:
507
+ return
508
+ if self._redrive_declared and (self._resume_step is None or base_sequence < self._resume_step):
509
+ return
510
+ marker = self.events[marker_index]
511
+ payload = marker["payload"]
512
+ if (_kind(marker) != "SelectionResolved" or any(key in payload for key in _REUSE_FIELDS)
513
+ or _kind(self.events[terminal_index]) != payload.get("resolution_event_type")):
514
+ return
515
+ self._pending = (marker_index, _time(_recorded_value(marker)))
516
+
416
517
  def observe_parallel_group(
417
- self, members: Sequence[_GroupMember], failed_member: int | None, *, family: str, reconstruction: bool,
518
+ self, members: Sequence[tuple[str, _GroupMember]], failed_member: int | None, *, reconstruction: bool,
418
519
  ) -> None:
419
520
  self._pending = (None, None)
420
521
  # Core's successful query group-send supplies no new time. Body and
421
522
  # callback reconstruction cannot borrow an executor-only aggregate.
422
- if reconstruction or not members or not members[0][3]:
523
+ if reconstruction or not members:
524
+ return
525
+ _, first = members[0]
526
+ first_path = first[3]
527
+ if not first_path:
423
528
  return
424
- root = members[0][3][0]
425
- if (root.get("parallel_group_base_sequence") != members[0][1]
426
- or root.get("parallel_group_size") != len(members) or root.get("parallel_group_kind") != family):
529
+ root = first_path[0]
530
+ families = {family for family, _ in members}
531
+ group_kind = next(iter(families)) if len(families) == 1 else "mixed"
532
+ if (root.get("parallel_group_base_sequence") != first[1]
533
+ or root.get("parallel_group_size") != len(members) or root.get("parallel_group_kind") != group_kind):
427
534
  return
428
- if family == "child":
429
- boundary = self._child_group_boundary
430
- identity_field, success_kind = "child_call_id", "ChildRunCompleted"
431
- elif family == "timer":
432
- boundary = self._timer_group_boundary
433
- identity_field, success_kind = "timer_id", "TimerFired"
434
- else:
435
- boundary = self._activity_group_boundary
436
- identity_field, success_kind = "activity_execution_id", "ActivityCompleted"
437
- events: list[Mapping[str, Any]] = []
438
- identities: set[str] = set()
439
- for offset, member in enumerate(members):
535
+ boundaries = {
536
+ "activity": (self._activity_group_boundary, "activity_execution_id", "ActivityCompleted"),
537
+ "timer": (self._timer_group_boundary, "timer_id", "TimerFired"),
538
+ "child": (self._child_group_boundary, "child_call_id", "ChildRunCompleted"),
539
+ }
540
+ events: list[tuple[Mapping[str, Any], str]] = []
541
+ identities: set[tuple[str, str]] = set()
542
+ for offset, (family, member) in enumerate(members):
543
+ proof = boundaries.get(family)
440
544
  path = member[3]
441
545
  expected_root = {**root, "parallel_group_index": offset}
442
- if (not path or not _group_entry_matches(path[0], expected_root)
443
- or member[1] != members[0][1] + offset):
546
+ if (proof is None or not path or not _group_entry_matches(path[0], expected_root)
547
+ or member[1] != first[1] + offset):
444
548
  return
549
+ boundary, identity_field, success_kind = proof
445
550
  event = boundary(member)
446
551
  if event is None:
447
552
  return
448
- identity = event["payload"][identity_field]
553
+ identity = family, event["payload"][identity_field]
449
554
  if identity in identities:
450
555
  return
451
556
  identities.add(identity)
452
- events.append(event)
453
- self._pending = (None, _group_time(events, failed_member, success_kind))
557
+ events.append((event, success_kind))
558
+ self._pending = (None, _group_time(events, failed_member))
454
559
 
455
560
  def observe_propagated_activity_failure(self, member: _GroupMember, *, reconstruction: bool) -> None:
456
561
  """Use only the qualified first-recorded failure of an explicit group."""
@@ -3335,8 +3335,13 @@ class WorkflowContext:
3335
3335
  """Return the proved UTC instant of the supported consumed boundary.
3336
3336
 
3337
3337
  This additive clock supports scalar persisted activities, timers and
3338
- children, explicit redrive start, and validated lists of remote
3339
- activities. Group success retains the selected event's full precision;
3338
+ children, explicit redrive start, validated selection decisions, and
3339
+ remote groups of activities, timers and children, including mixed
3340
+ groups. A selection uses its recorded decision instant. A satisfied
3341
+ ``wait_condition`` keeps the value read before the wait, and a
3342
+ condition timeout reads its recorded condition-timeout timer fire.
3343
+ Group success
3344
+ retains the selected event's full precision;
3340
3345
  matching caught failure uses canonical-v1 integer milliseconds.
3341
3346
  Ordinary entry reads the run's canonical start from the workflow
3342
3347
  task's ``replay_clock`` carrier (``WorkerReplayClock`` v1). Entry is
@@ -5978,9 +5983,12 @@ def _replay_state(
5978
5983
  start_payload = ev.get("payload")
5979
5984
  if not isinstance(start_payload, Mapping):
5980
5985
  start_payload = {}
5981
- explicit_time = "timestamp" in start_payload
5982
- ts = start_payload.get("timestamp") if explicit_time else ev.get("recorded_at")
5983
- clock_source = "payload.timestamp" if explicit_time else "recorded_at"
5986
+ if "timestamp" in start_payload:
5987
+ ts, clock_source = start_payload["timestamp"], "payload.timestamp"
5988
+ else:
5989
+ # History pages expose the recorded event time as timestamp.
5990
+ clock_source = "timestamp" if "recorded_at" not in ev and "timestamp" in ev else "recorded_at"
5991
+ ts = ev.get(clock_source)
5984
5992
  # A redriven run replays from the failed run's start time, as Core does.
5985
5993
  if start_payload.get("recovery_kind") == "redrive" and "replayed_started_at" in start_payload:
5986
5994
  ts = start_payload.get("replayed_started_at")
@@ -6131,8 +6139,7 @@ def _replay_state(
6131
6139
  selection_opening_payloads: dict[int, dict[str, Any]] = {}
6132
6140
  selection_condition_terminal_payloads: dict[int, list[dict[str, Any]]] = {}
6133
6141
  selection_condition_sequences: dict[str, int] = {}
6134
- selection_markers: list[dict[str, Any]] = []
6135
- selection_marker_indexes: list[int] = []
6142
+ selection_markers: list[tuple[dict[str, Any], int]] = []
6136
6143
  selection_marker_cursor = 0
6137
6144
  consumed_selection_sequences: set[int] = set()
6138
6145
  cancelled_selection_members: dict[tuple[str, int], dict[str, Any]] = {}
@@ -6378,7 +6385,7 @@ def _replay_state(
6378
6385
  detail="durable selection member history does not match replayed workflow code",
6379
6386
  )
6380
6387
  if selection_marker_cursor < len(selection_markers):
6381
- marker = selection_markers[selection_marker_cursor]
6388
+ marker, _ = selection_markers[selection_marker_cursor]
6382
6389
  marker_sequence = (
6383
6390
  _parallel_group_integer(marker, "selection_group_base_sequence")
6384
6391
  or _parallel_group_integer(marker, "member_base_sequence")
@@ -6702,8 +6709,7 @@ def _replay_state(
6702
6709
  wait_resolutions[wait_id] = "timed_out"
6703
6710
  elif etype == "SelectionResolved":
6704
6711
  if isinstance(payload.get("selection_group_id"), str):
6705
- selection_markers.append(dict(payload))
6706
- selection_marker_indexes.append(event_index)
6712
+ selection_markers.append((dict(payload), event_index))
6707
6713
  elif etype == "SelectionOperationCancelled":
6708
6714
  group_id = payload.get("selection_group_id")
6709
6715
  member_base = _parallel_group_integer(payload, "member_base_sequence")
@@ -6926,7 +6932,7 @@ def _replay_state(
6926
6932
  resolved_parallel_members,
6927
6933
  )
6928
6934
  selection_markers.sort(
6929
- key=lambda marker: _parallel_group_integer(marker, "selection_group_base_sequence") or 0
6935
+ key=lambda item: _parallel_group_integer(item[0], "selection_group_base_sequence") or 0,
6930
6936
  )
6931
6937
 
6932
6938
  signal_registry: dict[str, str] = getattr(workflow_cls, "__workflow_signals__", {}) or {}
@@ -7719,7 +7725,7 @@ def _replay_state(
7719
7725
  winner: DurableOperationHandle,
7720
7726
  group_base: int,
7721
7727
  group_size: int,
7722
- ) -> int:
7728
+ ) -> tuple[int, int | None]:
7723
7729
  expected = {
7724
7730
  "selection_group_id": winner.selection_group_id,
7725
7731
  "selection_group_base_sequence": group_base,
@@ -7773,9 +7779,12 @@ def _replay_state(
7773
7779
  "ConditionWaitTimedOut",
7774
7780
  }
7775
7781
  terminal_types = failure_types if outcome == "failed" else success_types
7776
- candidates: list[tuple[str, str, int]] = []
7777
- for event in events:
7782
+ candidates: list[tuple[str, str, int, int]] = []
7783
+ reference_count = 0
7784
+ for index, event in enumerate(events):
7778
7785
  event_type = _history_event_type(event)
7786
+ if event_type == resolution_type and (event.get("id") or event.get("event_id")) == resolution_id:
7787
+ reference_count += 1
7779
7788
  payload = event.get("payload") or {}
7780
7789
  if event_type not in terminal_types or not isinstance(payload, Mapping):
7781
7790
  continue
@@ -7793,7 +7802,7 @@ def _replay_state(
7793
7802
  "terminal selection history with a durable event id",
7794
7803
  [event_type or "<unknown>"],
7795
7804
  )
7796
- candidates.append((event_id, event_type, sequence))
7805
+ candidates.append((event_id, event_type, sequence, index))
7797
7806
 
7798
7807
  resolution = candidates[0] if outcome == "failed" and candidates else (
7799
7808
  candidates[-1] if candidates else None
@@ -7804,7 +7813,7 @@ def _replay_state(
7804
7813
  "SelectionResolved referencing the event that made its member terminal",
7805
7814
  ["SelectionResolved"],
7806
7815
  )
7807
- return resolution[2]
7816
+ return resolution[2], resolution[3] if reference_count == 1 else None
7808
7817
 
7809
7818
  def _annotate_selection(
7810
7819
  group: SelectGroup,
@@ -8720,10 +8729,10 @@ def _replay_state(
8720
8729
  cancellation_intent = boundary
8721
8730
  return _state(pending)
8722
8731
  if isinstance(cmd, SelectGroup):
8723
- marker = (
8732
+ marker, marker_index = (
8724
8733
  selection_markers[selection_marker_cursor]
8725
8734
  if selection_marker_cursor < len(selection_markers)
8726
- else None
8735
+ else (None, -1)
8727
8736
  )
8728
8737
  annotated, handles, shapes = _annotate_selection(cmd, marker)
8729
8738
  group_base = min(handle.base_sequence for handle in handles.values())
@@ -8811,10 +8820,10 @@ def _replay_state(
8811
8820
  "SelectionResolved member identity matching workflow code",
8812
8821
  ["SelectionResolved"],
8813
8822
  )
8814
- resolution_sequence = _validated_selection_resolution(
8823
+ resolution_sequence, terminal_index = _validated_selection_resolution(
8815
8824
  marker,
8816
8825
  winner,
8817
- min(handle.base_sequence for handle in handles.values()),
8826
+ group_base,
8818
8827
  len(annotated),
8819
8828
  )
8820
8829
  winner_offset = winner.base_sequence - group_base
@@ -8846,7 +8855,7 @@ def _replay_state(
8846
8855
  ["SelectionResolved"],
8847
8856
  detail="the committed winner has no terminal member history",
8848
8857
  )
8849
- _advance_cancellation_clock([selection_marker_indexes[selection_marker_cursor - 1]])
8858
+ _advance_cancellation_clock([marker_index])
8850
8859
  for sequence in range(
8851
8860
  winner.base_sequence,
8852
8861
  winner.base_sequence + winner.size,
@@ -8860,6 +8869,7 @@ def _replay_state(
8860
8869
  else:
8861
8870
  _ordered_condition_result(wait_id, ordered_wait, leaf.predicate)
8862
8871
  _release_ordered_condition_receivers(wait_id)
8872
+ ctx._business_clock.observe_selection(marker_index, terminal_index, group_base)
8863
8873
  next_value = SelectionResult(
8864
8874
  key=winner.key,
8865
8875
  index=winner.index,
@@ -8966,9 +8976,10 @@ def _replay_state(
8966
8976
  return _terminal_state(stop.value, include_pending=False)
8967
8977
  if all(isinstance(leaf, ScheduleActivity) for leaf in cmd):
8968
8978
  ctx._business_clock.observe_parallel_group(
8969
- [(step.history_index, step.workflow_sequence, leaf.activity_type, leaf._parallel_group_path)
8979
+ [("activity", (step.history_index, step.workflow_sequence, leaf.activity_type,
8980
+ leaf._parallel_group_path))
8970
8981
  for step, leaf in zip(consumed_steps, cmd, strict=True)],
8971
- None, family="activity", reconstruction=reconstruction_only,
8982
+ None, reconstruction=reconstruction_only,
8972
8983
  )
8973
8984
  else:
8974
8985
  ctx._business_clock.unavailable()
@@ -9013,32 +9024,29 @@ def _replay_state(
9013
9024
  group_typed_failure = error
9014
9025
  if not cmd:
9015
9026
  ctx._business_clock.preserve_boundary()
9016
- elif group_typed_failure is None and all(isinstance(leaf, ScheduleActivity) for leaf in cmd):
9017
- selected_failure = next(
9018
- (offset for offset, value in enumerate(vals) if failed is not None and value is failed),
9019
- None,
9020
- )
9021
- ctx._business_clock.observe_parallel_group(
9022
- [(step.history_index, step.workflow_sequence, leaf.activity_type, leaf._parallel_group_path)
9023
- for step, leaf in zip(consumed_steps, cmd, strict=True)],
9024
- selected_failure, family="activity", reconstruction=reconstruction_only,
9025
- )
9026
- elif (group_typed_failure is None and failed is None
9027
- and all(isinstance(leaf, StartTimer) for leaf in cmd)):
9028
- ctx._business_clock.observe_parallel_group(
9029
- [(step.history_index, step.workflow_sequence, leaf.delay_seconds, leaf._parallel_group_path)
9030
- for step, leaf in zip(consumed_steps, cmd, strict=True)],
9031
- None, family="timer", reconstruction=reconstruction_only,
9032
- )
9033
- elif group_typed_failure is None and all(isinstance(leaf, StartChildWorkflow) for leaf in cmd):
9027
+ elif group_typed_failure is None and all(
9028
+ isinstance(leaf, ScheduleActivity | StartTimer | StartChildWorkflow) for leaf in cmd
9029
+ ):
9034
9030
  selected_failure = next(
9035
9031
  (offset for offset, value in enumerate(vals) if failed is not None and value is failed),
9036
9032
  None,
9037
9033
  )
9034
+ clock_members = []
9035
+ for clock_step, leaf in zip(consumed_steps, cmd, strict=True):
9036
+ clock_target: str | int
9037
+ if isinstance(leaf, ScheduleActivity):
9038
+ family, clock_target = "activity", leaf.activity_type
9039
+ elif isinstance(leaf, StartTimer):
9040
+ family, clock_target = "timer", leaf.delay_seconds
9041
+ else:
9042
+ family, clock_target = "child", leaf.workflow_type
9043
+ clock_members.append((
9044
+ family,
9045
+ (clock_step.history_index, clock_step.workflow_sequence, clock_target,
9046
+ leaf._parallel_group_path),
9047
+ ))
9038
9048
  ctx._business_clock.observe_parallel_group(
9039
- [(step.history_index, step.workflow_sequence, leaf.workflow_type, leaf._parallel_group_path)
9040
- for step, leaf in zip(consumed_steps, cmd, strict=True)],
9041
- selected_failure, family="child", reconstruction=reconstruction_only,
9049
+ clock_members, selected_failure, reconstruction=reconstruction_only,
9042
9050
  )
9043
9051
  else:
9044
9052
  ctx._business_clock.unavailable()
@@ -9272,6 +9280,7 @@ def _replay_state(
9272
9280
  )
9273
9281
  if already_satisfied:
9274
9282
  terminal_condition_reopen_cmd = None
9283
+ ctx._business_clock.keep_condition_prior()
9275
9284
  next_value = True
9276
9285
  continue
9277
9286
  if next_opened_mismatch is not None:
@@ -9356,6 +9365,9 @@ def _replay_state(
9356
9365
  _advance_cancellation_clock([condition_wait_terminal_indexes.get(opened_id)])
9357
9366
  _release_ordered_condition_receivers(opened_id)
9358
9367
  terminal_condition_reopen_cmd = None
9368
+ # The worker writes an ordered resolution at
9369
+ # completion; its time is never a boundary.
9370
+ ctx._business_clock.keep_condition_prior()
9359
9371
  next_value = resolution_value
9360
9372
  wait_yield_count += 1
9361
9373
  break
@@ -9384,6 +9396,10 @@ def _replay_state(
9384
9396
  wait_yield_count = next_wait_index
9385
9397
  continue
9386
9398
  terminal_condition_reopen_cmd = None
9399
+ ctx._business_clock.observe_condition_timeout(
9400
+ opened.get("condition_wait_id") if opened is not None else None,
9401
+ reconstruction=reconstruction_only,
9402
+ )
9387
9403
  next_value = False
9388
9404
  wait_yield_count += 1
9389
9405
  break
@@ -9414,6 +9430,9 @@ def _replay_state(
9414
9430
  )
9415
9431
  terminal_condition_chain_first = wait_opened[first_open_index]
9416
9432
  terminal_condition_chain_current = opened
9433
+ # A satisfaction is recorded when the resuming task
9434
+ # completes, after this code ran: keep the prior value.
9435
+ ctx._business_clock.keep_condition_prior()
9417
9436
  next_value = True
9418
9437
  wait_yield_count += 1
9419
9438
  break
@@ -9425,6 +9444,9 @@ def _replay_state(
9425
9444
  )
9426
9445
  terminal_condition_chain_first = wait_opened[first_open_index]
9427
9446
  terminal_condition_chain_current = opened
9447
+ # A satisfaction is recorded when the resuming task
9448
+ # completes, after this code ran: keep the prior value.
9449
+ ctx._business_clock.keep_condition_prior()
9428
9450
  next_value = True
9429
9451
  wait_yield_count += 1
9430
9452
  break
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: durable-workflow
3
- Version: 2.29.0
3
+ Version: 2.31.0
4
4
  Summary: Python client and worker SDK for Durable Workflow Cloud and self-hosted Server
5
5
  Author: Durable Workflow Contributors
6
6
  License-Expression: MIT
@@ -86,10 +86,12 @@ tests/test_avro_value_benchmark.py
86
86
  tests/test_avro_value_protocol.py
87
87
  tests/test_business_replay_clock.py
88
88
  tests/test_business_replay_clock_child.py
89
+ tests/test_business_replay_clock_condition.py
89
90
  tests/test_business_replay_clock_entry.py
90
91
  tests/test_business_replay_clock_parallel.py
91
92
  tests/test_business_replay_clock_query_attestation.py
92
93
  tests/test_business_replay_clock_redrive.py
94
+ tests/test_business_replay_clock_selection.py
93
95
  tests/test_business_replay_clock_sequence_claims.py
94
96
  tests/test_cancellation_cause.py
95
97
  tests/test_cancellation_context.py