pub struct EnforceCtx<'a> {Show 17 fields
pub ladder: &'a [String],
pub gates: &'a [Box<dyn Gate>],
pub health: &'a GateHealthRegistry,
pub base_request: &'a ModelRequest,
pub providers: &'a ProviderRegistry,
pub auth: &'a Auth,
pub prices: &'a PriceTable,
pub budget_per_request_usd: Option<f64>,
pub max_rungs: u32,
pub speculation: u32,
pub serve_threshold: Option<f64>,
pub features: Features,
pub tenant_id: String,
pub session_id: String,
pub prompt_hash: String,
pub api: String,
pub policy_id: String,
}Expand description
Everything the engine needs for one decision. Borrowed to avoid cloning the ladder/request
per call; owned trace-context strings so the resulting Trace is self-contained.
Fields§
§ladder: &'a [String]Model ladder, cheapest first, as provider/model strings.
gates: &'a [Box<dyn Gate>]Gates run against each attempt’s output (already resolved).
health: &'a GateHealthRegistryPer-gate error budgets: a gate over budget is skipped (auto-disabled) this request.
base_request: &'a ModelRequestThe base request; its model is overwritten per rung.
providers: &'a ProviderRegistryProvider lookup.
auth: &'a AuthBYOK credentials for this request.
prices: &'a PriceTablePrice table for cost + counterfactual math.
budget_per_request_usd: Option<f64>Per-request USD cap (None = uncapped).
max_rungs: u32Hard ceiling on rungs attempted this request.
speculation: u32Prefetch depth: fire this many rungs ahead concurrently while gating in ladder order.
0 = serial (the default): one call at a time, byte-identical to the original engine.
serve_threshold: Option<f64>Calibrated conformal serve threshold (SPEC §10.1): a rung serves iff its aggregate gate
score is >= this value. None (the default) keeps the original rule — serve iff the
aggregate gate verdict is Pass — byte-identical to the original engine.
features: FeaturesFeature vector routed on (recorded in the trace).
tenant_id: StringTenant id.
session_id: StringSession id.
prompt_hash: StringSalted prompt hash (never the raw prompt).
api: StringWire API label, e.g. "anthropic.messages".
policy_id: StringPolicy identity, e.g. "static-ladder@v0".