1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! # firstpass-proxy
//!
//! An HTTP proxy that sits as a drop-in `base_url` in front of Anthropic/OpenAI-compatible
//! providers. In **observe** mode it forwards each request unchanged and records a
//! tamper-evident audit trace asynchronously (zero added latency). In **enforce** mode it runs
//! the escalation engine — cheapest model first, gate the output, escalate one rung on failure,
//! serve the first output that passes — with cross-provider failover (SPEC §7.1, §7.1a, §9.1).
//!
//! - [`config`] — [`ProxyConfig`], loaded from the environment.
//! - [`store`] — the background SQLite trace writer.
//! - [`calibrate`] — recalibrate the conformal serving threshold from deferred feedback.
//! - [`upstream`] — BYOK passthrough to the upstream provider (observe mode).
//! - [`provider`] — normalized multi-provider model access (Anthropic, OpenAI).
//! - [`gate`] — runtime verification gates (Batch 3 inline set).
//! - [`router`] — the enforce-mode escalation engine.
//! - [`proxy`] — axum routing, observe passthrough, and enforce dispatch.
//! - [`error`] — structured, no-leak error responses.
//! - [`metrics`] — Prometheus recorder install + `GET /metrics`.
//! - [`cli`] — `firstpass doctor` / `trace` logic (validate a setup, read the store).
//! - [`mcp`] — minimal MCP stdio server so an agent can read its traces and submit feedback.
//! - [`run`] — shared server bootstrap for the `firstpass` and `firstpass-proxy` binaries.
pub use ProxyConfig;
pub use ProxyError;
pub use ;
pub use ;