workflow: journal activity results across resume

Merged
TE
2d ago
+484-0

Leo-ask: ask-6ef2624788

Leo asked: “go do all those/help out where you can + examine how you can improve yourself and your available options and capabilities and speed”. This implements the journal foundation of native workflows (nightly-train PR 6), following teamleaderleo/leo-workspace#624, §3.2–3.3 of workstreams/cmux-next-nightly-train.md.

A workflow resume returns saved agent/machine outcomes and retains an interrupted activity's identity. The journal pins the source and matches invocations by position plus a hash of kind, prompt and canonical options. It persists starts before dispatch and outcomes before returning them, admits one resume owner, refuses divergence and corruption, and resets the fresh-call budget on resume without charging replay.

Validation at b352c8c2b5c8cab577159918eaed8be17b56c866:

  • Fleet check: cargo test -p acpmux native_workflow_journal --lib, 9 passed, 0 failed. Receipt tree 8a7b045f9642d575facb4a50a19e594c4fc3c8f0 matches the head.
  • Independent review: gpt-6-astra high, SHIP at that exact head; no findings.
  • git diff --check passed.
  • Clippy's sole diagnostic is the unchanged base's unused notify::Watcher import at login_env/watch.rs:15, fixed on base by efb75929b2aff51c69af1d3d85272118d4ecc473.
  • Release-notary's failure is the unchanged test_every_compile_job_names_its_warm_sources stable-next entry, repaired on base by #33648; Guard status rolls it up. This PR changes no CI inputs.

This foundation does not expose a user command yet. QuickJS runtime integration, daemon lifecycle, schema/stall policy and the cmux_workflow tool follow in separate slices. Risk: an interrupted executor must reattach using the stable identity; the journal itself grants no permission to rerun an effect.

Changelog

none

🤖 Generated with Codex

Agent session: agent session