!!id:"https://tson.io/2026/36/m/meta-kernel-resolved.tn" !!schema:"https://tson.io/2026/36/m/meta-kernel.tn" @doc:""" Resolver-output fixture for meta-kernel.tn (2026 Revision 36 draft). Parse the source schema, run the resolver, canonicalise, compare. Conventions: - Fields at their default values are omitted (`optional: false`, `role: FREE`, `state: REQUIRED`). - `type_definition.supertypes` and `subtypes` are complete and lexically sorted; a resolver's native ordering is implementation-defined, so comparison tools canonicalise both lists, and set-typed fields, before comparing (Part 2 Section 8). - `record.supertypes` inside bodies preserves source order (it records what was written). - `subtypes` lists entries of this map only; inverse edges from schemas that import this one are not represented here. - Source annotations are preserved in their authored positions. A conforming resolver carries the source schema's document-level @doc here; this fixture substitutes this conventions note. - Reference-kind names at type positions are stated as written: a reference is a hop, not a rewrite, so a use site naming an alias names the alias. A processor collapses the chain when it compiles readers, after linking, not in resolved output. - Type-reference positions (`record_field.type`, `tuple_element.element_type`, `type_definition.source`, choice variant elements, and binding-record type slots) hold type_ref values; `name` is type_ref's only REQUIRED field, so a bare name token is the positional form (Part 2 Section 5.6, general over schema-backed data) and a braced record appears only when `arguments` is present — which, in output, is only where an application is still open: template bodies and `source` provenance (Part 2 Section 8.1). - The container constructors carry no parameters: their type slots are plain REQUIRED `type_ref`-typed fields, filled by the construction (or by a sugar form's desugaring) like any other required field. Within a template body `value` also carries a parameter, unlabelled: a token there is a parameter exactly when its text resolves into the enclosing entry's `parameters` (Part 2 Section 5.10's shadowing rule), and a closed entry has none for one to resolve into. A parametric `= P` fixes nothing and stays a required FREE field until materialisation makes the value concrete; `~ P` yields a DEFAULT (Part 2 Section 5.7). - `arguments` elements are type_argument records: `{ name: ... }` is a reference — including, in template bodies, parameter references of either kind, read against `parameters` — and `{ value: ... }` is a concrete literal. - `supertypes` and `subtypes` are name-level indexes. `reference.target` is a `type_ref`, so an alias to an application states the arguments it binds; a declaration's provenance lives in `source`, which records the applied form. - Every open entry is written as the constructor application it denotes, ` !C core-value` — a record template as `!record`, a container as `!array`/`!map`/`!choice`, an alias as `!reference` — and its body is held unread until materialisation substitutes the parameters away. Closed definitions carry binding-record bodies headed by the applied constructor. Instantiation entries are internally named (implementation- chosen, non-normative); none appear here, as nothing in this schema applies a non-constructor template. - Synthetic entries — the closed forms the sugar lifts to — carry the derived `@synthetic` marker at their schema-map keys (Part 2 Sections 6, 8.2); on ingest the marker is discarded and recomputed. Their internal names here follow the convention `__xxhash`, where the trailing `xxhash` is a placeholder for a content hash of the resolved binding record: the *shape* of the data — one internally named, `@synthetic`-marked entry per distinct concrete form — is the conformance point; the hash spelling is an implementation's own business and the placeholder is deliberately not a real digest. - Bare parameter names (e.g. T) in bodies are read against the enclosing entry's `parameters` list. - Entry-level source @doc strings longer than one line are carried abbreviated in this fixture; a conforming resolver preserves them verbatim. """ !schema { @doc:"Base kinds. `top` is the structural root; every constructor transitively IS-A `atom`, `product`, `sum` or `data`, each of which IS-A `top`. Construction transfers kind, not IS-A." top => !type_definition { subtypes: [array atom choice data enum integer_type map product record reference regex_type set_type sum template text_type tuple unit uri_type] body: !record { fields: [] } } atom => !type_definition { supertypes: [top] subtypes: [enum integer_type regex_type text_type unit uri_type] body: !record { supertypes: [top] fields: [] } } product => !type_definition { supertypes: [top] subtypes: [array map record set_type tuple] body: !record { supertypes: [top] fields: [ !record_field { name: access_pattern type: product_access_type } !record_field { name: size_type type: product_size_type } ] } } sum => !type_definition { supertypes: [top] subtypes: [choice] body: !record { supertypes: [top] fields: [] } } @doc:""" Non-data base kind. The body of an entry that describes something other than a data value — vocabulary a meta-schema introduces beyond the kernel's own, whose instances ride along in a schema map without being types. Composes with `top` directly rather than with a kind that would oblige it to describe a value's shape. An entry whose kind is DATA is declared by its schema but is not a type. """ data => !type_definition { supertypes: [top] body: !record { supertypes: [top] fields: [] } } reference => !type_definition { supertypes: [top] body: !record { supertypes: [top] fields: [ !record_field { name: target type: type_ref } ] } } @doc:"Held body of an open entry — the application as written, unread until its parameters are substituted away." template => !type_definition { supertypes: [top] body: !record { supertypes: [top] fields: [ !record_field { name: parameters type: array_param_name_xxhash } !record_field { name: template type: text } !record_field { name: extension type: record_extension_type optional: true } !record_field { name: discriminators type: array_field_name_xxhash optional: true } ] } } @doc:""" Unit atom constructor. An atom with no constraint vocabulary — the atom equivalent of the empty record `{}` for products. Its instances (`value`, `identifier`, `void`, all in the kernel) are opaque atoms distinguished by name and prose-level parsing contract, not by schema shape. """ unit => !type_definition { supertypes: [atom top] body: !record { supertypes: [atom] fields: [] } } @doc:"Escape hatch primitive: base type resolution's result, uninterpreted. Instance of `unit`." value => !type_definition { source: unit body: !unit {} } @doc:"Identifier primitive: the type of every naming position; XID_Start-initial, XID_Continue plus '-', in NFC. Instance of `unit`." identifier => !type_definition { source: unit body: !unit {} } @doc:"Void primitive: admits only the absent sentinel `_`. Instance of `unit`." void => !type_definition { source: unit body: !unit {} } @doc:"Internal scalar types for constraint fields." boolean => !type_definition { source: enum body: !enum { members: [true false] } } @doc:"Fixed-width integer representation: bit width paired with two's-complement signedness." integer_size => !type_definition { body: !record { fields: [ !record_field { name: bits type: non_negative_integer } !record_field { name: signed type: boolean } ] } } @doc:"Integer constraint vocabulary. Its instance `integer` is the kernel's arbitrary-precision integer." integer_type => !type_definition { supertypes: [atom top] body: !record { supertypes: [atom] fields: [ !record_field { name: size type: integer_size optional: true } !record_field { name: min type: integer optional: true } !record_field { name: exclusive_min type: integer optional: true } !record_field { name: max type: integer optional: true } !record_field { name: exclusive_max type: integer optional: true } !record_field { name: multiple_of type: non_negative_integer optional: true } !record_field { name: members type: integer_member_set optional: true } ] groups: [ !field_group { members: [min exclusive_min] state: OPTIONAL } !field_group { members: [max exclusive_max] state: OPTIONAL } ] } } integer => !type_definition { source: integer_type subtypes: [non_negative_integer] body: !integer_type {} } @doc:"Text constraint vocabulary. Its instance `text` is the kernel's Unicode code point sequence type." text_member_set => !type_definition { source: set_type body: !set_type { element_type: text min_items: 1 } } text_type => !type_definition { supertypes: [atom top] subtypes: [regex_type uri_type] body: !record { supertypes: [atom] fields: [ !record_field { name: min_length type: non_negative_integer optional: true } !record_field { name: max_length type: non_negative_integer optional: true } !record_field { name: length type: non_negative_integer optional: true } !record_field { name: pattern type: regex optional: true } !record_field { name: members type: text_member_set optional: true } ] } } text => !type_definition { source: text_type body: !text_type {} } @doc:"Mixin record contributing the `spec` field to specification-bound atoms." atom_specification => !type_definition { subtypes: [regex_type uri_type] body: !record { fields: [ !record_field { name: spec type: uri } ] } } @doc:"URI constraint vocabulary. Composes with `text_type` and the `atom_specification` mixin." uri_type => !type_definition { supertypes: [atom atom_specification text_type top] body: !record { supertypes: [text_type atom_specification] fields: [ !record_field { name: min_length type: non_negative_integer optional: true } !record_field { name: max_length type: non_negative_integer optional: true } !record_field { name: length type: non_negative_integer optional: true } !record_field { name: pattern type: regex optional: true } !record_field { name: members type: text_member_set optional: true } !record_field { name: spec type: uri optional: true role: FIXED value: "https://www.rfc-editor.org/rfc/rfc3986" } !record_field { name: scheme type: text optional: true } ] } } uri => !type_definition { source: uri_type body: !uri_type {} } @doc:"Regex constraint vocabulary. Same shape pattern as uri_type, pinned to I-Regexp." regex_type => !type_definition { supertypes: [atom atom_specification text_type top] body: !record { supertypes: [text_type atom_specification] fields: [ !record_field { name: min_length type: non_negative_integer optional: true } !record_field { name: max_length type: non_negative_integer optional: true } !record_field { name: length type: non_negative_integer optional: true } !record_field { name: pattern type: regex optional: true } !record_field { name: members type: text_member_set optional: true } !record_field { name: spec type: uri optional: true role: FIXED value: "https://www.rfc-editor.org/rfc/rfc9485" } ] } } regex => !type_definition { source: regex_type body: !regex_type {} } @doc:"Identifier roles — distinct naming positions referencing the identifier primitive." type_name => !type_definition { source: identifier body: !reference { target: identifier } } field_name => !type_definition { source: identifier body: !reference { target: identifier } } param_name => !type_definition { source: identifier body: !reference { target: identifier } } @doc:"Structured type reference (Part 2 Section 8.1). `name` is the only REQUIRED field, so the positional form applies at every type_ref-typed position: bare token when argument-free, explicit record when carrying arguments." type_ref => !type_definition { body: !record { fields: [ !record_field { name: name type: type_name } !record_field { name: arguments type: array_type_argument_xxhash optional: true } ] } } @doc:"One positional argument of a type application. `name` holds every reference (types, entries, parameters of either kind); `value` holds concrete literals only. Exactly one member is present; no positional form — the braced record is the reference/literal discrimination." type_argument => !type_definition { body: !record { fields: [ !record_field { name: name type: type_ref optional: true } !record_field { name: value type: value optional: true } ] groups: [ !field_group { members: [name value] } ] } } @doc:"Internal enumerations." product_access_type => !type_definition { source: enum body: !enum { members: [INDEX NAMED] } } product_size_type => !type_definition { source: enum body: !enum { members: [FIXED VARIABLE] } } field_role => !type_definition { source: enum body: !enum { members: [FREE DEFAULT FIXED] } } element_state => !type_definition { source: enum body: !enum { members: [REQUIRED OPTIONAL] } } @doc:"How a record may be realised (Part 2 Section 5.2)." record_extension_type => !type_definition { source: enum body: !enum { members: [ABSTRACT FINAL OPEN] } } @doc:"Annotation type markers." annotation => @annotation !type_definition { source: void body: !reference { target: void } } documentation => @annotation !type_definition { source: text body: !reference { target: text } } doc => @annotation !type_definition { source: documentation body: !reference { target: documentation } } synthetic => @annotation !type_definition { source: void body: !reference { target: void } } @doc:"Supporting records." record_field => !type_definition { body: !record { fields: [ !record_field { name: name type: field_name } !record_field { name: type type: type_ref } !record_field { name: optional type: boolean optional: true role: DEFAULT value: false } !record_field { name: voidable type: boolean optional: true role: DEFAULT value: false } !record_field { name: role type: field_role optional: true role: DEFAULT value: FREE } !record_field { name: value type: value optional: true } ] } } tuple_element => !type_definition { body: !record { fields: [ !record_field { name: element_type type: type_ref } !record_field { name: state type: element_state optional: true role: DEFAULT value: REQUIRED } ] } } @doc:"Field group — a set of mutually exclusive fields of a record (Part 2 Section 5.11)." field_group => !type_definition { body: !record { fields: [ !record_field { name: members type: array_field_name_xxhash } !record_field { name: state type: element_state optional: true role: DEFAULT value: REQUIRED } ] } } @doc:"Constructors — ~ marks type factories." record => !type_definition { supertypes: [product top] body: !record { supertypes: [product] fields: [ !record_field { name: access_pattern type: product_access_type optional: true role: FIXED value: NAMED } !record_field { name: size_type type: product_size_type optional: true role: FIXED value: FIXED } !record_field { name: fields type: array_record_field_xxhash } !record_field { name: groups type: array_field_group_xxhash optional: true } !record_field { name: extension type: record_extension_type optional: true role: DEFAULT value: OPEN } !record_field { name: supertypes type: array_type_ref_xxhash optional: true } !record_field { name: discriminators type: array_field_name_xxhash optional: true } ] } } array => !type_definition { supertypes: [product top] subtypes: [set_type] body: !record { supertypes: [product] fields: [ !record_field { name: access_pattern type: product_access_type optional: true role: FIXED value: INDEX } !record_field { name: size_type type: product_size_type optional: true role: FIXED value: VARIABLE } !record_field { name: element_type type: type_ref } !record_field { name: state type: element_state optional: true role: DEFAULT value: REQUIRED } !record_field { name: unordered type: boolean optional: true role: DEFAULT value: false } !record_field { name: unique_items type: boolean optional: true role: DEFAULT value: false } !record_field { name: min_items type: non_negative_integer optional: true } !record_field { name: max_items type: non_negative_integer optional: true } ] } } set_type => !type_definition { source: array supertypes: [array product top] body: !record { fields: [ !record_field { name: access_pattern type: product_access_type optional: true role: FIXED value: INDEX } !record_field { name: size_type type: product_size_type optional: true role: FIXED value: VARIABLE } !record_field { name: element_type type: type_ref } !record_field { name: state type: element_state optional: true role: FIXED value: REQUIRED } !record_field { name: unordered type: boolean optional: true role: FIXED value: true } !record_field { name: unique_items type: boolean optional: true role: FIXED value: true } !record_field { name: min_items type: non_negative_integer optional: true role: DEFAULT value: 1 } !record_field { name: max_items type: non_negative_integer optional: true } ] } } map => !type_definition { supertypes: [product top] body: !record { supertypes: [product] fields: [ !record_field { name: access_pattern type: product_access_type optional: true role: FIXED value: NAMED } !record_field { name: size_type type: product_size_type optional: true role: FIXED value: VARIABLE } !record_field { name: key_type type: type_ref } !record_field { name: value_type type: type_ref } !record_field { name: state type: element_state optional: true role: DEFAULT value: REQUIRED } !record_field { name: min_items type: non_negative_integer optional: true } !record_field { name: max_items type: non_negative_integer optional: true } ] } } tuple => !type_definition { supertypes: [product top] body: !record { supertypes: [product] fields: [ !record_field { name: access_pattern type: product_access_type optional: true role: FIXED value: INDEX } !record_field { name: size_type type: product_size_type optional: true role: FIXED value: FIXED } !record_field { name: elements type: array_tuple_element_xxhash } ] } } @doc:"A named entry rather than an inline form: ! constructor applications remain prohibited at field positions (Part 2 Section 5.2) and set_type has no sugar of its own." enum_set => !type_definition { source: set_type body: !set_type { element_type: text min_items: 1 } } enum_profile => !type_definition { source: enum body: !enum { members: [IDENTIFIER TEXT] } } @doc:"A count. Refines integer rather than constructing beside it, so it IS-A integer." non_negative_integer => !type_definition { source: integer_type supertypes: [integer] body: !integer_type { min: 0 } } integer_member_set => !type_definition { source: set_type body: !set_type { element_type: integer min_items: 1 } } enum => !type_definition { supertypes: [atom top] body: !record { supertypes: [atom] fields: [ !record_field { name: members type: enum_set } !record_field { name: profile type: enum_profile optional: true role: DEFAULT value: IDENTIFIER } ] } } choice => !type_definition { supertypes: [sum top] body: !record { supertypes: [sum] fields: [ !record_field { name: variants type: array_type_ref_xxhash } !record_field { name: disjoint type: boolean optional: true } ] } } @doc:"Resolver output." type_definition => !type_definition { body: !record { fields: [ !record_field { name: source type: type_ref optional: true } !record_field { name: supertypes type: array_type_name_xxhash optional: true } !record_field { name: subtypes type: array_type_name_xxhash optional: true } !record_field { name: body type: top } ] } } schema => !type_definition { source: map body: !map { key_type: type_name value_type: type_definition } } @doc:""" Synthetic entries — the closed forms the sugar lifts to (Part 2 Section 5.3: "every sugar form lifts at desugar; a concrete form to a closed synthetic entry"). Each is named by derivation from the form it came from rather than declared, sources the constructor it builds, is referenced by the field that wrote the sugar, and carries the derived `@synthetic` marker at its key (Part 2 Sections 6, 8.2). The trailing `xxhash` stands for a content hash of the resolved binding record: identity is structural ("one entry per distinct concrete form schema-wide") and the spelling of the hash is an implementation's own business, not a conformance point — the placeholder keeps the hash value non-normative. """ @synthetic array_type_name_xxhash => !type_definition { source: array body: !array { element_type: type_name } } @synthetic array_field_name_xxhash => !type_definition { source: array body: !array { element_type: field_name } } @synthetic array_param_name_xxhash => !type_definition { source: array body: !array { element_type: param_name } } @synthetic array_type_ref_xxhash => !type_definition { source: array body: !array { element_type: type_ref } } @synthetic array_type_argument_xxhash => !type_definition { source: array body: !array { element_type: type_argument } } @synthetic array_record_field_xxhash => !type_definition { source: array body: !array { element_type: record_field } } @synthetic array_field_group_xxhash => !type_definition { source: array body: !array { element_type: field_group } } @synthetic array_tuple_element_xxhash => !type_definition { source: array body: !array { element_type: tuple_element } } }