Skip to content

State that a completed cleanup outcome does not prove cleanup code ran - #1314

Merged
rmcdaniel merged 2 commits into
mainfrom
general/workflow-863-completed-without-delivery
Nov 26, 2026
Merged

rmcdaniel merged 2 commits into
mainfrom
general/workflow-863-completed-without-delivery

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Adds one finding from the embedded proofs in #1312 to the portable contract (docs/architecture/timeout-cleanup.md). Part of #863.

A completed cleanup outcome means workflow code returned or rethrew before the cleanup deadline. It does not prove cleanup code ran. When a timer or activity result is already in history at the moment the engine notices the work deadline, workflow code can take that result and return without blocking again. The interruption is then never delivered, but the outcome is still completed. #1312 pins this in testCompletingInTheTaskThatNoticesTheWorkDeadlineEndsTimedOut.

The text says how to recognize this in history: WorkflowTimeoutCleanupStarted with no CooperativeCancellationDelivered. It also says that compensation which must always run belongs on every path that can return after the work deadline. A review-decisions entry records it. Behaviour is unchanged and matches ordinary cooperative cancellation.

Documentation only.

🤖 Generated with Claude Code

The embedded proofs (#1312) pin that a result already in history when
the work deadline is noticed can let workflow code return without the
interruption being delivered; the outcome is still completed. Say so in
the contract, how to recognize it in history, and where compensation
that must always run belongs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel rmcdaniel added the agent:general Work owned by General label Nov 26, 2026
…onable

Review follow-up: delivery is decided per durable wait by whether its
result was already in history, applies to any wait kind, and never to
side effects or shielded code. Compensation that must always run should
be idempotent and also run on late-return paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel

Copy link
Copy Markdown
Member Author

Independent review: PASS at 34ce81ba67dbc7f3a3ff8c0a225431950897c4fc. The reviewer saw only this PR, #863 and the #1312 evidence.

  • First pass at fdf1748e: PASS.
    • Accurate against WorkflowExecutor::runTask → TimeoutCleanup::enter() → deliverCancellationAtCall(): no delivery when the call's completion precedes the request. This is pinned by testCompletingInTheTaskThatNoticesTheWorkDeadlineEndsTimedOut and its contrast test.
    • Native follows the same rule (resolved_before → cancellation_delivery_not_eligible), so the text belongs in the portable contract.
  • Delta at 34ce81ba: PASS. Delivery is now described per durable wait, never for side effects or shielded code. The compensation guidance is actionable: Workflow::now() exists, and the author knows the admitted deadline.
  • Non-blocking: the wait list leaves out parallel and service-operation waits; it is representative, not exhaustive.

🤖 Generated with Claude Code

@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel merged commit e4a83ac into main Nov 26, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:general Work owned by General

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant