Skip to content

[docs] Catch up docs with recently shipped SDK changes - #4772

Open
pranaygp wants to merge 3 commits into
mainfrom
workflow-docs-cleanup-thu-8-oct
Open

pranaygp wants to merge 3 commits into
mainfrom
workflow-docs-cleanup-thu-8-oct

Conversation

@pranaygp

@pranaygp pranaygp commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Catches the docs up with SDK changes that shipped in the last day without (complete) docs updates.

Change Source PR Docs edit
The Local World stores events and steps in one directory per run, and deletes data in the old layout on upgrade #4718 The PR added a "Data directory layout" section but didn't say that existing local data is deleted on start, that the CLI and web UI never delete it, or that downgrading needs a manual wipe. Added that to the Local World page
Stream writes on the Vercel World use the WebSocket transport by default #4722 The PR updated the World and configuration references. Added stream writes to the WebSocket transport bullet in What's New
A hook payload is no longer lost to an awaiter left behind by a lost Promise.race #4324 The PR documented racing one promise created once in Hooks. The Sandbox cookbook raced a fresh hook.then() on every iteration, which still misses a command sent while the workflow snapshots or refreshes the sandbox. The example now keeps one pending nextCommand promise, and the pitfall note says why

I reviewed the other PRs from the last day and they need no further docs: the batched fan-out chunk cap (#4727) shipped its own docs, and the Zod schema compilation change (#4712), tagged clear() lock files (#4742), the in-band writer fence (#4733, not used by the runtime yet), and dependency upgrades (#4736, #4737, #4738) aren't user-facing. The Workflows pages in vercel/front were also checked and need no changes for these.

Docs Preview

Page Preview
Local World Data directory layout
What's New Also new in 5.0
Sandbox cookbook Keep the hook outside the loop

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
example-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workbench-astro-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workbench-express-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workbench-fastify-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workbench-hono-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workbench-nitro-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workbench-python-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workbench-vite-workflow Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workflow-docs Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workflow-swc-playground Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workflow-tarballs Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC
workflow-web Ready Ready Preview, v0 Oct 9, 2026 10:23pm UTC

Copilot AI balanced review requested due to automatic review settings October 8, 2026 16:05
@pranaygp
pranaygp requested a review from a team as a code owner October 8, 2026 16:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@changeset-bot

changeset-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e211051

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟠 world-sim scenario book — 1 fail of 42 total

fence=per-spec

scenario outcome events virt replay violations
✅ smoke-no-steps completed 3 0ms ok 0
✅ smoke-one-step completed 6 0ms ok 0
✅ hook-at-step-started completed 12 0ms ok 0
✅ hook-at-step-completed completed 12 0ms ok 0
✅ hook-at-hook-created completed 12 0ms ok 0
✅ deadline-hook-wins completed 7 1.0h ok 0
✅ deadline-expires completed 7 1.0h ok 0
✅ step-vs-timer-early-settlement completed 8 1.0h ok 0
✅ long-sleep completed 11 30.0d ok 0
✅ hook-never-arrives stalled 3 0ms skipped 0
✅ step-retries-twice completed 10 2.0s ok 0
✅ parallel-steps completed 9 0ms ok 0
✅ hook-on-execution-state completed 12 0ms ok 0
✅ peek-hook-before-branch completed 12 0ms ok 0
✅ peek-hook-after-branch completed 12 0ms ok 0
✅ peek-hook-at-registration completed 12 0ms ok 0
✅ race-hook-before-probe completed 12 0ms ok 0
✅ race-hook-after-probe completed 12 0ms ok 0
✅ race-duplicate-delivery completed 13 0ms ok 0
✅ attr-hook-before-step completed 11 0ms ok 0
✅ attr-hook-after-step completed 11 0ms ok 0
✅ attr-from-step-body completed 13 0ms ok 0
✅ fork-hook-after-timeout completed 14 1.0m ok 0
✅ fork-hook-before-timeout completed 14 1.0m ok 0
✅ count-hook-after-timeout completed 17 1.0m ok 0
✅ count-hook-before-timeout completed 20 1.0m ok 0
✅ stale-read-step-count-fork completed 20 1.0m ok 0
✅ stale-read-equal-step-counts completed 14 1.0m ok 0
✅ step-vs-step-fork completed 12 0ms ok 0
✅ step-vs-step-fork-fenced completed 12 0ms ok 0
✅ fence-catches-benign-direction completed 12 5ms ok 0
✅ in-flight-before-decision completed 17 1.0m ok 0
❌ in-flight-before-decision-counted completed 17 1.0m ok 0
✅ in-flight-after-decision completed 19 2.0m ok 0
✅ stale-read-step-count-fork-fenced completed 20 1.0m ok 0
✅ fork-hook-wins completed 13 1.0m ok 0
✅ fork-timeout-wins completed 13 1.0m ok 0
✅ unclaimed-payload-under-fork completed 17 1.0m ok 0
✅ claimed-payload-under-fork completed 17 1.0m ok 0
✅ writers-independent-step-bodies completed 12 0ms ok 0
✅ writers-scripted-tempo completed 12 0ms ok 0
✅ cancel-mid-step cancelled 7 0ms skipped 0

Full trace: world-sim.txt

Co-Authored-By: Claude <noreply@anthropic.com>

Co-Authored-By: Pranay Prakash <1797812+pranaygp@users.noreply.github.com>
@pranaygp
pranaygp force-pushed the workflow-docs-cleanup-thu-8-oct branch from 5c08368 to d08a0c3 Compare October 8, 2026 16:09
pranaygp added a commit that referenced this pull request Oct 8, 2026
…ounted (#4783)

## Summary

Sim World has reported `in-flight-before-decision-counted` as the book's
one red on every PR, docs-only ones included. The cause is a stale
expectation, not a runtime regression. This PR restores the check #3519
wrote for slot ids and adds a unit test for the count half of the fence,
which no scenario reaches anymore.

## Where it started

It started at ec709ba (#3544, Aug 17), not in the #4772–#4782 range.
It has failed on every `main` push since then:

- At b0adb50 (the parent of #3544), the append-only lane, which became
the only lane, passes with `ok check: the fence rejected the write`.
- At ec709ba the single remaining lane fails `the count guard fenced
the write the watermark let through`.
- I reproduced both locally (`pnpm sim
in-flight-before-decision-counted`, with `--append-only` on the parent).
The runtime trace is identical at both commits: the orchestrator's
`step_started` decision is rejected with `PreconditionFailedError: …
changed out of band since the caller's snapshot`, it reloads, and it
completes with replay ok. Only the check changed.

While removing the mint-ordered log, #3544 put back the scenario's
pre-#3519 check, which matches the count half's own message (`at or
below the caller`). #3519 had replaced it on purpose. Watermarks used to
be milliseconds, so the hook and the timeout compared equal and only the
count could separate them. A slot watermark is strictly ordered.

## Why the expectation is stale, not the runtime

With commit-time slots, the in-flight hook commits at slot 8, above the
caller's watermark of 7. The watermark half rejects the decision, and it
is evaluated first. The old check can't pass even if the count half is
reached: I disabled the watermark half locally, and at the decision
write `recorded == loaded` (7 == 7), so the count half lets it through.
The count half fires only later, on the settle step's `step_completed`,
after the branch has run.

That makes the old check worse than unsatisfiable. With the watermark
half broken it **passes**, because it accepts that late rejection. The
runtime does the right thing here: it fences the decision, reloads, and
settles on the branch the log implies, with 0 violations.

## Changes

- `in-flight-before-decision-counted`: assert that the fence rejected
the orchestrator's `step_started` decision (`PreconditionFailedError`,
writer `orchestrator`). Matching any 412 would also accept the late
step-body rejection above. The description now matches what happens.
- `store.test.ts`: a test for the count half, a snapshot missing an
event below its own watermark, rejected only with `countGuard`. I
mutation-checked it: loosening the predicate to `recorded > count + 1`
makes it fail.

No changeset. `@workflow/world-sim` and the workbench are private, and
nothing outside tests and scenarios changed.

## Verification

- `pnpm sim`: 42 passed, 0 failed, 0 violations (🟢 0 fail of 42).
- `pnpm sim --no-fence`: only this scenario fails, by design, with 0
violations. This is what `run.ts` and the README document.
- With the watermark half disabled in the built sim: the new check
fails, and the old one passed.
- `vitest run src/store.test.ts` in `packages/world-sim`: 25 passed.
`tsc --noEmit` is clean.

## Follow-up (not in this PR)

`packages/world-sim/DESIGN.md` still describes the mint-ordered model
#3544 removed: "The three" table, `appendOnlyLog`, and "6 → 8"
violations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Comment thread docs/content/worlds/v5/local.mdx Resolved
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Comment thread docs/content/worlds/v5/local.mdx Resolved
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

This branch was successfully deployed

1 active deployment
Preview – workflow-docs — e211051c Deployed Oct 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants