Skip to content

Suppress determinism rules inside Workflow.sideEffect callbacks - #1

Merged
vikas0686 merged 1 commit into
mainfrom
f/vikas/temporal-side-effect
Jul 6, 2026
Merged

vikas0686 merged 1 commit into
mainfrom
f/vikas/temporal-side-effect

Conversation

@vikas0686

Copy link
Copy Markdown
Owner

Temporal executes a Workflow.sideEffect(...)/mutableSideEffect(...) callback exactly once and replays its recorded result, so calls that are otherwise determinism violations (UUID.randomUUID(), Math.random(), the various Random APIs, non-deterministic time reads) are safe there. Introduce ExecutionContext and ContextEntryPoint so CallGraphAnalyzer can attribute each call-graph match to the context it was found in, teach forbidden-method rules to declare which contexts they're suppressed in via a new suppressedContexts field, and mark WG001/WG003/WG004/WG005/WG006/WG007 as suppressed in SIDE_EFFECT.

Extend sample-temporal-project with calls to UUID.randomUUID() and Workflow.newRandom().nextInt() from inside Workflow.sideEffect(...), verifying the suppression end-to-end: the violation count stays at 12 even though the new call sites would otherwise trigger WG001/WG005.

Temporal executes a Workflow.sideEffect(...)/mutableSideEffect(...) callback
exactly once and replays its recorded result, so calls that are otherwise
determinism violations (UUID.randomUUID(), Math.random(), the various Random
APIs, non-deterministic time reads) are safe there. Introduce ExecutionContext
and ContextEntryPoint so CallGraphAnalyzer can attribute each call-graph match
to the context it was found in, teach forbidden-method rules to declare which
contexts they're suppressed in via a new suppressedContexts field, and mark
WG001/WG003/WG004/WG005/WG006/WG007 as suppressed in SIDE_EFFECT.

Extend sample-temporal-project with calls to UUID.randomUUID() and
Workflow.newRandom().nextInt() from inside Workflow.sideEffect(...), verifying
the suppression end-to-end: the violation count stays at 12 even though the
new call sites would otherwise trigger WG001/WG005.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vikas0686
vikas0686 merged commit 1120f16 into main Jul 6, 2026
1 check passed
@vikas0686
vikas0686 deleted the f/vikas/temporal-side-effect branch July 6, 2026 14:28
@vikas0686 vikas0686 self-assigned this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant