Consolidate runnable examples - #30
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the documentation, product roadmap, and examples for the 0.7.0 correctness and adoption milestone. It consolidates runnable examples under docs/examples/, adds concept guides (covering machine configuration, runtime choices, actors, snapshot persistence, and SCXML import), documents completed milestones, and removes legacy untested top-level scripts. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
docs/examples/the sole canonical example locationmore-parallel, concept documentation, persistence adoption, and runnable-example milestones complete0.7.0changelog entryWhy
The repository had two example locations with very different quality levels. The top-level scripts used path mutation, real sleeps, legacy action calling patterns, or a manual Tk loop, while
docs/examples/now contains focused programs that run in isolated subprocesses on every supported CI Python version.One canonical location makes links, contributor commands, and adoption guidance predictable.
Legacy coverage audit
examples/basic.py: pure transitions and traffic-light structure are covered by the JSON-backedtraffic_intersectionexample and machine guideexamples/actions.py: named entry actions and sync execution are covered bytraffic_intersectionexamples/substates.py: nested states, final states, and completion flows are covered acrosstraffic_intersection,fetch_with_retry, andasync_workflowexamples/ui.py: contained no UI integration abstraction beyond calling the pure transition API; that API is covered by the machine guide and multiple runnable examplesMilestone status
Completed:
more-parallelcases and the 54-case configured SCXML suiteStill open:
0.7.0through the GitHub Release flowUser impact
Users and contributors now have one maintained example collection with no stale alternate path. No public API, package contents, or runtime behavior changes.
Validation
poetry run python -m pytest tests/test_examples.py -q(5 passed)poetry run python -m pytest tests/ --ignore=tests/test_scxml.py(397 passed)poetry run python -m pytest tests/test_scxml.py(54 passed)poetry run mypy src/xstate/poetry run ruff format --check src/ tests/ docs/examples/poetry run ruff check src/ tests/ docs/examples/git diff --check