digraph Smoke {
    graph [goal="Verify the sandbox can lint and test the project", retry_target=exit]
    rankdir=LR

    start [shape=Mdiamond, label="Start"]
    exit  [shape=Msquare, label="Exit"]

    toolchain          [label="Toolchain", shape=parallelogram, script="rustc --version && cargo --version && bun --version 2>&1", goal_gate=true]
    compile_rust       [label="Compile Rust", shape=parallelogram, script="cargo check -q --workspace 2>&1", goal_gate=true]
    compile_typescript [label="Compile TypeScript", shape=parallelogram, script="cd apps/fabro-web && bun install && bun run typecheck 2>&1", goal_gate=true]
    lint_rust          [label="Lint Rust", shape=parallelogram, script="cargo +nightly-2026-04-14 fmt --check --all 2>&1 && cargo +nightly-2026-04-14 clippy -q --workspace --all-targets -- -D warnings 2>&1", goal_gate=true]
    test_rust          [label="Test Rust", shape=parallelogram, script="ulimit -n 4096 && cargo nextest run --cargo-quiet --workspace --status-level fail 2>&1", goal_gate=true]
    test_typescript    [label="Test TypeScript", shape=parallelogram, script="cd apps/fabro-web && bun test 2>&1", goal_gate=true]

    start -> toolchain
    toolchain -> compile_rust
    compile_rust -> compile_typescript
    compile_typescript -> lint_rust
    lint_rust -> test_rust
    test_rust -> test_typescript
    test_typescript -> exit
}
