Refuse to replay a run stamped above core's SPEC_VERSION_MAX_SUPPORTED on every World

Open
#4,407 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript

Research direction

Start in @workflow/core's runtime and trace replay handling alongside requiresNewerWorld in world-local and world-postgres. Verify where run.specVersion is checked and how the existing error is raised. Done means every World rejects a run above core's SPEC_VERSION_MAX_SUPPORTED before replay, with coverage for the affected replay paths.

Written by the indexing model from the issue text.

Description

From the formal-model review of #4327 / #4366 / vercel/workflow-server#1044 (vercel/workflow#4406, findings C4, E1 and W1).

requiresNewerWorld is only called in world-local and world-postgres, and it compares against the World package's SPEC_VERSION_MAX_SUPPORTED, not core's. On the Vercel path nothing refuses a run whose specVersion is above what the executing core can read. Such runs are reachable through:

  • an explicit start({ specVersion }), a same-deployment replay, or a CLI fallback stamp above the target's version (C4). The model shows an explicit 8 on a spec-7 or stable victim unlocks hook force-claim, and the victim's await hook is stranded.
  • a package skew where world-postgres is newer than core (W1).

Fix: in core's runtime, before replaying, fail closed (the same error requiresNewerWorld raises) when run.specVersion > SPEC_VERSION_MAX_SUPPORTED from @workflow/core's own view, on every World. This is one check, and it covers all of the above. (E1, where an executor attests more than it was validated for, is fixed separately in #4366.)

Dominant language
TypeScript
Stars
2.5k
Forks
401
Avg merge
1d 21h
Merged PRs (30d)
201

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vercel/workflow

All issues in vercel/workflow

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.