Skip to content

Emit cancellation and termination lifecycle events after storage commit - #946

Merged
rmcdaniel merged 4 commits into
mainfrom
fix/896-terminal-lifecycle-20261026
Oct 26, 2026
Merged

rmcdaniel merged 4 commits into
mainfrom
fix/896-terminal-lifecycle-20261026

Conversation

@rmcdaniel

@rmcdaniel rmcdaniel commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Embedded applications receive WorkflowCancelled and WorkflowTerminated when a run closes through immediate cancellation, cooperative cancellation or termination. Notifications include the existing identity fields, the original command reason and the persisted UTC close time. A cancellation request alone emits nothing; ordinary run timeout still emits WorkflowFailed.

Bind these notifications to the run model's actual storage connection, including when nested or retried engine transactions collect them for later release. Rejected commands and rolled-back storage writes emit none; cooperative cleanup and its notification commit together. The broader transaction/storage issue #893 remains separate.

The regression suite covers real task execution, default and separate storage commit/rollback, a custom model connection, rejected commands, cooperative finally cleanup, cleanup expiry, ordinary timeout and nested retry collectors. The new PHP-only replay fixture additionally exercises pending cleanup, a real cleanup retry, notification after commit and duplicate job delivery. Existing replay fixtures and the wire protocol are unchanged.

Validation completed:

  • Published 2.14.2 reproduction: three missing-event failures and a passing completion control.
  • Focused lifecycle and collector tests: 28 tests / 239 assertions.
  • New replay and live terminal-notification cases: 2 tests / 70 assertions.
  • Unmodified strict corpus validator: 79 → 80 replay cases; official consumer passes at the base without the new fixture, passes current source with it, and fails the base with it.
  • PHPStan passes, including the expanded official consumer; feature-shard inventories pass.
  • The full coding-style check passes across 1,543 PHP files. English and all seven translated event guides build successfully; rendered sections, payload examples and canonical/language links pass in every locale.

The complete composer unit command exits 0: 5,036 tests / 72,018 assertions, with 43 skips and 15 non-failing PHPUnit notices, in 20m15s. The process-lifecycle control passes unchanged with a proper init reaper; the complete run uses --init and fast temporary SQLite storage. Coverage and full feature qualification remain pending before release.

Prepare the ordinary 2.15.0 minor release metadata; no tag or package has been published. Refs #896. The issue remains open through qualified release, a normally installed consumer, and actual delivery of the English event guide and all seven translations. The separately qualified Server consumer remains on 2.14.2.

@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel marked this pull request as ready for review October 26, 2026 21:10
@rmcdaniel
rmcdaniel merged commit e6a8fb8 into main Oct 26, 2026
24 checks passed
@rmcdaniel
rmcdaniel deleted the fix/896-terminal-lifecycle-20261026 branch October 26, 2026 22:44
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