Skip to main content

lean_ctx_proxy/
rollout.rs

1// SPDX-License-Identifier: Apache-2.0
2//! Public rollout cohort schema and deterministic assignment reference.
3//!
4//! The protocol implementation hashes task IDs and returns cohort metadata;
5//! it never evaluates eligibility or makes a model/provider decision.
6//! Production rollout intelligence remains in `lean-ctx-enterprise` (Class D).
7
8pub use lean_ctx_protocol::rollout::{
9    RolloutAssignment, RolloutCohort, RolloutConfig, assign_rollout,
10};
11
12#[cfg(test)]
13mod tests {
14    use super::*;
15
16    #[test]
17    fn proxy_exposes_deterministic_assignment() {
18        let config = RolloutConfig {
19            cohorts: vec![RolloutCohort {
20                name: "internal".to_owned(),
21                percentage: 100,
22                eligibility_override: false,
23                kill_switch: false,
24            }],
25        };
26        let first = assign_rollout("task-1", &config);
27        assert_eq!(first, config.assign("task-1"));
28        assert_eq!(first.cohort.as_deref(), Some("internal"));
29    }
30}