durable-workflow 2.17.0__tar.gz → 2.17.2__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 (209) hide show
  1. {durable_workflow-2.17.0/src/durable_workflow.egg-info → durable_workflow-2.17.2}/PKG-INFO +1 -1
  2. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/pyproject.toml +3 -3
  3. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/__init__.py +2 -0
  4. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/cancellation.py +24 -4
  5. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/client.py +31 -4
  6. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/errors.py +32 -0
  7. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/replay_clock.py +13 -0
  8. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/worker.py +58 -0
  9. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/workflow.py +236 -7
  10. {durable_workflow-2.17.0 → durable_workflow-2.17.2/src/durable_workflow.egg-info}/PKG-INFO +1 -1
  11. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow.egg-info/SOURCES.txt +6 -0
  12. durable_workflow-2.17.2/tests/test_activity_run_closed_refusal.py +221 -0
  13. durable_workflow-2.17.2/tests/test_cancellation_cause.py +227 -0
  14. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_client.py +32 -0
  15. durable_workflow-2.17.2/tests/test_parallel_group_policy.py +397 -0
  16. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_publish_workflow_isolation.py +3 -1
  17. durable_workflow-2.17.2/tests/test_release_promotion.py +294 -0
  18. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_replay_regression_corpus.py +21 -1
  19. durable_workflow-2.17.2/tests/test_run_closed_settlement_replay.py +658 -0
  20. durable_workflow-2.17.2/tests/test_static_credential_validation.py +58 -0
  21. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/LICENSE +0 -0
  22. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/README.md +0 -0
  23. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/setup.cfg +0 -0
  24. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_activity_lease.py +0 -0
  25. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_activity_process.py +0 -0
  26. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_avro.py +0 -0
  27. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_cancellation_scope.py +0 -0
  28. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_cancellation_scope_history.py +0 -0
  29. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_condition_fingerprint.py +0 -0
  30. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_cooperative_cancellation.py +0 -0
  31. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_failure_reporting.py +0 -0
  32. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_metric_routes.py +0 -0
  33. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_poll_transport.py +0 -0
  34. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_prepared_local_activity.py +0 -0
  35. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_query_task_authority.py +0 -0
  36. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_sticky_workflow_cache.py +0 -0
  37. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/_typed_values.py +0 -0
  38. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/activity.py +0 -0
  39. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/auth_composition.py +0 -0
  40. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/external_storage.py +0 -0
  41. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/external_task_input.py +0 -0
  42. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/external_task_result.py +0 -0
  43. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/history_bundle_verify.py +0 -0
  44. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/interceptors.py +0 -0
  45. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/invocable.py +0 -0
  46. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/metrics.py +0 -0
  47. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/nexus.py +0 -0
  48. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/py.typed +0 -0
  49. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/python_conformance.py +0 -0
  50. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/replay_clock_math.py +0 -0
  51. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/replay_conformance.py +0 -0
  52. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/replay_verify.py +0 -0
  53. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/retry_policy.py +0 -0
  54. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/serializer.py +0 -0
  55. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/server_compatibility.json +0 -0
  56. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/sync.py +0 -0
  57. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/telemetry.py +0 -0
  58. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/telemetry_carrier.py +0 -0
  59. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/testing.py +0 -0
  60. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/worker_session.py +0 -0
  61. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/worker_status.py +0 -0
  62. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow/workflow_updates_conformance.py +0 -0
  63. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow.egg-info/dependency_links.txt +0 -0
  64. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow.egg-info/entry_points.txt +0 -0
  65. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow.egg-info/requires.txt +0 -0
  66. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/src/durable_workflow.egg-info/top_level.txt +0 -0
  67. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_activity_cancellation_policies.py +0 -0
  68. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_activity_context.py +0 -0
  69. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_activity_heartbeat_authority.py +0 -0
  70. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_activity_identity.py +0 -0
  71. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_activity_lease_authority.py +0 -0
  72. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_activity_lease_renewal.py +0 -0
  73. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_activity_lease_worker.py +0 -0
  74. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_activity_process.py +0 -0
  75. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_activity_retry_info.py +0 -0
  76. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_auth_composition.py +0 -0
  77. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_avro_value_benchmark.py +0 -0
  78. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_avro_value_protocol.py +0 -0
  79. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_business_replay_clock.py +0 -0
  80. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_business_replay_clock_child.py +0 -0
  81. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_business_replay_clock_parallel.py +0 -0
  82. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_business_replay_clock_redrive.py +0 -0
  83. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_business_replay_clock_sequence_claims.py +0 -0
  84. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_cancellation_context.py +0 -0
  85. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_cancellation_remaining_time.py +0 -0
  86. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_cancellation_scope_admission.py +0 -0
  87. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_cancellation_scope_authoring.py +0 -0
  88. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_cancellation_scope_boundary.py +0 -0
  89. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_cancellation_scope_opening.py +0 -0
  90. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_child_workflow_policies.py +0 -0
  91. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_ci_checkout.py +0 -0
  92. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_ci_integration_endpoint.py +0 -0
  93. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_client_iterators.py +0 -0
  94. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_client_telemetry.py +0 -0
  95. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_client_timeouts.py +0 -0
  96. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_codec_regression_corpus.py +0 -0
  97. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_committed_cancellation_scope_descendants.py +0 -0
  98. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_committed_cancellation_scope_groups.py +0 -0
  99. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_committed_cancellation_scope_history.py +0 -0
  100. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_committed_cancellation_scope_replay.py +0 -0
  101. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_completion_size_limit.py +0 -0
  102. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_condition_fingerprint.py +0 -0
  103. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_condition_occurrence_id.py +0 -0
  104. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_condition_replay_drift.py +0 -0
  105. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_control_plane_parity_fixtures.py +0 -0
  106. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_cooperative_cancellation.py +0 -0
  107. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_cooperative_cancellation_client.py +0 -0
  108. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_cooperative_cancellation_worker.py +0 -0
  109. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_cooperative_remote_worker.py +0 -0
  110. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_docs_release_channel.py +0 -0
  111. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_docstring_cross_references.py +0 -0
  112. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_durable_selection.py +0 -0
  113. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_empty_callback_failure.py +0 -0
  114. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_errors.py +0 -0
  115. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_external_storage.py +0 -0
  116. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_external_task_input.py +0 -0
  117. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_external_task_result.py +0 -0
  118. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_failure_reporting.py +0 -0
  119. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_generator_lifecycle.py +0 -0
  120. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_golden_history_replay.py +0 -0
  121. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_history_bundle_pruned.py +0 -0
  122. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_history_bundle_schema2.py +0 -0
  123. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_history_bundle_verify.py +0 -0
  124. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_history_event_contract.py +0 -0
  125. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_invocable.py +0 -0
  126. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_local_activity_backoff.py +0 -0
  127. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_local_failure_reporting.py +0 -0
  128. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_message_streams.py +0 -0
  129. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_metric_routes.py +0 -0
  130. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_metrics.py +0 -0
  131. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_nexus_durable_wait.py +0 -0
  132. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_nexus_namespace.py +0 -0
  133. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_nexus_wire.py +0 -0
  134. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_order_processing_example.py +0 -0
  135. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_parallel_completion_order_replay.py +0 -0
  136. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_parallel_saga_authoring.py +0 -0
  137. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_patch_history.py +0 -0
  138. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_pending_operation_replay.py +0 -0
  139. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_poll_failure_backoff.py +0 -0
  140. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_poll_transport.py +0 -0
  141. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_portal_source_split.py +0 -0
  142. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_prepared_local_activity_client.py +0 -0
  143. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_prepared_local_activity_groups.py +0 -0
  144. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_prepared_local_activity_policies.py +0 -0
  145. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_prepared_local_activity_worker.py +0 -0
  146. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_public_boundary_scanner.py +0 -0
  147. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_pypi_project_surface.py +0 -0
  148. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_python_conformance.py +0 -0
  149. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_queries.py +0 -0
  150. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_query_task_authority.py +0 -0
  151. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_query_timeout_retry.py +0 -0
  152. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_readme_quickstart.py +0 -0
  153. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_redrive_call_ledger.py +0 -0
  154. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_redrive_replay.py +0 -0
  155. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_redrive_successor_evidence.py +0 -0
  156. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_registration_ambiguity.py +0 -0
  157. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_release_metadata.py +0 -0
  158. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_replay.py +0 -0
  159. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_replay_clock.py +0 -0
  160. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_replay_conformance.py +0 -0
  161. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_replay_verify.py +0 -0
  162. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_retry_policy.py +0 -0
  163. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_run_activities.py +0 -0
  164. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_run_cancellation_scope_replay.py +0 -0
  165. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_runtime_external_payload_transport.py +0 -0
  166. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_schedules.py +0 -0
  167. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_scoped_run_cancellation_context.py +0 -0
  168. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_sdk_metrics_contract.py +0 -0
  169. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_search_attribute_replay_identity.py +0 -0
  170. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_serializer.py +0 -0
  171. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_signals.py +0 -0
  172. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_sleep.py +0 -0
  173. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_standalone_activity_client.py +0 -0
  174. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_sticky_execution.py +0 -0
  175. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_sticky_history_suffix.py +0 -0
  176. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_storage_admission.py +0 -0
  177. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_sync.py +0 -0
  178. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_sync_activities.py +0 -0
  179. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_telemetry.py +0 -0
  180. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_telemetry_carrier.py +0 -0
  181. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_testing_failures.py +0 -0
  182. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_testing_harness.py +0 -0
  183. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_testing_nexus.py +0 -0
  184. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_threaded_heartbeat_example.py +0 -0
  185. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_tls_trust.py +0 -0
  186. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_transport_diagnostics.py +0 -0
  187. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_typed_values.py +0 -0
  188. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_typed_workflow_values.py +0 -0
  189. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_update_outcome.py +0 -0
  190. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_update_signal_condition_replay.py +0 -0
  191. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_updates.py +0 -0
  192. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_wait_condition.py +0 -0
  193. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_worker.py +0 -0
  194. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_worker_deregistration.py +0 -0
  195. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_worker_observation.py +0 -0
  196. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_worker_session.py +0 -0
  197. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_worker_startup_buffered.py +0 -0
  198. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_worker_startup_raw.py +0 -0
  199. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_worker_startup_read_budget.py +0 -0
  200. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_worker_startup_snapshot.py +0 -0
  201. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_worker_status.py +0 -0
  202. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_worker_telemetry_wire.py +0 -0
  203. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_workflow_entry_arguments.py +0 -0
  204. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_workflow_entrypoint_validation.py +0 -0
  205. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_workflow_handler_validation.py +0 -0
  206. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_workflow_identity.py +0 -0
  207. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_workflow_result_timeout.py +0 -0
  208. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/tests/test_workflow_streams.py +0 -0
  209. {durable_workflow-2.17.0 → durable_workflow-2.17.2}/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.17.0
3
+ Version: 2.17.2
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.17.0"
7
+ version = "2.17.2"
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"
@@ -79,8 +79,8 @@ durable-workflow-replay-conformance = "durable_workflow.replay_conformance:main"
79
79
  durable-workflow-workflow-updates-conformance = "durable_workflow.workflow_updates_conformance:main"
80
80
 
81
81
  [tool.durable-workflow]
82
- product-train = "2.17.0"
83
- registry-version = "2.17.0"
82
+ product-train = "2.17.2"
83
+ registry-version = "2.17.2"
84
84
  supported-server-versions = "2.8.0"
85
85
  supported-server-release-baselines = { "2" = "2.8.0", "3" = "3.0.0" }
86
86
  worker-protocol-version = "1.20"
@@ -119,6 +119,7 @@ from .errors import (
119
119
  WorkflowTaskCompletionTooLarge,
120
120
  WorkflowTerminated,
121
121
  WorkflowTimedOut,
122
+ WorkflowTimeoutCleanupRequested,
122
123
  )
123
124
  from .external_storage import (
124
125
  EXTERNAL_PAYLOAD_REFERENCE_SCHEMA,
@@ -428,6 +429,7 @@ __all__ = [
428
429
  "WorkflowTaskCompletionTooLarge",
429
430
  "WorkflowTerminated",
430
431
  "WorkflowTimedOut",
432
+ "WorkflowTimeoutCleanupRequested",
431
433
  "EXTERNAL_TASK_INPUT_CONTRACT_SCHEMA",
432
434
  "EXTERNAL_TASK_INPUT_MEDIA_TYPE",
433
435
  "EXTERNAL_TASK_INPUT_SCHEMA",
@@ -68,6 +68,14 @@ def _text(snapshot: Mapping[str, Any], key: str) -> str:
68
68
  return value
69
69
 
70
70
 
71
+ CANCELLATION_CAUSE = "cancellation"
72
+ TIMEOUT_CAUSE = "timeout"
73
+
74
+
75
+ def _format_timestamp(value: datetime) -> str:
76
+ return value.isoformat(timespec="microseconds").replace("+00:00", "Z")
77
+
78
+
71
79
  def _timestamp(value: str) -> datetime:
72
80
  if not re.fullmatch(r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})", value):
73
81
  raise ValueError("cancellation timestamp requires an ISO date, time and timezone")
@@ -112,6 +120,8 @@ class CancellationContext:
112
120
  lineage: tuple[CancellationLineage, ...]
113
121
  _replay_clock: Callable[[], datetime] | None = field(default=None, repr=False, compare=False)
114
122
  scope_origin: ScopedCancellationContext | None = None
123
+ cause: str | None = None
124
+ """``"timeout"`` for a timeout-cleanup request, else ``None`` or ``"cancellation"`` (ordinary)."""
115
125
 
116
126
  def __post_init__(self) -> None:
117
127
  object.__setattr__(self, "requester", MappingProxyType(dict(self.requester)))
@@ -122,6 +132,11 @@ class CancellationContext:
122
132
  """The original immutable cleanup deadline."""
123
133
  return self.cleanup_deadline_at
124
134
 
135
+ @property
136
+ def is_timeout(self) -> bool:
137
+ """Whether the run's work deadline passed and this request opens its timeout cleanup."""
138
+ return self.cause == TIMEOUT_CAUSE
139
+
125
140
  def remaining(self) -> float:
126
141
  """Seconds left at the consumed replay boundary, clamped to zero.
127
142
 
@@ -194,10 +209,13 @@ class CancellationContext:
194
209
  raise ValueError("cancellation deadline must follow the original request")
195
210
  if scope_origin is not None:
196
211
  _assert_scope_origin(snapshot, scope_origin, normalized, normalized_requester, requested_at, deadline)
212
+ cause = snapshot.get("cause")
213
+ if cause is not None and cause not in (CANCELLATION_CAUSE, TIMEOUT_CAUSE):
214
+ raise ValueError("cancellation cause must be cancellation or timeout")
197
215
  return cls(
198
216
  request_id, root_request_id, root_instance_id, root_run_id, parent_request_id,
199
217
  reason, normalized_requester, _text(snapshot, "source"), requested_at, deadline, tuple(normalized),
200
- scope_origin=scope_origin,
218
+ scope_origin=scope_origin, cause=cause,
201
219
  )
202
220
 
203
221
  def to_dict(self) -> dict[str, Any]:
@@ -213,10 +231,12 @@ class CancellationContext:
213
231
  "reason": self.reason,
214
232
  "requester": dict(self.requester),
215
233
  "source": self.source,
216
- "requested_at": self.requested_at.isoformat(timespec="microseconds").replace("+00:00", "Z"),
217
- "cleanup_deadline_at": self.cleanup_deadline_at.isoformat(timespec="microseconds").replace("+00:00", "Z"),
234
+ "requested_at": _format_timestamp(self.requested_at),
235
+ "cleanup_deadline_at": _format_timestamp(self.cleanup_deadline_at),
218
236
  "lineage": [entry.to_dict() for entry in self.lineage],
219
237
  }
238
+ if self.cause is not None:
239
+ snapshot["cause"] = self.cause
220
240
  if self.scope_origin is not None:
221
241
  snapshot["scope_origin"] = self.scope_origin.to_dict()
222
242
  snapshot["scope_authority_deadline_at"] = snapshot["cleanup_deadline_at"]
@@ -239,7 +259,7 @@ class ScopedCancellationLineage:
239
259
  "workflow_instance_id": self.workflow_instance_id,
240
260
  "workflow_run_id": self.workflow_run_id,
241
261
  "scope_id": self.scope_id,
242
- "cleanup_deadline_at": self.cleanup_deadline_at.isoformat(timespec="microseconds").replace("+00:00", "Z"),
262
+ "cleanup_deadline_at": _format_timestamp(self.cleanup_deadline_at),
243
263
  }
244
264
 
245
265
 
@@ -22,6 +22,7 @@ import asyncio
22
22
  import contextlib
23
23
  import copy
24
24
  import hashlib
25
+ import json
25
26
  import json as json_module
26
27
  import math
27
28
  import os
@@ -1885,6 +1886,16 @@ def _request_body_bytes(request: httpx.Request) -> int | None:
1885
1886
  return None
1886
1887
 
1887
1888
 
1889
+ def _validate_static_credential(option: str, value: str | None) -> None:
1890
+ if not value:
1891
+ return
1892
+ # Python's extra whitespace code points are Cc controls, also forbidden here.
1893
+ # Validate the original value, including credentials masked by role fallback.
1894
+ if (value[0].isspace() or value[-1].isspace()
1895
+ or any(ord(char) <= 0x1F or 0x7F <= ord(char) <= 0x9F for char in value)):
1896
+ raise ValueError(f"{option} must not have edge whitespace or control characters")
1897
+
1898
+
1888
1899
  class Client:
1889
1900
  """Async HTTP client for Durable Workflow control-plane and worker APIs.
1890
1901
 
@@ -1897,6 +1908,9 @@ class Client:
1897
1908
  ``tls_context`` selects an explicit trust configuration. It must require
1898
1909
  certificate and hostname verification. Treat the context as read-only after
1899
1910
  construction; worker query clones and Nexus namespace views reuse it.
1911
+
1912
+ Static tokens must have no edge whitespace or control characters. Invalid
1913
+ values raise ``ValueError`` naming the option, without exposing its value.
1900
1914
  """
1901
1915
 
1902
1916
  def __init__(
@@ -1920,6 +1934,9 @@ class Client:
1920
1934
  external_storage_cache: ExternalPayloadCache | None = None,
1921
1935
  telemetry: ExecutionTelemetry | None = None,
1922
1936
  ) -> None:
1937
+ _validate_static_credential("token", token)
1938
+ _validate_static_credential("control_token", control_token)
1939
+ _validate_static_credential("worker_token", worker_token)
1923
1940
  if tls_context is not None:
1924
1941
  if not isinstance(tls_context, ssl.SSLContext):
1925
1942
  raise TypeError("tls_context must be an ssl.SSLContext")
@@ -4950,11 +4967,14 @@ class Client:
4950
4967
  async def query_workflow(
4951
4968
  self, workflow_id: str, query_name: str, *, args: list[Any] | None = None
4952
4969
  ) -> Any:
4953
- """Execute a named read-only query against a workflow and return the result.
4970
+ """Execute a named read-only query and return the Server's receipt.
4954
4971
 
4955
4972
  Queries are synchronous and non-mutating. The server runs the named
4956
- query handler inside the workflow process and returns the decoded
4957
- result. Raises :class:`~durable_workflow.errors.QueryFailed` if the
4973
+ query handler inside the workflow process. The returned ``dict``
4974
+ includes workflow/run identities and ``query_name``; its ``result``
4975
+ member holds the decoded handler value, which may be ``None``.
4976
+ Read ``receipt["result"]`` to obtain that value.
4977
+ Raises :class:`~durable_workflow.errors.QueryFailed` if the
4958
4978
  query was rejected, the handler errored, or the original query timed
4959
4979
  out. A canonical query timeout is surfaced without automatically
4960
4980
  admitting another query.
@@ -6593,7 +6613,6 @@ class Client:
6593
6613
  body: dict[str, Any] = {
6594
6614
  "lease_owner": lease_owner,
6595
6615
  "query_task_attempt": query_task_attempt,
6596
- "result": result,
6597
6616
  "result_envelope": self._payload_envelope(
6598
6617
  result,
6599
6618
  codec=codec,
@@ -6605,6 +6624,14 @@ class Client:
6605
6624
  external_storage_threshold_bytes=external_storage_threshold_bytes,
6606
6625
  ),
6607
6626
  }
6627
+ # The envelope is authoritative. The optional plain projection must
6628
+ # not impose a JSON-only restriction on valid Avro values such as bytes.
6629
+ try:
6630
+ json.dumps(result, allow_nan=False)
6631
+ except (TypeError, ValueError):
6632
+ pass
6633
+ else:
6634
+ body["result"] = result
6608
6635
  return await self._request(
6609
6636
  "POST", f"/worker/query-tasks/{query_task_id}/complete", worker=True, json=body
6610
6637
  )
@@ -970,6 +970,38 @@ class WorkflowCancelled(BaseException):
970
970
  self.context = context
971
971
 
972
972
 
973
+ class WorkflowTimeoutCleanupRequested(WorkflowCancelled):
974
+ """The run's work deadline passed and its timeout cleanup has started.
975
+
976
+ Raised at the authored call, like a cooperative cancellation request, when a
977
+ run that opted in to timeout cleanup reaches its work deadline. It is a
978
+ :class:`WorkflowCancelled`, so existing ``except WorkflowCancelled:``
979
+ handlers (saga compensation, cleanup) run unchanged. The run still ends
980
+ timed out, whatever the cleanup returns.
981
+
982
+ Like :class:`WorkflowCancelled` it is :class:`BaseException`-rooted, and it
983
+ is not an :class:`asyncio.CancelledError`. ``context.cause`` is
984
+ ``"timeout"``; test ``cause`` rather than the type when telling the two
985
+ apart, since ``cause`` is the cross-SDK discriminator. ``context.cleanup_deadline_at``
986
+ is the cleanup deadline. Experimental.
987
+ """
988
+
989
+ def __init__(
990
+ self, message: str = "workflow work deadline passed: timeout cleanup requested", *,
991
+ request_id: str | None = None, context: CancellationContext | ScopedCancellationContext | None = None,
992
+ ) -> None:
993
+ super().__init__(message, request_id=request_id, context=context)
994
+
995
+
996
+ def _cancellation_requested(
997
+ message: str, *, request_id: str | None, context: CancellationContext | ScopedCancellationContext | None,
998
+ ) -> WorkflowCancelled:
999
+ """The exception for a delivered run request: the timeout subtype when timeout cleanup requested it."""
1000
+ if isinstance(context, CancellationContext) and context.is_timeout:
1001
+ return WorkflowTimeoutCleanupRequested(request_id=request_id, context=context)
1002
+ return WorkflowCancelled(message, request_id=request_id, context=context)
1003
+
1004
+
973
1005
  class ActivityCancelled(BaseException):
974
1006
  """An in-flight activity was cancelled.
975
1007
 
@@ -343,6 +343,19 @@ class BusinessReplayClock:
343
343
  events.append(event)
344
344
  self._pending = (None, _activity_group_time(events, failed_member))
345
345
 
346
+ def observe_propagated_activity_failure(self, member: _GroupMember, *, reconstruction: bool) -> None:
347
+ """Use only the qualified first-recorded failure of an explicit group."""
348
+ self._pending = (None, None)
349
+ if reconstruction:
350
+ return
351
+ event = self._activity_group_boundary(member)
352
+ if event is None or _kind(event) == "ActivityCompleted":
353
+ return
354
+ time = _group_event_time(event)
355
+ milliseconds = canonical_milliseconds(time) if time is not None else None
356
+ if milliseconds is not None:
357
+ self._pending = (member[0], from_canonical_milliseconds(milliseconds))
358
+
346
359
  def _activity_group_boundary(self, member: _GroupMember) -> Mapping[str, Any] | None:
347
360
  index, sequence, activity_type, path = member
348
361
  indices = self._by_sequence.get(sequence, [])
@@ -166,6 +166,36 @@ _WORKFLOW_WORK_TASK_KINDS = ("workflow", "update_validation")
166
166
  _MULTIPLEXED_WORKFLOW_POLL_ENDPOINT = "/worker/workflow-tasks/poll"
167
167
 
168
168
  _TERMINAL_WORKFLOW_STATUSES = {"completed", "failed", "terminated", "canceled", "cancelled"}
169
+
170
+ # The typed refusal for late activity work on a run whose own code closed it
171
+ # (server#1193, workflow#1117). The run settled the activity at close, or left
172
+ # it running under the abandon policy, and nothing is ever appended after the
173
+ # terminal event, so the refusal is final: never retried or reported again.
174
+ _RUN_CLOSED_REFUSAL = "run_closed"
175
+
176
+
177
+ def _run_closed_refusal(error: BaseException) -> bool:
178
+ """Whether a claim or outcome request was refused because its run closed."""
179
+ if isinstance(error, ActivityLeaseAuthorityLost):
180
+ return error.reason == _RUN_CLOSED_REFUSAL
181
+ return isinstance(error, ServerError) and error.reason() == _RUN_CLOSED_REFUSAL
182
+
183
+
184
+ def _run_closed_completion_kept(error: BaseException) -> bool | None:
185
+ """Classify a completion refused with ``run_closed``, as the PHP worker does.
186
+
187
+ ``True``: an abandon-policy activity its run left running at close, whose
188
+ own outcome closed it (``activity_status`` completed or failed); nothing
189
+ is recorded on the closed run. ``False``: the close cancelled the activity
190
+ and its outcome was dropped. ``None``: not a ``run_closed`` refusal with
191
+ ``recorded: false``.
192
+ """
193
+ if not isinstance(error, ServerError) or error.status != 409 or error.reason() != _RUN_CLOSED_REFUSAL:
194
+ return None
195
+ body = error.body
196
+ if not isinstance(body, dict) or body.get("recorded") is not False:
197
+ return None
198
+ return body.get("activity_status") in ("completed", "failed")
169
199
  _QUERY_TASK_FINAL_REJECTION_REASONS = {
170
200
  "lease_expired",
171
201
  "query_task_not_found",
@@ -3450,6 +3480,23 @@ class Worker:
3450
3480
  **self._external_storage_completion_kwargs(),
3451
3481
  )
3452
3482
  except Exception as e:
3483
+ kept = _run_closed_completion_kept(e)
3484
+ if kept is True:
3485
+ # The run left this activity running under the abandon policy:
3486
+ # its outcome closed it, and nothing is appended to the run.
3487
+ log.info(
3488
+ "activity task %s completed; its workflow run closed, so the outcome is not recorded on the run",
3489
+ task_id,
3490
+ )
3491
+ return "completed"
3492
+ if kept is False:
3493
+ # The run's close cancelled this activity: the outcome is
3494
+ # dropped, and the refusal is final, never retried.
3495
+ log.warning(
3496
+ "activity task %s outcome not recorded: its workflow run closed and cancelled the activity",
3497
+ task_id,
3498
+ )
3499
+ return "claim_aborted"
3453
3500
  log.warning("failed to complete activity task %s: %s", task_id, e)
3454
3501
  return "complete_error"
3455
3502
  return "completed"
@@ -3505,6 +3552,9 @@ class Worker:
3505
3552
  task_id=task_id, activity_attempt_id=attempt_id, lease_owner=self.worker_id, **failure,
3506
3553
  )
3507
3554
  except Exception as error:
3555
+ if _run_closed_refusal(error):
3556
+ log.info("%s for activity task %s not recorded: its workflow run closed", context, task_id)
3557
+ return
3508
3558
  log.warning("failed to report %s: %s", context, error)
3509
3559
 
3510
3560
  async def _invoke_remote_activity(self, task: dict[str, Any], activity_type: str,
@@ -4115,6 +4165,14 @@ class Worker:
4115
4165
  if self._stop.is_set():
4116
4166
  self._status.request_abandoned("activity_poll")
4117
4167
  return
4168
+ if _run_closed_refusal(e):
4169
+ # The claim's run closed before it started: the Server
4170
+ # settled that task, so this answered poll is no failure.
4171
+ log.info("activity claim refused because its workflow run closed: %s", e)
4172
+ failures.reset()
4173
+ self._status.request_succeeded("activity_poll")
4174
+ self._record_poll_metrics("activity", "empty", time.perf_counter() - poll_start)
4175
+ continue
4118
4176
  delay = _poll_capacity_delay(e, "activity_task", self.task_queue)
4119
4177
  self._record_poll_status("activity_poll", e, answered=delay is not None)
4120
4178
  if _is_storage_admission_error(e):