feat(workflow): durable QuickJS workflow engine

Merged
TE
3d ago
+494-10

Adds the native workflow execution seam on the existing cmux NEXT QuickJS code-mode runtime. Workflow scripts reuse the ordinary interpreter and preserve deterministic activity ordering while the daemon owns journal and activity effects.

Leo's ask: "go do all those/help out where you can + examine how you can improve yourself and your available options and capabilities and speed". This slice implements the native workflow runtime described in leo-workspace/workstreams/cmux-next-nightly-train.md §3.2–3.3 and design PR teamleaderleo/leo-workspace#624.

Changes:

  • Adds agent(), machine(), phase/parallel/pipeline helpers and pinned args to workflow code mode.
  • Keeps clocks and randomness unavailable for deterministic replay.
  • Queues starts before waits so parallel branches retain call order; preserves complete workflow results without normal MCP truncation.
  • Rejects workflow-only activity requests from ordinary cmux_exec callers.
  • Adds focused engine tests, including replay scheduling, errors, unfinished children and large results.

This is the engine-only slice; daemon lifecycle, activity execution, reply policy and public workflow catalog are separate changes.

Leo-ask: ask-6ef2624788

šŸ¤– Generated with Codex

Agent session: agent session