Skip to content

Add completion<T> post-event transition support#11

Merged
gabewillen merged 3 commits intomainfrom
codex/completion-event
Feb 24, 2026
Merged

Add completion<T> post-event transition support#11
gabewillen merged 3 commits intomainfrom
codex/completion-event

Conversation

@gabewillen
Copy link

Summary

  • add a new internal event type completion<T> and a public alias sml::completion<T>
  • run completion<origin_event_type> after each handled event (before anonymous progression)
  • apply the same post-event behavior for queued/deferred events, refreshing origin type per popped event
  • add functional tests for completion ordering and queue/defer origin refresh behavior

Details

  • process_event now routes through a shared helper that does:
    1. normal dispatch for the incoming event
    2. post-event loop: completion<origin> first, then anonymous transitions
  • process_event_no_defer and process_event_no_queue use the same helper so semantics are consistent

Tests

  • ./scripts/quality_gates.sh
    • format: pass
    • clang-tidy: pass
    • regression matrix: pass
    • sanitizer matrix: pass
    • coverage gate: pass (99.5% >= 90%)
    • benchmark smoke build: pass

Bench snapshots

  • compared before/after snapshots locally; no meaningful runtime regression observed for the sampled benches

Copilot AI review requested due to automatic review settings February 24, 2026 21:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for a new internal event type completion<T> that allows transitions to fire after a specific event type has been handled but before anonymous transitions. The completion events maintain the origin event type even when events are processed from queues or defer queues.

Changes:

  • Added completion<T> internal event type and public API alias
  • Refactored event processing to run completion events before anonymous transitions in a unified post-event loop
  • Added comprehensive tests for completion event ordering and queue/defer origin tracking

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Show a summary per file
File Description
include/boost/sml.hpp Core implementation: added completion event type, event mapping helpers, and refactored process_event to use process_event_and_post_events with unified post-event processing loop
test/ft/transitions.cpp Added test verifying completion events run before anonymous transitions
test/ft/actions_process_n_defer.cpp Added tests for completion events with process queue and defer queue, verifying origin type is refreshed per popped event; also fixed missing trailing newline
test/ft/issue_171.cpp Added regression test ensuring wildcard event handlers are not triggered by internal completion/anonymous events
test/ft/CMakeLists.txt Registered new issue_171 test

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gabewillen gabewillen merged commit 3dea786 into main Feb 24, 2026
10 checks passed
@gabewillen gabewillen deleted the codex/completion-event branch February 24, 2026 21:46
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.

2 participants