Repository navigation
Conversation
Each example takes the provider's name, and _setup.py is the one place a store is named. run.py composes the three paths in one agent, also behind the Nexus front.
One file per scenario family, each with a status. A scenario a provider cannot serve says so and the next one starts clean.
1 of 3 tasks
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.
This PR adds the stream examples, one per path, one composed agent, and the June scenarios.
What changed?
Two commits: the paths and the agent first, then the June scenarios.
examples/streams/path_a_publish.py: a workflow publishes progress and a backend follows it fromlatest().path_b_produce.py: an Activity appends to its workflow's topic, a backend produces and consumes, and the consumer handles a supersession when the first attempt fails.path_c_consume.py: a workflow consumes a topic fed from outside and runs an Activity per record with the cache off. On Redis, the outside append wakes the parked workflow with the reserved Signal.agent.pyandrun.pycompose the three onworkflow_streamsandredis, and behind the Nexus front withworkflow_streams,memoryorredisbehind it. The agent races its reader against the generator, so an exhausted generator fails the run. There's no plainmemorymode, since memory isn't replay-safe.examples/streams/june_scenarios/has one demo per scenario in Roey's June notes. Each file opens with the notes' heading, a status and why.run.pyruns them all on one provider.s2runs the three standalone alternatives on the handle, alt 3 with aStreamRefpassed into the workflow start.s8(b) returns aStreamReffrom a Nexus operation.README.mdmaps each path to its call._setup.pyis the one place a store is named, and every example defines its topics once withstreams.topic().examples/: a changelog line, andexamplesunder the type checker inpyproject.toml.Part of AI-198 (epic AI-37).
Why?
It puts the portability claim in code a reviewer can run, with the same accessor in every context. The June suite answers Roey's scenarios one by one. It says plainly which are implemented, which are emulated and which are unsupported by design. It sits on the top of the series, since it needs every provider at once.
The earlier version also ran on the native server-side provider. Native streams pause with the notification channel per the 2026-10-05 design review, so the native setup and its usage lines come back in phase 2, and the prose here speaks only of the providers this series ships.
How did you test it?
Link to a test plan if any -
The lint set is clean with
examples/under the type checker. On a stock dev server with a local Redis,run.pyexits 0 onworkflow_streamsandredis, andrun.py nexusexits 0 through an endpoint on that server withworkflow_streams,memoryandredisbehind it. The three path examples exit 0 onworkflow_streamsandredis. The June suite exits 0 onworkflow_streams,memoryandredis. A provider that can't serve a scenario says so:s2ands5(b) and (c) onworkflow_streams,s1(d) offmemory, ands7onmemory. The worker and consumer that die ins6ands8do so on purpose.