Skip to content

Publish MachineGraph so consumers can query assembly edges - #99

Merged
russwyte merged 1 commit into
mainfrom
machine-graph
Sep 16, 2026
Merged

russwyte merged 1 commit into
mainfrom
machine-graph

Conversation

@russwyte

Copy link
Copy Markdown
Collaborator

Closes #98.

Machine.transitionMeta and Machine.transitions are private[mechanoid]. Mermaid already walks that list. The in-tree docs demo could too, only because it lives under package mechanoid. A consumer FSM cannot.

MachineGraph reads the same assembly AST:

MachineGraph.hasEdge(machine, from, event)
MachineGraph.destLeaf(machine, from, event)

Semantics:

  • hasEdge is the declared edge, not reducer success. An incomplete Draft can still have a Launch edge; send then fails with ActionFailedError. No edge is InvalidTransitionError.
  • destLeaf is the Goto target leaf name, or the current leaf for Stay / Stop. None when there is no edge.
  • Override last-wins matches the runtime table.
  • Call sites do not hash Finite cases.

Docs demos (PublishDemoUi.canFire / eventTo, OrderDemoUi.eventTo) now use this API. Visualization and Reference cover the queries.

Covered by CI.

hasEdge is the declared transition, not reducer success. destLeaf is the
Goto leaf name, or the current leaf for Stay / Stop. Call sites do not
hash Finite cases.
@russwyte
russwyte merged commit 1f7b554 into main Sep 16, 2026
12 checks passed
@russwyte
russwyte deleted the machine-graph branch September 16, 2026 00:01
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.

Publish MachineGraph so consumers can query assembly edges

1 participant