Skip to content

feat(api): implement Phase 20 HTTP API with OpenAPI and Swagger - #27

Merged
404khai merged 1 commit into
mainfrom
feat/phase-20-http-api
Oct 10, 2026
Merged

404khai merged 1 commit into
mainfrom
feat/phase-20-http-api

Conversation

@404khai

@404khai 404khai commented Oct 10, 2026

Copy link
Copy Markdown
Owner

What changes

Roadrunner's routing, dispatch and shared operational state were only available through libraries and the CLI. Phase 20 adds a roadrunner-api Axum/Tokio server with generated OpenAPI 3.1 and vendored Swagger UI at /swagger-ui/.

  • Expose all specified route/order/rider/dispatch/delivery/simulation endpoints, plus the approved operational queries, fleet/recovery/cancellation commands, readiness/forecast/traffic updates and observed action lifecycle.
  • Keep one volatile operational authority and publication lane. Assemble server contexts, evaluate outside the writer, certify exact static-road temporal applicability, then publish effects and terminal command recognition together.
  • Bind bearer credentials to stable principals/capabilities/resource scopes and observation sources. Require namespace-qualified intent and principal-scoped idempotency keys; preserve original outcomes across retries and lost responses.
  • Return directed segment GeoJSON, explicit graph/profile/objective/traffic identity, opaque order/rider references and recorded decision/publication evidence. Run simulations in a separate authority.
  • Add run/contracts documentation, controlled race/disconnect tests, and a reproducible loopback HTTP benchmark with raw measurements and hardware/dataset/build/configuration details.

For example, creating an order leaves it unassigned; POST /v1/dispatch evaluates and attempts an authentic publication. Repeating the same key returns that original outcome, while conflicting meaning returns 409. A state change or expiry during evaluation rejects the proposal wholly.

Validation

  • cargo fmt --all -- --check
  • cargo +1.99.0 clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo +1.99.0 test --workspace --all-features --locked: 233 passed; the existing opt-in benchmark remains ignored.
  • Release API build, OpenAPI export/component-reference checks, vendored Swagger HTTP test and native browser inspection.
  • python3 scripts/collect_http_api_benchmark.py: 30 raw samples per workload on the verified 58-node/114-edge fixture; retries/effect counts verified.

See docs/phase-20-completion.md and docs/evidence/phase-20-verification.json for evidence and scope.

Boundaries

The binary requires explicit trusted-local mode, a bearer credential and a loopback bind. Embedded hosts provision actual observation trust. Recognition is volatile and single-process; discarded namespace outcomes are unknown. Operational certification supports free flow/static traffic and retains the existing unknown-prefix/time-dependent proof limits. Persistence, fencing, durable recovery, outbox/inbox and broker delivery remain Phases 21/22. The tiny loopback benchmark is an adapter baseline, not a scalability or SLO claim.

@404khai
404khai merged commit 3e0f907 into main Oct 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant