You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cascade compiles a manifest into GitHub Actions workflows, but the shape of the pipeline it
produces - the job DAG, the environment promotion chain, the cross-repo flows - is only
visible by reading generated YAML. This epic adds a first-class way to render the pipeline as
a diagram so a reader can see, at a glance, what cascade will do.
The first and only emit target is Mermaid. GitHub renders Mermaid natively in Markdown,
issues, and pull requests, so a Mermaid diagram is committable to a README and viewable in a
PR with no external tooling. That native rendering is the entire reason to start here.
The renderer is built behind a pluggable emit layer so a higher-fidelity render engine
can be added later (see the deferred follow-up) without reworking the model. The architecture
mirrors the separation proven in the sibling crucible project: viewmodel -> render -> theme -> emit
(crucible/cmd/crucible/internal/viewmodel builds a render-agnostic model; its render
package emits source under a Theme). cascade adopts the same split: an abstract pipeline
view model, a theme layer, and an Emitter interface whose first implementation is Mermaid.
What we render (grounded in the real model)
The visualizer reads cascade's existing internal model - it introduces no new manifest fields:
Job DAG - internal/generate/graph.go: DependencyGraph{Nodes, Edges, OptionalEdges, Order}, CallbackInfo{Name, JobID, DisplayName, Type, ...}, BuildDependencyGraph(cfg),
and TopologicalSort(). This is the job-level graph (validate -> builds -> deploys with
hard and optional edges).
Environment promotion chain - internal/config (TrunkConfig.Environments, EnvState, EnvState.IsDiverged(), EnvStateSnapshot, PromotionMode default/cascade)
and internal/promote (+ internal/hotfix): the dev -> ... -> prod chain plus the hotfix
divergence and rejoin states.
Cross-repo flow - internal/configExternalRepoConfig, ExternalDeployConfig, NotifyConfig (satellite repo notifies its primary after a dev deploy), and ExternalDeployState: the primary repo coordinating its dependent satellite repos.
Full job DAG - every job and edge from DependencyGraph.
Where it lives
A new top-level CLI command sits alongside the existing root subcommands registered in cmd/cascade/main.go (generate-workflow, plan, verify, status, environments, external, promote, hotfix, ...). The verb is cascade graph (see the CLI child issue for
the verb decision).
Integration hooks
A committable diagram in a repo README (run the command, paste/commit the Mermaid).
Optionally, a diagram of the pending change in the generated PR plan-preview lane
(PRPreviewConfig / cascade-pr-preview.yaml, the read-only preview from feat: optional PR plan-preview workflow #40).
A docs page under docs/src/content/docs/.
Theming
A separable theme layer (mirroring crucible's Theme / DefaultTheme split) templates the
Mermaid init directive and classDef styling. Ship a cascade theme and a monotone bland
theme, and accept a user-supplied theme file.
Child issues and dependency order
render core + view model + Mermaid emitter <- foundation, no deps
CLI command: cascade graph <- depends on render core
three granularities <- depends on render core, CLI
theme templating + two built-in themes <- depends on render core
cross-repo artifact rendering <- depends on render core, granularities
monorepo / multi-component rendering <- depends on render core, granularities AND monorepo epic #279
integration hooks: README + PR preview + docs <- depends on CLI, granularities
DEFERRED: robust render engine behind emitter <- depends on render core; later, lower priority
Summary
cascade compiles a manifest into GitHub Actions workflows, but the shape of the pipeline it
produces - the job DAG, the environment promotion chain, the cross-repo flows - is only
visible by reading generated YAML. This epic adds a first-class way to render the pipeline as
a diagram so a reader can see, at a glance, what cascade will do.
The first and only emit target is Mermaid. GitHub renders Mermaid natively in Markdown,
issues, and pull requests, so a Mermaid diagram is committable to a README and viewable in a
PR with no external tooling. That native rendering is the entire reason to start here.
The renderer is built behind a pluggable emit layer so a higher-fidelity render engine
can be added later (see the deferred follow-up) without reworking the model. The architecture
mirrors the separation proven in the sibling
crucibleproject:viewmodel -> render -> theme -> emit(
crucible/cmd/crucible/internal/viewmodelbuilds a render-agnostic model; itsrenderpackage emits source under a
Theme). cascade adopts the same split: an abstract pipelineview model, a theme layer, and an
Emitterinterface whose first implementation is Mermaid.What we render (grounded in the real model)
The visualizer reads cascade's existing internal model - it introduces no new manifest fields:
internal/generate/graph.go:DependencyGraph{Nodes, Edges, OptionalEdges, Order},CallbackInfo{Name, JobID, DisplayName, Type, ...},BuildDependencyGraph(cfg),and
TopologicalSort(). This is the job-level graph (validate -> builds -> deploys withhard and optional edges).
internal/config(TrunkConfig.Environments,EnvState,EnvState.IsDiverged(),EnvStateSnapshot,PromotionModedefault/cascade)and
internal/promote(+internal/hotfix): the dev -> ... -> prod chain plus the hotfixdivergence and rejoin states.
internal/configExternalRepoConfig,ExternalDeployConfig,NotifyConfig(satellite repo notifies its primary after a dev deploy), andExternalDeployState: the primary repo coordinating its dependent satellite repos.Components map[string]ComponentConfigshape. This depends on the multi-component schema model existing and is therefore gated;
see the monorepo rendering child issue and the monorepo epic epic: schema_version 2 - additive, opt-in monorepo support in a single manifest #279.
Three granularities
DependencyGraph.Where it lives
A new top-level CLI command sits alongside the existing root subcommands registered in
cmd/cascade/main.go(generate-workflow,plan,verify,status,environments,external,promote,hotfix, ...). The verb iscascade graph(see the CLI child issue forthe verb decision).
Integration hooks
(
PRPreviewConfig/cascade-pr-preview.yaml, the read-only preview from feat: optional PR plan-preview workflow #40).docs/src/content/docs/.Theming
A separable theme layer (mirroring crucible's
Theme/DefaultThemesplit) templates theMermaid init directive and
classDefstyling. Ship acascadetheme and a monotoneblandtheme, and accept a user-supplied theme file.
Child issues and dependency order
cascade graphcommand with--granularityand--format#302 CLI command:cascade graphwith--granularityand--format(depends on visualizer: pipeline view model + pluggable emitter + Mermaid emitter #301)cascade graphcommand with--granularityand--format#302)cascadeandblandbuilt-in themes #304 Theme templating withcascadeandblandbuilt-in themes (depends on visualizer: pipeline view model + pluggable emitter + Mermaid emitter #301)cascade graphcommand with--granularityand--format#302, visualizer: three rendering granularities (env / stages / jobs) #303)Out of scope (for now)
and is purely additive thanks to the pluggable emitter.