### The native sink: a platform's own player, verified and evidenced

- **The extension** ([native-sink](extensions/native-sink.md)): what a native host's sink does for a
  stream the host plays through its platform's player, which is not changed and decodes on the
  platform's media engine. The sink sits on the path of the player's requests. It verifies a media
  playlist against its playlist receipt and the chain of its live revisions (http-delivery §8.6),
  the host fetching each parent the chain asks for; it holds an object whose URL states its content
  hash (a WAI object's cid, a floor fragment's SHA-256 name under a signed playlist or by the
  owner's word) to that hash; and it tells the host, object by object, whether it may hand the
  bytes to the player, a refusal withheld and answered with a failed request (§4). It signs
  stream-audit's acknowledgements, claims and session record under a fresh key per session, keeps
  the observation log in order and closed at its end (§5), ends a session nobody can see or whose
  viewer is idle (§6), and states the sink decode and the display as the unmetered marker where the
  platform's decoder runs outside every counter an application reads (§7). One C interface serves
  every native platform (§9). No record of its own.
- **Reference**: `wai-rs` module `native_sink` and its C interface `ffi_sink` (feature
  `native_sink`, pure Rust, no codec library), `include/wai.h` regenerated, the generator
  `wai_native_sink_vectors`, `tests/native_sink.rs` (every corpus case through the C symbols).
- **Corpus** [`live-conformance/native-sink/`](live-conformance/native-sink/): scripts of a host's
  calls with the answer each gets, over the reference package's floor fragments: a signed on-demand
  presentation, a fragment changed in transit, receipts that do not hold, a live chain walked
  through a parent, WAI objects held to their cids, an alias rebound, a stream of another service
  with a key and a marked ad, sessions ended hidden and idle, energy entries, the log's order, and
  refused calls and configurations. Its second implementation, `native_sink_verify.py`, replays
  every case from the text, holds every bundle to its own session field by field, verifies it with
  stream-audit's verifier, and catches every mutation and every dropped check. The page's
  integration of stream-audit replays one case call for call and signs the same bundle byte for
  byte (`wai-audit/web/native-sink.test.mjs`).
- **The Swift package** (`wai/wai-sink-swift`): the wrapper, the loopback relay, the player
  session and the platform's attention signals, with `scripts/build-xcframework.sh` for every
  slice; its tests replay the corpus through the wrapper, run the relay over the reference floor,
  and play a presentation made with the platform's own encoder through the sink to its end, with a
  changed fragment withheld and a session nobody can see ended as hidden.
- **The Kotlin library** (`wai/wai-sink-android`, an AAR): a JNI layer over the C interface
  (`jni/wai_sink_jni.c`, every status carried to Kotlin with libwai's message), libwai and that
  layer built for `arm64-v8a`, `armeabi-v7a` and `x86_64` with a pinned NDK and linked for 16 KiB
  pages; the wrapper, the loopback relay (a random 128-bit path token, 502 for anything refused),
  the observation loop, the collector client, the player session over the platform's media player
  library, and the attention signals from the activity's lifecycle, the window's and the display's
  state, the view's place in its window and the window's input. Its unit tests run on the host JVM
  through the JNI layer over a host build of libwai: every corpus case and refused configuration,
  the `page-parity` bundle byte for byte, the relay over the reference floor, and the loop's
  `hidden` and `idle` endings. Its instrumented tests, in a headless emulator, run the corpus and
  the relay on the device, play the floor (AV1 in CMAF) through the sink to its end, refuse a
  changed fragment on every retry, end a session nobody can see as `hidden`, and read the
  attention signals from a real activity. The extension now says that a window shown without the
  input focus is shown (§6.2), and that a platform's exception for unencrypted HTTP covers the
  loopback address alone (§11).

