Skip to content

Add machine inspection APIs and planner visualizer - #19

Merged
SandroMaglione merged 4 commits into
mainfrom
codex/machine-inspection-api
Aug 6, 2026
Merged

Add machine inspection APIs and planner visualizer#19
SandroMaglione merged 4 commits into
mainfrom
codex/machine-inspection-api

Conversation

@SandroMaglione

@SandroMaglione SandroMaglione commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

  • expose public getters for compiled state nodes, active snapshot configuration, and registered transition definitions without executing handlers
  • allow object-form event, eventless, and completion handlers to declare an upper bound of target paths; inferred transition results are checked at compile time, while unknown declarations and unsafe runtime mismatches are rejected at runtime
  • keep rendering outside core with an experimental text renderer that nests transitions beneath source states and distinguishes declared targets, no direct target, and dynamic handlers
  • declare all 27 platformer transitions and cover its complete inspectable chart as an example of the API on a nested, parallel machine
  • add a standalone planner visualizer that renders states and declared transitions, highlights the active configuration, and steps through enabled events with Machine.plan
  • generate deterministic schema-valid event samples with Schema.toArbitrary, while allowing typed authored fixtures to override samples that need semantic values

Changeset

  • Added or updated for a library or package-metadata change
  • Not required because this PR does not change src/ or package.json

The visualizer-only commit does not need an additional changeset.

Validation

  • pnpm check
  • Relevant example checks, when examples changed
  • Reviewed the automated type-performance report, when the public TypeScript API or inference changed

Additional validation:

  • pnpm check passed with 226 runtime tests, 105 type tests, strict consumer validation, and package verification
  • pnpm perf:types passed; machine.handle measures 21,266 instantiations
  • pnpm check passed in examples/platformer
  • pnpm check passed in examples/visualizer with 8 tests, TypeScript validation, and a production Vite build
  • the visualizer was exercised in a browser through initialization and a planned transition with no console warnings or errors

@SandroMaglione SandroMaglione changed the title Add machine inspection APIs Add machine inspection APIs and planner visualizer Aug 5, 2026
@SandroMaglione
SandroMaglione marked this pull request as ready for review August 5, 2026 16:51
@SandroMaglione
SandroMaglione merged commit 6809080 into main Aug 6, 2026
9 checks passed
@SandroMaglione
SandroMaglione deleted the codex/machine-inspection-api branch August 6, 2026 07:36
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