# ASCII byte contracts

Sources reviewed 2026-11-20: RFC 20 (code table and control functions),
Unicode 17 section 2.5.3 (ASCII transparency), and WHATWG Encoding section
4.2 (label resolution), plus Node.js v24.22.2 Buffer character encodings. Links appear in the ASCII record and article.

The Python probe enumerates all 256 possible one-byte inputs under the
standard-library strict ASCII codec. It records 128 accepted values and 128
rejections, plus six fixed ASCII/UTF-8 examples. NUL and DEL are valid ASCII
codes, not printable text. C3 A9 is valid UTF-8 but not ASCII.
The separate Node tests exercise WHATWG TextDecoder label resolution:
ascii and us-ascii select windows-1252, including when fatal is true.
Additional Buffer tests exhaust 256 byte values: decoding with ascii clears
the high bit. They compare this with TextDecoder and demonstrate that the
ascii encode/decode round trip is not reversible for a non-ASCII value.
Source: https://nodejs.org/download/release/v24.22.2/docs/api/buffer.html#buffers-and-character-encodings

Run with Python 3 and Node (tested runtime versions appear in receipts):

    python3 -B probe.py
    python3 -B -m unittest discover -s . -p test_probe.py
    python3 -B -O -m unittest discover -s . -p test_probe.py
    node --test whatwg.test.mjs

Only intentional regeneration uses probe.py --write. results.json records
the interpreter and probe SHA-256; the check compares observations and source
hash without requiring a later machine to have the same interpreter version.
Both sites carry identical public files. No external Python package is needed.

These are exhaustive single-byte checks plus bounded multi-byte/API examples,
not an encoding detector, complete Unicode conformance suite, filesystem
experiment or estimated frequency of failed restores. Byte-range validity
does not establish the original encoding or a destination filename policy.

## Delimiter-conversion controls (2026-11-21)

Additional Node tests check 80 -> U+0000, AE -> U+002E, AF -> U+002F and
DC -> U+005C under Buffer ASCII decoding. Input 61 AF 62 has no 2F byte,
but becomes the string a/b. Checking the converted output for the ASCII
range therefore cannot establish that the original bytes were ASCII.
These are constructed in-memory codec checks: no path is opened, no archive
is extracted, and no filesystem or product vulnerability is established.
