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
Give cascade users a way to answer "what would happen if I ran this?" locally, before they
touch a real pipeline. cascade already generates the workflows that drive promotion,
hotfix, rollback, and release. The orchestration decisions those workflows make are
implemented in cascade's own Go packages. A simulator surfaces those decisions locally so a
user can preview the outcome of an action against their real manifest and current state.
Two fidelity tiers
Tier 1 - cascade simulate (lead with this; light, in-process, no containers). Given
the manifest, the current ci.state, and a hypothetical action (promote A to B, hotfix a
commit set into an environment, rollback, release), run the SAME orchestration logic the
generated workflows invoke, in-process, and print the resulting state diff (before to
after) plus the ordered sequence of effects. This extends the existing --dry-run into a
full what-if that reports the computed outcome rather than just suppressing mutation. It
validates the ORCHESTRATION (state transitions, gating, divergence, rejoin), NOT the user's
real build or deploy scripts. Fast, no Docker, runnable anywhere.
Tier 2 - high-fidelity local integration (later, heavier). Productize cascade's
existing e2e harness (e2e/harness/: act + gitea + testcontainers) as a user-facing
integration simulator. The user supplies their manifest and deploy stubs; cascade runs the
GENERATED workflows locally through act against a gitea instance, with deploys stubbed. This
exercises the real generated YAML end to end. It requires Docker and is aimed at power users
and CI, not the everyday inner loop.
Scope boundary (applies to both tiers)
The simulator validates cascade's ORCHESTRATION, not the user's deploy scripts. Builds and
deploys are stubbed or recorded. In Tier 1 they never execute; in Tier 2 they run as inert
stub workflows. A green simulation means "cascade would sequence and transition state
correctly," not "your deploy succeeds." This boundary is stated in every issue and in the
docs page so users do not mistake the simulator for a deploy test.
E2E harness Tier 2 productizes: e2e/harness/ (act.go, gitea.go, harness.go, scenario.go, runner.go), scenario fixtures in e2e/scenarios/*.yaml, deploy stubbing
via generateStubWorkflow in harness.go.
Root command wiring for a new simulate subcommand: cmd/cascade/main.go.
Composition with the visualizer
When the env state-machine visualizer lands, cascade simulate can render the simulated
PATH on the visual graph (before to after, with the traversed edges highlighted). That work
depends on the visualizer view-model and follows the visualizer core (visualizer epic #300). Tracked here as a nice-to-have, not a blocker for Tier 1.
Plus a nice-to-have tracked only here (promote to a standalone issue once the visualizer
view-model exists): visualizer composition - render the simulated path on the state-machine
graph (depends on the Tier 1 core, the actions, AND the visualizer epic #300).
Recommended sequencing: core, then actions and deploy-stub in parallel, then Tier 2 and docs.
Acceptance for the epic
cascade simulate exists and previews promote, hotfix, rollback, and release outcomes
with no GitHub calls and no containers.
The orchestration-not-deploys boundary is enforced in code and documented.
The Tier 2 integration path is available for users who supply Docker and deploy stubs.
Summary
Give cascade users a way to answer "what would happen if I ran this?" locally, before they
touch a real pipeline. cascade already generates the workflows that drive promotion,
hotfix, rollback, and release. The orchestration decisions those workflows make are
implemented in cascade's own Go packages. A simulator surfaces those decisions locally so a
user can preview the outcome of an action against their real manifest and current state.
Two fidelity tiers
Tier 1 -
cascade simulate(lead with this; light, in-process, no containers). Giventhe manifest, the current
ci.state, and a hypothetical action (promote A to B, hotfix acommit set into an environment, rollback, release), run the SAME orchestration logic the
generated workflows invoke, in-process, and print the resulting state diff (before to
after) plus the ordered sequence of effects. This extends the existing
--dry-runinto afull what-if that reports the computed outcome rather than just suppressing mutation. It
validates the ORCHESTRATION (state transitions, gating, divergence, rejoin), NOT the user's
real build or deploy scripts. Fast, no Docker, runnable anywhere.
Tier 2 - high-fidelity local integration (later, heavier). Productize cascade's
existing e2e harness (
e2e/harness/: act + gitea + testcontainers) as a user-facingintegration simulator. The user supplies their manifest and deploy stubs; cascade runs the
GENERATED workflows locally through act against a gitea instance, with deploys stubbed. This
exercises the real generated YAML end to end. It requires Docker and is aimed at power users
and CI, not the everyday inner loop.
Scope boundary (applies to both tiers)
The simulator validates cascade's ORCHESTRATION, not the user's deploy scripts. Builds and
deploys are stubbed or recorded. In Tier 1 they never execute; in Tier 2 they run as inert
stub workflows. A green simulation means "cascade would sequence and transition state
correctly," not "your deploy succeeds." This boundary is stated in every issue and in the
docs page so users do not mistake the simulator for a deploy test.
Grounding in the current code
internal/globals/globals.go(SetDryRun/DryRun),internal/promote/command.goandinternal/promote/promote.go(--dry-runguards),internal/hotfix/plan.go+internal/hotfix/finalize.go(WithDryRun,WithFinalizeDryRun),internal/rollback/command.go(report(..., dryRun)).internal/promote:Promoter(NewPromoter,Promote) inpromote.go,Finalizerin
finalize.go, rejoin inrejoin.go.internal/hotfix:Planner(PlanChain, multi-commit/multi-env) inplan.goandchain.go,Finalizerinfinalize.go, divergence handling.internal/rollback:Rollbacker(New,Plan,Apply) inrollback.go, historyin
history.go.internal/release:Managerinrelease.go.internal/config/types.go-EnvState(withSHA,Version,Builds,Deploys,External,Ref,BaseSHA,Patches,Previous,IsDiverged()),DeployState,BuildState,EnvStateSnapshot.e2e/harness/(act.go,gitea.go,harness.go,scenario.go,runner.go), scenario fixtures ine2e/scenarios/*.yaml, deploy stubbingvia
generateStubWorkflowinharness.go.simulatesubcommand:cmd/cascade/main.go.Composition with the visualizer
When the env state-machine visualizer lands,
cascade simulatecan render the simulatedPATH on the visual graph (before to after, with the traversed edges highlighted). That work
depends on the visualizer view-model and follows the visualizer core (visualizer epic
#300). Tracked here as a nice-to-have, not a blocker for Tier 1.
Child issues (dependency order)
cascade simulatewhat-if engine (state diff + effect sequence)Plus a nice-to-have tracked only here (promote to a standalone issue once the visualizer
view-model exists): visualizer composition - render the simulated path on the state-machine
graph (depends on the Tier 1 core, the actions, AND the visualizer epic #300).
Recommended sequencing: core, then actions and deploy-stub in parallel, then Tier 2 and docs.
Acceptance for the epic
cascade simulateexists and previews promote, hotfix, rollback, and release outcomeswith no GitHub calls and no containers.