Goal: Wire AI models into robots and understand why ActionProposal cannot drive actuators
directly.
Examples:
examples/showcase/rover_navigation.sdexamples/showcase/ai_safety_violation.sd
(intentional compile error — execute(ActionProposal))examples/showcase/ai_safety_drive_bypass.sd
(intentional compile error — drive fed from ActionProposal fields)AI output is untrusted. Spanda enforces this at compile time:
// INVALID — compile error
wheels.execute(proposal);
wheels.drive(linear: proposal.linear, angular: proposal.angular);
// VALID — only SafeAction reaches hardware via execute()
let action = safety.validate(proposal);
wheels.execute(action);
planner.reason(...) returns an ActionProposal. Only safety.validate() produces a
SafeAction that execute() accepts. ActionProposal fields cannot feed drive() /
follow() either. Literal non-AI drive(...) is still allowed and is clamped by max_speed /
optional max_angular at runtime.
ai_model planner: LLM {
provider: "mock";
model: "safe-planner";
temperature: 0.1;
}
In alpha, providers are simulated ("mock"). The syntax is stable for when live providers ship.
agent Navigator {
uses planner;
tools [lidar, camera, wheels];
goal "Navigate safely";
plan {
let scan = lidar.read();
let scene = camera.analyze();
let proposal = planner.reason(
prompt: "Plan safe forward motion",
input: scene
);
let action = safety.validate(proposal);
wheels.execute(action);
}
}
behavior run() {
loop every 100ms {
Navigator.plan();
}
}
The agent encapsulates perception → reasoning → validation → actuation.
spanda check examples/showcase/ai_safety_violation.sd
Expect a type error mentioning ActionProposal. This is the language working as designed.
spanda check examples/showcase/rover_navigation.sd
spanda run examples/showcase/rover_navigation.sd
For the full flagship walkthrough (verify + sim + fault injection), see killer-demo.md.
rover_navigation.sd structure into your projectstop_if lidar.nearest_distance < 0.4 m in safety { }spanda check passes and spanda run executes without type errors