Generating code
When a model is ready, click Generate Code in Designer’s toolbar. Designer downloads a Rust project, as a zip, that implements the model.
Designer generates Rust. The SDKs support other languages for writing components by hand.
What’s in the project
Section titled “What’s in the project”- A Cargo workspace, with a crate for each State Change and each State View on the canvas.
- A domain crate with a type for every command, event and State View, generated from their schemas.
- A
decidestub for each State Change, with the right signature and atodo!()where the business logic goes. - An
evolvestub for each State View, with a match arm for each event the view folds, marked// TODO. Unlikedecide, an unfilledevolvecompiles and runs: it returns the state unchanged. - Test scaffolds from the model’s specifications: each has the specification’s given data and expected result, and is marked
#[ignore]until you complete it, by calling yourdecideorevolveand uncommenting its assertions. build_all.sh, which compiles every component to WebAssembly.install.sh, which creates the database if it doesn’t exist and publishes the components to it. See Deploying to Sandbox.
Check each State View’s selector. A view’s metadata.json selects the stream of the first event it folds. If the view folds events from more than one stream, widen the selector to cover them, or the other events never reach it.
docker-compose.yml, which runs EvidentSource and its MCP server on your machine, in memory.- A ShadowTraffic configuration, for generating load against the running system.
- A
CLAUDE.mdand agent skills, so an AI coding assistant can help implement the stubs. - A
README.mddescribing the project.
What you need
Section titled “What you need”Rust, with the WebAssembly target: rustup target add wasm32-wasip2.
Regenerating
Section titled “Regenerating”Generating again downloads the whole project again, from the model as it stands. It doesn’t merge with changes you’ve made to an earlier download, so keep the project in version control, and merge each regeneration into it there.
- Deploying to Sandbox: build the components, and publish them.
- Designer → Sandbox: the full walkthrough.