pub struct KeyFirstGate {
pub opts: RouteOptions,
pub frame: PromptFrame,
pub can_render: bool,
}Expand description
What the key_first policy needs to take a decision
(resolve_lookup_gated): that the decision was the ROUTER’s own (a
caller that pinned the target passes no gate — --route backbone,
--skill none and a forced record are never overridden) and the
conditions the router’s own pick of the record would have met.
Fields§
§opts: RouteOptionsThe routing options of the decision: a record the router could not
pick under them (router::is_routable — active with a
measured gate, or any non-retired class with include_quarantine)
is not taken by key_first either.
frame: PromptFrameThe frame the request generates under, and whether the caller can
render the user text as cmf-im-v1: the record’s prompt_contract
is checked exactly as for the router’s pick
(router::enforce_prompt_contract).
can_render: boolImplementations§
Source§impl KeyFirstGate
impl KeyFirstGate
Sourcepub fn new(opts: RouteOptions, frame: PromptFrame) -> Self
pub fn new(opts: RouteOptions, frame: PromptFrame) -> Self
A router decision under opts for a request framed as frame
(no rendering).
Sourcepub fn can_render(self, on: bool) -> Self
pub fn can_render(self, on: bool) -> Self
The caller can render a raw prompt as cmf-im-v1 (run).