Skip to content

feat(cmd/crucible): render SVG/PNG via embedded Graphviz with a Forge theme#185

Merged
joshua-temple merged 1 commit into
mainfrom
feat/cli-render-svg-png
Jun 17, 2026
Merged

feat(cmd/crucible): render SVG/PNG via embedded Graphviz with a Forge theme#185
joshua-temple merged 1 commit into
mainfrom
feat/cli-render-svg-png

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Closes #176.

What

crucible render gains -format svg|png (alongside dot/mermaid) and -o. Images render in-process via goccy/go-graphviz (Graphviz compiled to WebAssembly, run through wazero) — 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). The state engine 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 adds THIRD_PARTY_NOTICES.md attributing go-graphviz (MIT) and the Graphviz it bundles (EPL).

  • goccy/go-graphviz is MIT, CGO-free (WASM via wazero — the same runtime the wasm module already uses). It pins wazero v1.10.1; the wasm module uses v1.12.0 — separate workspace modules, no conflict.
  • Cost: a transitive image-lib tree → larger CLI binary. Acceptable for a leaf tool.

Verification

  • state: unchanged (1113 tests still pass).
  • cmd/crucible in-workspace: build/vet/test (94)/golangci-lint — all green.
  • cmd/crucible standalone (GOWORK=off): build + test green — i.e. go install-style consumers work.
  • End-to-end against the binary: svg output contains <svg and the brand colors reach the SVG; png writes valid PNG (magic bytes) to -o/stdout; jpg/unknown → usage error; the dot/mermaid text output is unchanged.

… 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.
@joshua-temple joshua-temple merged commit 9e8efd5 into main Jun 17, 2026
121 checks passed
@joshua-temple joshua-temple deleted the feat/cli-render-svg-png branch June 17, 2026 17:05
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.

render: emit SVG/PNG directly instead of only DOT

1 participant