Skip to content

feat(journal): v0.6.27 — BU-4 resume-not-cancel boot reconcile#294

Merged
Shooksie merged 4 commits into
mainfrom
feat/journal-reconcile
Jun 30, 2026
Merged

feat(journal): v0.6.27 — BU-4 resume-not-cancel boot reconcile#294
Shooksie merged 4 commits into
mainfrom
feat/journal-reconcile

Conversation

@Shooksie

Copy link
Copy Markdown
Contributor

What

When the durable workflow_journal (Postgres) backend is active, the daemon boot/steady-state orphan sweep now resumes in-flight workflows from the journal instead of cancelling them — restart/redeploy mid-task picks up where it left off.

Decision table per orphaned (past-grace, non-manual) Running run: no-journal→cancel (byte-identical to today); live runner→skip; in grace→skip; has session-id→mid-phase resume (session reattach); phase-boundary only→re-dispatch fresh runner from current_phase; unresumable→cancel.

Guardrails: gated on durable_journal_active + kill-switch off; no double-dispatch (excludes PM-active/pid-registry/live-agent subjects + within-tick dedupe + resume-before-lease); grace/manual/merge-conflict guards retained; kill-switch ANIMUS_DAEMON_DISABLE_JOURNAL_RESUME=1 forces the old cancel path. Merges v0.6.26 (journal import).

Caveat (follow-up)

Phase-boundary re-dispatch relies on the workflow-runner honoring execute --workflow-id (continue, not duplicate). If an older runner rejects it, the spawn fails safe (run preserved, no dup/cancel). Mid-phase resume (session reattach) is unaffected.

Verification

build/clippy/fmt clean; 7 new reconciliation tests + journal_client/phase_session units pass; pre-existing decision_gate::workflow_* + config_source-dependent daemon-runtime tests fail on clean main too. codex 7 substantive rounds — all P1s fixed (duplicate-run, live-agent exclusion, livelock); round 8 didn't converge (budget), round-7 P1 re-verified against source.

🤖 Generated with Claude Code

Shooksie added 3 commits June 29, 2026 21:11
… boot

When the durable workflow_journal backend (Postgres) is active, the daemon
boot/steady-state orphan sweep now RESUMES in-flight runs instead of
CANCELLING them, so a restart/redeploy that wiped the local volume picks up
exactly where it left off.

- recover_orphaned_running_workflows gains a resume_orphans gate: when the
  durable journal is active (and ANIMUS_DAEMON_DISABLE_JOURNAL_RESUME is unset),
  resumable orphans are PRESERVED (not cancelled); only genuinely unresumable
  runs (no addressable current phase) still cancel. No-journal (SQLite) path is
  byte-identical to pre-BU-4.
- resumable_orphans_for_redispatch + dispatch leg: preserved no-checkpoint runs
  are re-dispatched from their current phase boundary via a fresh runner
  (execute --workflow-id continues the persisted run). Runs with a mid-phase
  session checkpoint continue to recover via auto_resume_running_checkpoints.
- Guardrails: started_at grace + manual/approval guards retained; live runners
  (ProcessManager active set, pid registry, AND live agent records) excluded to
  prevent double-dispatch; within-tick subject dedupe; resume runs before queue
  leasing so the lease excludes resumed subjects; blocked (held) checkpoints
  skipped; failed early-exit resume targets terminalized so they cannot loop.
- Kill-switch ANIMUS_DAEMON_DISABLE_JOURNAL_RESUME forces the old cancel path.

Adds durable_journal_active(), SubjectDispatch resume spawn
(spawn_workflow_runner_resume / build_runner_command_with_resume), and
phase_session::blocked_checkpoint_workflow_ids.
# Conflicts:
#	crates/orchestrator-core/src/workflow.rs
@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
animus-docs Ready Ready Preview, Comment Jun 30, 2026 3:19am

Request Review

@Shooksie
Shooksie merged commit cae870e into main Jun 30, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant