# `PtcRunner.Kernel.InspectionSink`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/kernel/inspection_sink.ex#L1)

Required owner for bounded streaming private inspection evidence.

The sink validates and deterministically encodes one record at a time, then
appends its length-framed bytes to an exclusive missing-destination
reservation. It retains only incremental digests, identities, counts, and
limits. `seal/1` appends and synchronizes the terminal footer; it never
returns or retains a complete record collection.

A record emitted with digest-results capture has its value replaced by a
deterministic value identity. The sink computes the identity, so an emitter
sends the same message in both capture modes and enabling digest capture
cannot change the emitting process's heap behaviour.

# `t`

```elixir
@type t() :: %PtcRunner.Kernel.InspectionSink{pid: pid(), token: reference()}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `emit`

```elixir
@spec emit(t(), binary(), map(), map(), keyword()) ::
  :ok | {:error, :inspection_sink_error}
```

# `seal`

```elixir
@spec seal(t()) :: {:ok, map()} | {:error, :inspection_sink_error}
```

Seals and synchronizes the streamed artifact and returns bounded publication metadata.

# `start`

```elixir
@spec start(keyword()) :: {:ok, t()} | {:error, :invalid_inspection_sink}
```

# `stop`

```elixir
@spec stop(t()) :: :ok
```

---

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