Repository navigation
Conversation
A field takes a source or an api-omit for the Workflow or the client target. Target code runs a targeted source, so a model built outside a Workflow never calls a Workflow helper.
This was referenced Oct 28, 2026
Contributor
Author
|
Moved to |
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
@nexus.sourceand@nexus.api-omitname the generation target that they apply to.In each target, a field is one of three things. A source of that target fills it, the call leaves it unset, or the convenience API takes it as a parameter.
_<service>_<operation>method) also fill each optional or list field that the request leaves unset. So a resource method and SDK code get the sources, and a field that SDK code sets keeps its value.definition, the definition argument of an operation that returns a resource with@nexus.definition. The Workflow create of the stream sample takes its id fromworkflow_stream_id(definition).nexgen refuses an unknown target, two sources for one target, a source with no target next to a targeted one, a source and an api-omit for the same target, an api-omit on another required field, a source that reads
definitionwhere the call has none (or that names no target), and a resource method parameter that names a sourced or api-omitted request field. Such a parameter had no effect before.The stream sample takes the sources and api-omits of Brook's next WIT. Its
publishandcloselose the parameters of those fields. The sample support code gives the sources, since Brook's runtime isn't here. The TypeScript models now name an omitted field by its TypeScript name in the input type of an operation, which a field with a dash broke.This PR also fixes a TypeScript test of #326, which read the first mock call, not the last, so it didn't check the typed decode.
It replaces moetemp#76. It sits on #328. The stack is #308, #310, #311, #297, #296, #303, #304, #309, #318, #319, #320, #321, #322, #323, #324, #325, #326, #327, #328, then this PR.
Why?
The client target shares the models with the Workflow target. A Workflow helper as the default of a shared model fails when client code builds the model, with
Not in workflow event loop. Brook's context fields differ per context. In a Workflow the producer is the run, in an Activity it is the attempt, and in a client it is the client. Some fields are for the transport only. moetemp#76 added the targets, but it still ran the sources as model defaults.How did you test it?
Python tests build a Workflow create with a fake Workflow context and check the id from the definition and the owner from the run. Others check that a client append fills the producer from a fake Activity context, that a resource method gets the client's source, and that SDK code keeps its own producer. A TypeScript test checks the sources of a Workflow create. A .NET compile check creates a Stream with only a definition. A unit test checks the roles of the stream fields, and rejection fixtures cover each refusal.
cargo validatepasses.