Skip to content

fix(dag): sweep terminalizes workflows and releases their lease after a host-level settle - #360

Merged
LeXwDeX merged 2 commits into
devfrom
feat/343-issue343
Aug 19, 2026
Merged

fix(dag): sweep terminalizes workflows and releases their lease after a host-level settle#360
LeXwDeX merged 2 commits into
devfrom
feat/343-issue343

Conversation

@LeXwDeX

Copy link
Copy Markdown
Owner

Closes#343

What

After a host-level sweep settle lands, the sweep mirrors checkCompletion's durable half:

  • when every current-revision node is terminal and the workflow row is not, it lands the terminal transition — dag.fail (required-node failure) or dag.complete({skipReviewGate:true}) — through the same workflow-lock-serialized command layer a live DagLoop uses (double settles collapse via the terminal-status guards)
  • then unregisters the workflow's dag automation lease (this process's registry; cross-process registries are untouched no-ops)

Explicitly out of scope (converge through existing instance-load paths, documented in code):

  • parent wake delivery — needs owning-instance session context (ownsSession guard + prompt injection); the DagLoop init drain delivers on the next instance load
  • cascade skips of pending dependents — orphan-pending legalization + cascade at adopt

Tests

  • dispose-instance integration test extended: after the sweep settles the frozen worker, the workflow itself reaches failed (single required node) — 11/11 in the file pass with --timeout 30000 (CI suite default)
  • sweep wiring tests unaffected; checkpoint-gate tests unaffected; typecheck green

Note: the earlier "pre-existing failures" in this file were bun's default 5s per-test timeout; the file's header already mandates --timeout 30000.

… a host-level settle
With the owning instance torn down, checkCompletion/dag.fail/complete and the
automation unregister all lived inside the dead DagLoop — a swept workflow
stayed running forever with required nodes failed and its lease registration
leaking (workflow rot). After a host-level settle lands, the sweep now mirrors
checkCompletion's durable half: when every current-revision node is terminal
it fails (required-node failure) or completes the workflow via the same
workflow-lock-serialized command layer, then unregisters the dag lease.
Parent wake delivery stays with the owning instance (session context) and
converges through the DagLoop init drain on the next instance load; cascade
skips of pending dependents likewise converge at adopt.
Closes#343
@LeXwDeX
LeXwDeX merged commit 3ee0254 into devAug 19, 2026
6 checks passed
@LeXwDeX
LeXwDeX deleted the feat/343-issue343 branch August 19, 2026 04:13
Sign up for freeto 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

@LeXwDeX