feat(cmd/crucible): render SVG/PNG via embedded Graphviz with a Forge theme#185
Merged
Conversation
… theme render gains -format svg|png (alongside dot|mermaid) and -o. Images render in-process through goccy/go-graphviz (Graphviz compiled to WebAssembly via wazero), so no external Graphviz install is needed. The CLI applies the Forge/Crucible brand (ember borders, copper edges, charcoal text) by injecting DOT default attributes before rendering; ownership fills and final-state rings are preserved. The dependency lives only in cmd/crucible. The state engine is untouched and stays stdlib-only; the README and a new THIRD_PARTY_NOTICES.md scope the "stdlib-only" guarantee to the library and attribute go-graphviz (MIT) and the bundled Graphviz (EPL). Closes #176.
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.
Closes #176.
What
crucible rendergains-format svg|png(alongsidedot/mermaid) and-o. Images render in-process viagoccy/go-graphviz(Graphviz compiled to WebAssembly, run throughwazero) — no external Graphviz install required.The CLI applies the Forge/Crucible brand (ember borders, copper edges, charcoal text) by injecting DOT default attributes before rendering; state's per-node ownership fills and final-state rings are preserved.
Dependency & the "stdlib-only" claim
The dependency lives only in
cmd/crucible(a leaf binary). Thestateengine is untouched and stays stdlib-only. This PR makes the README's "stdlib-only / no forced dependencies" language precise — it's a guarantee about the library you import, with the CLI tool the one disclosed exception — and addsTHIRD_PARTY_NOTICES.mdattributing go-graphviz (MIT) and the Graphviz it bundles (EPL).goccy/go-graphvizis MIT, CGO-free (WASM via wazero — the same runtime thewasmmodule already uses). It pinswazero v1.10.1; thewasmmodule uses v1.12.0 — separate workspace modules, no conflict.Verification
state: unchanged (1113 tests still pass).cmd/cruciblein-workspace: build/vet/test (94)/golangci-lint — all green.cmd/cruciblestandalone (GOWORK=off): build + test green — i.e.go install-style consumers work.svgoutput contains<svgand the brand colors reach the SVG;pngwrites valid PNG (magic bytes) to-o/stdout;jpg/unknown → usage error; thedot/mermaidtext output is unchanged.