Architecture¶
State Mate is intentionally a narrow adapter rather than a second state-machine framework.
Sismic YAML
|
v
Sismic loader + model
|
v
State Mate subset validator
|
v
Rendering helpers
|
v
Jinja2 template
|
v
python-statemachine source
Loading belongs to Sismic¶
state_mate.loader delegates YAML parsing and core statechart validation to sismic.io.import_from_yaml().
State Mate therefore does not duplicate Sismic's file format, parser, state classes, or transition classes.
Validation defines the semantic boundary¶
A valid Sismic model can express more than State Mate's generated python-statemachine target can represent.
validate_supported_subset() is the explicit contract between those two models. Unsupported constructs fail early instead of being ignored or flattened.
Rendering is deliberately small¶
state_mate.render performs only generation-specific work:
- convert source names to legal Python names;
- detect naming collisions;
- identify direct child and final states;
- group Sismic
Transitionobjects by event; - populate the Jinja2 template.
There is no secondary Machine, State, or Transition data model.
The template controls emitted syntax¶
The Jinja2 template owns the textual structure of the generated Python module. Rendering helpers prepare values needed by the template without attempting to become a new domain layer.