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.
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.