Spanda

Spanda examples

Runnable .sd programs for learning, demos, regression, and CI. Start here if you learn by reading code.

Guided tutorials: Tutorials index · Spanda 101 · Getting started

Platform pillars: docs/pillars/ · Solution blueprints: ROADMAP.md § Blueprints


By platform pillar & blueprint

Examples tagged by Platform Pillar and Official Solution Blueprint.

Directory Pillar(s) Blueprint
basics/ Language, Developer Research & Education
features/ Language, Verification
showcase/ Verification, Developer Research & Education
showcase/autonomous_rover/ Verification, Device & Fleet Research & Education
showcase/self_healing/ Verification
showcase/continuity/ Device & Fleet, Verification Warehouse
showcase/compliance/ Security, Verification Critical Infrastructure
showcase/secure_boot/ Security Defense
security/ Security Defense
communication/ Device & Fleet
end_to_end/warehouse_delivery/ Device & Fleet, Verification Warehouse Automation
end_to_end/pick_and_place_cell/ Verification, Device & Fleet Smart Factory
solutions/agriculture/ Device & Fleet, Verification Agriculture
solutions/adas/ Verification, Device & Fleet, Security ADAS
solutions/spatial-computing/ Device & Fleet, Operations SAR, Healthcare, Spatial HRI
solutions/smart-spaces/ Verification, Device & Fleet, Operations Smart Spaces & Ambient Intelligence
iot/ Packages, Device & Fleet Environmental Monitoring
packages/ Packages & Ecosystem
robotics/ Verification, Packages Smart Factory

Quick start (three pillars)

Evaluators and new users should run these first:

Pillar Command File
Safety spanda check … (expect fail) showcase/ai_safety_violation.sd
Verify spanda verify … --target RoverV1 showcase/hardware_compatibility.sd
Sim spanda sim … showcase/killer_demo.sd

Walkthrough: docs/killer-demo.md · Index: showcase/README.md

spanda check examples/showcase/ai_safety_violation.sd && exit 1 || true
spanda check examples/showcase/killer_demo.sd
spanda verify examples/showcase/hardware_compatibility.sd --json --target RoverV1
spanda sim examples/showcase/killer_demo.sd

Learning ladder

Work through tiers in order, or jump via features/README.md (one file per capability).

Tier Directory Index Spanda 101
1 — Basics basics/ README Lessons 1–5, 9
2 — Integration integration/ triggers, concurrency, verify Lessons 7–8
3 — Features features/ README Lookup by topic
4 — End-to-end end_to_end/ README Lesson 10
5 — Packages packages/ README Lesson 9

By topic

Topic Directory Doc
Showcase demos showcase/ killer-demo.md
Real-time & reliability realtime/ realtime.md
Mission replay end_to_end/replay_mission.sd replay.md
Triggers & concurrency triggers_demo.sd, concurrency.sd triggers.md
Communication & fleet communication/ concurrency.md
Hardware & deploy hardware/ hardware-compatibility.md
Health & capabilities hardware/capability_verification.sd health-checks.md
IoT & live bridges iot/ iot.md
Live AI providers features/live_openai.sd live-ai-provider.md
Testing & compile-fail basics/12_compile_fail_tests.sd testing.md
Verification diagnostics hardware/capability_verification.sd verification-diagnostics.md
Robotics platform robotics/ robotics-platform.md
Mission assurance assurance/, anomaly/, diagnostics/, prognostics/, resilience/, mission/, showcase/assurance/, showcase/continuity/ mission-assurance.md · mission-continuity.md
Self-healing & recovery showcase/self_healing/, showcase/fleet_recovery/ self-healing.md
Readiness & go/no-go showcase/readiness/ readiness.md
Regex regex/ regex.md
Security security/ secure-communication.md
FFI & ROS2 ffi_*.sd, ros2_bridge.sd ffi-and-ecosystem.md
Adapter bridges adapters/ ros2-golden-path.md
Package layouts packages/ packages.md
Publish mirror workflow packages/publish_mirror_project/ registry.md
Standard library std/ standard-library.md
Type snippets types/ spanda-type-system.md
Modules modules/ spanda-language.md

Official packages (lean-core)

Domain integrations (ROS2, MQTT, GPS, fleet, OTA, …) ship as optional official packages under packages/registry/. Example projects show how to depend on them:

spanda check examples/packages/ros2_adapter_package/src/main.sd
spanda verify-adapter examples/packages/nav2_adapter_package

Registry catalog: docs/official-packages.md (37 hosted packages, including 8 mission assurance packages) · Architecture: docs/lean-core.md


Notable single-file demos (repo root)

File Topic
lidar_avoidance.sd Classic lidar stop
ai_navigation.sd AI + navigation
humanoid_assistant.sd Humanoid agent pattern
warehouse_logistics.sd Logistics workflow
jetson_inspection.sd Edge vision / Jetson

Regression & CI

All examples are type-checked in CI Integration (core-smokes job on main):

./scripts/check_all_examples.sh

PR gate locally: ./scripts/ci-fast.sh · CI tiers: docs/ci-architecture.md

Golden fixtures: tests/golden/manifest.json · Vitest: npm test -- tests/golden/rust.test.ts

Tier 3 experimental golden paths (MQTT, twin cloud, LLVM, cpp-native, ledger, world model, self-host lexer): docs/tier-3-golden-paths.md


Adding an example

  1. Place under the right tier (basics/, features/, end_to_end/, …)
  2. Header comment with spanda check / run commands
  3. Update the directory README and features/README.md if applicable
  4. Add to docs/tutorials/README.md when it is a learning resource
  5. Optional: tests/golden/manifest.json for CI

See CONTRIBUTING.md.