Examples
Six small programs, one idea each. They live in examples/ in the repository, and cargo test -p vertep-examples runs every one and compares what it prints with the output shown on these pages.
Traffic light
An SCXML chart driven through the pure core: a parallel state, delayed sends, a host that owns the clock.
Open →Typed order
A typed YAML chart on CEL: vt typecheck, vt schema, vt gen ts, and a type error with its location.
Open →Rust macro
A turnstile written with statechart!, with guards and actions as ordinary Rust functions.
Open →Durable actor
A virtual actor on a tiramemsu journal: the process stops, a new one replays it, and a durable timer fires.
Open →Decider agent
Two vt:decide choice points answered by a scripted decider, then replayed with no decider at all.
Open →Browser and Node.js
@vertep/web from Node.js: spawn from SCXML text, send, subscribe, read the journal, travel back.
Open →Setup
The Rust examples need only the workspace toolchain. For the vt commands, install the CLI from the checkout, or alias it to cargo:
cargo install --path crates/vertep-cli # puts `vt` on your PATH
# or
alias vt='cargo run -q -p vertep-cli --bin vt --'
The browser example needs the JavaScript packages built once; its page shows how.
How they stay honest
examples/tests/run_examples.rsruns each binary and compares its output with theexpected-output.txtnext to it. It also runs the Node.js example when Node and itsnode_modulesare present.examples/tests/vt_commands.rsruns thevtcommands and compares them with the recorded files undervt/.- After an intended change,
VERTEP_BLESS=1 cargo test -p vertep-examplesre-records the outputs, andpython3 site/tools/sync-examples.pyrewrites these pages.