# `Pixir.Provider.OutputTruncation`
[🔗](https://github.com/Ranvier-Technologies/pixir/blob/main/lib/pixir/provider/output_truncation.ex#L1)

Provider-neutral evidence about whether a successful model response ended because
the Provider truncated its output.

The value is deliberately independent from operational `finish_reason`: a response
can contain executable, finalized tool calls and still be positively truncated. Raw
Provider terminal tokens are retained only when they are bounded, valid UTF-8, and
contain the conservative identity alphabet used by this contract.

Missing and malformed historical evidence normalizes to an explicit `:unknown`
value. It is never inferred from token counts, text length, transport closure, or a
requested output cap.

# `t`

```elixir
@opaque t()
```

# `from_event_data`

```elixir
@spec from_event_data(term()) :: t()
```

Normalize the nested object in canonical `provider_usage` data.

# `from_result`

```elixir
@spec from_result(term(), module()) :: t()
```

Normalize the evidence carried by one successful Provider result.

# `normalize`

```elixir
@spec normalize(term()) :: t()
```

Normalize a struct or atom/string-keyed neutral evidence map.

# `not_truncated`

```elixir
@spec not_truncated(term()) :: t()
```

Build explicit Provider evidence that output was not truncated.

# `provider_reason`

```elixir
@spec provider_reason(t() | term()) :: String.t() | nil
```

Return the bounded raw Provider terminal token, if retained.

# `reason`

```elixir
@spec reason(t() | term()) :: atom() | nil
```

Return the neutral reason enum, if any.

# `status`

```elixir
@spec status(t() | term()) :: atom()
```

Return the neutral status enum.

# `summary`

```elixir
@spec summary(t() | term()) :: String.t()
```

Return a bounded redacted summary that never includes the raw Provider token.

# `to_event_data`

```elixir
@spec to_event_data(t() | term()) :: map()
```

Project the opaque value into a string-keyed canonical Event map.

# `to_result_map`

```elixir
@spec to_result_map(t() | term()) :: map()
```

Project the opaque value into an atom-keyed Provider result map.

# `truncated`

```elixir
@spec truncated(term(), term()) :: t()
```

Build explicit positive truncation evidence.

# `truncated?`

```elixir
@spec truncated?(t() | term()) :: boolean()
```

True only for explicit, valid positive truncation evidence.

# `unknown`

```elixir
@spec unknown(term(), term()) :: t()
```

Build explicit uncertainty evidence.

---

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