pub struct Policy {
pub defaults: Defaults,
pub target: BTreeMap<String, TargetPolicy>,
pub flows: Option<FlowsPolicy>,
pub journal: Option<JournalLocation>,
pub telemetry: Option<TelemetryPolicy>,
}Expand description
The whole keel.toml document (contracts/policy.schema.json), typed.
deny_unknown_fields at every object level (here and on the layer structs)
makes a typo’d or unknown key a configuration error (KEEL-E001 with the exact
path via serde_path_to_error), honoring the frozen schema’s
additionalProperties: false and E001’s “an unknown key was used” — instead
of the previous silent drop that ran the target on defaults the user never
asked for.
Fields§
§defaults: Defaults§target: BTreeMap<String, TargetPolicy>§flows: Option<FlowsPolicy>§journal: Option<JournalLocation>Journal location (schema-validated), honored by the real core at
configure time (see JournalLocation).
telemetry: Option<TelemetryPolicy>Telemetry config (schema-validated); otlp_endpoint is honored by
native front ends (env still wins), console is not yet wired — see
TelemetryPolicy.
Implementations§
Source§impl Policy
impl Policy
Sourcepub fn resolve_target(
&self,
method: &str,
host: &str,
scheme: Option<&str>,
port: Option<u16>,
path: Option<&str>,
) -> String
pub fn resolve_target( &self, method: &str, host: &str, scheme: Option<&str>, port: Option<u16>, path: Option<&str>, ) -> String
The policy target key for one outbound request. See the module-level
precedence comment above OUTBOUND_METHODS for the four tiers.
Sourcepub fn known_llm_hosts() -> Vec<(&'static str, &'static str)>
pub fn known_llm_hosts() -> Vec<(&'static str, &'static str)>
Every host the LLM host map (tier 1 of resolve_target’s precedence)
knows about, as (host, provider) pairs — the enumeration twin of
resolve_target‘s single-lookup form. Not tied to any policy
instance: the map is a hardcoded constant, identical for every
Policy. Lets front-end packs’ targets() (consumed by keel doctor/keel init documentation output) enumerate every known LLM
provider host without holding their own copy (issue #49). Vertex’s
REGIONAL endpoints are matched by suffix (VERTEX_REGIONAL_SUFFIX),
not enumerated here — there is no fixed list of regions to list.