Mimir.Descriptor (Mimir v0.1.0)

Copy Markdown View Source

The workload descriptor — the public contract a workflow step presents to a routing oracle. Pure validation: no persistence, no process state.

quality_bar is reserved for eval-scored routing; a non-nil value is REJECTED (not ignored) until scorecards exist.

agent is optional correlation identity for the caller: a content digest plus an optional display name/version, carried through as plain data (e.g. into decision records) without the descriptor needing to know what an "agent" is beyond that shape.

max_outcome_iterations is a budget hint for outcome-evaluated sessions — an outcome session may revise its answer up to that many times before settling, so budget-scaling layers can widen ceilings for it the same way they do for fan-out hints.

Summary

Functions

Validate and build a t() from a plain map. Accepts atom or string keys. Rejects a non-nil quality_bar and any unknown capability/runtime-preference value rather than silently dropping it.

Types

agent_identity()

@type agent_identity() :: %{
  digest: String.t(),
  name: String.t() | nil,
  version: String.t() | nil
}

capability()

@type capability() :: :tools | :vision | :long_context

runtime_preference()

@type runtime_preference() :: :any | :managed | :local

t()

@type t() :: %Mimir.Descriptor{
  agent: agent_identity() | nil,
  budget_ceiling_microdollars: pos_integer(),
  capabilities: [capability()],
  expected_tokens: %{in: non_neg_integer(), out: non_neg_integer()} | nil,
  latency_tolerance_ms: pos_integer(),
  max_outcome_iterations: pos_integer() | nil,
  quality_bar: nil,
  runtime_preference: runtime_preference(),
  task_class: String.t()
}

Functions

parse(input)

@spec parse(map()) ::
  {:ok, t()}
  | {:error, {:invalid_descriptor, atom(), String.t()}}
  | {:error, :quality_bar_unsupported}

Validate and build a t() from a plain map. Accepts atom or string keys. Rejects a non-nil quality_bar and any unknown capability/runtime-preference value rather than silently dropping it.