Skip to content

fix: fence DAG node settlement by execution attempt #545

Description

@LeXwDeX

Why

After a running node is restarted, its previous prompt can settle before the WorkflowReplanned subscriber interrupts it. The failure callback currently identifies only the workflow and node, so it can fail the replacement attempt while that attempt is still pending. DAG-A01 reproduced this against the real command service, event store and loop.

Scope

DAG node execution identity, result and timeout settlement, restart projection, and focused regression tests. Preserve session cleanup and public compatibility. This differs from closed #213, which makes orphan cancellation fail closed during recovery; this issue protects settlement even before cleanup runs.

Approach

Use GPT-5.6-Sol for this issue after the atomic replan foundation is integrated. Bind execution-originated state writes to a durable current-attempt identity and verify it inside the workflow lock. Cover success, failure, deadlines and recovery callers. Use Deferred-controlled late completions instead of timing sleeps.

This issue is one independently verifiable repair in the seven-finding DAG audit delivery. The authorized route is SpecGit delivery to dev, a separately tracked promotion to main, then the official release workflow. The integrator reviews each issue patch and records exact-head local and CI evidence before acceptance. Unrelated workspace modifications and deferred database maintenance #531 remain outside this delivery.

Acceptance

A delayed old prompt failure, success or timeout cannot terminalize a restarted/retried node. The current attempt can still settle normally. The original audit interleaving passes as a regression, restart/recovery behavior remains compatible, and DAG core coverage plus package typechecks pass.

The audit baseline is cf5fd26; the DAG runtime tree is identical on dev at 711e7b5. Regression tests must assert corrected public behavior using real DAG state and deterministic boundary stubs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions