wire-form

Body SchemaThe class whose generated (kanonak-codec) shape the JSON tail parses against. REQUIRED when encodedAs is JsonBody; forbidden otherwise.Byte LengthExact byte count. REQUIRED when encodedAs is FixedBytes; forbidden otherwise.ConstantOne named constant. Embedded within its group's wire.constants list.Constant GroupA named registry of wire constants (channel ids, frame kinds, op codes) — generated as typed constants in every language, so cross-boundary numbers are never…Constant NameThe constant's logical name (lowerCamelCase; rendered per language idiom).Constant ValueThe constant's numeric value. Must fit the group's membersEncodedAs range.ConstantGroupShapeConstantsThe group's members. constantNames MUST be unique within the group.ConstantShapeDeclarationMarker superclass for the wire artifacts a package author declares — Structs, Unions, and ConstantGroups. Generators detect a package's wire surface as its…EmptyStructsAreVariantsOnlyA Variant MAY declare zero fields (a tag-only message). A standalone Struct declaration MUST declare at least one field.Encoded AsThe field's wire form: a Primitive member, or a declared Struct/Union (composition — the referenced declaration's layout is encoded in place).FieldOne field of a Struct (or Variant). Embedded within its owner's wire.fields list; never a standalone declaration.Field NameThe generated accessor's logical name (lowerCamelCase). Each language port renders it per idiom — the name, like everything else here, is authored once.FieldOrderIsByteOrderThe wire.fields list order IS the byte layout. Implementations MUST encode and decode fields in list order with no padding, alignment, or reordering.FieldsThe Struct's fields, IN BYTE ORDER — the list order is the wire layout. At most one tail-typed field (Rest, JsonBody), and only in final position.FieldShapeFixed BytesExactly byteLength raw bytes (the Field MUST carry wire.byteLength). Decoded as a zero-copy view where the language has one.FixedBytesRequiresLengthA field typed FixedBytes MUST carry wire.byteLength; any other field type MUST NOT.GenerateDontInterpretWire declarations MUST be realized as generated static codecs; implementations MUST NOT interpret declarations on the per-frame data path.JSON BodyAll remaining bytes decoded as strict UTF-8 and parsed as JSON against the Field's wire.bodySchema class. A tail type: legal only as the FINAL field. Never…JsonBodyRequiresSchemaA field typed JsonBody MUST carry wire.bodySchema; any other field type MUST NOT.KernelSemanticsPrimitive semantics are defined by the kanonak-wire runtime kernel at wireFormatVersion "1" (big-endian, strict UTF-8, lowercase UUID canonical form, fail-loud…LayoutVersioningWire messages carry no in-band version. Any change to a Declaration's layout (fields, order, types, tags, constants) MUST ship as a new package version, never…Length-Prefixed UTF-8A u16be byte length, then exactly that many bytes decoded as strict UTF-8. Unlike the tail types this may appear at any position. Added for a real consumer: a…Members Encoded AsThe wire type of every member. Version 1 permits U8, U16BE, or U32BE.PrimitiveThe closed set of primitive field types. Byte semantics are defined by the kanonak-wire runtime kernel, wireFormatVersion "1" — big-endian integers,…RestAll remaining bytes (possibly zero), as a zero-copy view. A tail type: legal only as the FINAL field of its Struct or Variant.StructAn ordered sequence of Fields encoded back-to-back with no padding, no alignment, and no in-band version byte (layout changes require a new package version).…StructShapeTag ValueThe discriminator value selecting this variant. Unique within the Union.Tagged ByThe discriminator primitive read before the variant body. Version 1 permits U8 only (widen only with a real consumer).TagValuesUniqueAndInRangeWithin a Union, every Variant's tagValue MUST be unique and MUST fit the taggedBy primitive's value range. Decoders MUST fail loudly (UnknownTag) on an…TailTypesLastA field typed Rest or JsonBody MUST be the final field of its Struct or Variant, and at most one such field may appear.U16BETwo bytes, big-endian, unsigned, 0..65535.U32BEFour bytes, big-endian, unsigned, 0..2^32-1. Languages without a fitting unsigned type widen (e.g. Java long) — exactness above 2^31 is normative.U8One byte, unsigned, 0..255.UnionA discriminated union: the tag (taggedBy's primitive) is read first, then exactly the matching Variant's fields. An unrecognized tag is a loud UnknownTag error…UnionShapeUUIDExactly 16 bytes. String form is lowercase hyphenated 8-4-4-4-12; any 16 bytes are legal (no version/variant validation).VariantOne arm of a Union: a Struct (ordered fields) plus the tagValue that selects it. Embedded within its Union's wire.variants list; never a standalone declaration.Variant NameThe generated variant's logical name (lowerCamelCase).VariantsThe union's arms. tagValue decides dispatch; list order carries no wire meaning. tagValues MUST be unique within the Union and fit taggedBy's range.VariantShapeWire FormAnything a Field may be encoded as: a Primitive member, or a declared Struct or Union. Abstract — never instantiated directly.