📘 Context
A fleet dispatch AI assistant must enforce US DOT (FMCSA) Hours of Service rules
to prevent drivers from being assigned routes that would push them past legal
or safe driving limits.
This policy acts as a deterministic gate on every dispatch decision, ensuring
agents cannot dispatch a load that creates HOS violations or fatigue risk.
🎯 The Goal
Write a driver hours-of-service compliance policy for a logistics AI assistant.
Variables you can use:
driver_id (String): Unique driver identifier.
hours_driven_today (Float): Total hours driven in the current 24-hour window.
hours_on_duty_today (Float): Total hours on duty (driving + non-driving).
consecutive_days_worked (Integer): Days worked without a 34-hour reset.
last_rest_break_minutes_ago (Integer): Minutes since the last 30-minute break.
route_estimated_hours (Float): Estimated drive time for the proposed route.
cargo_type (Enum): "GENERAL", "HAZMAT", "PASSENGERS".
dispatcher_approved (Boolean): Whether a human dispatcher approved the override.
Requirements:
- BLOCK if
hours_driven_today + route_estimated_hours > 11 (FMCSA 11-hour driving limit).
- BLOCK if
hours_on_duty_today + route_estimated_hours > 14 (FMCSA 14-hour on-duty window).
- BLOCK if
consecutive_days_worked >= 7 and dispatcher_approved is False.
- BLOCK if
last_rest_break_minutes_ago >= 480 (8h driving max without 30-min break).
- BLOCK if
cargo_type == "HAZMAT" and hours_driven_today + route_estimated_hours > 10.
- ESCALATE if
cargo_type == "PASSENGERS" and hours_driven_today + route_estimated_hours > 9.
📚 Resources
- Start here:
docs/getting-started.md
- Check syntax:
quickstart/01_hello_world.csl
- See how examples are structured:
examples/community/
✅ Definition of Done
Submit a PR with: examples/community/logistics_driver_hos_gate.csl
📘 Context
A fleet dispatch AI assistant must enforce US DOT (FMCSA) Hours of Service rules
to prevent drivers from being assigned routes that would push them past legal
or safe driving limits.
This policy acts as a deterministic gate on every dispatch decision, ensuring
agents cannot dispatch a load that creates HOS violations or fatigue risk.
🎯 The Goal
Write a driver hours-of-service compliance policy for a logistics AI assistant.
Variables you can use:
driver_id(String): Unique driver identifier.hours_driven_today(Float): Total hours driven in the current 24-hour window.hours_on_duty_today(Float): Total hours on duty (driving + non-driving).consecutive_days_worked(Integer): Days worked without a 34-hour reset.last_rest_break_minutes_ago(Integer): Minutes since the last 30-minute break.route_estimated_hours(Float): Estimated drive time for the proposed route.cargo_type(Enum): "GENERAL", "HAZMAT", "PASSENGERS".dispatcher_approved(Boolean): Whether a human dispatcher approved the override.Requirements:
hours_driven_today + route_estimated_hours > 11(FMCSA 11-hour driving limit).hours_on_duty_today + route_estimated_hours > 14(FMCSA 14-hour on-duty window).consecutive_days_worked >= 7anddispatcher_approvedis False.last_rest_break_minutes_ago >= 480(8h driving max without 30-min break).cargo_type == "HAZMAT"andhours_driven_today + route_estimated_hours > 10.cargo_type == "PASSENGERS"andhours_driven_today + route_estimated_hours > 9.📚 Resources
docs/getting-started.mdquickstart/01_hello_world.cslexamples/community/✅ Definition of Done
Submit a PR with:
examples/community/logistics_driver_hos_gate.csl