# `Spectre.Inference.StreamAdapter.Conformance`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/inference/stream_adapter/conformance.ex#L1)

Adapter-neutral checks for the normalized streaming protocol.

Provider packages pass a portable inference descriptor and deterministic
transport messages from an isolated fixture. The runner verifies capability
negotiation, open/resume shape, pull-credit discipline, normalized event
batches, global provider ordering, UTF-8 reassembly, terminal cardinality,
optional cancel or reconcile replies, and mandatory enforcement of the raw
transport-chunk and parser-residual bounds. Real network flow control,
cancellation, and credentials remain adapter-owned integration tests.

# `report`

```elixir
@type report() :: %{
  capabilities: MapSet.t(atom()),
  transport: :pull | :push,
  transport_requests: non_neg_integer(),
  transport_items: non_neg_integer(),
  ignored_messages: non_neg_integer(),
  events: non_neg_integer(),
  bounds: %{
    max_transport_chunk_bytes: pos_integer(),
    max_parser_residual_bytes: pos_integer()
  },
  bound_checks: %{transport_chunk: :enforced, parser_residual: :enforced},
  terminal: atom() | nil,
  cancel: :not_exercised | :accepted | {:error, atom()},
  reconcile: :not_exercised | atom()
}
```

# `run`

```elixir
@spec run(module(), Spectre.Inference.Descriptor.t(), [term()], keyword()) ::
  {:ok, report()} | {:error, term()}
```

Runs the protocol contract over deterministic transport messages.

Important options are `:profile`, `:adapter_opts`, `:open_mode`
(`:open` or `{:resume, cursor}`), `:require_terminal?`, `:cancel_after?`,
`:reconcile_provider_request_id`, `:max_events_per_transport_item`, and
`:max_delta_bytes`. `:max_transport_chunk_bytes` and
`:max_parser_residual_bytes` are mandatory adapter bounds with safe defaults.
The adapter must implement `StreamAdapter.conformance_fixture/4`; the runner
supplies an oversized binary and uses the returned fixture to prove both
bounds through real `handle_transport/2` calls.

---

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