Repository navigation
fix: a State belongs to one run, not to the Pipeline - #13
Merged
Merged
Conversation
Two runs of one Pipeline that were in progress at the same time wrote into one State, so their steps mixed. Each run now writes into a State of its own, and the caller can give it: run(payload, state). Python: the State is a local of the run. The Pipeline asks the Predicate of a Valve itself and no longer reads a flag from the Valve, which each run in progress shared. TypeScript: run takes an optional State. The contract has the rule, and three conformance cases: the caller gives the State, and a run that starts inside another run. Closes #11 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reference step no longer holds a Pipeline. The runner gives it the way to run the pipeline again: a method of the Pipeline, or for a compiled form a second call of its function. Both compilers lower the step, so no case is unsupported on any target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
A State belongs to one run, not to the Pipeline. Closes #11.
Before this change, two runs of one Pipeline that were in progress at the same time wrote into one State, so their steps mixed.
The rule (conformance/API.md, "State")
run(payload, state). A caller with more than one run at a time gives each run its own.stateon the Pipeline is the State of the run that started last. It is for a caller with one run at a time.Nothing breaks for a caller with one run at a time:
run(payload)andpipeline.statework as before.Changes
Python
runandrun_asynctake an optionalstate. The State is a local of the run.TypeScript
runtakes an optionalstate. Each run already wrote into its own State; a caller had no way to get it when runs overlapped.Conformance
cases/state.json: the caller gives the State, a run that starts inside another run has its own State, andstateon the Pipeline is the State of the run that started last.run_again, starts a second run of its own pipeline inside the first one. This makes two runs overlap in the same way in each runtime, with no threads and no timers.stateon the Pipeline object. A compiled form is a function and has no such object. That case passes there on what it can show.Checks
asyncio.gather). All four fail on the code before this change.Not in this change
🤖 Generated with Claude Code