Skip to content

Add SDK-owned Nexus operation serialization registry - #2721

Draft
dplyukhin wants to merge 59 commits into
mainfrom
nexus-operation-registry
Draft

dplyukhin wants to merge 59 commits into
mainfrom
nexus-operation-registry

Conversation

@dplyukhin

@dplyukhin dplyukhin commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

Added an internal system Nexus operation registry that selects serialization contexts in the SDK after outbound interceptors run. The SDK retains the selected inner converter scope for input, result, and failure conversion while preserving the existing outer Nexus envelope context. Registry entries support native input-type guards and external-model conversion callbacks; eager result adapters can retrieve the selected scope, including through explicitly forwarding future wrappers.

This PR builds on #2703 and includes the root-data-converter export needed for context selection. It is the SDK prerequisite for temporalio/nexgen#206. Generated packages register metadata rather than injecting workflow-context values or implementing model-provider methods.

Why?

Match the Python SDK ownership boundary: operation policy lookup and converter scoping belong in the runtime, so raw native-model calls and inputs replaced by interceptors receive the same policy as generated wrapper calls. Type guards preserve existing raw protobuf calls, and system-endpoint gating avoids changing ordinary Nexus operations.

This is not full Python system-payload parity: Go captures the policy once rather than reevaluating it, and the existing Go Nexus envelope encoding remains unchanged. Python-style system-envelope marking and codec traversal are not implemented here.

Checklist

  1. Closes: N/A; prerequisite for feat: support Go Nexus serialization contexts nexgen#206.
  2. How was this tested: Canonical SDK checks and focused race-enabled registry, serialization-context, and transfer-converter tests passed. Replay and Nexus caller-context integration tests passed with default caching and with WORKFLOW_CACHE_SIZE=0; nex-gen Go sample race tests and vet passed against this SDK. The full SDK unit suite timed out after four minutes, so full-suite completion is unverified.
  3. Any docs updates needed? Experimental API contracts and limitations are documented in code and CHANGELOG.md; generated-code usage and parity limitations are documented in the dependent nex-gen PR.

@dplyukhin
dplyukhin marked this pull request as draft September 30, 2026 20:10
@dplyukhin
dplyukhin added this pull request to stack #2722 September 30, 2026 20:12
Base automatically changed from go-transfer-types-v3 to main October 6, 2026 23:49
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