Repository navigation
Conversation
WorkflowFiberRunner, the worker-protocol runner for external PHP workers, runs a side effect, memo upsert or search-attribute upsert inline before the Server records it, so first execution kept the previous boundary time. Replay moved Workflow::now() to the step's later recorded_at, so code that read the clock right after such a step could decide differently on replay. Replay now keeps the previous boundary time too. Version decisions keep their replay time, which repeated-version-legacy-clock-boundaries pins for parity with the embedded executor. A feature test shows the embedded executor, which records side effects synchronously, already agrees on both paths. Refs durable-workflow/.github#215 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ner-inline-clock # Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Independent review: CHANGES REQUESTED at 5433289 A reviewer in a fresh context reviewed this PR's own changes against main and .github#215. Verified
BLOCKING
Non-blocking
|
|
Held out of the Workflow 2.42.0 round. The blocking finding above needs a decision on .github#215: either gate the inline-step clock with a mark the Server persists and every PHP consumer honours, or accept a documented break with drain guidance. Without one, merging would change replay values for executor-written histories and for in-flight external-worker runs. The PR stays open, and #1307 (the entry carrier) ships without it. |
|
Closing per General's #215 decision (.github#215, Nov 26). Changing the replay-time read after inline steps alters replay output for runs already in flight and for embedded-written histories, without gating. The limit is documented instead: clock reads immediately after inline steps aren't portable until Core defines a persisted time for those steps. Revisit with a gated design if Core does. |



What
A determinism fix found while checking the embedded side of durable-workflow/.github#215.
Finding. I tested a
Workflow::now()read right after an inline step through each real runner path, on both first execution and replay.WorkflowExecutor(embedded engine)SideEffectRecordedsynchronously, then resumes with itsrecorded_attestSideEffectClockAgreesOnFirstExecutionAndReplayWorkflowFiberRunner(external PHP workers)recorded_atWorkflowFiberRunnerWorkflowFiberRunnerrecorded_atChange. On replay,
WorkflowFiberRunnernow keeps the previous boundary time after a side effect, memo upsert or search-attribute upsert. That is the time first execution already used. The changed lines are the three replaysendToWorkflowcalls, which no longer passrecorded_at.Not changed: version markers. The pinned, immutable corpus fixture
repeated-version-legacy-clock-boundariesrequiresWorkflowFiberRunner,QueryStateReplayerandWorkflowExecutorall to advance to the marker'srecorded_aton replay. That is parity with the embedded executor, which records markers synchronously. Keeping the previous time there would break that pinned contract, and with it mixed-fleet parity with executor-written histories. The remaining fiber-runner version-marker divergence is a decision for General.Trade-off for side effects, memos and upserts: if a history written by the embedded executor is replayed by
WorkflowFiberRunner(a mixed fleet), the executor's first execution read the step's time and this runner now reads the previous time. No pinned fixture covers that combination. For histories produced by external workers, which is this runner's own case, replay now matches first execution.Evidence
tests/Unit/V2/WorkflowFiberRunnerInlineClockTest.php: side effect, memo and search-attribute cases. It fails on main (after_inline00:00:03 on first execution vs 00:00:07 on replay) and passes here.worker-protocol-side-effect-keeps-previous-clock. It fails with main's runner and passes here.V2DeterministicTimeReplayTest::testSideEffectClockAgreesOnFirstExecutionAndReplayshows the embedded executor agrees (12:09:00 on both paths).WorkflowFiberRunnerInlineClockTest,ReplayRegressionCorpusTestandWorkflowFiberRunnerTestpass (283 tests), including the pinned version fixture. The feature test passes on sqlite. phpstan and ecs are clean on the changed files. CI runs the full suites and the corpus counterfactual.Refs durable-workflow/.github#215
🤖 Generated with Claude Code