Skip to main content

lean_ctx_proxy/
auto_routing.rs

1// SPDX-License-Identifier: Apache-2.0
2//! Legacy `model=auto` wire types, kept for compatibility only.
3//!
4//! The types live in `lean_ctx_protocol` and are a frozen experimental surface
5//! (`security/public-protocol-surface-freeze-v1.json`: not removed before the
6//! next protocol major). The Engine re-exports them and does nothing with
7//! them: the proxy never selects, ranks or substitutes a model or provider,
8//! and holds no gate that would admit such a selection. The former
9//! cost-improvement gate (`check_auto_eligibility`) is removed.
10
11pub use lean_ctx_protocol::auto_routing::{
12    AutoRoutingConfig, AutoRoutingEvidence, AutoRoutingRequest, RoutingDecision, RoutingMode,
13    RoutingReceipt, SchedulerGate,
14};
15
16#[cfg(test)]
17mod tests {
18    use super::*;
19
20    #[test]
21    fn proxy_reexports_protocol_wire_types() {
22        let request = AutoRoutingRequest {
23            task_id: "task-1".to_owned(),
24            requested_model: Some("model".to_owned()),
25            routing_mode: RoutingMode::Shadow,
26        };
27        let json = serde_json::to_string(&request).expect("request serializes");
28        let decoded: AutoRoutingRequest = serde_json::from_str(&json).expect("request parses");
29        assert_eq!(decoded, request);
30    }
31}