🧭 Add durable Workspace coordination seams - #400
Conversation
PR #400: 🧭 Add durable Workspace coordination seams16 files, +1357 / -28 Scope🔴 PR has 1385 lines changed. Split into focused PRs. 🟡 1385 lines changed. PRs under 400 receive more thorough review. StructuralOxlint structural signals:
Slop✅ Slop indicators look low. Static AnalysisOxlint: 260 diagnostics across 7 files (32 rules) new-cap (36): packages/workflow/src/deno/provider.ts, packages/workflow/src/deno/database.ts CorrectnessFILE: packages/workflow/src/deno/provider.ts, packages/workflow/src/deno/database.ts FILE: packages/workflow/src/deno/journal-route.ts FILE: packages/workflow/src/deno/journal-route.ts FILE: packages/durable-streams/effect.ts |
ec823f2 to
0b4fdb4
Compare
Why
Issue #365 needs a provider-neutral boundary where a later Workspace effect can coordinate live execution with durable publication, without making ordinary durable operations enlist or leaking Deno storage authority into shared APIs.
This is stack layer 5 and replaces only the durable-coordination portion of draft #387. The preceding stack layers are merged. This revision is rebased onto
mainat2a0e0f2c8e870d092c4df1b16f131a29afbe039dand semantically preserves PR #394's durable persistence boundary. It does not close #365.What changes
Before:
createDurableOperation()owned one fixed live execute/serialize/append path.After:
DurablePersistenceError, retain the adapter error as cause, write no compensatingClose, and fence later durable work.transaction.journal.{ at: "min" }handlers, so a same-named enclosing loaded copy cannot suppress an append or bypass exact validation.How it works
The journal destination is bound only around publication. Mutation execution and unrelated appends do not inherit it. Unbound appends keep the standalone serialized journal path, and
readAll()never routes. There is no generic durable validation hook; callers and providers validate before constructing the durable effect.Review guide
Start with:
packages/durable-streams/live-coordinator.tsand thecreateDurableOperation()live path inpackages/durable-streams/effect.ts.Then review:
packages/durable-streams/tests/live-coordinator.test.tsfor default execution, 🐛 Restore the durable eval journal boundary #394 fail-stop persistence, replay, partial replay, cancellation, and callback compatibility.packages/workflow/src/workspace/api.tsandeffect.tsfor explicit fail-closed Workspace selection.packages/workflow/src/deno/journal-route.tsfor lexical routing, exact-authority validation, and terminal dispatch.Look carefully at:
DurablePersistenceError, retains the adapter failure as cause, persists neither Yield nor Close, and never resumes the workflow past publication.What must stay true
Resultis the only live success/failure representation — DLC1–DLC9.createDurableEffect()behavior stays unchanged — DLC9.How to verify it
deno task setup— passed; tracked files unchanged.deno task lint— passed with 0 errors.deno task check— passed.deno task check:jsr—Success Dry run complete.deno task test --related=packages/durable-streams/effect.ts— 299 tests, 2,215 steps, all passed.git diff --check origin/main...HEAD— passed.CI owns the exhaustive Deno/Node/Bun matrix for this runtime-adapter and shared durable boundary.
Scope
Included
Intentionally unchanged
<File>, history/fork, Worker Shell, Git/Repository effects, FUSE, workerd, subprocess bridges, GC, schema, migration, and vendored Cloudflare source.New abstractions
LiveDurableOperationCoordinatorseparates live execution/result construction from the existing Yield publication continuation; the default and explicit Workspace coordinator are its concrete uses.WorkspaceCoordinationis the shared contextual capability that makes live Workspace work fail closed when no owning provider is installed.Risks and limitations
Scope confirmation