Repository navigation
Conversation
Machine.Mermaid renders what DOT renders, for a mermaid block in Markdown
that GitHub draws in place: groups are composite states, nested and left
out exactly as DOT's clusters, with inherited transitions drawn once from
the composite under the same conditions; an internal transition is a line
inside its state; [*] marks the start and follows a terminal.
The two renderers share one layout, so they cannot disagree about which
states a group holds or which arrows leave its boundary. Names are only
labels, behind positional ids, and every character Mermaid reads as syntax
or markup is written as an entity code, in the comment for an undrawn
group too, since Mermaid applies a %%{ directive even there. Every shape
the tests pin was rendered with mermaid-cli.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Machine.Mermaid()renders whatDOT()renders, for a```mermaidblock in Markdown that GitHub draws in place. It's motivated by the grpcproc leader README, which will embed its election, singleton and peer-view machines and keep them current with a test.%%comment, both exactly as DOT handles clusters. An inherited transition is drawn once from the composite, under DOT's three conditions.Stay) are lines inside their state, below its name, rather than loops.[*]points at theInitialstate, and every terminal state points at[*].layout(boxed and unboxed groups, nesting, owners, boundary tails and skips), so the two diagrams can't disagree. DOT's output is byte-identical; every existing golden test passes unchanged.s0,g0). Characters Mermaid reads as syntax or markup become entity codes, including in the comment for an undrawn group, because Mermaid applies a%%{…}%%directive even inside a comment. An empty name becomes a zero-width space, and the title isstrconv.Quoted YAML.Every pinned shape was rendered with
@mermaid-js/mermaid-cli, along with the four grpcproc leader machines. That includes edges between states in different composites: Mermaid's docs call them unsupported, but it draws them.Tests: golden outputs for nesting and crossing groups, internal transitions, guards, no-Initial and escapes;
ExampleMachine_Mermaid; determinism inFuzzMachineInvariants; and the concurrent-introspection test. Coverage stays at 100%. A code review ran and its findings are addressed; the claim about cross-composite edges was refuted by rendering.🤖 Generated with Claude Code