Repository navigation
feat: allow a result record to hold a resource in an own<T> field - #280
Merged
Merged
Conversation
This was referenced Oct 23, 2026
Closed
Base automatically changed from
moe/up/required-resource-result-field-2
to
main
October 26, 2026 16:16
tconley1428
reviewed
Oct 26, 2026
|
|
||
| /// @nexus.endpoint "temporal-system" go="__temporal_system" python="__temporal_system" | ||
| /// @nexus.service-name "temporal.example.v1.WorkflowRunService" | ||
| interface workflow-run-service { |
Collaborator
There was a problem hiding this comment.
I know I have bad names for existing samples, but we should start naming these based on what we're actually validating. This one being... proto backed records with resources?
Today's compiler can't generate this shape, so this commit has only the WIT.
A create often answers with a handle and with facts about the create, such as whether it made a new object. An own<T> result alone dropped those facts.
The name now says what the sample checks. The WIT keeps its workflow run domain.
moetemp
force-pushed
the
moe/up/result-record-holds-resource-2
branch
from
October 26, 2026 19:56
f702dac to
ffe6ab6
Compare
…#282) The stream service answers a create with the stream's status. Today's compiler plans the proto-backed enum, so the sample needs no compiler change.
Its create-stream returns a proto-backed record that holds the stream, next to created.
tconley1428
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
This PR lets an operation return a proto-backed record that holds a resource in an
own<T>field, beside the other fields of the same message. Python, TypeScript, .NET and Go generate it. Java refuses it, as it refuses every proto-backed model.The change is in the second commit, d31e11fb. The first commit makes the
stream-servicesample'screate-streamreturncreate-stream-result { stream, created }, which main can't generate. The third regenerates theworkflow-handle.NET models, which failcargo validateon main today. It also holds #282, which adds astream-statusenum to that create result.Why?
A create often answers with a handle and with facts about the create, such as whether it made a new stream. An
own<T>result alone drops those facts.How did you test it?
The
stream-servicegoldens cover Python, TypeScript and .NET. Go and the System Nexus path have no golden for a holder record yet. A fixture checks that a holder record needs@nexus.proto.cargo validatepasses.