durable-workflow 2.28.0__tar.gz → 2.30.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 (264) hide show
  1. {durable_workflow-2.28.0/src/durable_workflow.egg-info → durable_workflow-2.30.0}/PKG-INFO +1 -1
  2. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/pyproject.toml +3 -3
  3. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/replay_clock.py +76 -30
  4. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/workflow.py +49 -34
  5. {durable_workflow-2.28.0 → durable_workflow-2.30.0/src/durable_workflow.egg-info}/PKG-INFO +1 -1
  6. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow.egg-info/SOURCES.txt +1 -0
  7. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_business_replay_clock_parallel.py +183 -14
  8. durable_workflow-2.30.0/tests/test_business_replay_clock_selection.py +111 -0
  9. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_replay_clock.py +17 -8
  10. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_replay_regression_corpus.py +6 -0
  11. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/LICENSE +0 -0
  12. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/README.md +0 -0
  13. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/setup.cfg +0 -0
  14. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/__init__.py +0 -0
  15. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_activity_checkpoint.py +0 -0
  16. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_activity_lease.py +0 -0
  17. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_activity_process.py +0 -0
  18. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_avro.py +0 -0
  19. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_cancellation_scope.py +0 -0
  20. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_cancellation_scope_history.py +0 -0
  21. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_capabilities_digest.py +0 -0
  22. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_condition_fingerprint.py +0 -0
  23. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_condition_input_order.py +0 -0
  24. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_continue_as_new.py +0 -0
  25. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_cooperative_cancellation.py +0 -0
  26. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_failure_reporting.py +0 -0
  27. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_metric_routes.py +0 -0
  28. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_parallel_group_policy.py +0 -0
  29. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_payload_protection.py +0 -0
  30. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_poll_transport.py +0 -0
  31. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_prepared_local_activity.py +0 -0
  32. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_query_task_authority.py +0 -0
  33. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_response_limit.py +0 -0
  34. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_sticky_workflow_cache.py +0 -0
  35. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_timeout_cleanup.py +0 -0
  36. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/_typed_values.py +0 -0
  37. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/activity.py +0 -0
  38. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/auth_composition.py +0 -0
  39. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/cancellation.py +0 -0
  40. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/client.py +0 -0
  41. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/errors.py +0 -0
  42. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/external_storage.py +0 -0
  43. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/external_task_input.py +0 -0
  44. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/external_task_result.py +0 -0
  45. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/history_bundle_verify.py +0 -0
  46. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/interceptors.py +0 -0
  47. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/invocable.py +0 -0
  48. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/metrics.py +0 -0
  49. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/nexus.py +0 -0
  50. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/prepared_payload.py +0 -0
  51. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/py.typed +0 -0
  52. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/python_conformance.py +0 -0
  53. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/replay_clock_math.py +0 -0
  54. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/replay_conformance.py +0 -0
  55. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/replay_verify.py +0 -0
  56. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/retry_policy.py +0 -0
  57. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/serializer.py +0 -0
  58. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/server_compatibility.json +0 -0
  59. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/sync.py +0 -0
  60. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/telemetry.py +0 -0
  61. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/telemetry_carrier.py +0 -0
  62. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/testing.py +0 -0
  63. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/worker.py +0 -0
  64. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/worker_session.py +0 -0
  65. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/worker_status.py +0 -0
  66. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow/workflow_updates_conformance.py +0 -0
  67. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow.egg-info/dependency_links.txt +0 -0
  68. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow.egg-info/entry_points.txt +0 -0
  69. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow.egg-info/requires.txt +0 -0
  70. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/src/durable_workflow.egg-info/top_level.txt +0 -0
  71. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_acceptance_authority.py +0 -0
  72. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_acceptance_consumer.py +0 -0
  73. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_acceptance_entry.py +0 -0
  74. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_cancellation_policies.py +0 -0
  75. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_checkpoint.py +0 -0
  76. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_context.py +0 -0
  77. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_exponential_retry.py +0 -0
  78. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_heartbeat_authority.py +0 -0
  79. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_heartbeat_unavailable.py +0 -0
  80. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_identity.py +0 -0
  81. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_install_inventory.py +0 -0
  82. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_lease_authority.py +0 -0
  83. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_lease_renewal.py +0 -0
  84. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_lease_worker.py +0 -0
  85. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_process.py +0 -0
  86. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_retry_cap_cell.py +0 -0
  87. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_retry_info.py +0 -0
  88. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_run_closed_refusal.py +0 -0
  89. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_activity_worker_lost.py +0 -0
  90. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_auth_composition.py +0 -0
  91. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_avro_value_benchmark.py +0 -0
  92. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_avro_value_protocol.py +0 -0
  93. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_business_replay_clock.py +0 -0
  94. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_business_replay_clock_child.py +0 -0
  95. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_business_replay_clock_entry.py +0 -0
  96. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_business_replay_clock_query_attestation.py +0 -0
  97. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_business_replay_clock_redrive.py +0 -0
  98. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_business_replay_clock_sequence_claims.py +0 -0
  99. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_cancellation_cause.py +0 -0
  100. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_cancellation_context.py +0 -0
  101. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_cancellation_remaining_time.py +0 -0
  102. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_cancellation_scope_admission.py +0 -0
  103. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_cancellation_scope_authoring.py +0 -0
  104. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_cancellation_scope_boundary.py +0 -0
  105. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_cancellation_scope_opening.py +0 -0
  106. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_capabilities_digest.py +0 -0
  107. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_capabilities_digest_unknown.py +0 -0
  108. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_checkpointed_batch_example.py +0 -0
  109. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_child_workflow_policies.py +0 -0
  110. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_ci_checkout.py +0 -0
  111. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_ci_integration_endpoint.py +0 -0
  112. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_client.py +0 -0
  113. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_client_iterators.py +0 -0
  114. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_client_payload_protection.py +0 -0
  115. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_client_telemetry.py +0 -0
  116. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_client_timeouts.py +0 -0
  117. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_coalescing_signal_timer_replay.py +0 -0
  118. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_codec_regression_corpus.py +0 -0
  119. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_command_keys_acceptance.py +0 -0
  120. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_command_keys_captured_inputs.py +0 -0
  121. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_command_keys_container_ownership.py +0 -0
  122. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_command_keys_workspace.py +0 -0
  123. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_committed_cancellation_scope_descendants.py +0 -0
  124. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_committed_cancellation_scope_groups.py +0 -0
  125. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_committed_cancellation_scope_history.py +0 -0
  126. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_committed_cancellation_scope_replay.py +0 -0
  127. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_completion_size_limit.py +0 -0
  128. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_condition_fingerprint.py +0 -0
  129. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_condition_occurrence_id.py +0 -0
  130. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_condition_replay_drift.py +0 -0
  131. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_continue_as_new_target.py +0 -0
  132. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_control_plane_parity_fixtures.py +0 -0
  133. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_cooperative_cancellation.py +0 -0
  134. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_cooperative_cancellation_client.py +0 -0
  135. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_cooperative_cancellation_worker.py +0 -0
  136. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_cooperative_remote_worker.py +0 -0
  137. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_docs_release_channel.py +0 -0
  138. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_docstring_cross_references.py +0 -0
  139. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_durable_selection.py +0 -0
  140. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_empty_callback_failure.py +0 -0
  141. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_errors.py +0 -0
  142. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_external_storage.py +0 -0
  143. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_external_task_input.py +0 -0
  144. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_external_task_result.py +0 -0
  145. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_failure_reporting.py +0 -0
  146. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_generator_lifecycle.py +0 -0
  147. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_golden_history_replay.py +0 -0
  148. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_history_bundle_pruned.py +0 -0
  149. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_history_bundle_schema2.py +0 -0
  150. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_history_bundle_verify.py +0 -0
  151. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_history_event_contract.py +0 -0
  152. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_invocable.py +0 -0
  153. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_local_activity_backoff.py +0 -0
  154. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_local_failure_reporting.py +0 -0
  155. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_message_streams.py +0 -0
  156. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_metric_routes.py +0 -0
  157. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_metrics.py +0 -0
  158. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_native_timer_redrive_cell.py +0 -0
  159. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_native_timer_redrive_clock.py +0 -0
  160. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_nexus_durable_wait.py +0 -0
  161. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_nexus_namespace.py +0 -0
  162. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_nexus_wire.py +0 -0
  163. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_order_processing_example.py +0 -0
  164. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_ordered_condition_input.py +0 -0
  165. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_parallel_completion_order_replay.py +0 -0
  166. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_parallel_failure_order.py +0 -0
  167. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_parallel_group_boundaries.py +0 -0
  168. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_parallel_group_policy.py +0 -0
  169. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_parallel_member_failure_open_siblings.py +0 -0
  170. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_parallel_saga_authoring.py +0 -0
  171. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_patch_history.py +0 -0
  172. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_payload_policy_refresh.py +0 -0
  173. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_payload_protection.py +0 -0
  174. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_pending_operation_replay.py +0 -0
  175. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_physical_command_key_readback.py +0 -0
  176. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_poll_failure_backoff.py +0 -0
  177. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_poll_transport.py +0 -0
  178. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_portal_source_split.py +0 -0
  179. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_prepared_local_activity_client.py +0 -0
  180. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_prepared_local_activity_groups.py +0 -0
  181. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_prepared_local_activity_policies.py +0 -0
  182. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_prepared_local_activity_worker.py +0 -0
  183. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_protected_workflow_replay.py +0 -0
  184. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_public_boundary_scanner.py +0 -0
  185. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_publish_workflow_isolation.py +0 -0
  186. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_published_activity_acceptance.py +0 -0
  187. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_published_pagination_evidence.py +0 -0
  188. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_pypi_project_surface.py +0 -0
  189. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_python_conformance.py +0 -0
  190. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_queries.py +0 -0
  191. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_query_task_authority.py +0 -0
  192. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_query_timeout_retry.py +0 -0
  193. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_quiesced_snapshot.py +0 -0
  194. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_readme_quickstart.py +0 -0
  195. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_redrive_call_ledger.py +0 -0
  196. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_redrive_replay.py +0 -0
  197. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_redrive_successor_evidence.py +0 -0
  198. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_registration_ambiguity.py +0 -0
  199. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_release_metadata.py +0 -0
  200. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_release_promotion.py +0 -0
  201. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_replay.py +0 -0
  202. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_replay_conformance.py +0 -0
  203. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_replay_verify.py +0 -0
  204. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_response_body_limit.py +0 -0
  205. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_result_continue_as_new.py +0 -0
  206. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_retry_cap_download.py +0 -0
  207. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_retry_cap_workflow.py +0 -0
  208. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_retry_policy.py +0 -0
  209. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_run_activities.py +0 -0
  210. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_run_cancellation_scope_replay.py +0 -0
  211. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_run_closed_settlement_replay.py +0 -0
  212. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_runtime_external_payload_transport.py +0 -0
  213. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_schedule_origin.py +0 -0
  214. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_schedules.py +0 -0
  215. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_scoped_run_cancellation_context.py +0 -0
  216. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_sdk_metrics_contract.py +0 -0
  217. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_search_attribute_replay_identity.py +0 -0
  218. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_serializer.py +0 -0
  219. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_signal_external_workflow.py +0 -0
  220. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_signal_with_start.py +0 -0
  221. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_signals.py +0 -0
  222. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_sleep.py +0 -0
  223. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_standalone_activity_client.py +0 -0
  224. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_static_credential_validation.py +0 -0
  225. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_sticky_execution.py +0 -0
  226. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_sticky_history_suffix.py +0 -0
  227. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_storage_admission.py +0 -0
  228. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_sync.py +0 -0
  229. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_sync_activities.py +0 -0
  230. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_synthetic_command_key_readback.py +0 -0
  231. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_telemetry.py +0 -0
  232. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_telemetry_carrier.py +0 -0
  233. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_testing_failures.py +0 -0
  234. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_testing_harness.py +0 -0
  235. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_testing_nexus.py +0 -0
  236. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_threaded_heartbeat_example.py +0 -0
  237. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_timeout_cleanup.py +0 -0
  238. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_tls_trust.py +0 -0
  239. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_transport_diagnostics.py +0 -0
  240. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_typed_values.py +0 -0
  241. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_typed_workflow_values.py +0 -0
  242. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_update_outcome.py +0 -0
  243. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_update_signal_condition_replay.py +0 -0
  244. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_updates.py +0 -0
  245. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_wait_condition.py +0 -0
  246. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker.py +0 -0
  247. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker_deregistration.py +0 -0
  248. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker_observation.py +0 -0
  249. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker_session.py +0 -0
  250. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker_startup_buffered.py +0 -0
  251. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker_startup_raw.py +0 -0
  252. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker_startup_read_budget.py +0 -0
  253. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker_startup_snapshot.py +0 -0
  254. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker_status.py +0 -0
  255. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker_telemetry_wire.py +0 -0
  256. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker_transient_5xx_retry.py +0 -0
  257. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_worker_transient_runtime.py +0 -0
  258. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_workflow_entry_arguments.py +0 -0
  259. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_workflow_entrypoint_validation.py +0 -0
  260. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_workflow_handler_validation.py +0 -0
  261. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_workflow_identity.py +0 -0
  262. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_workflow_result_timeout.py +0 -0
  263. {durable_workflow-2.28.0 → durable_workflow-2.30.0}/tests/test_workflow_streams.py +0 -0
  264. {durable_workflow-2.28.0 → durable_workflow-2.30.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.28.0
3
+ Version: 2.30.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.28.0"
7
+ version = "2.30.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.28.0"
86
- registry-version = "2.28.0"
85
+ product-train = "2.30.0"
86
+ registry-version = "2.30.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"
@@ -234,10 +234,10 @@ def _group_payload_matches(payload: Mapping[str, Any], expected: Sequence[Mappin
234
234
  ) for field in _GROUP_FIELDS)
235
235
 
236
236
 
237
- def _group_event_time(event: Mapping[str, Any], *, public_timer_history: bool = False) -> datetime | None:
237
+ def _group_event_time(event: Mapping[str, Any], *, public_history: bool = False) -> datetime | None:
238
238
  # Core's settled all-group paths use these model fields.
239
- if public_timer_history and "recorded_at" not in event and "created_at" not in event:
240
- # Native's public history exports the same recorded timer instant as timestamp.
239
+ if public_history and "recorded_at" not in event and "created_at" not in event:
240
+ # Native exports the same recorded parent-history instant as timestamp.
241
241
  return _time(event.get("timestamp"))
242
242
  value = event.get("recorded_at")
243
243
  time = _time(event.get("created_at") if value is None else value)
@@ -247,16 +247,23 @@ def _group_event_time(event: Mapping[str, Any], *, public_timer_history: bool =
247
247
 
248
248
 
249
249
  def _group_time(
250
- events: Sequence[Mapping[str, Any]], failed_member: int | None, success_kind: str,
250
+ events: Sequence[tuple[Mapping[str, Any], str]], failed_member: int | None,
251
251
  ) -> datetime | None:
252
252
  candidates: list[tuple[int, datetime, int]] = []
253
- for offset, event in enumerate(events):
253
+ for offset, (event, success_kind) in enumerate(events):
254
254
  failed = _kind(event) != success_kind
255
255
  if failed != (failed_member is not None):
256
256
  if failed:
257
257
  return None
258
258
  continue # Successful siblings do not choose the failure clock.
259
- time = _group_event_time(event, public_timer_history=success_kind == "TimerFired")
259
+ # Native's public history projects recorded_at as timestamp for every
260
+ # event type. A bare activity timestamp without that row shape is
261
+ # still insufficient to prove the consumed instant.
262
+ sequence = event.get("sequence")
263
+ native_export = type(sequence) is int and sequence > 0 and "principal" in event
264
+ time = _group_event_time(
265
+ event, public_history=native_export or success_kind in {"TimerFired", "ChildRunCompleted"},
266
+ )
260
267
  milliseconds = canonical_milliseconds(time) if time is not None else None
261
268
  if time is None or milliseconds is None:
262
269
  return None
@@ -413,39 +420,62 @@ class BusinessReplayClock:
413
420
  self._pending = self._current
414
421
  self._pending_entry = self._current_entry
415
422
 
423
+ def observe_selection(self, marker_index: int, terminal_index: int | None, base_sequence: int) -> None:
424
+ """Use the matched decision when it follows its unique winner terminal."""
425
+ self._pending = (None, None)
426
+ if terminal_index is None or terminal_index >= marker_index:
427
+ return
428
+ if self._redrive_declared and (self._resume_step is None or base_sequence < self._resume_step):
429
+ return
430
+ marker = self.events[marker_index]
431
+ payload = marker["payload"]
432
+ if (_kind(marker) != "SelectionResolved" or any(key in payload for key in _REUSE_FIELDS)
433
+ or _kind(self.events[terminal_index]) != payload.get("resolution_event_type")):
434
+ return
435
+ self._pending = (marker_index, _time(_recorded_value(marker)))
436
+
416
437
  def observe_parallel_group(
417
- self, members: Sequence[_GroupMember], failed_member: int | None, *, family: str, reconstruction: bool,
438
+ self, members: Sequence[tuple[str, _GroupMember]], failed_member: int | None, *, reconstruction: bool,
418
439
  ) -> None:
419
440
  self._pending = (None, None)
420
441
  # Core's successful query group-send supplies no new time. Body and
421
442
  # callback reconstruction cannot borrow an executor-only aggregate.
422
- if reconstruction or not members or not members[0][3]:
443
+ if reconstruction or not members:
444
+ return
445
+ _, first = members[0]
446
+ first_path = first[3]
447
+ if not first_path:
423
448
  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):
449
+ root = first_path[0]
450
+ families = {family for family, _ in members}
451
+ group_kind = next(iter(families)) if len(families) == 1 else "mixed"
452
+ if (root.get("parallel_group_base_sequence") != first[1]
453
+ or root.get("parallel_group_size") != len(members) or root.get("parallel_group_kind") != group_kind):
427
454
  return
428
- timer_group = family == "timer"
429
- boundary = self._timer_group_boundary if timer_group else self._activity_group_boundary
430
- identity_field = "timer_id" if timer_group else "activity_execution_id"
431
- events: list[Mapping[str, Any]] = []
432
- identities: set[str] = set()
433
- for offset, member in enumerate(members):
455
+ boundaries = {
456
+ "activity": (self._activity_group_boundary, "activity_execution_id", "ActivityCompleted"),
457
+ "timer": (self._timer_group_boundary, "timer_id", "TimerFired"),
458
+ "child": (self._child_group_boundary, "child_call_id", "ChildRunCompleted"),
459
+ }
460
+ events: list[tuple[Mapping[str, Any], str]] = []
461
+ identities: set[tuple[str, str]] = set()
462
+ for offset, (family, member) in enumerate(members):
463
+ proof = boundaries.get(family)
434
464
  path = member[3]
435
465
  expected_root = {**root, "parallel_group_index": offset}
436
- if (not path or not _group_entry_matches(path[0], expected_root)
437
- or member[1] != members[0][1] + offset):
466
+ if (proof is None or not path or not _group_entry_matches(path[0], expected_root)
467
+ or member[1] != first[1] + offset):
438
468
  return
469
+ boundary, identity_field, success_kind = proof
439
470
  event = boundary(member)
440
471
  if event is None:
441
472
  return
442
- identity = event["payload"][identity_field]
473
+ identity = family, event["payload"][identity_field]
443
474
  if identity in identities:
444
475
  return
445
476
  identities.add(identity)
446
- events.append(event)
447
- success_kind = "TimerFired" if timer_group else "ActivityCompleted"
448
- self._pending = (None, _group_time(events, failed_member, success_kind))
477
+ events.append((event, success_kind))
478
+ self._pending = (None, _group_time(events, failed_member))
449
479
 
450
480
  def observe_propagated_activity_failure(self, member: _GroupMember, *, reconstruction: bool) -> None:
451
481
  """Use only the qualified first-recorded failure of an explicit group."""
@@ -534,7 +564,18 @@ class BusinessReplayClock:
534
564
  return self._reused_time(payload, family, sequence)
535
565
  return _time(_recorded_value(event))
536
566
 
537
- def _child_boundary(self, index: int, sequence: int) -> bool:
567
+ def _child_group_boundary(self, member: _GroupMember) -> Mapping[str, Any] | None:
568
+ index, sequence, workflow_type, path = member
569
+ if (index is None or not path
570
+ or self._redrive_declared and (self._resume_step is None or sequence < self._resume_step)
571
+ or not self._child_boundary(index, sequence, path)):
572
+ return None
573
+ event = self.events[index]
574
+ return event if event["payload"]["child_workflow_type"] == workflow_type else None
575
+
576
+ def _child_boundary(
577
+ self, index: int, sequence: int, path: Sequence[Mapping[str, Any]] | None = None,
578
+ ) -> bool:
538
579
  indices = self._by_sequence.get(sequence, [])
539
580
  if len(indices) not in (2, 3) or indices[-1] != index:
540
581
  return False
@@ -550,14 +591,19 @@ class BusinessReplayClock:
550
591
  return False
551
592
  if self._child_calls.get(payload["child_call_id"]) != indices:
552
593
  return False
553
- return all(self._child_row(position, payload) for position in indices)
594
+ return all(self._child_row(position, sequence, payload, path) for position in indices)
554
595
 
555
- def _child_row(self, index: int, terminal: Mapping[str, Any]) -> bool:
596
+ def _child_row(
597
+ self, index: int, sequence: int, terminal: Mapping[str, Any], path: Sequence[Mapping[str, Any]] | None,
598
+ ) -> bool:
556
599
  payload = self.events[index].get("payload")
557
- return (self._scalar_row(index, _CHILD_FAMILY, "child_call_id", terminal["child_call_id"], _CHILD_EVENTS)
558
- and isinstance(payload, Mapping)
559
- and payload.get("workflow_type", terminal["child_workflow_type"]) == terminal["child_workflow_type"]
560
- and all(payload.get(key) == terminal[key] for key in _CHILD_IDENTITIES))
600
+ if (not isinstance(payload, Mapping) or _sequence(payload) != sequence
601
+ or payload.get("workflow_type", terminal["child_workflow_type"]) != terminal["child_workflow_type"]
602
+ or any(payload.get(key) != terminal[key] for key in _CHILD_IDENTITIES)):
603
+ return False
604
+ if path is not None:
605
+ return _group_payload_matches(payload, path)
606
+ return self._scalar_row(index, _CHILD_FAMILY, "child_call_id", terminal["child_call_id"], _CHILD_EVENTS)
561
607
 
562
608
  def _reused_time(self, payload: Mapping[str, Any], family: str, sequence: int) -> datetime | None:
563
609
  if (self._source_run is None or payload.get("reused_from_run_id") != self._source_run
@@ -3335,8 +3335,10 @@ 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. Group success
3341
+ retains the selected event's full precision;
3340
3342
  matching caught failure uses canonical-v1 integer milliseconds.
3341
3343
  Ordinary entry reads the run's canonical start from the workflow
3342
3344
  task's ``replay_clock`` carrier (``WorkerReplayClock`` v1). Entry is
@@ -5978,9 +5980,12 @@ def _replay_state(
5978
5980
  start_payload = ev.get("payload")
5979
5981
  if not isinstance(start_payload, Mapping):
5980
5982
  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"
5983
+ if "timestamp" in start_payload:
5984
+ ts, clock_source = start_payload["timestamp"], "payload.timestamp"
5985
+ else:
5986
+ # History pages expose the recorded event time as timestamp.
5987
+ clock_source = "timestamp" if "recorded_at" not in ev and "timestamp" in ev else "recorded_at"
5988
+ ts = ev.get(clock_source)
5984
5989
  # A redriven run replays from the failed run's start time, as Core does.
5985
5990
  if start_payload.get("recovery_kind") == "redrive" and "replayed_started_at" in start_payload:
5986
5991
  ts = start_payload.get("replayed_started_at")
@@ -6131,8 +6136,7 @@ def _replay_state(
6131
6136
  selection_opening_payloads: dict[int, dict[str, Any]] = {}
6132
6137
  selection_condition_terminal_payloads: dict[int, list[dict[str, Any]]] = {}
6133
6138
  selection_condition_sequences: dict[str, int] = {}
6134
- selection_markers: list[dict[str, Any]] = []
6135
- selection_marker_indexes: list[int] = []
6139
+ selection_markers: list[tuple[dict[str, Any], int]] = []
6136
6140
  selection_marker_cursor = 0
6137
6141
  consumed_selection_sequences: set[int] = set()
6138
6142
  cancelled_selection_members: dict[tuple[str, int], dict[str, Any]] = {}
@@ -6378,7 +6382,7 @@ def _replay_state(
6378
6382
  detail="durable selection member history does not match replayed workflow code",
6379
6383
  )
6380
6384
  if selection_marker_cursor < len(selection_markers):
6381
- marker = selection_markers[selection_marker_cursor]
6385
+ marker, _ = selection_markers[selection_marker_cursor]
6382
6386
  marker_sequence = (
6383
6387
  _parallel_group_integer(marker, "selection_group_base_sequence")
6384
6388
  or _parallel_group_integer(marker, "member_base_sequence")
@@ -6702,8 +6706,7 @@ def _replay_state(
6702
6706
  wait_resolutions[wait_id] = "timed_out"
6703
6707
  elif etype == "SelectionResolved":
6704
6708
  if isinstance(payload.get("selection_group_id"), str):
6705
- selection_markers.append(dict(payload))
6706
- selection_marker_indexes.append(event_index)
6709
+ selection_markers.append((dict(payload), event_index))
6707
6710
  elif etype == "SelectionOperationCancelled":
6708
6711
  group_id = payload.get("selection_group_id")
6709
6712
  member_base = _parallel_group_integer(payload, "member_base_sequence")
@@ -6926,7 +6929,7 @@ def _replay_state(
6926
6929
  resolved_parallel_members,
6927
6930
  )
6928
6931
  selection_markers.sort(
6929
- key=lambda marker: _parallel_group_integer(marker, "selection_group_base_sequence") or 0
6932
+ key=lambda item: _parallel_group_integer(item[0], "selection_group_base_sequence") or 0,
6930
6933
  )
6931
6934
 
6932
6935
  signal_registry: dict[str, str] = getattr(workflow_cls, "__workflow_signals__", {}) or {}
@@ -7719,7 +7722,7 @@ def _replay_state(
7719
7722
  winner: DurableOperationHandle,
7720
7723
  group_base: int,
7721
7724
  group_size: int,
7722
- ) -> int:
7725
+ ) -> tuple[int, int | None]:
7723
7726
  expected = {
7724
7727
  "selection_group_id": winner.selection_group_id,
7725
7728
  "selection_group_base_sequence": group_base,
@@ -7773,9 +7776,12 @@ def _replay_state(
7773
7776
  "ConditionWaitTimedOut",
7774
7777
  }
7775
7778
  terminal_types = failure_types if outcome == "failed" else success_types
7776
- candidates: list[tuple[str, str, int]] = []
7777
- for event in events:
7779
+ candidates: list[tuple[str, str, int, int]] = []
7780
+ reference_count = 0
7781
+ for index, event in enumerate(events):
7778
7782
  event_type = _history_event_type(event)
7783
+ if event_type == resolution_type and (event.get("id") or event.get("event_id")) == resolution_id:
7784
+ reference_count += 1
7779
7785
  payload = event.get("payload") or {}
7780
7786
  if event_type not in terminal_types or not isinstance(payload, Mapping):
7781
7787
  continue
@@ -7793,7 +7799,7 @@ def _replay_state(
7793
7799
  "terminal selection history with a durable event id",
7794
7800
  [event_type or "<unknown>"],
7795
7801
  )
7796
- candidates.append((event_id, event_type, sequence))
7802
+ candidates.append((event_id, event_type, sequence, index))
7797
7803
 
7798
7804
  resolution = candidates[0] if outcome == "failed" and candidates else (
7799
7805
  candidates[-1] if candidates else None
@@ -7804,7 +7810,7 @@ def _replay_state(
7804
7810
  "SelectionResolved referencing the event that made its member terminal",
7805
7811
  ["SelectionResolved"],
7806
7812
  )
7807
- return resolution[2]
7813
+ return resolution[2], resolution[3] if reference_count == 1 else None
7808
7814
 
7809
7815
  def _annotate_selection(
7810
7816
  group: SelectGroup,
@@ -8720,10 +8726,10 @@ def _replay_state(
8720
8726
  cancellation_intent = boundary
8721
8727
  return _state(pending)
8722
8728
  if isinstance(cmd, SelectGroup):
8723
- marker = (
8729
+ marker, marker_index = (
8724
8730
  selection_markers[selection_marker_cursor]
8725
8731
  if selection_marker_cursor < len(selection_markers)
8726
- else None
8732
+ else (None, -1)
8727
8733
  )
8728
8734
  annotated, handles, shapes = _annotate_selection(cmd, marker)
8729
8735
  group_base = min(handle.base_sequence for handle in handles.values())
@@ -8811,10 +8817,10 @@ def _replay_state(
8811
8817
  "SelectionResolved member identity matching workflow code",
8812
8818
  ["SelectionResolved"],
8813
8819
  )
8814
- resolution_sequence = _validated_selection_resolution(
8820
+ resolution_sequence, terminal_index = _validated_selection_resolution(
8815
8821
  marker,
8816
8822
  winner,
8817
- min(handle.base_sequence for handle in handles.values()),
8823
+ group_base,
8818
8824
  len(annotated),
8819
8825
  )
8820
8826
  winner_offset = winner.base_sequence - group_base
@@ -8846,7 +8852,7 @@ def _replay_state(
8846
8852
  ["SelectionResolved"],
8847
8853
  detail="the committed winner has no terminal member history",
8848
8854
  )
8849
- _advance_cancellation_clock([selection_marker_indexes[selection_marker_cursor - 1]])
8855
+ _advance_cancellation_clock([marker_index])
8850
8856
  for sequence in range(
8851
8857
  winner.base_sequence,
8852
8858
  winner.base_sequence + winner.size,
@@ -8860,6 +8866,7 @@ def _replay_state(
8860
8866
  else:
8861
8867
  _ordered_condition_result(wait_id, ordered_wait, leaf.predicate)
8862
8868
  _release_ordered_condition_receivers(wait_id)
8869
+ ctx._business_clock.observe_selection(marker_index, terminal_index, group_base)
8863
8870
  next_value = SelectionResult(
8864
8871
  key=winner.key,
8865
8872
  index=winner.index,
@@ -8966,9 +8973,10 @@ def _replay_state(
8966
8973
  return _terminal_state(stop.value, include_pending=False)
8967
8974
  if all(isinstance(leaf, ScheduleActivity) for leaf in cmd):
8968
8975
  ctx._business_clock.observe_parallel_group(
8969
- [(step.history_index, step.workflow_sequence, leaf.activity_type, leaf._parallel_group_path)
8976
+ [("activity", (step.history_index, step.workflow_sequence, leaf.activity_type,
8977
+ leaf._parallel_group_path))
8970
8978
  for step, leaf in zip(consumed_steps, cmd, strict=True)],
8971
- None, family="activity", reconstruction=reconstruction_only,
8979
+ None, reconstruction=reconstruction_only,
8972
8980
  )
8973
8981
  else:
8974
8982
  ctx._business_clock.unavailable()
@@ -9013,22 +9021,29 @@ def _replay_state(
9013
9021
  group_typed_failure = error
9014
9022
  if not cmd:
9015
9023
  ctx._business_clock.preserve_boundary()
9016
- elif group_typed_failure is None and all(isinstance(leaf, ScheduleActivity) for leaf in cmd):
9024
+ elif group_typed_failure is None and all(
9025
+ isinstance(leaf, ScheduleActivity | StartTimer | StartChildWorkflow) for leaf in cmd
9026
+ ):
9017
9027
  selected_failure = next(
9018
9028
  (offset for offset, value in enumerate(vals) if failed is not None and value is failed),
9019
9029
  None,
9020
9030
  )
9031
+ clock_members = []
9032
+ for clock_step, leaf in zip(consumed_steps, cmd, strict=True):
9033
+ clock_target: str | int
9034
+ if isinstance(leaf, ScheduleActivity):
9035
+ family, clock_target = "activity", leaf.activity_type
9036
+ elif isinstance(leaf, StartTimer):
9037
+ family, clock_target = "timer", leaf.delay_seconds
9038
+ else:
9039
+ family, clock_target = "child", leaf.workflow_type
9040
+ clock_members.append((
9041
+ family,
9042
+ (clock_step.history_index, clock_step.workflow_sequence, clock_target,
9043
+ leaf._parallel_group_path),
9044
+ ))
9021
9045
  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,
9046
+ clock_members, selected_failure, reconstruction=reconstruction_only,
9032
9047
  )
9033
9048
  else:
9034
9049
  ctx._business_clock.unavailable()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: durable-workflow
3
- Version: 2.28.0
3
+ Version: 2.30.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
@@ -90,6 +90,7 @@ tests/test_business_replay_clock_entry.py
90
90
  tests/test_business_replay_clock_parallel.py
91
91
  tests/test_business_replay_clock_query_attestation.py
92
92
  tests/test_business_replay_clock_redrive.py
93
+ tests/test_business_replay_clock_selection.py
93
94
  tests/test_business_replay_clock_sequence_claims.py
94
95
  tests/test_cancellation_cause.py
95
96
  tests/test_cancellation_context.py
@@ -14,8 +14,14 @@ from durable_workflow import serializer, workflow
14
14
  from durable_workflow.errors import ActivityFailed, NonDeterministicReplayError, TypedValueError
15
15
  from durable_workflow.replay_clock_math import canonical_milliseconds, from_canonical_milliseconds
16
16
  from durable_workflow.workflow import WorkflowContext, query_state, replay
17
- from tests.business_clock_workflows import ParallelTimerBusinessClockWorkflow, clock_text
17
+ from tests.business_clock_workflows import (
18
+ ParallelChildBusinessClockWorkflow,
19
+ ParallelMixedBusinessClockWorkflow,
20
+ ParallelTimerBusinessClockWorkflow,
21
+ clock_text,
22
+ )
18
23
  from tests.test_business_replay_clock import result
24
+ from tests.test_business_replay_clock_child import child_rows
19
25
 
20
26
  START = "2026-01-01T00:00:00.000000+00:00"
21
27
  FIRST = "2026-01-01T00:00:03.123100+00:00"
@@ -199,6 +205,102 @@ def test_unproved_timer_group_keeps_its_results_without_certifying_time(field: s
199
205
  assert result(rows, ParallelTimerBusinessClockWorkflow) == [[None, None], None, None]
200
206
 
201
207
 
208
+ def child_group_history(
209
+ times: list[str] | None = None, *, order: tuple[int, ...] = (1, 0),
210
+ failures: dict[int, str] | None = None, nested: bool = False,
211
+ ) -> list[dict[str, Any]]:
212
+ times = [FIRST, TIED] if times is None else times
213
+ rows: list[dict[str, Any]] = [{"event_type": "WorkflowStarted", "recorded_at": START, "payload": {}}]
214
+ terminals = []
215
+ for offset, time in enumerate(times):
216
+ kind = (failures or {}).get(offset, "ChildRunCompleted")
217
+ lifecycle = child_rows(offset + 1, kind, time)
218
+ path = [
219
+ {**entry, "parallel_group_kind": "child",
220
+ "parallel_group_id": entry["parallel_group_id"].replace("parallel-activities:", "parallel-children:")}
221
+ for entry in group_path(1, len(times), offset, nested=nested)
222
+ ]
223
+ for row in lifecycle:
224
+ row["payload"].update(deepcopy(path[-1]), parallel_group_path=deepcopy(path))
225
+ if kind == "ChildRunCompleted":
226
+ lifecycle[-1]["payload"]["result"] = serializer.envelope(f"child-value-{offset}")
227
+ rows.extend(lifecycle[:-1])
228
+ terminals.append(lifecycle[-1])
229
+ rows.extend(terminals[offset] for offset in order)
230
+ return rows
231
+
232
+
233
+ @pytest.mark.parametrize("order", [(0, 1), (1, 0)])
234
+ def test_child_group_preserves_authored_ties_and_excludes_later_history(order: tuple[int, ...]) -> None:
235
+ rows = child_group_history(order=order)
236
+ rows.append({"event_type": "WorkflowTaskCompleted", "recorded_at": "2099-01-01T00:00:00Z", "payload": {}})
237
+ original = deepcopy(rows)
238
+ wanted = {"values": ["child-value-0", "child-value-1"], "failure": None, "clock": FIRST, "repeated": FIRST}
239
+ assert result(rows, ParallelChildBusinessClockWorkflow) == wanted
240
+ assert result(rows, ParallelChildBusinessClockWorkflow) == wanted
241
+ assert rows == original
242
+ for query in ("clock", "body-clock"):
243
+ assert query_state(ParallelChildBusinessClockWorkflow, rows, [], query, payload_codec="avro") is None
244
+
245
+
246
+ def test_nested_child_group_uses_the_latest_consumed_member_from_public_history() -> None:
247
+ class Nested(ParallelChildBusinessClockWorkflow):
248
+ size = 3
249
+ nested = True
250
+
251
+ later = "2026-01-01T00:00:03.123500+00:00"
252
+ rows = child_group_history([FIRST, TIED, later], order=(2, 1, 0), nested=True)
253
+ for row in rows[1:]:
254
+ row["timestamp"] = row.pop("recorded_at")
255
+ observed = result(rows, Nested)
256
+ assert observed == {"values": ["child-value-0", ["child-value-1", "child-value-2"]],
257
+ "failure": None, "clock": later, "repeated": later}
258
+ rows[-3]["recorded_at"] = FIRST
259
+ assert result(rows, Nested) == {**observed, "clock": None, "repeated": None}
260
+
261
+
262
+ @pytest.mark.parametrize(("terminal", "failure_kind"), [
263
+ ("ChildRunFailed", "child_workflow"), ("ChildRunCancelled", "cancelled"), ("ChildRunTerminated", "terminated"),
264
+ ])
265
+ def test_child_group_failure_keeps_its_exception_and_clock(terminal: str, failure_kind: str) -> None:
266
+ rows = child_group_history([FIRST, "2099-01-01T00:00:00Z"], failures={0: terminal})
267
+ clock = "2026-01-01T00:00:03.123000+00:00"
268
+ observed = result(rows, ParallelChildBusinessClockWorkflow)
269
+ assert observed == {"values": None, "failure": [failure_kind, "run-1", "recorded child failure"],
270
+ "clock": clock, "repeated": clock}
271
+
272
+
273
+ def test_child_group_keeps_legacy_failure_when_a_different_member_would_set_the_clock() -> None:
274
+ later = "2026-01-01T00:00:03.130000+00:00"
275
+ rows = child_group_history([later, FIRST], failures={0: "ChildRunFailed", 1: "ChildRunFailed"})
276
+ assert result(rows, ParallelChildBusinessClockWorkflow) == {
277
+ "values": None, "failure": ["child_workflow", "run-1", "recorded child failure"],
278
+ "clock": None, "repeated": None,
279
+ }
280
+
281
+
282
+ @pytest.mark.parametrize(("field", "replacement"), [
283
+ ("child_workflow_run_id", "unexpected-run"), ("child_call_id", "unexpected-call"),
284
+ ("child_workflow_instance_id", "unexpected-instance"), ("parallel_group_path", []),
285
+ ])
286
+ def test_unproved_child_lifecycle_preserves_results_without_clock(field: str, replacement: Any) -> None:
287
+ rows = child_group_history()
288
+ if field == "parallel_group_path":
289
+ rows[1]["payload"].pop("parallel_group_id")
290
+ rows[1]["payload"][field] = replacement
291
+ assert result(rows, ParallelChildBusinessClockWorkflow) == {
292
+ "values": ["child-value-0", "child-value-1"], "failure": None, "clock": None, "repeated": None,
293
+ }
294
+
295
+
296
+ def test_two_different_child_calls_can_share_the_target_run() -> None:
297
+ rows = child_group_history()
298
+ for row in rows[1:]:
299
+ if row["payload"]["sequence"] == 2:
300
+ row["payload"].update(child_workflow_instance_id="child-1", child_workflow_run_id="run-1")
301
+ assert result(rows, ParallelChildBusinessClockWorkflow)["clock"] == FIRST
302
+
303
+
202
304
  @pytest.mark.parametrize("order", [(0, 1), (1, 0)])
203
305
  def test_success_uses_authored_tie_order_and_full_precision_not_arrival_or_history_max(order: tuple[int, ...]) -> None:
204
306
  rows = history(order=order)
@@ -414,26 +516,93 @@ def test_pending_and_unmarked_legacy_groups_do_not_receive_a_proved_clock() -> N
414
516
  assert result(rows, ParallelProbe)["clock"] is None
415
517
 
416
518
 
417
- def test_mixed_and_recorded_local_groups_remain_explicitly_unqualified() -> None:
418
- class Mixed:
419
- def run(self, ctx: WorkflowContext): # type: ignore[no-untyped-def]
420
- values = yield [ctx.schedule_activity("group.0", []), ctx.start_timer(1)]
421
- return values, clock_text(ctx)
422
-
423
- rows = history()
519
+ def mixed_group_history(
520
+ times: list[str], *, activity_failed: bool = False, child_failed: bool = False,
521
+ order: tuple[int, ...] = (2, 1, 0),
522
+ ) -> list[dict[str, Any]]:
523
+ rows = history(times, order=order, failures={0} if activity_failed else None)
524
+ child = child_rows(3, "ChildRunFailed" if child_failed else "ChildRunCompleted", times[2])
525
+ mixed = [rows[0]]
424
526
  for row in rows[1:]:
425
527
  payload = row["payload"]
426
- payload["parallel_group_id"] = "parallel-calls:1:2"
427
- payload["parallel_group_kind"] = "mixed"
428
- for entry in payload["parallel_group_path"]:
429
- entry.update(parallel_group_id="parallel-calls:1:2", parallel_group_kind="mixed")
528
+ group = {**payload["parallel_group_path"][0], "parallel_group_id": "parallel-calls:1:3",
529
+ "parallel_group_kind": "mixed"}
530
+ payload.update(group, parallel_group_path=[group])
430
531
  if payload["sequence"] == 2:
431
532
  row["event_type"] = "TimerScheduled" if row["event_type"] == "ActivityScheduled" else "TimerFired"
432
533
  for field in ("activity_type", "activity_execution_id", "result"):
433
534
  payload.pop(field, None)
434
- payload.update(timer_kind="durable_timer", timer_id="group-timer", delay_seconds=1)
435
- assert result(rows, Mixed) == (["value-0", None], None)
535
+ payload.update(timer_id="group-timer", delay_seconds=1)
536
+ if payload["sequence"] == 3:
537
+ replacements = child[:-1] if row["event_type"] == "ActivityScheduled" else child[-1:]
538
+ for replacement in replacements:
539
+ replacement["payload"].pop("reused_recorded_at", None)
540
+ replacement["payload"].update(group, parallel_group_path=[group])
541
+ mixed.extend(replacements)
542
+ else:
543
+ mixed.append(row)
544
+ return mixed
545
+
546
+
547
+ @pytest.mark.parametrize("order", [(0, 1, 2), (2, 1, 0)])
548
+ @pytest.mark.parametrize("timer_time,expected", [(TIED, FIRST), ("2026-01-01T00:00:03.123500+00:00",
549
+ "2026-01-01T00:00:03.123500+00:00")])
550
+ def test_mixed_remote_group_uses_only_the_proved_consumed_members(
551
+ order: tuple[int, ...], timer_time: str, expected: str,
552
+ ) -> None:
553
+ rows = mixed_group_history([FIRST, timer_time, TIED], order=order)
554
+ rows.append({"event_type": "WorkflowTaskCompleted", "recorded_at": "2099-01-01T00:00:00Z", "payload": {}})
555
+ original = deepcopy(rows)
556
+ wanted = {"values": ["value-0", None, "recorded"], "failure": None, "clock": expected,
557
+ "repeated": expected, "legacy": START}
558
+ assert result(rows, ParallelMixedBusinessClockWorkflow) == wanted
559
+ assert result(rows, ParallelMixedBusinessClockWorkflow) == wanted
560
+ assert rows == original
561
+ for query in ("body-clock", "clock"):
562
+ assert query_state(ParallelMixedBusinessClockWorkflow, rows, [], query, payload_codec="avro") is None
563
+
564
+
565
+ def test_unproved_mixed_timer_keeps_the_result_without_certifying_time() -> None:
566
+ rows = mixed_group_history([FIRST, TIED, TIED])
567
+ timer = next(row for row in rows if row["event_type"] == "TimerFired")
568
+ timer["payload"]["timer_kind"] = "durable_timer"
569
+ actual = result(rows, ParallelMixedBusinessClockWorkflow)
570
+ assert actual["values"] == ["value-0", None, "recorded"]
571
+ assert actual["clock"] is None
572
+
573
+
574
+ def test_mixed_group_clock_survives_the_native_public_history_projection() -> None:
575
+ rows = mixed_group_history([FIRST, TIED, TIED])
576
+ expected = result(rows, ParallelMixedBusinessClockWorkflow)
577
+ assert expected["clock"] == FIRST
578
+ for sequence, row in enumerate(rows[1:], start=2):
579
+ row["sequence"] = sequence
580
+ row["principal"] = None
581
+ row["timestamp"] = row.pop("recorded_at")
582
+ assert result(rows, ParallelMixedBusinessClockWorkflow) == expected
583
+
584
+ activity = next(row for row in rows if row["event_type"] == "ActivityCompleted")
585
+ activity.pop("principal")
586
+ assert result(rows, ParallelMixedBusinessClockWorkflow)["clock"] is None
587
+ activity["principal"] = None
588
+ activity["recorded_at"] = TIED
589
+ assert result(rows, ParallelMixedBusinessClockWorkflow)["clock"] is None
590
+
591
+
592
+ def test_mixed_group_retains_the_executors_selected_failure() -> None:
593
+ earlier_child = "2026-01-01T00:00:02.500400+00:00"
594
+ rows = mixed_group_history([FIRST, TIED, earlier_child], child_failed=True)
595
+ actual = result(rows, ParallelMixedBusinessClockWorkflow)
596
+ assert actual["failure"] == ["run-3", "recorded child failure"]
597
+ assert actual["clock"] == "2026-01-01T00:00:02.500000+00:00"
598
+
599
+ rows = mixed_group_history([FIRST, TIED, earlier_child], activity_failed=True, child_failed=True)
600
+ actual = result(rows, ParallelMixedBusinessClockWorkflow)
601
+ assert actual["failure"] == ["group.0", "failure-0"]
602
+ assert actual["clock"] is None
603
+
436
604
 
605
+ def test_recorded_local_group_remains_explicitly_unqualified() -> None:
437
606
  class Local:
438
607
  def run(self, ctx: WorkflowContext): # type: ignore[no-untyped-def]
439
608
  values = yield [ctx.local_activity("prepared.first", []), ctx.local_activity("prepared.second", [])]