DO NOT MERGE: ✨ Retain atomic workflow Workspaces - #387
Draft
taras wants to merge 1 commit into
Draft
Conversation
PR #387: ✨ Retain atomic workflow Workspaces144 files, +11457 / -268 Scope🔴 PR has 11725 lines changed. Split into focused PRs. 🟡 11725 lines changed. PRs under 400 receive more thorough review. 🟡 144 files changed. Are all changes related? 🟡 PR mixes config and source changes. Structural🟡 3 console statements. Slop✅ Slop indicators look low. Static Analysis✅ Oxlint found no issues. CorrectnessNo extraneous code patterns detected. |
This was referenced Aug 7, 2026
6 tasks
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.
Why
Workflow runs retain their filtered journal, but they do not yet retain the filesystem state that live durable effects observe and publish. Issue #365 establishes that provider-level Workspace foundation while preserving the transaction and secret-gate contracts merged in #374.
Closes #365.
What changes
Before:
A WorkflowRun database owns definitions and filtered journal events. Workspace mutations, immutable filesystem roots, and the journal event that observes a root do not share one provider-owned atomic boundary.
After:
Each WorkflowRun path owns one authoritative SQLite connection, Cloudflare DOFS wrapper, Workspace filesystem, cooperative connection queue, and savepoint allocator. A live Workspace effect mutates the filesystem, publishes or reuses a canonical immutable root, passes its protocol result through the existing secret gate, and appends the rooted journal event in one caller-owned transaction.
Complete schema version 1 includes the pinned DOFS schema, immutable root manifests and exact manifest/blob reachability references, the current-root singleton, and a non-null root reference on every journal event. Existing or partial databases are validation-only and corruption is left unchanged.
How it works
Known provider-domain failures roll back the operation savepoint, retain the previous root, and publish one failed protocol result. Infrastructure, corruption, routing, filtering, serialization, journal insertion, and cancellation failures roll back the outer transaction and publish nothing.
Review guide
Start with:
packages/workflow/tests/workspace-filesystem.test.tsThen review:
packages/durable-streams/live-coordinator.tsand the provider-neutral Workspace APIpackages/workflow/src/deno/database.ts,connections.ts, andsavepoints.tspackages/workflow/src/deno/workspace/root.tsandschema.tspackages/workflow/src/deno/journal-route.tsand the secret-gated publication pathLook carefully at:
What must stay true
How to verify it
deno task vendor:verifyproves every pinned upstream/generated file matches its recorded SHA-256 and rejects missing, extra, changed, or regenerated drift.deno task lintverifies repository lint and formatting rules.deno task checkverifies the complete Deno workspace type graph.deno task testruns 401 tests / 2,736 steps, including atomic Workspace, corruption, restoration, restart, and SIGKILL coverage.deno task check:jsrcompletes the JSR publish dry run.deno task verifypasses all nine applicable commands concurrently under the repository-pinned Node 22 toolchain and confirms the tracked tree is unchanged.Scope
Included
Intentionally unchanged
<File>New abstractions
LiveDurableEffectCoordinatorlets a provider wrap only live execution and publication while replay remains unchanged.Workspaceexposes the provider-neutral retained-effect foundation without leaking SQLite, DOFS, or runtime types.New dependencies
zod ^4.3.6in@executablemd/workflowGenerated or mechanical changes
packages/workflow/vendor/cloudflare-computer-dofs/upstreamis the byte-identical required source closure from Cloudflare Computer commit63d363632e558f7e077794988d36ed75017c2a62.packages/workflow/vendor/cloudflare-computer-dofs/generatedis the deterministic TypeScript 5.9.3 production output recorded byMANIFEST.json.LICENSEandPROVENANCE.md.Risks and limitations
Scope confirmation