durable-workflow 2.17.0__tar.gz → 2.17.1__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 (206) hide show
  1. {durable_workflow-2.17.0/src/durable_workflow.egg-info → durable_workflow-2.17.1}/PKG-INFO +1 -1
  2. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/pyproject.toml +3 -3
  3. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/client.py +16 -0
  4. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/worker.py +58 -0
  5. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/workflow.py +21 -1
  6. {durable_workflow-2.17.0 → durable_workflow-2.17.1/src/durable_workflow.egg-info}/PKG-INFO +1 -1
  7. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow.egg-info/SOURCES.txt +3 -0
  8. durable_workflow-2.17.1/tests/test_activity_run_closed_refusal.py +221 -0
  9. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_replay_regression_corpus.py +3 -0
  10. durable_workflow-2.17.1/tests/test_run_closed_settlement_replay.py +658 -0
  11. durable_workflow-2.17.1/tests/test_static_credential_validation.py +58 -0
  12. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/LICENSE +0 -0
  13. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/README.md +0 -0
  14. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/setup.cfg +0 -0
  15. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/__init__.py +0 -0
  16. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_activity_lease.py +0 -0
  17. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_activity_process.py +0 -0
  18. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_avro.py +0 -0
  19. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_cancellation_scope.py +0 -0
  20. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_cancellation_scope_history.py +0 -0
  21. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_condition_fingerprint.py +0 -0
  22. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_cooperative_cancellation.py +0 -0
  23. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_failure_reporting.py +0 -0
  24. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_metric_routes.py +0 -0
  25. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_poll_transport.py +0 -0
  26. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_prepared_local_activity.py +0 -0
  27. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_query_task_authority.py +0 -0
  28. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_sticky_workflow_cache.py +0 -0
  29. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/_typed_values.py +0 -0
  30. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/activity.py +0 -0
  31. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/auth_composition.py +0 -0
  32. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/cancellation.py +0 -0
  33. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/errors.py +0 -0
  34. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/external_storage.py +0 -0
  35. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/external_task_input.py +0 -0
  36. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/external_task_result.py +0 -0
  37. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/history_bundle_verify.py +0 -0
  38. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/interceptors.py +0 -0
  39. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/invocable.py +0 -0
  40. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/metrics.py +0 -0
  41. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/nexus.py +0 -0
  42. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/py.typed +0 -0
  43. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/python_conformance.py +0 -0
  44. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/replay_clock.py +0 -0
  45. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/replay_clock_math.py +0 -0
  46. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/replay_conformance.py +0 -0
  47. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/replay_verify.py +0 -0
  48. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/retry_policy.py +0 -0
  49. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/serializer.py +0 -0
  50. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/server_compatibility.json +0 -0
  51. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/sync.py +0 -0
  52. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/telemetry.py +0 -0
  53. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/telemetry_carrier.py +0 -0
  54. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/testing.py +0 -0
  55. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/worker_session.py +0 -0
  56. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/worker_status.py +0 -0
  57. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow/workflow_updates_conformance.py +0 -0
  58. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow.egg-info/dependency_links.txt +0 -0
  59. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow.egg-info/entry_points.txt +0 -0
  60. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow.egg-info/requires.txt +0 -0
  61. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/src/durable_workflow.egg-info/top_level.txt +0 -0
  62. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_activity_cancellation_policies.py +0 -0
  63. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_activity_context.py +0 -0
  64. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_activity_heartbeat_authority.py +0 -0
  65. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_activity_identity.py +0 -0
  66. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_activity_lease_authority.py +0 -0
  67. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_activity_lease_renewal.py +0 -0
  68. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_activity_lease_worker.py +0 -0
  69. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_activity_process.py +0 -0
  70. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_activity_retry_info.py +0 -0
  71. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_auth_composition.py +0 -0
  72. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_avro_value_benchmark.py +0 -0
  73. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_avro_value_protocol.py +0 -0
  74. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_business_replay_clock.py +0 -0
  75. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_business_replay_clock_child.py +0 -0
  76. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_business_replay_clock_parallel.py +0 -0
  77. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_business_replay_clock_redrive.py +0 -0
  78. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_business_replay_clock_sequence_claims.py +0 -0
  79. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_cancellation_context.py +0 -0
  80. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_cancellation_remaining_time.py +0 -0
  81. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_cancellation_scope_admission.py +0 -0
  82. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_cancellation_scope_authoring.py +0 -0
  83. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_cancellation_scope_boundary.py +0 -0
  84. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_cancellation_scope_opening.py +0 -0
  85. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_child_workflow_policies.py +0 -0
  86. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_ci_checkout.py +0 -0
  87. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_ci_integration_endpoint.py +0 -0
  88. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_client.py +0 -0
  89. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_client_iterators.py +0 -0
  90. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_client_telemetry.py +0 -0
  91. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_client_timeouts.py +0 -0
  92. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_codec_regression_corpus.py +0 -0
  93. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_committed_cancellation_scope_descendants.py +0 -0
  94. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_committed_cancellation_scope_groups.py +0 -0
  95. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_committed_cancellation_scope_history.py +0 -0
  96. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_committed_cancellation_scope_replay.py +0 -0
  97. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_completion_size_limit.py +0 -0
  98. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_condition_fingerprint.py +0 -0
  99. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_condition_occurrence_id.py +0 -0
  100. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_condition_replay_drift.py +0 -0
  101. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_control_plane_parity_fixtures.py +0 -0
  102. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_cooperative_cancellation.py +0 -0
  103. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_cooperative_cancellation_client.py +0 -0
  104. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_cooperative_cancellation_worker.py +0 -0
  105. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_cooperative_remote_worker.py +0 -0
  106. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_docs_release_channel.py +0 -0
  107. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_docstring_cross_references.py +0 -0
  108. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_durable_selection.py +0 -0
  109. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_empty_callback_failure.py +0 -0
  110. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_errors.py +0 -0
  111. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_external_storage.py +0 -0
  112. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_external_task_input.py +0 -0
  113. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_external_task_result.py +0 -0
  114. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_failure_reporting.py +0 -0
  115. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_generator_lifecycle.py +0 -0
  116. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_golden_history_replay.py +0 -0
  117. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_history_bundle_pruned.py +0 -0
  118. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_history_bundle_schema2.py +0 -0
  119. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_history_bundle_verify.py +0 -0
  120. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_history_event_contract.py +0 -0
  121. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_invocable.py +0 -0
  122. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_local_activity_backoff.py +0 -0
  123. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_local_failure_reporting.py +0 -0
  124. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_message_streams.py +0 -0
  125. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_metric_routes.py +0 -0
  126. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_metrics.py +0 -0
  127. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_nexus_durable_wait.py +0 -0
  128. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_nexus_namespace.py +0 -0
  129. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_nexus_wire.py +0 -0
  130. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_order_processing_example.py +0 -0
  131. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_parallel_completion_order_replay.py +0 -0
  132. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_parallel_saga_authoring.py +0 -0
  133. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_patch_history.py +0 -0
  134. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_pending_operation_replay.py +0 -0
  135. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_poll_failure_backoff.py +0 -0
  136. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_poll_transport.py +0 -0
  137. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_portal_source_split.py +0 -0
  138. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_prepared_local_activity_client.py +0 -0
  139. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_prepared_local_activity_groups.py +0 -0
  140. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_prepared_local_activity_policies.py +0 -0
  141. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_prepared_local_activity_worker.py +0 -0
  142. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_public_boundary_scanner.py +0 -0
  143. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_publish_workflow_isolation.py +0 -0
  144. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_pypi_project_surface.py +0 -0
  145. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_python_conformance.py +0 -0
  146. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_queries.py +0 -0
  147. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_query_task_authority.py +0 -0
  148. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_query_timeout_retry.py +0 -0
  149. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_readme_quickstart.py +0 -0
  150. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_redrive_call_ledger.py +0 -0
  151. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_redrive_replay.py +0 -0
  152. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_redrive_successor_evidence.py +0 -0
  153. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_registration_ambiguity.py +0 -0
  154. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_release_metadata.py +0 -0
  155. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_replay.py +0 -0
  156. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_replay_clock.py +0 -0
  157. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_replay_conformance.py +0 -0
  158. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_replay_verify.py +0 -0
  159. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_retry_policy.py +0 -0
  160. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_run_activities.py +0 -0
  161. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_run_cancellation_scope_replay.py +0 -0
  162. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_runtime_external_payload_transport.py +0 -0
  163. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_schedules.py +0 -0
  164. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_scoped_run_cancellation_context.py +0 -0
  165. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_sdk_metrics_contract.py +0 -0
  166. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_search_attribute_replay_identity.py +0 -0
  167. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_serializer.py +0 -0
  168. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_signals.py +0 -0
  169. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_sleep.py +0 -0
  170. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_standalone_activity_client.py +0 -0
  171. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_sticky_execution.py +0 -0
  172. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_sticky_history_suffix.py +0 -0
  173. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_storage_admission.py +0 -0
  174. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_sync.py +0 -0
  175. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_sync_activities.py +0 -0
  176. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_telemetry.py +0 -0
  177. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_telemetry_carrier.py +0 -0
  178. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_testing_failures.py +0 -0
  179. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_testing_harness.py +0 -0
  180. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_testing_nexus.py +0 -0
  181. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_threaded_heartbeat_example.py +0 -0
  182. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_tls_trust.py +0 -0
  183. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_transport_diagnostics.py +0 -0
  184. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_typed_values.py +0 -0
  185. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_typed_workflow_values.py +0 -0
  186. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_update_outcome.py +0 -0
  187. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_update_signal_condition_replay.py +0 -0
  188. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_updates.py +0 -0
  189. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_wait_condition.py +0 -0
  190. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_worker.py +0 -0
  191. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_worker_deregistration.py +0 -0
  192. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_worker_observation.py +0 -0
  193. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_worker_session.py +0 -0
  194. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_worker_startup_buffered.py +0 -0
  195. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_worker_startup_raw.py +0 -0
  196. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_worker_startup_read_budget.py +0 -0
  197. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_worker_startup_snapshot.py +0 -0
  198. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_worker_status.py +0 -0
  199. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_worker_telemetry_wire.py +0 -0
  200. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_workflow_entry_arguments.py +0 -0
  201. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_workflow_entrypoint_validation.py +0 -0
  202. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_workflow_handler_validation.py +0 -0
  203. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_workflow_identity.py +0 -0
  204. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_workflow_result_timeout.py +0 -0
  205. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/tests/test_workflow_streams.py +0 -0
  206. {durable_workflow-2.17.0 → durable_workflow-2.17.1}/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.1
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.1"
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.1"
83
+ registry-version = "2.17.1"
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"
@@ -1885,6 +1885,16 @@ def _request_body_bytes(request: httpx.Request) -> int | None:
1885
1885
  return None
1886
1886
 
1887
1887
 
1888
+ def _validate_static_credential(option: str, value: str | None) -> None:
1889
+ if not value:
1890
+ return
1891
+ # Python's extra whitespace code points are Cc controls, also forbidden here.
1892
+ # Validate the original value, including credentials masked by role fallback.
1893
+ if (value[0].isspace() or value[-1].isspace()
1894
+ or any(ord(char) <= 0x1F or 0x7F <= ord(char) <= 0x9F for char in value)):
1895
+ raise ValueError(f"{option} must not have edge whitespace or control characters")
1896
+
1897
+
1888
1898
  class Client:
1889
1899
  """Async HTTP client for Durable Workflow control-plane and worker APIs.
1890
1900
 
@@ -1897,6 +1907,9 @@ class Client:
1897
1907
  ``tls_context`` selects an explicit trust configuration. It must require
1898
1908
  certificate and hostname verification. Treat the context as read-only after
1899
1909
  construction; worker query clones and Nexus namespace views reuse it.
1910
+
1911
+ Static tokens must have no edge whitespace or control characters. Invalid
1912
+ values raise ``ValueError`` naming the option, without exposing its value.
1900
1913
  """
1901
1914
 
1902
1915
  def __init__(
@@ -1920,6 +1933,9 @@ class Client:
1920
1933
  external_storage_cache: ExternalPayloadCache | None = None,
1921
1934
  telemetry: ExecutionTelemetry | None = None,
1922
1935
  ) -> None:
1936
+ _validate_static_credential("token", token)
1937
+ _validate_static_credential("control_token", control_token)
1938
+ _validate_static_credential("worker_token", worker_token)
1923
1939
  if tls_context is not None:
1924
1940
  if not isinstance(tls_context, ssl.SSLContext):
1925
1941
  raise TypeError("tls_context must be an ssl.SSLContext")
@@ -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):
@@ -3955,6 +3955,23 @@ def _history_event_type(event: Mapping[str, Any]) -> str | None:
3955
3955
  return value if isinstance(value, str) and value else None
3956
3956
 
3957
3957
 
3958
+ # ``cancellation_reason`` of an ActivityCancelled that the run's own close
3959
+ # recorded (Workflow 2.28.0, workflow#1117 and server#1193). Completing,
3960
+ # failing or continuing as new cancels each activity the workflow never
3961
+ # awaited, such as a select() loser, in the closing transaction just before the
3962
+ # terminal event. The workflow had already moved past those operations, so the
3963
+ # cancellation is never an outcome replay can observe: the activity stays open.
3964
+ RUN_CLOSED_CANCELLATION_REASON = "run_closed"
3965
+
3966
+
3967
+ def _settled_at_close(event: Any) -> bool:
3968
+ """Whether this is an activity cancellation recorded by its run's close."""
3969
+ if not isinstance(event, Mapping) or _history_event_type(event) != "ActivityCancelled":
3970
+ return False
3971
+ payload = event.get("payload")
3972
+ return isinstance(payload, Mapping) and payload.get("cancellation_reason") == RUN_CLOSED_CANCELLATION_REASON
3973
+
3974
+
3958
3975
  def _workflow_sequence(payload: Mapping[str, Any]) -> int | None:
3959
3976
  value = payload.get("sequence") or payload.get("workflow_sequence")
3960
3977
  if isinstance(value, int):
@@ -4865,7 +4882,10 @@ def _replay_state(
4865
4882
  exception_type=type(exception).__name__,
4866
4883
  ) from exception
4867
4884
 
4868
- events = list(history_events)
4885
+ # A run-close cancellation never resolves a select() member, never fails
4886
+ # an all() group and never supplies replay time: the workflow had closed
4887
+ # past it. Every history reader below sees the activity as still open.
4888
+ events = [event for event in history_events if not _settled_at_close(event)]
4869
4889
  # A malformed delivery span refuses replay before any history parser can
4870
4890
  # read it more permissively.
4871
4891
  _assert_delivery_spans(events)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: durable-workflow
3
- Version: 2.17.0
3
+ Version: 2.17.1
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
@@ -62,6 +62,7 @@ tests/test_activity_lease_renewal.py
62
62
  tests/test_activity_lease_worker.py
63
63
  tests/test_activity_process.py
64
64
  tests/test_activity_retry_info.py
65
+ tests/test_activity_run_closed_refusal.py
65
66
  tests/test_auth_composition.py
66
67
  tests/test_avro_value_benchmark.py
67
68
  tests/test_avro_value_protocol.py
@@ -154,6 +155,7 @@ tests/test_replay_verify.py
154
155
  tests/test_retry_policy.py
155
156
  tests/test_run_activities.py
156
157
  tests/test_run_cancellation_scope_replay.py
158
+ tests/test_run_closed_settlement_replay.py
157
159
  tests/test_runtime_external_payload_transport.py
158
160
  tests/test_schedules.py
159
161
  tests/test_scoped_run_cancellation_context.py
@@ -163,6 +165,7 @@ tests/test_serializer.py
163
165
  tests/test_signals.py
164
166
  tests/test_sleep.py
165
167
  tests/test_standalone_activity_client.py
168
+ tests/test_static_credential_validation.py
166
169
  tests/test_sticky_execution.py
167
170
  tests/test_sticky_history_suffix.py
168
171
  tests/test_storage_admission.py
@@ -0,0 +1,221 @@
1
+ """Activity workers treat a ``run_closed`` refusal as final (server#1193).
2
+
3
+ When a run's own code closes it, Workflow 2.28.0 (workflow#1117/#1121) and
4
+ Server cancel each activity it never awaited in the closing transaction, or
5
+ leave an abandon-policy activity running, and append nothing after the
6
+ terminal event. A late claim, heartbeat or outcome for such an activity is
7
+ answered with the typed ``run_closed`` refusal. The worker must stop there:
8
+ no retry, no second report, and no poll failure backoff.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ import asyncio
14
+ import logging
15
+ from typing import Any
16
+ from unittest.mock import AsyncMock
17
+
18
+ import pytest
19
+
20
+ from durable_workflow import activity, serializer
21
+ from durable_workflow.activity import ActivityContext, ActivityInfo
22
+ from durable_workflow.client import Client
23
+ from durable_workflow.errors import ActivityCancelled, ActivityLeaseAuthorityLost, ServerError
24
+ from durable_workflow.worker import Worker
25
+
26
+ RUN_CLOSED_OUTCOME = {
27
+ "task_id": "late-task",
28
+ "activity_attempt_id": "late-attempt",
29
+ "outcome": "completed",
30
+ "recorded": False,
31
+ "reason": "run_closed",
32
+ "next_task_id": None,
33
+ }
34
+
35
+
36
+ def _task(activity_type: str) -> dict[str, Any]:
37
+ return {
38
+ "task_id": "late-task", "activity_attempt_id": "late-attempt",
39
+ "activity_type": activity_type, "attempt_number": 1,
40
+ "arguments": serializer.encode([], codec="avro"), "payload_codec": "avro",
41
+ }
42
+
43
+
44
+ def _worker(client: AsyncMock, handler: Any) -> Worker:
45
+ return Worker(client, task_queue="late-queue", workflows=[], activities=[handler])
46
+
47
+
48
+ @pytest.mark.asyncio
49
+ async def test_completion_refused_because_the_run_closed_is_final(caplog: pytest.LogCaptureFixture) -> None:
50
+ """An abandon-policy activity kept running after close reports its outcome;
51
+ the Server accepts it with ``recorded: false, reason: run_closed``."""
52
+ client = AsyncMock(spec=Client)
53
+ client.complete_activity_task.side_effect = ServerError(
54
+ 409, {**RUN_CLOSED_OUTCOME, "activity_status": "completed"},
55
+ )
56
+
57
+ @activity.defn(name="abandoned-at-close")
58
+ async def handler() -> str:
59
+ return "independent result"
60
+
61
+ with caplog.at_level(logging.INFO, logger="durable_workflow.worker"):
62
+ assert await _worker(client, handler)._run_activity_task(_task("abandoned-at-close")) == "completed"
63
+
64
+ client.complete_activity_task.assert_awaited_once()
65
+ client.fail_activity_task.assert_not_called()
66
+ assert not [record for record in caplog.records if record.levelno >= logging.WARNING]
67
+ assert any(
68
+ record.levelno == logging.INFO and "late-task completed" in record.getMessage()
69
+ for record in caplog.records
70
+ )
71
+
72
+
73
+ @pytest.mark.asyncio
74
+ async def test_completion_refused_because_the_close_cancelled_the_activity_is_aborted(
75
+ caplog: pytest.LogCaptureFixture,
76
+ ) -> None:
77
+ """A select() loser the close cancelled finishes anyway and reports its
78
+ result; the Server drops it with ``recorded: false, reason: run_closed``
79
+ and ``activity_status: cancelled``. The worker reports an abort, never a
80
+ completion, and never retries or reports again."""
81
+ client = AsyncMock(spec=Client)
82
+ client.complete_activity_task.side_effect = ServerError(
83
+ 409, {**RUN_CLOSED_OUTCOME, "activity_status": "cancelled"},
84
+ )
85
+
86
+ @activity.defn(name="loser-finished-after-close")
87
+ async def handler() -> str:
88
+ return "late result"
89
+
90
+ with caplog.at_level(logging.INFO, logger="durable_workflow.worker"):
91
+ outcome = await _worker(client, handler)._run_activity_task(_task("loser-finished-after-close"))
92
+
93
+ assert outcome == "claim_aborted"
94
+ client.complete_activity_task.assert_awaited_once()
95
+ client.fail_activity_task.assert_not_called()
96
+ warnings = [record for record in caplog.records if record.levelno == logging.WARNING]
97
+ assert len(warnings) == 1
98
+ assert "closed and cancelled the activity" in warnings[0].getMessage()
99
+ assert not [record for record in caplog.records if "late-task completed" in record.getMessage()]
100
+
101
+
102
+ @pytest.mark.asyncio
103
+ async def test_cancellation_at_close_is_reported_once_and_its_refusal_is_final(
104
+ caplog: pytest.LogCaptureFixture,
105
+ ) -> None:
106
+ """A running select() loser cancelled at close: its heartbeat reports the
107
+ cancellation, and the late report is refused with run_closed."""
108
+ client = AsyncMock(spec=Client)
109
+ client.heartbeat_activity_task.return_value = {
110
+ "can_continue": False, "cancel_requested": True, "reason": "activity_cancelled",
111
+ }
112
+ client.fail_activity_task.side_effect = ServerError(
113
+ 409, {**RUN_CLOSED_OUTCOME, "outcome": "failed"},
114
+ )
115
+ cleaned_up: list[str] = []
116
+
117
+ @activity.defn(name="loser-cancelled-at-close")
118
+ async def handler() -> str:
119
+ try:
120
+ await activity.context().heartbeat()
121
+ except ActivityCancelled:
122
+ cleaned_up.append("cleanup")
123
+ raise
124
+ return "late result"
125
+
126
+ with caplog.at_level(logging.INFO, logger="durable_workflow.worker"):
127
+ assert await _worker(client, handler)._run_activity_task(_task("loser-cancelled-at-close")) == "cancelled"
128
+
129
+ assert cleaned_up == ["cleanup"]
130
+ client.complete_activity_task.assert_not_called()
131
+ client.fail_activity_task.assert_awaited_once()
132
+ assert client.fail_activity_task.await_args.kwargs["non_retryable"] is True
133
+ assert client.fail_activity_task.await_args.kwargs["failure_type"] == "ActivityCancelled"
134
+ assert not [record for record in caplog.records if record.levelno >= logging.WARNING]
135
+
136
+
137
+ @pytest.mark.asyncio
138
+ async def test_failure_refused_because_the_run_closed_is_final() -> None:
139
+ client = AsyncMock(spec=Client)
140
+ client.fail_activity_task.side_effect = ServerError(409, {**RUN_CLOSED_OUTCOME, "outcome": "failed"})
141
+
142
+ @activity.defn(name="fails-after-close")
143
+ async def handler() -> str:
144
+ raise RuntimeError("late failure")
145
+
146
+ assert await _worker(client, handler)._run_activity_task(_task("fails-after-close")) == "failed"
147
+
148
+ client.fail_activity_task.assert_awaited_once()
149
+ client.complete_activity_task.assert_not_called()
150
+
151
+
152
+ @pytest.mark.asyncio
153
+ async def test_heartbeat_refused_because_the_run_closed_stops_without_any_outcome() -> None:
154
+ client = AsyncMock(spec=Client)
155
+ client.heartbeat_activity_task.return_value = {
156
+ "can_continue": False, "cancel_requested": False, "reason": "run_closed",
157
+ }
158
+ continued: list[str] = []
159
+
160
+ @activity.defn(name="heartbeat-after-close")
161
+ async def handler() -> str:
162
+ await activity.context().heartbeat()
163
+ continued.append("after refusal")
164
+ return "late result"
165
+
166
+ assert await _worker(client, handler)._run_activity_task(_task("heartbeat-after-close")) == "claim_aborted"
167
+
168
+ assert continued == []
169
+ client.heartbeat_activity_task.assert_awaited_once()
170
+ client.complete_activity_task.assert_not_called()
171
+ client.fail_activity_task.assert_not_called()
172
+
173
+
174
+ @pytest.mark.asyncio
175
+ async def test_heartbeat_of_an_abandoned_activity_keeps_running() -> None:
176
+ client = AsyncMock(spec=Client)
177
+ client.heartbeat_activity_task.return_value = {"can_continue": True, "cancel_requested": False}
178
+ ctx = ActivityContext(info=ActivityInfo(
179
+ task_id="late-task", activity_type="abandoned-at-close", activity_attempt_id="late-attempt",
180
+ attempt_number=1, task_queue="late-queue", worker_id="late-worker",
181
+ ), client=client)
182
+
183
+ await ctx.heartbeat({"message": "still going"})
184
+
185
+ assert not ctx.is_cancelled
186
+
187
+
188
+ @pytest.mark.asyncio
189
+ async def test_claim_refused_because_the_run_closed_is_an_answered_poll(
190
+ monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture,
191
+ ) -> None:
192
+ client = AsyncMock(spec=Client)
193
+
194
+ @activity.defn(name="claimed-after-close")
195
+ async def handler() -> str:
196
+ return "never runs"
197
+
198
+ worker = Worker(client, task_queue="late-queue", workflows=[], activities=[handler], poll_timeout=0.01)
199
+ polls: list[str] = []
200
+
201
+ async def poll(**_: object) -> None:
202
+ polls.append("poll")
203
+ if len(polls) == 1:
204
+ raise ActivityLeaseAuthorityLost("late-task", "run_closed")
205
+ await worker.stop()
206
+ return None
207
+
208
+ async def no_failure_backoff(*_: object) -> None:
209
+ raise AssertionError("a run_closed claim refusal is not a poll failure")
210
+
211
+ client.poll_activity_task.side_effect = poll
212
+ monkeypatch.setattr(asyncio, "sleep", no_failure_backoff)
213
+ dispatched: list[dict[str, Any]] = []
214
+ monkeypatch.setattr(worker, "_dispatch_activity_task", lambda task: dispatched.append(task))
215
+
216
+ with caplog.at_level(logging.INFO, logger="durable_workflow.worker"):
217
+ await worker._poll_activity_tasks()
218
+
219
+ assert polls == ["poll", "poll"]
220
+ assert dispatched == []
221
+ assert not [record for record in caplog.records if record.levelno >= logging.WARNING]
@@ -67,6 +67,7 @@ from tests.test_replay_clock import (
67
67
  RedriveVisibilityCleanupWorkflow,
68
68
  RedriveVisibilityWorkflow,
69
69
  )
70
+ from tests.test_run_closed_settlement_replay import AllFailureClosedWorkflow, SelectionLoserAtCloseWorkflow
70
71
  from tests.test_typed_values import TypedActivityResultsWorkflow
71
72
  from tests.test_typed_workflow_values import TypedOnboarding, TypedTerminalResult
72
73
  from tests.test_update_signal_condition_replay import (
@@ -433,6 +434,8 @@ WORKFLOWS = [
433
434
  SelectionAwaitMarkerWorkflow,
434
435
  SelectionCancellationQueryWorkflow,
435
436
  SelectionMissingNestedOpeningWorkflow,
437
+ SelectionLoserAtCloseWorkflow,
438
+ AllFailureClosedWorkflow,
436
439
  UpdateSignalConditionTimerWorkflow,
437
440
  WorkflowStreamAuthorWorkflow,
438
441
  WorkflowMemoAuthorWorkflow,