af-web 0.2.0

Reusable axum web infrastructure: request-id + latency-SLO middleware, JSON error envelope, health. The cross-cutting half of agent_core/api/.
Documentation

af-web — reusable axum web infrastructure (the cross-cutting half of agent_core/api/). Provides:

  • [ApiError] — JSON error envelope carrying the request id.
  • [middleware::request_id] / [middleware::latency_slo] — request-id propagation and the API latency SLO (warn past [middleware::SLO_BUDGET_MS]).
  • [with_standard_middleware] — wrap any Router with the standard stack.
  • [health] — a ready-made health handler.
  • [metrics] — a minimal Prometheus-compatible liveness metric.

A service composes its product routes and wraps them:

let app = with_standard_middleware(
    Router::new().route("/health", get(health)).merge(product_routes),
);