feat(workflow-world): dual-engine workflows — Vercel SDK 'world' (Postgres/MongoDB) behind WorkflowKit#112
Merged
Merged
Conversation
Spec: dual-engine workflows (legacy in-memory + Vercel SDK 'world' backed by self-hosted Postgres/MongoDB) behind a thin WorkflowKit facade. Plan: TDD, optional @ai_kit/workflow-world package, blocking spike on directive-in-arrow detection, mocked unit tests + opt-in docker-compose integration tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…pping Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ction Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rld backends Addresses code review: stop() releases injection before close, run() guards uninitialized world, world backends moved to optional peerDependencies, minor cleanups (loaders lookup, jobPrefix guard). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…kflow) Per spike verdict 2: directives are only detected on top-level bindings, so no runtime defineWorldStep wrapper is shipped; types document the required form. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…TS, types) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Define the WorldConfig/WorldEngineAdapter/WorldRunHandle contract locally in workflow-world (src/contract.ts) instead of importing from @ai_kit/core. A peerDependency does not guarantee build order under pnpm, so the install-time prepare build of workflow-world failed to resolve @ai_kit/core's freshly-cleaned dist. workflow-world is consumed BY core (dynamically), never the reverse, so it needs no dependency on core. Also drop the core->workflow-world devDependency (it created a dev/peer cycle); core keeps workflow-world as an optional peer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…acy+world) Lazy-loads the optional @ai_kit/workflow-world via a variable-specifier import behind a test seam, so core has no hard dependency on it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds docker-compose.test.yml (postgres:16 + mongo:7 with healthchecks) and db:up/db:down/test:integration scripts for opt-in integration tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Skipped by default; run via 'pnpm run db:up && pnpm run test:integration'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… document it
The postgres world requires a one-time schema setup ('workflow-postgres-setup')
before use; the integration test now runs it as a subprocess (the CLI calls
process.exit, so it can't run in-process under vitest). Validated end-to-end
against real postgres:16 and mongo:7. README documents the provisioning step.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…it (EN+FR) Adds a 'World engine (durable workflows)' guide and a WorkflowKit API-reference page in both English and French, registered in docs.json. The English pages are sourced by @ai_kit/mcp-docs, so the MCP docs server serves them to AI tools too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… workflow-world publish CI - @ai_kit/core 1.3.1 -> 1.4.0 (new WorkflowKit facade / world engine) - @ai_kit/mcp-docs 1.0.6 -> 1.0.7 (rebundles the new world-engine docs) - @ai_kit/workflow-world stays 0.1.0 (initial release) - add .github/workflows/release-workflow-world.yml (mirrors release-rag.yml: publishes on push to main touching packages/workflow-world/package.json) Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Résumé
Ajoute un second moteur de workflow à ai-kit : le moteur "world" (Vercel Workflow SDK, persistance durable Postgres/MongoDB) à côté du moteur legacy en mémoire, exposé via une façade unifiée
WorkflowKit(défaut :legacy).Contenu
@ai_kit/core— façadeWorkflowKit(enginelegacy|world,start/stop/run, validation), contrat d'adapter, exports publics. Lazy-load du package world via specifier variable + seam de test → aucune dépendance dure sur le SDK Vercel.@ai_kit/workflow-world(nouveau package optionnel) —createWorldAdapter(injection programmatique :createWorld+setWorld+start(fn,args,{world})), mappingworlds.ts, helpers de typageWorldStep/WorldWorkflow, README, docker-compose de test.Décisions clés
defineWorldStepruntime ; on fournit les typesWorldStep/WorldWorkflowet l'utilisateur écrit une liaison top-level avec la directive"use step"/"use workflow".npx workflow-postgres-setup) — documenté.Vérification
@ai_kit/workflow-world: 15 passed (+2 intégration skip par défaut)@ai_kit/core(kit + workflows) : 36 passed — sans régression@ai_kit/server(gated CI) : 19 passedDocs
docs/superpowers/specs/2026-06-02-workflow-world-engine-design.mddocs/superpowers/plans/2026-06-02-workflow-world-engine.mddocs/superpowers/notes/2026-06-02-vercel-sdk-signatures.mdNotes
legacyest inchangé ; aucun utilisateur legacy ne tire les dépendances Vercel.🤖 Generated with Claude Code