README.md

Go-derived tunnel wire fixtures

../../resources/tunnel/codec-go.json is an independent wire oracle for TunnelFrameGoldenTest. Normal Java tests read the checked-in resource: they do not run Go or require an upstream checkout.

Reproduce

From the Android repository root, with Go 1.25 or newer and an upstream harness checkout available:

sh
1go run ez-agent-lib/src/test/fixtures/tunnelcodec/generate.go \
2 -harness /path/to/ez-agent -check

Omit -check to regenerate the resource. Review the fixture diff when updating upstream. -out /path/to/codec-go.json selects an alternative output.

The generator reads but never modifies the harness. It copies the upstream internal/tunnelpipe/codec.go and pkg/protocol/csv.go verbatim into a temporary, standard-library-only Go module with their original import paths, runs vectors.go there, then removes that module. No Java codec participates in producing the rows. Each valid row is encoded and decoded by upstream Go; every negative row must return upstream ErrFrame before it can enter the resource. The inner module disables dependency downloads and automatic toolchain upgrades.

The JSON provenance records the upstream revision and SHA-256 hashes of the actual codec, CSV helper and contract bytes. A dirty upstream checkout is therefore distinguishable even if its HEAD is unchanged. Byte-for-byte -check comparison includes this source provenance. The fixture does not record or pin the compiler version; the codec's canonical output is expected to be stable across supported Go toolchains.

Coverage and limits

The corpus covers all six pipe-frame kinds, unsigned 32/64-bit boundaries, canonical single-quoted CSV, supplementary Unicode, UTF-8 byte-length limits, binary payloads through the maximum frame size, and rejection of noncanonical numbers, CSV, base64, field counts, controls and oversized data. Java constructs expected frames from independent semantic fields as well as decoding Go rows; this is not just a Java round-trip check.

Go takes UTF-8 bytes while Java takes UTF-16 strings. Unpaired Java surrogates cannot be represented in valid UTF-8 JSON and are tested separately. These are codec fixtures, not proof of pipe flow-control, adapter discovery, RPC routing, SSH, browser or lifecycle behavior; the existing tests and Android end-to-end validation cover those separately.