Documentation
¶
Overview ¶
Package kindcheck answers "do these facts-CBOR bytes claim kind K?" for hosts that must validate a payload at a boundary without importing the payload's Go type (ADR-0135 §SD1: the window host refuses a malformed or mistargeted launch config before the target app sees it).
The boxer.facts sparse-CBOR wire carries no kind marker — a row's kind is implied by which vocabulary membership ids populate its tagged sections, and only the kind's generated codec knows that set. So the check cannot be a header peek; instead each codec module registers a probe minted from its own generated decoder, and Check runs the claimed kind's probe against the bytes. A probe failure (garbage, truncation, or a payload whose memberships belong to another kind) refuses the claim.
Registration is one hand-written init line per module (see launchrequest/register.go); the generated .out.go files are untouched. Only kinds that cross a validated boundary need to register — the registry is deliberately not a census of the codec corpus.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PackageProps = packageprops.Props{ WASMWASI: packageprops.WASMBlocked, WASMJS: packageprops.WASMBlocked, WASMFreestanding: packageprops.WASMBlocked, }
PackageProps records this package's curated properties (ADR-0080). Seeded by `boxer code analysis golang wasmsurvey props generate`; curate by hand. The same group's `props verify` reconciles it.
Functions ¶
func Check ¶
Check verifies that b decodes as the claimed kind. An unregistered kind is refused — the caller cannot distinguish "unknown kind" from "kind with no codec", and both must fail closed.
func PeekKind ¶
PeekKind identifies which registered kind b decodes as by probing all registrations. Exactly one probe must accept: zero acceptances refuse the bytes (garbage, truncation, or an unregistered kind), and more than one is reported as ambiguous rather than resolved by iteration order. Diagnostic / test helper; boundary code that already holds a claimed kind should call Check instead.