Repository navigation
feat(workflow-world): implement the Workflow SDK 5 World contract (spec 8) - #5880
Open
VaguelySerious wants to merge 1 commit into
Open
VaguelySerious wants to merge 1 commit into
VaguelySerious wants to merge 1 commit into
Conversation
Member
|
👀 |
Member
|
will take a look! |
This branch has not been deployed
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.
(AI) Brings
@rivet-dev/workflow-worldup to the Workflow SDK 5 World contract. Today it pins@workflow/world@5.0.0-beta.21, whoseSPEC_VERSION_CURRENTis 5, soworkflow@5.2.2refuses it at startup ("supports Worlds with spec version 6 through 8").slotToEventId,evnt_…0001first). Each run's actor allocates the next slot inside the same transaction that appends the event, withevent_idas the primary key, so the log stays dense and never has holes. Nonoopevents are ever written.eventCountis behind the log still commits at the next slot, and returns the events in the slots it skipped (events/cursor/hasMore).specVersionwithmintedSpecVersion()(8 by default, 6 underWORKFLOW_SEALED_LOG=0). Hook token takeover (capabilities.hookForceClaim) is not implemented, so it stays unadvertised andcreateHook({ experimental_force: true })fails closed.run_startedandstep_startedwithRunExpiredError, and still acceptsstep_completed/step_failed/step_retryingfor a step that was running when the run finished.step_startedfor a step that already exists now throwsEntityConflictError. Before, the loser of a concurrent lazy start got the winner's step back, and could run the step body a second time. A start for a completed step is refused too.steps.getandevents.listByCorrelationIdtake the run id and go straight to the run actor, so they no longer look anything up through the coordinator.runs.listaccepts an array of statuses.CreateEventParamscarries a function (replayEventObserver) that can't be serialized across the actor RPC, so only the params the actor reads are forwarded. Without this everyrun_startedfailed withValue of type "function" is not CBOR serializable.@workflow/worldand@workflow/errorsto 5.0.4 and@workflow/world-testingto 5.0.5, adds@workflow/utilsfor a process-wide id factory, and movesexamples/workflow-sdktoworkflow@5.2.2(workflow@5.0.0-beta.35would refuse a spec 8 World).Rollout: runs written by earlier releases have ULID event ids, and the v5 runtime cannot replay them. All runs are served by the deployment at
WORKFLOW_RUNTIME_URL, so in-flight runs need to finish on the previous release before upgrading. The README now says this.Verification (macOS, Node 24, published
rivetkit/@rivetkit/engine-cli2.3.27 instead of the workspace builds):tsc --noEmitandtsc -p tsconfig.build.json: clean.@workflow/world-testing@5.0.5conformance: 14 passed, 2 skipped (the in-band fence tests, which are optional), includingnumbers events by position.retriable and fatal errorspassed on its one retry.scripts/integration/run.ts: all checks passed.vitest tests/unit tests/integration: 70/73 passed. The 3 failures all assert on an error message, and that message reaches the client asAn internal error occurred. One of them (a duplicate hook id cannot confirm a different token) fails the same way onmainin this setup. With the message match dropped, the two new ones pass.auth.admin_tokenin its config before it will start. I added it locally to run the conformance and integration scripts. It isn't in this diff.Not done: the coordinator's correlation index is still written for every step, hook and wait, though nothing reads it anymore. Optional v5 surface that isn't implemented:
events.createBatch,queueBatch,runs.waitForTerminalStatus,getRuntimeDeadline, and thesinceCursordelta.