# `Jidoka.Agent.Spec.Result`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/agent/spec/result.ex#L1)

Structured app-facing result contract for an agent.

The result contract is intentionally provider-neutral. It stores a Zoi schema
used by the runtime after a model returns a final decision, plus a bounded
repair count for deterministic retry behavior.

# `t`

```elixir
@type t() :: %Jidoka.Agent.Spec.Result{
  max_repairs: integer(),
  metadata: map(),
  schema: any()
}
```

# `from_input`

```elixir
@spec from_input(t() | keyword() | map() | term()) :: {:ok, t()} | {:error, term()}
```

Normalizes a result contract or treats a schema value as the contract schema.

# `new`

```elixir
@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}
```

Builds a structured-result contract from keyword or map attributes.

# `new!`

```elixir
@spec new!(keyword() | map()) :: t()
```

Builds a structured-result contract and raises if the attributes are invalid.

# `schema`

```elixir
@spec schema() :: Zoi.schema()
```

Returns the Zoi schema for a structured-result contract.

# `validate`

```elixir
@spec validate(t(), term()) :: {:ok, term()} | {:error, term()}
```

Validates and normalizes a value through the result schema.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
