Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #694 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 53 53
Lines 5900 5904 +4
Branches 939 941 +2
=========================================
+ Hits 5900 5904 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fgmacedo
force-pushed
the
fgmacedo/uml-w2c_initial
branch
from
October 15, 2026 00:54
e2abeb3 to
c5d1039
Compare
fgmacedo
force-pushed
the
fgmacedo/uml-w2c_initial
branch
from
October 15, 2026 01:56
c5d1039 to
0ad7a1d
Compare
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Refs #587
Refs #692
Builds on #693 (merged), which makes default entry run the initial transition it chose.
Why
d.to(d.d2.d21.d212, initial=True, on="init_action")inside a compound entered the deep target, but the factory also registered the automatic document-order initial transitiond -> d1, so the state held two initial transitions, and theon=effect of the explicit one never ran.What changes
factory.py: when a non-parallel compound already declares an explicit initial transition, no default initial transition is added and no child is flagged initial by document order. Two explicit initial transitions on the same state raiseInvalidDefinition.on_erroras transitiononcontent, so in aStateChartan exception in it becomeserror.executionat block level and entry completes, instead of aborting the microstep. Duringerror.executionhandling it propagates, as transitiononcontent does.docs/states.md: new "Explicit initial transition" section with a doctest (deep target, effect order, re-entry).tests/test_statechart_initial_transition.py(sync and async viasm_runner) and a native YAML case intests/io/test_native_behavior.py.Behavior change: a Python-API chart whose first child was only "reachable" through the automatic initial transition (never actually entered, since the explicit one won) now fails the reachability check with
InvalidDefinition.Evidence
main, 10 fail on top of fix: enter history states by default without running the incoming effect twice #693 alone (duplicate registration, two explicit initials, error handling, native format); all pass here.enter d, init_action, enter d2, enter d21, enter d212, also on re-entry and in subclasses; initial into a history state runs the effect once per entry.main(75c9181): 2992 passed, 26 skipped, 126 xfailed; branch coverage 100%; ruff and mypy clean.tests/uml/pssm/,xfail_strict): 150 passed, 1 skipped, 82 xfailed; no case changes status with this PR.mainand left out of scope: an explicit initial transition silently wins over a contradictoryinitial=Truechild (rejecting it breaks W3C cases, because the SCXML reader flags deep initial targets asinitial); diagrams draw the first child instead of the explicit initial target; an initial target outside the compound and an explicit initial on a parallel state are not validated; a subclass adding an explicit initial to an inherited compound now raises "more than one initial transition" instead of being silently ignored.Not verified
on_init_<state>convention and a root-level initial effect are out of scope (they wait for an API decision on UML initial transitions: target a nested descendant directly and support on_init_<state> actions #587).