Normalized routing decision returned by Spectre.
A route is the stable handoff between router and runner. It contains the selected label, handler, strategy, scores, and metadata needed for logging or host decisions.
Summary
Functions
Builds an accepted deterministic route from a compiled rule.
Builds a normalized route struct.
Types
@type t() :: %Spectre.Route{ accepted?: boolean(), confidence: float() | nil, core_route: term(), definition_injections: [Spectre.Prompt.Operation.t()], escalation_reason: String.t() | nil, fallback_error: term(), flow: atom() | nil, handler: Spectre.Rule.handler() | nil, injections: [Spectre.Prompt.Operation.t()], label: atom() | nil, labels: [atom()], local: map() | nil, margin: float() | nil, owner: module() | nil, raw: term(), rule: Spectre.Rule.t() | nil, scope: Spectre.Definition.scope() | nil, scores: map(), semantic_cache: term(), semantic_cache_after: term(), semantic_examples: [map()], strategy: atom(), terminal?: boolean() }
Functions
@spec from_rule(Spectre.Rule.t(), atom(), String.t() | nil) :: t()
Builds an accepted deterministic route from a compiled rule.
raw is the matched input text, or nil when inspecting a declaration or
restoring its dispatch identity without retaining the original transport.
route = Spectre.Route.from_rule(rule, :regex, "hello")
Builds a normalized route struct.
route = Spectre.Route.new(label: :hello, accepted?: true)