Files
zeekay 7cb6f9f3d9 feat(sdk/workflow): add GetVersion / SideEffect / MutableSideEffect / metrics / search-attributes
System workers (scheduler, deletenamespace, workerdeployment) need:
- GetVersion(ctx, changeID, min, max) — replay-determinism marker
- SideEffect(ctx, fn) — once-per-ordinal recorded computation
- MutableSideEffect(ctx, changeID, fn, eq) — replaceable recorded value
- GetMetricsHandler(ctx).WithTags(...) — workflow-scoped metrics
- UpsertSearchAttributes(ctx, attrs) — visibility upsert

CoroutineEnv extended with the five seam methods. workerEnv carries
per-run maps (versions, sideEffects, mutables) keyed by changeID /
call ordinal; replays on the same input re-record the same values at
the same call sites — Phase-1 contract.

StubEnv mirrors the contract for tests, plus SetMetricsHandler and
UpsertedSearchAttributes() for assertions.

Property tests cover record-once, clamping, independent changeIDs,
side-effect ordinal stability, mutable equality, and metrics routing.

Refused without proven concrete need: HasLastCompletionResult,
GetLastCompletionResult, UpsertTypedSearchAttributes, GetTypedSearch-
Attributes. Nothing kept calls them.
2026-04-25 12:53:18 -07:00
..