Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SafeRoutes — an S-shaped route ending at a verified destination

SafeRoutes

Fuel-safe road-trip intelligence for OpenClaw agents.

An OpenClaw-compatible Agent Skill for deterministic, stateful, and auditable US road-trip planning.

OpenClaw compatible Agent Skill CI Python 3.11 or newer

What is SafeRoutes?

SafeRoutes is an OpenClaw-compatible Agent Skill that turns natural-language trip requests into fuel-range-safe driving plans. It plans and re-plans US road trips from manual addresses, verifies real gas, lodging, and repair stops, persists every change in a reversible trip tree, and hands the selected route off to Google Maps.

The repository ships a framework-neutral skill package in skill/ and a machine-readable CLI that emits one structured JSON object per action. OpenClaw can load the package as a standard skill; a thin native-tool adapter can promote that same CLI to a first-class saferoutes function tool. The adapter improves discovery and invocation—the safety and routing logic remain inside SafeRoutes.

Agent-native Fuel-safe Stateful Auditable
SKILL.md contract and JSON CLI Vehicle range is a hard planning constraint plan, update, undo, and status share a reversible trip tree Every run persists plans, maps, tool traces, and logs

SafeRoutes is intentionally not turn-by-turn GPS navigation. It is a static-first planning and re-planning layer that produces evidence-backed route artifacts an agent can explain, inspect, and hand off to a navigation app.

Iron law: the agent only produces judgements about the world (open / closed / road description) — it never edits the route. Every route decision converges in the Orchestrator (a pure function). The agent is a sensor/verifier; the function is the decider.

Design is the single source of truth—see docs/:

  • 01_SYSTEM_DESIGN.md — V3 architecture (components, data model, interfaces, algorithms, errors, config).
  • 02_MVP_SPEC.md — MVP scope, acceptance criteria, test layers, DoD.
  • 03_ROADMAP.md — MVP → V1 → V2 → V3 evolution.

Real-world results with OpenClaw agents

SafeRoutes has been exercised through a live OpenClaw gateway with real model turns, tool calls, routing providers, persisted plans, and session transcripts—not just mocked model responses. The evaluations show that lower-cost, general-purpose agents can execute the workflow correctly once the tool is easy to discover; the largest gain came from making SafeRoutes a native function tool instead of asking the model to discover a prompt-level skill.

OpenClaw agent to SafeRoutes tool and auditable output bundle

The interface change

Before the redesign, an agent had to notice injected skill text, read its instructions, and construct a shell command. web_search was a much shorter path, and all three agents missed SafeRoutes on autonomous requests. After the redesign, saferoutes appears directly in OpenClaw's function-tool list and can produce the complete bundle in one structured call.

Before and after the first-class-tool redesign

Measured outcomes: two evidence layers

The numbers below deliberately separate the historical three-model live baseline from the post-redesign MiniMax-M3 rerun. We have not claimed that all three models achieved M3's post-redesign score.

1. Three-model baseline: execution quality and speed

The 2026-06-17 baseline ran 41 cases × 3 models = 123 real OpenClaw runs. Although autonomous discovery was still broken, agents that actually invoked SafeRoutes were usually able to extract parameters and continue route trees correctly.

Three-model baseline correctness, trigger rate, and average wall time

Agent Correct after invocation Named-request trigger rate Mean wall time (A/B/C/E)
GLM-5.2 91% 55% 121s
MiniMax-M3 100% 25% 75s
MiMo-2.5-Pro 75% 40% 257s

This baseline established the engineering diagnosis: using the route tool correctly was not the main bottleneck; deciding to invoke it was. See the full report and 123 raw result rows. The timing column covers the 35 non-gap A/B/C/E cases per model; the six D-class ingestion/gap cases are preserved in the raw results but excluded from that latency comparison.

2. Post-redesign: focused MiniMax-M3 proof

The first-class-tool redesign was then tested in 10 additional live M3 cases: six requests did not name SafeRoutes, and four explicitly supplied a waypoint. Full means that the agent invoked SafeRoutes and returned the route, fuel, lodging/repair, and Google Maps bundle; named cases also had to persist the requested waypoint.

MiniMax-M3 results after the first-class-tool redesign

Post-redesign outcome Result
Full single-turn outcomes 9/10 (90%)
Autonomous triggers 5/6 (~83%), up from 0/12
Named waypoint cases 4/4 Full
Native SafeRoutes calls 9/10
web_search escapes 0/10
Mean wall time across the 10 turns 101.8s

The one counted failure asked for the vehicle's safe range before planning; it did not fabricate a route or fall back to web search. This was a 10-case, single-repetition (K=1) M3 validation, not a three-model post-redesign benchmark. See the redesign report and raw rerun results.

What one successful run actually produced

Case A-L1-01 was an ordinary Chinese request—“plan my drive from Pittsburgh to West Lafayette”—that did not name SafeRoutes. MiniMax-M3 made one native saferoutes call, made zero web_search calls, persisted trip 8241dc0ec036, and returned a 425-mile route with two fuel stops, lodging, repair coverage, warnings, and a Google Maps deep link. The complete agent turn took 119.8 seconds.

Roadbook overview rendered from the retained post-redesign M3 plan

Representative lines from the retained live run.log:

stage:geocode done in 250.5ms
google routes: 3 candidate(s) returned, 3 kept
stage:route done in 414.3ms
stage:plan+score done in 1558.5ms
stage:render done in 119.9ms

The full trace keeps provider failures and fallback behavior instead of hiding them. Inspect the tool trace, tool timing summary, persisted plan, itinerary, redacted OpenClaw transcript, or the evidence provenance note.

More retained outputs from real agents

These are separate Full-verdict round-two examples for the models whose roadbook snapshots were retained (GLM, M3, and Qwen). They demonstrate the actual rendered output and are not used as the post-redesign comparison above.

GLM-5.2 · waypoint route MiniMax-M3 · gap recovery Qwen3.7-max · route plan
GLM-5.2 SafeRoutes roadbook overview MiniMax-M3 SafeRoutes roadbook overview Qwen3.7-max SafeRoutes roadbook overview
run.log · tools.jsonl run.log · tools.jsonl run.log · tools.jsonl

Traceability from prompt to evaluator verdict

Every score can be followed back through the evaluation evidence index, redacted transcript manifest, tool trace, persisted plan, and rendered map. Editable diagrams.net sources for all five figures are in docs/assets/readme/openclaw-eval/.

Limits: no post-redesign three-model rerun has been performed; the live tests validate software/tool behavior, not a person physically driving the route. Historical logs also do not contain comparable dollar-cost accounting, so efficiency claims here use elapsed time, tool-call count, and output completeness—not invented cost savings.

Quick start

uv sync --extra dev               # install deps + dev tooling
uv run saferoutes \
    --from "5522 Baum Blvd, Pittsburgh PA" \
    --to   "1717 University Ave, Berkeley CA" \
    --depart 2026-06-02T07:00 [--avoid-highway]

Output lands in ./out/<timestamp>/: map.html + plan.json + run.log.

Tests (CI makes zero real API calls)

uv run ruff check . && uv run mypy .   # lint + type-check
uv run pytest -m unit                  # pure functions, no network
uv run pytest -m integration           # mocked externals, no network
uv run pytest -m agent                 # cassette replay, no network
uv run pytest -m arch                  # import / architecture guard
make smoke                             # E2E against real APIs (manual / nightly)

Configuration

  • Secrets live in .env (never committed, never logged): OPENROUTER_API_KEY, TAVILY_API_KEY, FIRECRAWL_API_KEY, GOOGLE_ROUTES_API_KEY.
  • Tunables (weights / vehicle / model) live in saferoutes/config.py.
  • See .env.example for the expected variable names.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages