open-standards/wai/live-conformance/native-sink/README.md
Transaction Science 77cdcf7f93 wai: native sink in CI, the changelog and SPEC §5, the package README and simulator runner
wai-conformance.yml runs the native sink's module tests, tests/native_sink.rs and
native_sink_verify.py; wai-audit.yml has the page replay the native sink corpus's
page-parity case; wai-sink-swift.yml builds every slice of the package's binary target
and runs the package's tests on the desktop and in the phone and television simulators,
and builds the device slices. scripts/test-simulator.sh builds the test bundle for a
simulator and runs it there through simctl; on a host whose simulator service is older
than its Xcode's, it says so and fails, since a run that did not happen is not a pass.
The simulator slice of the phone SDK holds both architectures. packaging is cited by its
section heading. The corpus is listed in live-conformance/README.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 23:23:19 -04:00

3.7 KiB

live-conformance/native-sink — the native sink

The corpus of extensions/native-sink.md §10: scripts of the calls a native host makes to its sink over one session, each with the answer the call gets, and the outcome the owner's collector reaches for the session's bundle (stream-audit §10).

Sink equivalence. For each case, a conforming sink opened with the case's config, the session key whose seed is seed and the start start_us, and given each call's do in order, gives each call the answer it states: a playlist's verdict (§4.2), an object's verdict (§4.3), an observation's {"end"} (§6.1), {"ok": true} for an event, a parent receipt, an energy entry or an attachment, a CMCD batch, or the bundle (stream-audit §9) as the JSON text the sink writes; and a refused call {"error": <reason>}. The bundle, verified for owner serving channels, reaches the case's outcome. Each configuration under configs is refused with the reason it states. A sink that gives another answer, byte or reason does not conform.

Provenance. Generated here: wai_native_sink_vectors gen writes vectors.json from fixed seeds. Each key is SHA-256 of the corpus's label (wai:native-sink/corpus/key, a zero byte) and an index byte (0 the owner, 1 the publisher that seals the playlists, 2 a stranger); each session's seed is SHA-256 of wai:native-sink/corpus/session, a zero byte and an index byte; every time is a constant after 2026-10-25T00:00:00Z; and Ed25519 signing is deterministic (RFC 8032), so the file is the same bytes on every machine. The media are the reference package pack-conformance/packs/video-base-01's floor: its CMAF initialization section and five fragments, each named by its SHA-256 (packaging §7), copied byte for byte; a tampered fragment differs from its original in one bit of its last byte. The WAI objects are opaque test bytes (WAI1 and a SHA-256 of a label), named by their content hashes, which nothing decodes. The playlists are written here: the floor's, in the form http-delivery Appendix G renders, sealed by playlist receipts under the publisher's key; a WAI playlist of the objects; live revisions chained by their receipts; and a stream of another service, with a key, program times and an ad marked by EXT-X-DATERANGE. The observation cadences, stalls and energy figures are synthetic constants chosen to exercise the rules and were measured by nothing. The origins are .example names (RFC 2606). The generator asserts that each case gets the answers it was written to have before it writes it.

Layout

One file, vectors.json:

  • owner, channels: the collector's key and the channels it serves;
  • objects: every body a call names, hexadecimal, by name;
  • configs: configurations a session refuses;
  • cases: each with its name, a note, its config, seed, start_us, calls (each a do and its answer) and the bundle's outcome:
    • signed-vod, tampered-fragment, unsigned-refused, receipt-refusals, live-chain, wai-objects, live-rebound, third-party-ad, content-addressed, names-are-names, hidden, idle, energy, log-order, page-parity and refused-calls.

page-parity is also replayed by the page's integration of stream-audit, wai-audit/web/native-sink.test.mjs, which signs the same bundle byte for byte.

Rebuilding: cd wai/wai-rs && cargo run --no-default-features --features native_sink --bin wai_native_sink_vectors gen ../live-conformance/native-sink; … verify ../live-conformance/native-sink checks it; python3 -I ../live-conformance/native_sink_verify.py ../live-conformance/native-sink is the second implementation.