Return type annotations on behaviors, tasks, triggers, events, and agent plans — validated at compile time in Rust and the TypeScript mirror (Phases 28–34).
Example:
examples/features/typed_handler_returns.sd
behavior status() -> Bool {
return true;
}
task Monitor every 50ms -> Bool {
return battery_ok;
}
every 100ms -> Bool {
return true;
}
when lidar.nearest_distance > 1.0 m -> Bool {
return true;
}
while operating -> Bool {
return true;
}
event Alert;
on Alert -> Bool {
return true;
}
Mismatching return types are compile errors:
behavior bad() -> Bool {
return 1; // error: expected Bool, found Number
}
When an agent is granted propose_motion or execute, the plan block must return SafeAction
(not raw ActionProposal):
agent Navigator {
uses planner;
can [ propose_motion ];
plan {
let proposal = planner.reason(prompt: "...", input: scan);
let action = safety.validate(proposal);
return action; // SafeAction required
}
}
See agentic-programming.md for capability enforcement.
can[] default denyAn empty can [] denies high-risk actions at runtime (Phase 32):
agent Restricted {
can [];
plan { /* propose_motion denied at runtime */ }
}
Example: examples/features/agent_can_deny.sd
Typed handlers participate in DAP stepping. Debug sessions enter from behavior, task every, or
top-level every trigger bodies.
Example: examples/integration/debugger_every.sd ·
debugging.md
on health … becomes)