mirror of
https://github.com/temporalio/temporal.git
synced 2026-08-31 02:51:51 -07:00
## What changed? Adds a top-level `nexusworkflowref` package exposing two functions that convert a Nexus operation completion token between its HSM and CHASM forms: - `HSMRefToCHASMRef` — HSM `StateMachineRef` token → CHASM `ChasmComponentRef` token - `CHASMRefToHSMRef` — the reverse Both directions rebuild the target framework's ref from the fields shared by the two representations (namespace, workflow, run, scheduled event ID, request ID). `CHASMRefToHSMRef` only accepts workflow-backed operations: it verifies the ref's `WorkflowArchetypeID` and its `["Operations", "<scheduledEventID>"]` component path before converting. ## Why? Preparation for the cross-framework Nexus completion fallback (#11035), where a completion whose token targets one framework must be retried against the other after a rebuild (reset or conflict resolution) flips the operation's framework. ## How did you test it? - [x] built - [ ] run locally and tested manually - [ ] covered by existing tests - [x] added new unit test(s) - [ ] added new functional test(s) ## Potential risks Low — additive, and only invoked by #11035. The one coupling to watch: the converter encodes the CHASM `Operations` map field name and `WorkflowArchetypeID`; a change to the workflow component's layout must be reflected here.