Declare on `DurabilityEngineSpec` whether an engine replays orchestrator code, can wake its loop from a thread, and bounds blocking orchestrator code

DO
1d ago
+238-19

Written by Claude Code on behalf of @DouweM.

Part of #14525

Why we make these changes

This is the base of the Azure Code Mode stack. It declares three facts about how an engine runs durable-container (orchestrator) code on DurabilityEngineSpec, so capabilities can read them from the spec instead of checking engine names:

  • #14523 refuses Code Mode configs that rely on bounds_blocking_orchestrator_code; Douwe ruled the field must exist before #14523 merges, so the fields land here, below it.
  • #14855 then switches Code Mode and DynamicWorkflow to read the fields.

This PR adds the fields and the built-in engines' values only, with no consumers.

Enginereplays_orchestrator_codethread_wakeable_loopbounds_blocking_orchestrator_code
TemporalTrueFalseTrue (deadlock detector fails the workflow task after 2 s)
Azure Durable TaskTrueFalseFalse
DBOSTrue (recovery re-runs the workflow; steps matched by position, DBOSUnexpectedStepError on divergence)TrueFalse
AWS LambdaTrue (handler re-run; steps matched in order, NonDeterministicExecutionError on divergence)TrueFalse
AbsurdTrue (handler re-run; checkpoints found by name and occurrence count)TrueFalse
pgtaskTrue (task re-run; TaskSteps maps steps to checkpoints in order)TrueFalse
PrefectFalse (caches task results by input, not position)TrueFalse
RenderFalse (a retried run restarts with no recorded progress)TrueFalse

bounds_blocking_orchestrator_code matters only where replays_orchestrator_code is True.

New public surface

  • DurabilityEngineSpec.replays_orchestrator_code
  • DurabilityEngineSpec.thread_wakeable_loop
  • DurabilityEngineSpec.bounds_blocking_orchestrator_code

Verification

  • Spec values are pinned in tests/durable_exec/temporal/test_durability.py, tests/harness/azure_durable_task/test_capability.py and, for the defaults, tests/durable_exec/test_durable_exec_compat.py.
  • check_api_compatibility.py --against v2.77.0 exits 0 on the PR merged with main, with five waivers: the engine_spec values of Azure Durable Task, DBOS, AWS Lambda, Absurd and pgtask. Temporal's spec is a module constant, so Griffe sees no change there.
  • scripts/durable_exec_contract.py --write: manifest unchanged.

Decisions

  • replays_orchestrator_code values corrected after a per-engine evidence check: DBOS (dbos/_sys_db.py raises DBOSUnexpectedStepError when a replayed step doesn't match its recorded position), AWS Lambda (handler re-run, steps matched in order, NonDeterministicExecutionError), Absurd (handler re-run, checkpoints by name and occurrence count) and pgtask (TaskSteps maps replayed steps to checkpoints in order, pgtask/_context.py) all re-run container code and need the replay to take the recorded path, so they set it to True. Prefect (caches by input, not position) and Render (restarts with no recorded progress) keep False. The old "keep the default for now (#12539)" note is gone: #12539 is closed, fixed by #13527. thread_wakeable_loop and bounds_blocking_orchestrator_code values were checked and are unchanged.
  • No new pre-push review for that correction: it is four one-line declaration values plus matching docs, backed by the engine evidence above, and nothing reads the field in this PR.
  • In DBOS and AWS Lambda the new keyword sits earlier in the spec call, away from nondeterminism_error_types (#13527, on main), so the PR still merges cleanly without a main merge.

What changes for existing users

Nothing: no code reads the new fields yet.

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.

Summary by cubic

Adds three fields to DurabilityEngineSpec — replays_orchestrator_code, thread_wakeable_loop, and bounds_blocking_orchestrator_code — declaring how an engine runs durable-container code, so future features can read engine capabilities from the spec instead of checking engine names. No code reads the fields yet; thread_wakeable_loop defaults to True so engine specs written before the field existed keep long-standing behavior.

  • Defaults are False, True, False; Temporal declares True, False, True and Azure Durable Task declares True, False, False.
  • DBOS, Hatchet, AWS Lambda, Absurd, and pgtask set replays_orchestrator_code=True: each re-runs container code on recovery and requires the replay to match the recorded path — Absurd by checkpoint name and occurrence count, the rest by position (AWS SDK 2.0+ raises NonDeterministicExecutionError on divergence). Prefect (caches by input) and Render (restarts with no recorded progress) keep the default.
  • bounds_blocking_orchestrator_code only matters where replays_orchestrator_code is True.
  • Adds four API-compatibility waivers against v2.78.0 for the harness engines whose spec sets the new fields (DBOS, Temporal, and Hatchet specs are module constants, so Griffe sees no change there), and pins the declared values in tests that involve no provider request.