durable-workflow 2.17.2__tar.gz → 2.18.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 (230) hide show
  1. {durable_workflow-2.17.2/src/durable_workflow.egg-info → durable_workflow-2.18.0}/PKG-INFO +2 -1
  2. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/README.md +1 -0
  3. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/pyproject.toml +3 -3
  4. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/__init__.py +6 -0
  5. durable_workflow-2.18.0/src/durable_workflow/_activity_checkpoint.py +131 -0
  6. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/activity.py +31 -1
  7. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/client.py +4 -2
  8. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/errors.py +74 -0
  9. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/worker.py +25 -5
  10. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/workflow.py +45 -0
  11. {durable_workflow-2.17.2 → durable_workflow-2.18.0/src/durable_workflow.egg-info}/PKG-INFO +2 -1
  12. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow.egg-info/SOURCES.txt +20 -0
  13. durable_workflow-2.18.0/tests/test_activity_acceptance_authority.py +122 -0
  14. durable_workflow-2.18.0/tests/test_activity_acceptance_consumer.py +174 -0
  15. durable_workflow-2.18.0/tests/test_activity_acceptance_entry.py +121 -0
  16. durable_workflow-2.18.0/tests/test_activity_checkpoint.py +249 -0
  17. durable_workflow-2.18.0/tests/test_activity_exponential_retry.py +133 -0
  18. durable_workflow-2.18.0/tests/test_activity_install_inventory.py +152 -0
  19. durable_workflow-2.18.0/tests/test_activity_retry_cap_cell.py +125 -0
  20. durable_workflow-2.18.0/tests/test_checkpointed_batch_example.py +174 -0
  21. durable_workflow-2.18.0/tests/test_command_keys_acceptance.py +167 -0
  22. durable_workflow-2.18.0/tests/test_command_keys_captured_inputs.py +181 -0
  23. durable_workflow-2.18.0/tests/test_command_keys_container_ownership.py +108 -0
  24. durable_workflow-2.18.0/tests/test_command_keys_workspace.py +180 -0
  25. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_completion_size_limit.py +86 -1
  26. durable_workflow-2.18.0/tests/test_local_activity_backoff.py +99 -0
  27. durable_workflow-2.18.0/tests/test_native_timer_redrive_cell.py +345 -0
  28. durable_workflow-2.18.0/tests/test_native_timer_redrive_clock.py +144 -0
  29. durable_workflow-2.18.0/tests/test_physical_command_key_readback.py +209 -0
  30. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_portal_source_split.py +114 -0
  31. durable_workflow-2.18.0/tests/test_published_activity_acceptance.py +708 -0
  32. durable_workflow-2.18.0/tests/test_published_pagination_evidence.py +167 -0
  33. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_replay_regression_corpus.py +26 -7
  34. durable_workflow-2.18.0/tests/test_retry_cap_download.py +71 -0
  35. durable_workflow-2.18.0/tests/test_retry_cap_workflow.py +51 -0
  36. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_worker.py +4 -0
  37. durable_workflow-2.17.2/tests/test_local_activity_backoff.py +0 -49
  38. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/LICENSE +0 -0
  39. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/setup.cfg +0 -0
  40. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_activity_lease.py +0 -0
  41. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_activity_process.py +0 -0
  42. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_avro.py +0 -0
  43. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_cancellation_scope.py +0 -0
  44. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_cancellation_scope_history.py +0 -0
  45. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_condition_fingerprint.py +0 -0
  46. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_cooperative_cancellation.py +0 -0
  47. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_failure_reporting.py +0 -0
  48. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_metric_routes.py +0 -0
  49. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_poll_transport.py +0 -0
  50. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_prepared_local_activity.py +0 -0
  51. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_query_task_authority.py +0 -0
  52. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_sticky_workflow_cache.py +0 -0
  53. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/_typed_values.py +0 -0
  54. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/auth_composition.py +0 -0
  55. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/cancellation.py +0 -0
  56. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/external_storage.py +0 -0
  57. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/external_task_input.py +0 -0
  58. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/external_task_result.py +0 -0
  59. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/history_bundle_verify.py +0 -0
  60. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/interceptors.py +0 -0
  61. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/invocable.py +0 -0
  62. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/metrics.py +0 -0
  63. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/nexus.py +0 -0
  64. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/py.typed +0 -0
  65. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/python_conformance.py +0 -0
  66. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/replay_clock.py +0 -0
  67. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/replay_clock_math.py +0 -0
  68. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/replay_conformance.py +0 -0
  69. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/replay_verify.py +0 -0
  70. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/retry_policy.py +0 -0
  71. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/serializer.py +0 -0
  72. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/server_compatibility.json +0 -0
  73. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/sync.py +0 -0
  74. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/telemetry.py +0 -0
  75. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/telemetry_carrier.py +0 -0
  76. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/testing.py +0 -0
  77. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/worker_session.py +0 -0
  78. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/worker_status.py +0 -0
  79. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow/workflow_updates_conformance.py +0 -0
  80. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow.egg-info/dependency_links.txt +0 -0
  81. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow.egg-info/entry_points.txt +0 -0
  82. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow.egg-info/requires.txt +0 -0
  83. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/src/durable_workflow.egg-info/top_level.txt +0 -0
  84. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_activity_cancellation_policies.py +0 -0
  85. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_activity_context.py +0 -0
  86. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_activity_heartbeat_authority.py +0 -0
  87. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_activity_identity.py +0 -0
  88. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_activity_lease_authority.py +0 -0
  89. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_activity_lease_renewal.py +0 -0
  90. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_activity_lease_worker.py +0 -0
  91. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_activity_process.py +0 -0
  92. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_activity_retry_info.py +0 -0
  93. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_activity_run_closed_refusal.py +0 -0
  94. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_auth_composition.py +0 -0
  95. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_avro_value_benchmark.py +0 -0
  96. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_avro_value_protocol.py +0 -0
  97. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_business_replay_clock.py +0 -0
  98. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_business_replay_clock_child.py +0 -0
  99. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_business_replay_clock_parallel.py +0 -0
  100. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_business_replay_clock_redrive.py +0 -0
  101. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_business_replay_clock_sequence_claims.py +0 -0
  102. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_cancellation_cause.py +0 -0
  103. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_cancellation_context.py +0 -0
  104. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_cancellation_remaining_time.py +0 -0
  105. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_cancellation_scope_admission.py +0 -0
  106. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_cancellation_scope_authoring.py +0 -0
  107. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_cancellation_scope_boundary.py +0 -0
  108. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_cancellation_scope_opening.py +0 -0
  109. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_child_workflow_policies.py +0 -0
  110. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_ci_checkout.py +0 -0
  111. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_ci_integration_endpoint.py +0 -0
  112. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_client.py +0 -0
  113. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_client_iterators.py +0 -0
  114. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_client_telemetry.py +0 -0
  115. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_client_timeouts.py +0 -0
  116. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_codec_regression_corpus.py +0 -0
  117. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_committed_cancellation_scope_descendants.py +0 -0
  118. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_committed_cancellation_scope_groups.py +0 -0
  119. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_committed_cancellation_scope_history.py +0 -0
  120. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_committed_cancellation_scope_replay.py +0 -0
  121. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_condition_fingerprint.py +0 -0
  122. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_condition_occurrence_id.py +0 -0
  123. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_condition_replay_drift.py +0 -0
  124. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_control_plane_parity_fixtures.py +0 -0
  125. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_cooperative_cancellation.py +0 -0
  126. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_cooperative_cancellation_client.py +0 -0
  127. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_cooperative_cancellation_worker.py +0 -0
  128. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_cooperative_remote_worker.py +0 -0
  129. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_docs_release_channel.py +0 -0
  130. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_docstring_cross_references.py +0 -0
  131. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_durable_selection.py +0 -0
  132. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_empty_callback_failure.py +0 -0
  133. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_errors.py +0 -0
  134. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_external_storage.py +0 -0
  135. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_external_task_input.py +0 -0
  136. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_external_task_result.py +0 -0
  137. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_failure_reporting.py +0 -0
  138. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_generator_lifecycle.py +0 -0
  139. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_golden_history_replay.py +0 -0
  140. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_history_bundle_pruned.py +0 -0
  141. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_history_bundle_schema2.py +0 -0
  142. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_history_bundle_verify.py +0 -0
  143. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_history_event_contract.py +0 -0
  144. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_invocable.py +0 -0
  145. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_local_failure_reporting.py +0 -0
  146. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_message_streams.py +0 -0
  147. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_metric_routes.py +0 -0
  148. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_metrics.py +0 -0
  149. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_nexus_durable_wait.py +0 -0
  150. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_nexus_namespace.py +0 -0
  151. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_nexus_wire.py +0 -0
  152. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_order_processing_example.py +0 -0
  153. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_parallel_completion_order_replay.py +0 -0
  154. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_parallel_group_policy.py +0 -0
  155. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_parallel_saga_authoring.py +0 -0
  156. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_patch_history.py +0 -0
  157. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_pending_operation_replay.py +0 -0
  158. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_poll_failure_backoff.py +0 -0
  159. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_poll_transport.py +0 -0
  160. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_prepared_local_activity_client.py +0 -0
  161. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_prepared_local_activity_groups.py +0 -0
  162. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_prepared_local_activity_policies.py +0 -0
  163. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_prepared_local_activity_worker.py +0 -0
  164. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_public_boundary_scanner.py +0 -0
  165. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_publish_workflow_isolation.py +0 -0
  166. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_pypi_project_surface.py +0 -0
  167. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_python_conformance.py +0 -0
  168. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_queries.py +0 -0
  169. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_query_task_authority.py +0 -0
  170. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_query_timeout_retry.py +0 -0
  171. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_readme_quickstart.py +0 -0
  172. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_redrive_call_ledger.py +0 -0
  173. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_redrive_replay.py +0 -0
  174. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_redrive_successor_evidence.py +0 -0
  175. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_registration_ambiguity.py +0 -0
  176. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_release_metadata.py +0 -0
  177. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_release_promotion.py +0 -0
  178. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_replay.py +0 -0
  179. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_replay_clock.py +0 -0
  180. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_replay_conformance.py +0 -0
  181. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_replay_verify.py +0 -0
  182. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_retry_policy.py +0 -0
  183. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_run_activities.py +0 -0
  184. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_run_cancellation_scope_replay.py +0 -0
  185. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_run_closed_settlement_replay.py +0 -0
  186. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_runtime_external_payload_transport.py +0 -0
  187. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_schedules.py +0 -0
  188. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_scoped_run_cancellation_context.py +0 -0
  189. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_sdk_metrics_contract.py +0 -0
  190. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_search_attribute_replay_identity.py +0 -0
  191. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_serializer.py +0 -0
  192. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_signals.py +0 -0
  193. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_sleep.py +0 -0
  194. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_standalone_activity_client.py +0 -0
  195. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_static_credential_validation.py +0 -0
  196. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_sticky_execution.py +0 -0
  197. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_sticky_history_suffix.py +0 -0
  198. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_storage_admission.py +0 -0
  199. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_sync.py +0 -0
  200. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_sync_activities.py +0 -0
  201. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_telemetry.py +0 -0
  202. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_telemetry_carrier.py +0 -0
  203. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_testing_failures.py +0 -0
  204. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_testing_harness.py +0 -0
  205. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_testing_nexus.py +0 -0
  206. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_threaded_heartbeat_example.py +0 -0
  207. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_tls_trust.py +0 -0
  208. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_transport_diagnostics.py +0 -0
  209. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_typed_values.py +0 -0
  210. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_typed_workflow_values.py +0 -0
  211. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_update_outcome.py +0 -0
  212. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_update_signal_condition_replay.py +0 -0
  213. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_updates.py +0 -0
  214. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_wait_condition.py +0 -0
  215. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_worker_deregistration.py +0 -0
  216. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_worker_observation.py +0 -0
  217. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_worker_session.py +0 -0
  218. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_worker_startup_buffered.py +0 -0
  219. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_worker_startup_raw.py +0 -0
  220. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_worker_startup_read_budget.py +0 -0
  221. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_worker_startup_snapshot.py +0 -0
  222. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_worker_status.py +0 -0
  223. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_worker_telemetry_wire.py +0 -0
  224. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_workflow_entry_arguments.py +0 -0
  225. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_workflow_entrypoint_validation.py +0 -0
  226. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_workflow_handler_validation.py +0 -0
  227. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_workflow_identity.py +0 -0
  228. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_workflow_result_timeout.py +0 -0
  229. {durable_workflow-2.17.2 → durable_workflow-2.18.0}/tests/test_workflow_streams.py +0 -0
  230. {durable_workflow-2.17.2 → durable_workflow-2.18.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.17.2
3
+ Version: 2.18.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
@@ -146,6 +146,7 @@ for the complete cross-SDK contract.
146
146
  - [Python SDK guide](https://durable-workflow.com/docs/2.0/polyglot/python/)
147
147
  - [Complete SDK reference](docs/sdk-reference.md)
148
148
  - [Runnable examples](examples/)
149
+ - [Checkpointed batch source example](examples/CHECKPOINTED_BATCH.md) (SDK 2.18.0 accessor; synthetic provider)
149
150
  - [Separate workflow and activity worker processes](docs/guides/separate-workers.md)
150
151
  - [Symmetric SDK playground](https://github.com/durable-workflow/sample-app#symmetric-sdk-playground)
151
152
 
@@ -99,6 +99,7 @@ for the complete cross-SDK contract.
99
99
  - [Python SDK guide](https://durable-workflow.com/docs/2.0/polyglot/python/)
100
100
  - [Complete SDK reference](docs/sdk-reference.md)
101
101
  - [Runnable examples](examples/)
102
+ - [Checkpointed batch source example](examples/CHECKPOINTED_BATCH.md) (SDK 2.18.0 accessor; synthetic provider)
102
103
  - [Separate workflow and activity worker processes](docs/guides/separate-workers.md)
103
104
  - [Symmetric SDK playground](https://github.com/durable-workflow/sample-app#symmetric-sdk-playground)
104
105
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "durable-workflow"
7
- version = "2.17.2"
7
+ version = "2.18.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"
@@ -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.2"
83
- registry-version = "2.17.2"
82
+ product-train = "2.18.0"
83
+ registry-version = "2.18.0"
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"
@@ -7,6 +7,7 @@ except PackageNotFoundError: # source checkout without installed metadata
7
7
  __version__ = "0.0.0+unknown"
8
8
 
9
9
  from . import activity, sync, testing, workflow
10
+ from ._activity_checkpoint import ActivityHeartbeatCheckpoint
10
11
  from .activity import ActivityContext, ActivityInfo, ActivityRetryInfo
11
12
  from .auth_composition import (
12
13
  AUTH_COMPOSITION_CONTRACT_SCHEMA,
@@ -70,6 +71,7 @@ from .client import (
70
71
  from .errors import (
71
72
  ActivityCancelled,
72
73
  ActivityFailed,
74
+ ActivityHeartbeatResumeUnavailable,
73
75
  ChildWorkflowCancelled,
74
76
  ChildWorkflowFailed,
75
77
  ChildWorkflowTerminated,
@@ -117,6 +119,7 @@ from .errors import (
117
119
  WorkflowNotFound,
118
120
  WorkflowPayloadDecodeError,
119
121
  WorkflowTaskCompletionTooLarge,
122
+ WorkflowTaskHistoryLimitExceeded,
120
123
  WorkflowTerminated,
121
124
  WorkflowTimedOut,
122
125
  WorkflowTimeoutCleanupRequested,
@@ -260,6 +263,8 @@ __all__ = [
260
263
  "ActivityHandler",
261
264
  "ActivityInfo",
262
265
  "ActivityRetryInfo",
266
+ "ActivityHeartbeatCheckpoint",
267
+ "ActivityHeartbeatResumeUnavailable",
263
268
  "ActivityInterceptorContext",
264
269
  "ActivityRetryPolicy",
265
270
  "BridgeAdapterOutcome",
@@ -427,6 +432,7 @@ __all__ = [
427
432
  "WorkflowFailed",
428
433
  "WorkflowNotFound",
429
434
  "WorkflowTaskCompletionTooLarge",
435
+ "WorkflowTaskHistoryLimitExceeded",
430
436
  "WorkflowTerminated",
431
437
  "WorkflowTimedOut",
432
438
  "WorkflowTimeoutCleanupRequested",
@@ -0,0 +1,131 @@
1
+ """Immutable heartbeat-resume metadata captured from one negotiated poll."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import re
7
+ from collections.abc import Mapping
8
+ from dataclasses import dataclass, field
9
+ from datetime import datetime
10
+ from typing import Any
11
+
12
+ from ._typed_values import decode_payload_value, validate_annotation
13
+ from .errors import ActivityHeartbeatResumeUnavailable
14
+
15
+ _IDENTITY = ("task_id", "activity_execution_id", "activity_attempt_id", "workflow_id", "run_id", "namespace")
16
+ _TIMESTAMP = re.compile(
17
+ r"[0-9]{4}-[0-9]{2}-[0-9]{2}T(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]"
18
+ r"(?:\.[0-9]{1,9})?(?:Z|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])"
19
+ )
20
+
21
+
22
+ def _invalid() -> ValueError:
23
+ return ValueError("activity_heartbeat_resume v1 claim has an invalid checkpoint")
24
+
25
+
26
+ @dataclass(frozen=True, init=False)
27
+ class ActivityHeartbeatCheckpoint:
28
+ """The acknowledged snapshot received with this claim, never a pending write.
29
+
30
+ ``contract_version`` describes the negotiated wire contract. Server v1
31
+ supplies no checkpoint write sequence. Acknowledgement does not commit an
32
+ external business effect atomically.
33
+ """
34
+
35
+ acknowledged_at: str
36
+ contract_version: int = field(default=1, init=False)
37
+ _details_json: str = field(repr=False)
38
+
39
+ def __init__(self, details: Any, acknowledged_at: str) -> None:
40
+ if details is None or not isinstance(acknowledged_at, str) or not _TIMESTAMP.fullmatch(acknowledged_at):
41
+ raise _invalid()
42
+ try:
43
+ # Python 3.10's parser accepts fewer fractional forms. Validate the
44
+ # calendar/offset separately and retain the original precision.
45
+ calendar = re.sub(r"\.\d+(?=Z|[+-])", "", acknowledged_at)
46
+ datetime.fromisoformat(calendar.replace("Z", "+00:00"))
47
+ encoded = json.dumps(details, allow_nan=False)
48
+ except (ValueError, TypeError, OverflowError, RecursionError):
49
+ raise _invalid() from None
50
+ object.__setattr__(self, "acknowledged_at", acknowledged_at)
51
+ object.__setattr__(self, "_details_json", encoded)
52
+
53
+ def details(self, *, result_type: Any = None) -> Any:
54
+ """Return an independent copy, optionally decoded using SDK typed values."""
55
+ value = json.loads(self._details_json)
56
+ if result_type is None:
57
+ return value
58
+ validate_annotation(result_type, "checkpoint")
59
+ return decode_payload_value(value, result_type, "checkpoint")
60
+
61
+
62
+ @dataclass(frozen=True)
63
+ class _HeartbeatResume:
64
+ available: bool = False
65
+ checkpoint: ActivityHeartbeatCheckpoint | None = None
66
+ identity: tuple[Any, ...] = ()
67
+
68
+ def get(self) -> ActivityHeartbeatCheckpoint | None:
69
+ if not self.available:
70
+ raise ActivityHeartbeatResumeUnavailable()
71
+ return self.checkpoint
72
+
73
+
74
+ class _ActivityTask(dict[str, Any]):
75
+ """Keep poll metadata outside the task's unchanged public wire dictionary."""
76
+
77
+ def __init__(self, task: Mapping[str, Any], resume: _HeartbeatResume) -> None:
78
+ super().__init__(task)
79
+ self.heartbeat_resume = resume
80
+
81
+
82
+ def _identity(task: Mapping[str, Any]) -> tuple[Any, ...]:
83
+ values = tuple(task.get(name) for name in _IDENTITY)
84
+ attempt = task.get("attempt_number")
85
+ if (any(not isinstance(value, str) or not value.strip() for value in values)
86
+ or type(attempt) is not int or attempt < 1):
87
+ raise _invalid()
88
+ return (*values, attempt, task.get("lease_owner"), task.get("activity_type"), task.get("task_queue"))
89
+
90
+
91
+ def capture_poll(data: Mapping[str, Any], namespace: str, worker_id: str, task_queue: str | None = None) -> Any:
92
+ task = data.get("task")
93
+ capabilities = data.get("server_capabilities")
94
+ capability = capabilities.get("activity_heartbeat_resume") if isinstance(capabilities, Mapping) else None
95
+ if (not isinstance(task, dict) or not isinstance(capability, Mapping)
96
+ or capability.get("supported") is not True or type(capability.get("version")) is not int
97
+ or capability["version"] != 1):
98
+ return task
99
+ if "last_heartbeat_details" not in task and "last_heartbeat_at" not in task:
100
+ return task
101
+ identity = _identity(task)
102
+ if task["namespace"] != namespace or task.get("lease_owner") != worker_id:
103
+ raise _invalid()
104
+ if task_queue is not None and "task_queue" in task and task["task_queue"] != task_queue:
105
+ raise _invalid()
106
+ if "last_heartbeat_details" not in task or "last_heartbeat_at" not in task:
107
+ raise _invalid()
108
+ details, at = task["last_heartbeat_details"], task["last_heartbeat_at"]
109
+ if details is None and at is None:
110
+ checkpoint = None
111
+ elif details is not None and task["attempt_number"] > 1:
112
+ checkpoint = ActivityHeartbeatCheckpoint(details, at)
113
+ else:
114
+ raise _invalid()
115
+ return _ActivityTask(task, _HeartbeatResume(True, checkpoint, identity))
116
+
117
+
118
+ def claim_resume(
119
+ task: Mapping[str, Any], namespace: str | None, task_id: str, attempt_id: str, attempt: int, worker_id: str,
120
+ activity_type: str, task_queue: str,
121
+ ) -> _HeartbeatResume:
122
+ if not isinstance(task, _ActivityTask):
123
+ return _HeartbeatResume()
124
+ resume = task.heartbeat_resume
125
+ if (resume.identity != _identity(task) or task.get("namespace") != namespace
126
+ or task.get("task_id") != task_id or task.get("activity_attempt_id") != attempt_id
127
+ or type(attempt) is not int or task.get("attempt_number") != attempt
128
+ or task.get("lease_owner") != worker_id or task.get("activity_type") != activity_type
129
+ or "task_queue" in task and task["task_queue"] != task_queue):
130
+ raise _invalid()
131
+ return resume
@@ -8,6 +8,7 @@ from collections.abc import Awaitable, Callable, Mapping
8
8
  from dataclasses import InitVar, dataclass, field
9
9
  from typing import TYPE_CHECKING, Any
10
10
 
11
+ from ._activity_checkpoint import ActivityHeartbeatCheckpoint, _HeartbeatResume, claim_resume
11
12
  from ._activity_lease import current_activity_authority
12
13
  from .errors import ActivityCancelled, ActivityLeaseAuthorityLost
13
14
 
@@ -79,14 +80,20 @@ class ActivityInfo:
79
80
  task_queue: str
80
81
  worker_id: str
81
82
  task_metadata: InitVar[Mapping[str, Any] | None] = None
83
+ task_namespace: InitVar[str | None] = None
82
84
  retry_info: ActivityRetryInfo = field(init=False)
85
+ _heartbeat_resume: _HeartbeatResume = field(init=False, repr=False)
83
86
  workflow_id: str | None = field(init=False)
84
87
  run_id: str | None = field(init=False)
85
88
  activity_execution_id: str | None = field(init=False)
86
89
 
87
- def __post_init__(self, task_metadata: Mapping[str, Any] | None) -> None:
90
+ def __post_init__(self, task_metadata: Mapping[str, Any] | None, task_namespace: str | None) -> None:
88
91
  task = task_metadata if task_metadata is not None else {}
89
92
  object.__setattr__(self, "retry_info", ActivityRetryInfo.from_task(self.attempt_number, task))
93
+ object.__setattr__(self, "_heartbeat_resume", claim_resume(
94
+ task, task_namespace, self.task_id, self.activity_attempt_id, self.attempt_number, self.worker_id,
95
+ self.activity_type, self.task_queue,
96
+ ))
90
97
  for name in ("workflow_id", "run_id"):
91
98
  value = task.get(name)
92
99
  object.__setattr__(self, name, value if isinstance(value, str) and value else None)
@@ -125,6 +132,29 @@ class ActivityContext:
125
132
  """``True`` once the server has signalled that the owning workflow cancelled this activity."""
126
133
  return self._cancel_requested
127
134
 
135
+ def heartbeat_resume_version(self) -> int | None:
136
+ """The received contract version, or ``None`` when unavailable."""
137
+ return 1 if self._info._heartbeat_resume.available else None
138
+
139
+ def last_heartbeat_checkpoint(self) -> ActivityHeartbeatCheckpoint | None:
140
+ """Return the received snapshot, or ``None`` for supported empty state.
141
+
142
+ Raises ActivityHeartbeatResumeUnavailable for older or nonparticipating
143
+ claims, inline local activities and Server-free tests. Heartbeat writes
144
+ never change this snapshot, including rejected or uncertain writes.
145
+ """
146
+ return self._info._heartbeat_resume.get()
147
+
148
+ def last_heartbeat_details(self, *, result_type: Any = None) -> Any:
149
+ """Read acknowledged details, optionally decoded to an application type."""
150
+ checkpoint = self.last_heartbeat_checkpoint()
151
+ return checkpoint.details(result_type=result_type) if checkpoint is not None else None
152
+
153
+ def last_heartbeat_at(self) -> str | None:
154
+ """The original RFC3339 acknowledgement time without losing precision."""
155
+ checkpoint = self.last_heartbeat_checkpoint()
156
+ return checkpoint.acknowledged_at if checkpoint is not None else None
157
+
128
158
  def heartbeat_sync(self, details: dict[str, Any] | None = None) -> None:
129
159
  """Heartbeat from a synchronous activity thread and check attempt authority.
130
160
 
@@ -41,6 +41,7 @@ from urllib.parse import quote, unquote, urlencode, urlsplit
41
41
  import httpx
42
42
 
43
43
  from . import serializer
44
+ from ._activity_checkpoint import capture_poll as _capture_activity_checkpoint
44
45
  from ._activity_lease import ActivityLeaseAuthority, current_activity_authority
45
46
  from ._cancellation_scope import CancellationScopeOpenReceipt, scope_identity
46
47
  from ._cancellation_scope_history import (
@@ -6135,7 +6136,8 @@ class Client:
6135
6136
  if sticky_cache is not None:
6136
6137
  body["sticky_cache"] = sticky_cache
6137
6138
  return await self._request(
6138
- "POST", f"/worker/workflow-tasks/{task_id}/complete", worker=True, json=body
6139
+ "POST", f"/worker/workflow-tasks/{task_id}/complete", worker=True, json=body,
6140
+ context="task_completion",
6139
6141
  )
6140
6142
 
6141
6143
  async def fail_workflow_task(
@@ -6782,7 +6784,7 @@ class Client:
6782
6784
  except httpx.TimeoutException:
6783
6785
  continue
6784
6786
 
6785
- return (data or {}).get("task")
6787
+ return _capture_activity_checkpoint(data or {}, self.namespace, worker_id, task_queue)
6786
6788
 
6787
6789
  return None
6788
6790
 
@@ -27,6 +27,13 @@ class DurableWorkflowError(Exception):
27
27
  """Base class for every exception raised by the SDK."""
28
28
 
29
29
 
30
+ class ActivityHeartbeatResumeUnavailable(DurableWorkflowError):
31
+ """This claim did not supply the supported heartbeat-resume contract."""
32
+
33
+ def __init__(self) -> None:
34
+ super().__init__("activity_heartbeat_resume v1 is unavailable for this claim")
35
+
36
+
30
37
  class ReplayClockUnavailable(DurableWorkflowError):
31
38
  """The current execution has no proved business replay-time boundary."""
32
39
 
@@ -355,6 +362,71 @@ class WorkflowTaskCompletionTooLarge(ServerError):
355
362
  )
356
363
 
357
364
 
365
+ HISTORY_TRANSACTION_REFUSALS = frozenset({"history_transaction_limit_exceeded", "completion_budget_exceeded"})
366
+ _HISTORY_TRANSACTION_UNITS = {
367
+ "history_transaction_size": "history events",
368
+ "history_transaction_bytes": "history bytes",
369
+ "history_transaction_rows": "rows",
370
+ }
371
+
372
+
373
+ class WorkflowTaskHistoryLimitExceeded(WorkflowTaskCompletionTooLarge):
374
+ """The Server refused a completion over its history-transaction budget.
375
+
376
+ A workflow-task completion is recorded in one history transaction, bounded
377
+ by the Server's ``history_transaction_size`` (events),
378
+ ``history_transaction_bytes`` and ``history_transaction_rows`` structural
379
+ limits. A completion past one of them is refused with ``409`` and reason
380
+ ``history_transaction_limit_exceeded`` (or ``completion_budget_exceeded``
381
+ from the early local-activity count) before anything is recorded. Native
382
+ Server releases after 3.12.0 also name ``limit_kind``, the measured
383
+ ``current_value`` and the ``configured_limit`` (.github#228).
384
+
385
+ Replaying the task produces the same commands, so like
386
+ :class:`WorkflowTaskCompletionTooLarge` this is not retryable: the worker
387
+ fails the run once with a ``structural_limit`` failure instead of
388
+ reporting a workflow-task failure, which would block replay.
389
+
390
+ :attr:`limit_kind` is the Server's limit kind, or the refusal reason when
391
+ the Server named none. :attr:`limit` is the configured limit and
392
+ :attr:`size` the Server's measured value, in that limit's unit, when
393
+ reported.
394
+ """
395
+
396
+ def __init__(self, status: int, body: object, *, size: int | None = None) -> None:
397
+ ServerError.__init__(self, status, body)
398
+ fields = body if isinstance(body, dict) else {}
399
+ kind = fields.get("limit_kind")
400
+ limit = fields.get("configured_limit")
401
+ current = fields.get("current_value")
402
+ message = fields.get("message")
403
+ self.limit_kind = kind if isinstance(kind, str) and kind else str(self.reason() or "history_transaction_limit")
404
+ self.limit = limit if type(limit) is int else None
405
+ self.size = current if type(current) is int else None
406
+ self.server_message = message if isinstance(message, str) and message else None
407
+ self.args = (self.structural_limit_message(),)
408
+
409
+ @staticmethod
410
+ def matches(status: int, body: object) -> bool:
411
+ """Whether a response is a history-transaction budget refusal."""
412
+ return (
413
+ status == 409
414
+ and isinstance(body, dict)
415
+ and body.get("reason") in HISTORY_TRANSACTION_REFUSALS
416
+ and body.get("recorded") is not True
417
+ )
418
+
419
+ def structural_limit_message(self) -> str:
420
+ unit = _HISTORY_TRANSACTION_UNITS.get(self.limit_kind, "units")
421
+ size = f"{self.size} {unit}" if self.size is not None else "more than the limit allows"
422
+ limit = f"the server limit of {self.limit} {unit}" if self.limit is not None else "the server limit"
423
+ return (
424
+ f"Structural limit exceeded: {self.limit_kind}: the workflow task completion would write {size} "
425
+ f"in one history transaction, over {limit}. Split the fan-out into smaller batches, move work into "
426
+ "child workflows, or continue-as-new; offload large payloads with external payload storage."
427
+ )
428
+
429
+
358
430
  class NexusOperationFailed(DurableWorkflowError):
359
431
  """A Nexus service operation completed with a typed service failure."""
360
432
 
@@ -1073,6 +1145,8 @@ def _raise_for_status(
1073
1145
 
1074
1146
  if WorkflowTaskCompletionTooLarge.matches(status, body):
1075
1147
  raise WorkflowTaskCompletionTooLarge(status, body, size=request_bytes)
1148
+ if context == "task_completion" and WorkflowTaskHistoryLimitExceeded.matches(status, body):
1149
+ raise WorkflowTaskHistoryLimitExceeded(status, body)
1076
1150
 
1077
1151
  reason = body.get("reason") if isinstance(body, dict) else None
1078
1152
  message = body.get("message", "") if isinstance(body, dict) else str(body)
@@ -151,7 +151,7 @@ TYPED_SEARCH_ATTRIBUTES_CAPABILITY = "typed_search_attributes"
151
151
  DURABLE_SELECTION_CAPABILITY = "durable_selection"
152
152
  LOCAL_ACTIVITIES_CAPABILITY = "local_activities"
153
153
 
154
- # Command capabilities implemented by every high-level Python worker. Keep this
154
+ # Base capabilities implemented by every high-level Python worker. Keep this
155
155
  # advertisement explicit: worker capabilities are not inferred from runtime,
156
156
  # SDK, or protocol-version metadata.
157
157
  _WORKFLOW_COMMAND_CAPABILITIES = (
@@ -160,6 +160,7 @@ _WORKFLOW_COMMAND_CAPABILITIES = (
160
160
  DURABLE_SELECTION_CAPABILITY,
161
161
  LOCAL_ACTIVITIES_CAPABILITY,
162
162
  "workflow_entry_arguments_validation",
163
+ "activity_heartbeat_resume",
163
164
  )
164
165
 
165
166
  _WORKFLOW_WORK_TASK_KINDS = ("workflow", "update_validation")
@@ -2410,6 +2411,23 @@ class Worker:
2410
2411
  reference = store_external_payload(storage, data, codec=envelope["codec"])
2411
2412
  return {"codec": envelope["codec"], "external_storage": reference.to_dict()}
2412
2413
 
2414
+ async def _wait_local_retry_backoff(self, task: dict[str, Any], seconds: float) -> None:
2415
+ """Wait a local retry backoff while keeping the workflow task leased.
2416
+
2417
+ A backoff, such as the generated 60-second default cap, can be as long
2418
+ as the Server's workflow-task lease (60 seconds by default on native
2419
+ Server). Renew at the cooperative lease observer's cadence so the
2420
+ Server never reclaims the claim and reruns the local activity from its
2421
+ first attempt (.github#219). The full backoff is never shortened.
2422
+ """
2423
+ remaining = float(seconds)
2424
+ while remaining > 0:
2425
+ step = min(remaining, 5.0, self._heartbeat_interval)
2426
+ await asyncio.sleep(step)
2427
+ remaining -= step
2428
+ if remaining > 0:
2429
+ await self._renew_local_workflow_lease(task)
2430
+
2413
2431
  async def _execute_cooperative_local_callable(
2414
2432
  self, task: dict[str, Any], command: RecordLocalActivity, handler: Callable[..., Any],
2415
2433
  attempt_state: dict[str, Any],
@@ -2700,7 +2718,7 @@ class Worker:
2700
2718
  attempts.append(attempt_report)
2701
2719
  if retry:
2702
2720
  if backoff_seconds:
2703
- await asyncio.sleep(backoff_seconds)
2721
+ await self._wait_local_retry_backoff(task, backoff_seconds)
2704
2722
  continue
2705
2723
  return terminal_failure(
2706
2724
  status, message, exception_type,
@@ -3118,12 +3136,13 @@ class Worker:
3118
3136
  the typed error is raised again with the follow-up's error as its
3119
3137
  cause, so the caller never reports a workflow-task failure (``/fail``)
3120
3138
  on this path: the Server would retry the task into the same 413 or
3121
- block replay.
3139
+ block replay. A history-transaction budget refusal
3140
+ (:class:`WorkflowTaskHistoryLimitExceeded`, a 409) takes this path too.
3122
3141
  """
3123
3142
  message = error.structural_limit_message()
3124
3143
  log.error(
3125
- "workflow task %s completion refused by the server: %s (limit_kind=%s, size=%s bytes, "
3126
- "limit=%s bytes); failing the run instead of resending it",
3144
+ "workflow task %s completion refused by the server: %s (limit_kind=%s, measured=%s, "
3145
+ "limit=%s); failing the run instead of resending it",
3127
3146
  task_id,
3128
3147
  message,
3129
3148
  error.limit_kind,
@@ -3416,6 +3435,7 @@ class Worker:
3416
3435
  task_queue=self.task_queue,
3417
3436
  worker_id=self.worker_id,
3418
3437
  task_metadata=task,
3438
+ task_namespace=getattr(self.client, "namespace", None),
3419
3439
  ),
3420
3440
  client=self.client,
3421
3441
  )
@@ -366,6 +366,10 @@ class ActivityRetryPolicy:
366
366
  ``non_retryable_error_types`` names failure types that should bypass this
367
367
  retry budget. An activity worker can also report ``non_retryable=True`` on
368
368
  a failure to stop retrying that activity execution.
369
+
370
+ Use :meth:`exponential` for generated backoff with a finite default cap.
371
+ The legacy constructor preserves its original omission behavior: no
372
+ maximum is applied when ``maximum_interval_seconds`` is ``None``.
369
373
  """
370
374
 
371
375
  max_attempts: int = 3
@@ -375,6 +379,47 @@ class ActivityRetryPolicy:
375
379
  non_retryable_error_types: list[str] = field(default_factory=list)
376
380
  backoff_seconds: list[int] | None = None
377
381
 
382
+ @classmethod
383
+ def exponential(
384
+ cls,
385
+ *,
386
+ max_attempts: int = 3,
387
+ initial_interval_seconds: float = 1.0,
388
+ backoff_coefficient: float = 2.0,
389
+ maximum_interval_seconds: float = 60.0,
390
+ non_retryable_error_types: list[str] | None = None,
391
+ ) -> ActivityRetryPolicy:
392
+ """Generate capped backoff, counting the first attempt in ``max_attempts``.
393
+
394
+ The maximum defaults to 60 seconds and must be finite and non-negative.
395
+ Generated fractional intervals retain the constructor's rounding to
396
+ whole command seconds. This factory does not change existing policies
397
+ or the legacy constructor's defaults.
398
+ """
399
+ if type(max_attempts) is not int or max_attempts < 1:
400
+ raise ValueError("max_attempts must be an integer >= 1")
401
+ for name, value, minimum in (
402
+ ("initial_interval_seconds", initial_interval_seconds, 0),
403
+ ("backoff_coefficient", backoff_coefficient, 1),
404
+ ("maximum_interval_seconds", maximum_interval_seconds, 0),
405
+ ):
406
+ try:
407
+ valid = (
408
+ isinstance(value, (int, float)) and not isinstance(value, bool)
409
+ and math.isfinite(value) and value >= minimum
410
+ )
411
+ except OverflowError:
412
+ valid = False
413
+ if not valid:
414
+ raise ValueError(f"{name} must be a finite number >= {minimum}")
415
+ return cls(
416
+ max_attempts=max_attempts,
417
+ initial_interval_seconds=initial_interval_seconds,
418
+ backoff_coefficient=backoff_coefficient,
419
+ maximum_interval_seconds=maximum_interval_seconds,
420
+ non_retryable_error_types=list(non_retryable_error_types or []),
421
+ )
422
+
378
423
  def to_dict(self) -> dict[str, Any]:
379
424
  """Return the server command shape for this activity retry policy."""
380
425
  if self.max_attempts < 1:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: durable-workflow
3
- Version: 2.17.2
3
+ Version: 2.18.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
@@ -146,6 +146,7 @@ for the complete cross-SDK contract.
146
146
  - [Python SDK guide](https://durable-workflow.com/docs/2.0/polyglot/python/)
147
147
  - [Complete SDK reference](docs/sdk-reference.md)
148
148
  - [Runnable examples](examples/)
149
+ - [Checkpointed batch source example](examples/CHECKPOINTED_BATCH.md) (SDK 2.18.0 accessor; synthetic provider)
149
150
  - [Separate workflow and activity worker processes](docs/guides/separate-workers.md)
150
151
  - [Symmetric SDK playground](https://github.com/durable-workflow/sample-app#symmetric-sdk-playground)
151
152
 
@@ -2,6 +2,7 @@ LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
4
  src/durable_workflow/__init__.py
5
+ src/durable_workflow/_activity_checkpoint.py
5
6
  src/durable_workflow/_activity_lease.py
6
7
  src/durable_workflow/_activity_process.py
7
8
  src/durable_workflow/_avro.py
@@ -53,14 +54,21 @@ src/durable_workflow.egg-info/dependency_links.txt
53
54
  src/durable_workflow.egg-info/entry_points.txt
54
55
  src/durable_workflow.egg-info/requires.txt
55
56
  src/durable_workflow.egg-info/top_level.txt
57
+ tests/test_activity_acceptance_authority.py
58
+ tests/test_activity_acceptance_consumer.py
59
+ tests/test_activity_acceptance_entry.py
56
60
  tests/test_activity_cancellation_policies.py
61
+ tests/test_activity_checkpoint.py
57
62
  tests/test_activity_context.py
63
+ tests/test_activity_exponential_retry.py
58
64
  tests/test_activity_heartbeat_authority.py
59
65
  tests/test_activity_identity.py
66
+ tests/test_activity_install_inventory.py
60
67
  tests/test_activity_lease_authority.py
61
68
  tests/test_activity_lease_renewal.py
62
69
  tests/test_activity_lease_worker.py
63
70
  tests/test_activity_process.py
71
+ tests/test_activity_retry_cap_cell.py
64
72
  tests/test_activity_retry_info.py
65
73
  tests/test_activity_run_closed_refusal.py
66
74
  tests/test_auth_composition.py
@@ -78,6 +86,7 @@ tests/test_cancellation_scope_admission.py
78
86
  tests/test_cancellation_scope_authoring.py
79
87
  tests/test_cancellation_scope_boundary.py
80
88
  tests/test_cancellation_scope_opening.py
89
+ tests/test_checkpointed_batch_example.py
81
90
  tests/test_child_workflow_policies.py
82
91
  tests/test_ci_checkout.py
83
92
  tests/test_ci_integration_endpoint.py
@@ -86,6 +95,10 @@ tests/test_client_iterators.py
86
95
  tests/test_client_telemetry.py
87
96
  tests/test_client_timeouts.py
88
97
  tests/test_codec_regression_corpus.py
98
+ tests/test_command_keys_acceptance.py
99
+ tests/test_command_keys_captured_inputs.py
100
+ tests/test_command_keys_container_ownership.py
101
+ tests/test_command_keys_workspace.py
89
102
  tests/test_committed_cancellation_scope_descendants.py
90
103
  tests/test_committed_cancellation_scope_groups.py
91
104
  tests/test_committed_cancellation_scope_history.py
@@ -120,6 +133,8 @@ tests/test_local_failure_reporting.py
120
133
  tests/test_message_streams.py
121
134
  tests/test_metric_routes.py
122
135
  tests/test_metrics.py
136
+ tests/test_native_timer_redrive_cell.py
137
+ tests/test_native_timer_redrive_clock.py
123
138
  tests/test_nexus_durable_wait.py
124
139
  tests/test_nexus_namespace.py
125
140
  tests/test_nexus_wire.py
@@ -129,6 +144,7 @@ tests/test_parallel_group_policy.py
129
144
  tests/test_parallel_saga_authoring.py
130
145
  tests/test_patch_history.py
131
146
  tests/test_pending_operation_replay.py
147
+ tests/test_physical_command_key_readback.py
132
148
  tests/test_poll_failure_backoff.py
133
149
  tests/test_poll_transport.py
134
150
  tests/test_portal_source_split.py
@@ -138,6 +154,8 @@ tests/test_prepared_local_activity_policies.py
138
154
  tests/test_prepared_local_activity_worker.py
139
155
  tests/test_public_boundary_scanner.py
140
156
  tests/test_publish_workflow_isolation.py
157
+ tests/test_published_activity_acceptance.py
158
+ tests/test_published_pagination_evidence.py
141
159
  tests/test_pypi_project_surface.py
142
160
  tests/test_python_conformance.py
143
161
  tests/test_queries.py
@@ -155,6 +173,8 @@ tests/test_replay_clock.py
155
173
  tests/test_replay_conformance.py
156
174
  tests/test_replay_regression_corpus.py
157
175
  tests/test_replay_verify.py
176
+ tests/test_retry_cap_download.py
177
+ tests/test_retry_cap_workflow.py
158
178
  tests/test_retry_policy.py
159
179
  tests/test_run_activities.py
160
180
  tests/test_run_cancellation_scope_replay.py