MAP Type Definition Language (TDL) Specification v0.10¶
Validation status:¶
The Schema 2.0 Core Schema TDL corpus is the primary test of this specification's syntactic
completeness and expressive adequacy. The corpus now expresses graph-derived Instance TypeKind
classification through explicit DefinesInstanceTypeKind anchor values and contains no authored
legacy TypeKind property, enum, or key rule.
The representation architecture is resolved: the TDL parser produces the same schema-backed
LoaderRefRep holon graph as the MAP JSON parser. Source conversion may render JSON or TDL
directly from that graph. When loading, the existing Holon Loader resolves LoaderRefRep into the
staged Holons Core shared-object and Reference Layer representation. Guest-side Schema 2.0
semantics operate through HolonDescriptor and its typed descriptor wrappers. There is no separate
semantic IR or graph-adapter layer.
Descriptor-semantic conformance is owned by Descriptor-Aware Holon Validation, not by TDL. The
Validation Schema defines validation-owned
holon types such as ValidationRule families and typekind-compatible Validations relationships.
TDL may author those holons and relationships like any other schema content, but the TDL parser
does not execute validation-rule semantics during source conversion.
ChangeLog¶
Entries before v0.10 describe the model implemented by those historical revisions. Where they
conflict, the v0.10 rules are authoritative.
-
v0.10 -
Added Appendix C Mechanical Decompile Keyword Selection
-
Clarified that TDL delegates descriptor-semantic conformance to Descriptor-Aware Holon Validation and may author Validation Schema holons as ordinary schema content.
-
v0.9 -
aligns TDL with Descriptor-Kernel Semantic Rules v2.0.1 and its four kernel jobs
- adds
DefinesInstanceTypeKindas an ordinary authored Boolean descriptor property whose localtruevalue explicitly designates an abstract Instance TypeKind anchor - derives
InstanceTypeKind(T)from the nearest designated anchor inL(T)while retaining descriptor identity andExtendsas the authority for subtype classification - retires
TypeKind.PropertyType,TypeKind.MapEnumValueType, andTypeKindRule.KeyRuleTypefrom the Schema 2.0 TDL corpus - permits any descriptor to be self-describing when it satisfies the ordinary describing-type
compatibility and conformance rules; no semantic rule follows
DescribedBytransitively - delegates descriptor validation to the stable
DS-*rules instead of restating a second TDL-specific semantic checklist - authors inverse pairing once, through declared-side
HasInverse, and removes the redundant inverse-sideinverse (...)clause -
records the current corpus dependency cycles and parser failure as implementation work rather than weakening the normative dependency or syntax rules
-
v0.8 -
resolves the semantic middle as the explicit Holons Core graph accessed through
HolonDescriptorand existing Reference Layer operations, retiring the separate Canonical Holon IR as a target architecture - unifies the descriptor hierarchy by defining
MetaTypeDescriptor Extends HolonType - defines one generalized
(HolonType)-[DescribedBy]->(TypeDescriptor)relationship and(TypeDescriptor)-[Instances]->(HolonType)inverse - introduces abstract
RelationshipTypeas the shared classification parent of declared and inverse relationship descriptor roots - distinguishes meta-type conformance contracts from endpoint types
- defines endpoint compatibility through the endpoint holon's direct describing type
- requires explicit directional deletion semantics on declared and inverse relationship descriptors
- identifies
MetaValueTypeas the Core Schema describing type for enum-variant descriptor declarations - permits abstract descriptor holons to omit category-specific positive-minimum conformance members while enforcing the universal descriptor baseline and validating supplied members
- introduces
instanceas the generic holon declaration form while retaining specialized descriptor declaration forms and the compilation-scopingschemaform - derives descriptor category from identity and transitive
Extendsrather than authoredTypeKind - requires quoted keys and references when whitespace makes bare form ambiguous
- renames descriptor shorthand
keyruletoinstance_keyrule, which lowers toInstanceKeyRule - represents unbounded relationship cardinality as
min..*, lowering*to an absent optionalMaxCardinalityrather than a finite sentinel -
defines
BaseValueValueTypeas the broad representation type forDefaultValue, with dependent validation against the carrying property descriptor's selectedValueType -
v0.7 -
requires every descriptor declaration to provide an explicit
typeclause that lowers toDescribedBy - makes
Extendsgenuinely optional for every descriptor; omission means that no localExtendsrelationship is populated - defines the declaration identifier as the descriptor's authored key and validates that key against the effective key rule supplied by the descriptor's explicit type
- requires descriptor and schema references to use keys
- replaces holon property/relationship attachment shorthand with an explicit relationship map capable of representing both instance-contract declarations and other populated descriptor relationships
- removes TDL name-based and declaration-kind-based bootstrap exceptions
-
preserves only representation-level bootstrap sufficient to resolve keys, references, and the explicitly authored reflective graph
-
v0.6 -
aligns TDL lowering and validation with the Schema 2.0 two-hierarchy model rooted at
MetaTypeDescriptorand abstractTypeDescriptor - removes general
TypeKindcompatibility fromExtendsvalidation - separates descriptor self-conformance, described-instance contracts, and inherited populated descriptor values
- replaces blanket Boolean omission handling with guest-side materialization of required descriptor defaults during Holon Loading
- aligns contract inheritance, kernel inheritance rules, admissibility, endpoint, and key-rule semantics with the shared descriptor-semantics kernel
-
retains a fixed grammar by expressing schema-defined descriptor properties through one generic property-assignment clause rather than schema-specific keywords
-
v0.5 -
replaces projected-TypeKind and fixed-slot validation with descriptor-driven holon conformance
- establishes shared descriptor-semantics behavior over the explicit holon graph through
HolonDescriptor - makes the existing descriptor inheritance rules authoritative for lineage, inherited-member flattening, identity-based deduplication, and cycle/cardinality errors
- retains source-adapter syntax/default responsibilities and the existing runtime-loader boundary
-
clarifies that R5 code generation and R6 editor services consume, but do not redefine, the shared descriptor semantics established in R4
-
v0.4 -
renamed Domain Specific Lanuguage (DSL) to Type Definition Language (TDL)
- moved complete formal EBNF grammar for TDL to the Appendix
- aligns TDL validation with a source-neutral holon-representation boundary
- replaces non-extensible property/relationship rules with TypeKind-compatible inheritance
-
defines layered diagnostics, post-lowering requiredness, relationship inverse completeness, effective key-rule validation, semantic diff/fidelity, and loader projectability
-
v0.3 -
aligned the DSL with the then-current
DescriptorRootmodel, superseded by the Schema 2.0 two-root model inv0.6 - replaces implicit
DescribedBy #TypeDescriptorwith TypeKind-specific meta-type injection - clarifies that the JSON
typefield compiled by the DSL is shorthand forDescribedBy - clarifies that
extendsremains single inheritance and defaults to the appropriate abstract type anchor - replaced examples that used the then-removed
TypeDescriptornode withDescriptorRootor concrete descriptor identifiers -
treated
DescriptorRootand top-level abstract anchors as bootstrap exceptions rather than ordinary DSL declarations -
v0.2 -
introduces explicit document versioning
- adds schema-level
depends_ondeclarations - adds schema declaration bodies with
headerand openness flags - adds
propertiesandrelationshipsattachment blocks forholondeclarations - adds qualified relationship references for attachment blocks
- promotes braced declaration bodies and nested block styling as the preferred authoring form
- renames generic metadata blocks to
headerblocks - adds
deletion_semanticas an explicit relationship clause - adds
allows_additional_propertiesandallows_additional_relationshipsas explicit holon openness flags - clarifies compiler responsibilities for
InstancePropertiesandInstanceRelationships
This document rigorously defines a Type Definition Language (TDL) for authoring MAP schema packages
in a compact, human-readable form that lowers deterministically into the source-neutral
LoaderRefRep holon graph used by the Holon Loader. That graph can be rendered as MAP JSON or
canonical TDL without introducing another semantic representation.
TDL supports generic holon instances as well as specialized declaration forms for type descriptor
holons. The specialized forms provide descriptor-oriented shorthand; they do not establish a
separate representation or author category metadata. The specialized schema form establishes
compilation scope and lowers to the schema holon contributed by the file.
MAP JSON and TDL are concrete source syntaxes. Both lower to LoaderRefRep; neither is the semantic
middle. After guest-side reference resolution, the staged Holons Core shared-object and Reference
Layer representation is the graph over which descriptor semantics operate.
In compiled JSON, the type field is shorthand for a holon's DescribedBy relationship.
Every non-schema declaration therefore supplies an explicit type clause. A descriptor may
describe the instance shape of its type by populating InstanceProperties and
InstanceRelationships through its relationship map.
1. Design Principles¶
The TDL is designed to satisfy the following constraints:
- TDL can author generic holon instances and type descriptor holons in one schema package.
- Every non-schema declaration explicitly supplies exactly one
typekey, which lowers toDescribedBy. Declaration forms do not select or default the describing type. - Every descriptor may supply at most one
extendsclause. Omission means that the descriptor has no localExtendstarget. - Every descriptor belongs to exactly one schema via the
ComponentOfrelationship implied by its containing TDL file. - A TDL file contributes holons to exactly one schema. Implicit
ComponentOfapplies only to descriptor declarations, not generic instances. - The specialized
depends_onclause establishes the dependency closure needed for resolution and lowers to the schema holon's semanticDependsOnrelationship. Extendsuses optional single inheritance in the unified hierarchy rooted at abstractTypeDescriptor;MetaTypeDescriptor Extends HolonTypeestablishes the meta-type branch.- Descriptor classification and runtime-wrapper admissibility derive from resolved descriptor
identity and transitive
Extends. A descriptor'sInstanceTypeKindis the nearest abstract anchor in that lineage with a localDefinesInstanceTypeKind truevalue. LegacyTypeKindis not authored or persisted descriptor state. - Every populated descriptor member follows the kernel's
InheritanceRulestable through the type's ownExtendslineage.InstanceProperties,InstanceRelationships,AffordsCommand,AffordsDance,AffordsOperator,Validations, andConstraintsareAdditive;InstanceKeyRuleisOverride; all other members areLocal. - Presence-based Boolean keywords lower to explicit
true. Their absence is an omission, not a general implicitfalse; Holon Loading materializesfalseonly when a required property declares that default. - Instance-contract declarations are ordinary populated relationships in the declaring
descriptor's relationship map:
InstancePropertiestargets property descriptor keys, whileInstanceRelationshipstargets declared relationship descriptor keys. - The TDL supports both:
- complete schema files
- documentation fragments.
- The TDL supports both a compact line-oriented surface form and a braced block surface form. They are semantically equivalent.
- Concrete-syntax parsers own syntax and source-to-
LoaderRefReplowering. Holon Loading owns automatic descriptor-default materialization; the Holon Validator invokes descriptor semantics throughHolonDescriptorafter the guest constructs the staged application graph. - TDL/JSON source-conversion fidelity compares normalized
LoaderRefRepgraphs, not concrete source text or default-materialized application holons. - Descriptor validity is derived from resolved descriptors. Validators must not replace descriptor-declared property, relationship, value, or inheritance rules with hard-coded schema-specific tables or name-based inference.
- Loaded and runtime holons use the same
HolonDescriptorsurface for inheritance and effective descriptor behavior. The host-side TDL parser does not execute descriptor semantics. - Every TDL-produced holon is eventually submitted to Descriptor-Aware Holon Validation when it is
loaded for commit; its own
Extendslineage separately determines its classification and, for a descriptor, the effective specification it imposes on described instances. - Abstractness never creates a blanket conformance exemption. The descriptor kernel applies minimum cardinality according to each member's completeness policy and validates every supplied value under the same effective member definition used for concrete instances.
2. File Structure¶
A complete TDL file begins with a schema declaration.
schema <SchemaKey>
Optional schema dependency clauses may follow:
depends_on <SchemaKey>
The document or its containing package must bind interpretation to a specific Core Schema version. Ordinarily, the schema dependency closure supplies that binding. Requiredness, defaults, descriptor kinds, relationships, cardinalities, and validation rules are resolved against that version.
The schema declaration may also use the braced form when the schema holon itself needs a header or openness flags:
schema <SchemaKey> {
SchemaBodyClause*
}
All descriptors following this declaration implicitly compile with:
ComponentOf <SchemaKey>
The schema declaration key is the authored key of the schema holon contributed by the file.
depends_on entries are likewise schema holon keys. Schema creation validates the authored schema
key against the effective key rule of the bound Schema type.
depends_on binds the current versioned schema to an exact dependency schema identity. The
resulting schema dependency graph must be acyclic. A schema must not depend on itself, and no
dependency path may return to its source.
Every descriptor reference whose source and target are owned by different schemas requires a
direct depends_on declaration from the source schema to the target schema. A transitive
dependency makes the target available in the resolution closure but does not satisfy this direct
dependency declaration requirement.
Several TDL files may name and contribute to the same schema. Their components may use forward or circular references because those references remain within one schema node. The multi-pass loader resolves that within-schema closure; it does not make cycles among distinct schema holons valid.
Schema syntax is specialized because it establishes compilation and dependency-resolution scope
before ordinary holon validation. depends_on is therefore not merely relationship-map sugar,
although it lowers to the ordinary semantic DependsOn relationship.
Example:
`schema "MAP Metaschema-v0.0.2" { depends_on "MAP Core Schema-v0.0.7"
header { description: "Schema containing MAP metaschema descriptors." } }
def relationship (TypeDescriptor)-[ComponentOf]->(Schema) { type MetaDeclaredRelationshipType extends DeclaredRelationshipType source TypeDescriptor target Schema }
property Description.PropertyType { type MetaPropertyType.MetaTypeDescriptor extends PropertyType.TypeDescriptor value MapStringValueType.StringValueType IsValueRequired true } `
3. Declaration Separation¶
Declarations are separated by:
- blank lines
- or the appearance of a new top-level declaration-form keyword.
Semicolons are not used. Commas are optional between entries in braced maps and lists.
Indentation is used for readability but is not semantically significant beyond grouping clauses under a descriptor.
Braces may be used to group descriptor bodies and nested blocks such as
header, relationships, and variants. The braced style is
the preferred house style for examples because it makes large schema
definitions easier to scan.
Map and list blocks remain newline-oriented by default. Commas are optional between relationship
map entries and variant entries. Commas are recommended between targets inside bracketed
relationship target collections. These rules do not apply to header fields.
4. Reserved Keywords¶
The following tokens are reserved:
schema
instance
abstract
value
property
relationship
inverse
def
enum
variant
holon
type
extends
source
target
instance_keyrule
cardinality
deletion_semantic
ordered
duplicates
depends_on
header
allows_additional_properties
allows_additional_relationships
relationships
variants
5. Declaration Forms¶
TDL provides the specialized compilation-scoping form:
schema
the generic holon form:
instance
and the following descriptor-oriented forms:
value
property
relationship
inverse relationship
enum
variant
holon
Each declaration compiles to a holon. Descriptor-oriented forms compile to type descriptor holons
and make descriptor-specific shorthand available. instance provides only explicit type, fixed
property assignments, and a relationship map.
The declaration form selects available surface clauses. It does not select or default a
declaration's type or classify the resulting holon. Category follows the resolved descriptor's
transitive Extends lineage.
6. Identity, Properties, and References¶
The key following a declaration-form label is the holon's explicitly authored key.
It is not merely a local symbol or a type_name.
Every non-schema declaration must provide exactly one:
type <TypeKey>
The type key resolves the descriptor that describes the declared holon and lowers to the declared
holon's unique DescribedBy target. The authored key must conform to the effective instance key
rule supplied by that describing type. A holon descriptor's own instance_keyrule clause is
different: it populates InstanceKeyRule and governs holons described by that descriptor, not the
key of the descriptor itself.
References elsewhere in TDL use keys. A reference may resolve to a holon in the current schema
package or dependency closure. Key binding must produce exactly one resolved holon identity; later
semantic validation uses that identity and does not repeatedly group or resolve by key. Binding
must not fall back to type_name, display name, declaration form, or suffix inference.
The current unqualified-key model requires keys to be unique within that bound closure. How independent Extension Schemas with colliding local keys coexist or qualify their references is part of the deferred Extension Schema identity design, not an inference made by TDL.
A key or reference containing whitespace must be quoted. Delimiter-free keys may be written bare. Quoting is lexical only and does not change key identity. Fully qualified relationship keys retain their dedicated structural syntax.
A qualified relationship key has the form:
(<SourceTypeKey>)-[<RelationshipName>]->(<TargetTypeKey>)
The complete expression identifies one authoritative declared relationship descriptor. Its source, target, cardinality, deletion behavior, ordering, duplicate policy, and inverse pairing come from that descriptor. Using the key as a relationship-map target does not redeclare or override any of those semantics.
Every relationship endpoint is a holon. Endpoint validation uses:
TypeSubstitutable(T, requiredType)
iff
requiredType is in L(T)
EndpointCompatible(H, requiredType)
iff
TypeSubstitutable(D(H), requiredType)
Every holon is tested through its direct describing type's lineage. Descriptor holons are no exception: endpoint constraints for descriptor holons name the compatible describing meta-type, not the descriptor holon's own classification category. Qualified relationship keys still use their descriptor source and target identities; that key structure does not add another endpoint classification path.
TDL uses one fixed property-assignment form for descriptor properties that do not have dedicated surface syntax:
<PropertyName> <PropertyValue>
The property name resolves through the describing type's effective property contract. That contract determines the authoritative property descriptor, value type, requiredness, constraints, and default. Ambiguous or undeclared names are errors unless the effective additional-property policy permits them. The schema does not dynamically create new grammar productions or keywords.
Property member names and relationship member names come from the required local TypeName of
their descriptors and occupy separate namespaces. Within either namespace, binding compares exact,
case-sensitive MapString values without Unicode normalization. Any ergonomic spelling conversion
is an adapter operation performed before binding.
Examples:
IsValueRequired true
DefaultValue None
Inheritance policy is not a TDL property assignment. The kernel selects it
from canonical relationship identity, so no TDL form may author, omit,
materialize, or emit InheritanceMode. Any required property without a
default must be supplied explicitly.
Concise TDL may omit values that a load workflow completes deterministically. Source-only TDL/JSON conversion preserves that omission because it performs no descriptor binding or default materialization. Canonical TDL rendered from an already completed graph emits the materialized values through the same property-assignment form. Changing a bound-schema default can therefore change the created state produced from unchanged concise TDL and is a schema-versioning event.
7. Surface Styles¶
The TDL supports two equivalent surface styles.
Compact form:
value MapLocalizedString.MapStringValueType type MetaStringValueType.MetaValueType extends MapStringValueType.StringValueType
Braced form:
value MapLocalizedString.MapStringValueType { type MetaStringValueType.MetaValueType extends MapStringValueType.StringValueType }
Examples in this specification prefer the braced form.
8. Value Type Descriptors¶
Syntax:
[abstract] value
or
[abstract] value
Example:
abstract value ValueType.TypeDescriptor { type MetaValueType.MetaTypeDescriptor extends TypeDescriptor DefinesInstanceTypeKind true }
value MapLocalizedString.MapStringValueType { type MetaStringValueType.MetaValueType extends MapStringValueType.StringValueType }
Compilation rules:
- Require exactly one explicit
typeclause and lower it toDescribedBy. - Lower
extendsonly when explicitly authored. Omission produces no localExtendstarget. - If
abstractis present, lowerIsAbstractType true. abstractdoes not implyDefinesInstanceTypeKind. A descriptor is an Instance TypeKind anchor only when its body explicitly assignsDefinesInstanceTypeKind true.
9. Property Type Descriptors¶
Syntax:
[abstract] property
or
[abstract] property
Example:
property Description.PropertyType { type MetaPropertyType.MetaTypeDescriptor extends PropertyType.TypeDescriptor value MapStringValueType.StringValueType IsValueRequired true }
Compilation rules:
- Require exactly one explicit
typeclause and lower it toDescribedBy. - Lower
extendsonly when explicitly authored. IsValueRequiredandDefaultValueuse the fixed descriptor-property assignment form.DefaultValueis valid only whenIsValueRequiredistrue.- An explicit
extendsclause is validated by the shared Schema 2.0 hierarchy and conformance rules, not by a TDL-specific property-family orTypeKindrule.
10. Relationship Type Descriptors¶
Relationship descriptors define graph edge semantics.
An explicit extends clause on a relationship descriptor is validated by the shared Schema 2.0
hierarchy and conformance rules. TDL does not impose a separate same-TypeKind or
declared-versus-inverse inheritance rule.
10.1 Declared Relationship¶
relationship
Syntax:
[abstract] [def] relationship
or
[abstract] [def] relationship
Example:
relationship (HolonType.TypeDescriptor)-[InstanceKeyRule]->(KeyRuleType.HolonType) { type MetaDeclaredRelationshipType.MetaRelationshipType extends DeclaredRelationshipType.RelationshipType relationships { HasInverse -> KeyRuleForInstancesOf } source HolonType.TypeDescriptor target KeyRuleType.HolonType cardinality 1..1 deletion_semantic Allow }
10.2 Definitional Relationship¶
def relationship
Rules:
- Presence of
deflowers to explicitis_definitional = true. - Absence of
defleaves the property omitted; Holon Loading materializes a declared required default such asfalse.
Declared relationship validation:
- Every declared relationship descriptor must provide exactly one
sourceclause and exactly onetargetclause. - The authored relationship key must conform to the effective key rule supplied by its explicit type.
- The source key, relationship name, and target key encoded by a qualified authored key must match
the descriptor's populated
SourceType, semantic relationship name, andTargetType. - Every declared relationship descriptor must author exactly one
HasInversetarget in its relationship map. - The target must be an inverse relationship descriptor, and no inverse descriptor may be the
HasInversetarget of more than one declared descriptor. The paired inverse-sideInverseOfoccurrence is derived during relationship materialization rather than redundantly authored in TDL. - The inverse descriptor's effective source constraint must equal the declared descriptor's effective target constraint, and its effective target constraint must equal the declared descriptor's effective source constraint. Directional cardinalities are validated independently and need not match.
min_cardinalityis a required semantic slot.max_cardinalityis optional; absence means unbounded. When present,min_cardinality <= max_cardinality.- A
cardinality min..*clause lowers to the required minimum and omitsmax_cardinality. A finite upper bound lowers both properties. DeletionSemanticis required on every declared relationship descriptor and must be supplied explicitly when its property descriptor does not define a default.
10.3 Inverse Relationship¶
Syntax:
[abstract] inverse relationship
or
[abstract] inverse relationship
Example:
inverse relationship (Schema)-[Components]->(TypeDescriptor) { type MetaInverseRelationshipType extends InverseRelationshipType source Schema target TypeDescriptor cardinality 0..* deletion_semantic Block }
Rules:
- Require exactly one explicit
typeclause and lower it toDescribedBy. - Lower
extendsonly when explicitly authored. - Require exactly one
sourceand onetargetclause. - Validate that the authored inverse relationship key matches its populated source, semantic name, and target and conforms to the effective key rule supplied by its explicit type.
- Do not accept an inverse-side
inverse (...)clause. Pairing is authored once through the declared descriptor'sHasInverserelationship and is validated over the resolved graph. - Validate that the inverse's effective source and target constraints mirror the paired declared relationship's effective target and source constraints. Do not require directional cardinalities to match.
defis not allowed with inverse relationships.DeletionSemanticis required on every inverse relationship descriptor and is directional. It must be authored or completed independently of the paired declared relationship.
deletion_semantic is valid only on relationship descriptors.
11. Enum Type Descriptors¶
Syntax:
[abstract] enum
or
[abstract] enum
Example:
enum DeletionSemantic.MapEnumValueType { type MetaEnumValueType.MetaValueType extends MapEnumValueType.EnumValueType }
or
enum DeletionSemantic.MapEnumValueType { type MetaEnumValueType.MetaValueType extends MapEnumValueType.EnumValueType variants { variant Allow { type MetaEnumVariantValueType.MetaValueType extends MapEnumVariantValueType.EnumVariantValueType } } }
Variants may be declared inline, but each inline variant remains a descriptor declaration and must
include the variant keyword and an explicit type clause.
The lowered variant descriptor's required local TypeName is its canonical stored enum token. For
an inline declaration such as variant Allow, Allow supplies that local name. The enclosing enum
and the effective enum-variant key rule determine the descriptor key; the qualified key and display
metadata do not replace the local name as the value token.
Compilation rules:
- Require exactly one explicit
typeclause and lower it toDescribedBy. - Lower
extendsonly when explicitly authored. - Reject duplicate local variant names within the same enum.
12. Enum Variant Descriptors¶
Variants compile to independent type descriptor holons.
Syntax:
variant
or
variant
Example:
abstract variant EnumVariantValueType.ValueType { type MetaValueType.MetaTypeDescriptor extends ValueType.TypeDescriptor }
This standalone form remains valid for cases where a variant needs to be
declared or documented separately from the enum's inline variants block.
Compilation rules:
- Require exactly one explicit
typeclause and lower it toDescribedBy. - Lower
extendsonly when explicitly authored. - An inline variant lowers its enclosing enum key to
VariantOf. - A standalone variant must explicitly provide the equivalent enum ownership relationship through syntax defined by the bound enum-variant schema.
- Preserve the variant's required local
TypeName; do not derive enum membership from its key or display metadata.
13. Holon Type Descriptors¶
Syntax:
[abstract] holon
or
[abstract] holon
Example:
holon Book { type MetaHolonType extends CulturalExpression allows_additional_properties
relationships { InstanceProperties -> [ Title.PropertyType, Author.PropertyType ] InstanceRelationships -> [ (Book)-[WrittenBy]->(Person) ] } }
Compilation rules:
- Require exactly one explicit
typeclause and lower it toDescribedBy. - Lower
extendsonly when explicitly authored. - Lower the relationship map to populated relationships on the descriptor holon.
allows_additional_propertiesandallows_additional_relationshipspopulate the corresponding holon descriptor properties.
13.1 Instance-Contract Declarations¶
InstanceProperties and InstanceRelationships are declared through ordinary entries in the
descriptor's relationship map:
holon DanceInvocation.HolonType { type MetaHolonType.MetaTypeDescriptor extends HolonType.TypeDescriptor relationships { InstanceProperties -> [ InvocationSource.PropertyType ] InstanceRelationships -> [ (DanceInvocation.HolonType)-[Target]->(HolonType.TypeDescriptor), (DanceInvocation.HolonType)-[Request]->(HolonType.TypeDescriptor) ] } }
Rules:
- Every
InstancePropertiestarget must resolve by key to a property descriptor. - Every
InstanceRelationshipstarget must resolve by key to a declared relationship descriptor. - Inverse relationship descriptors are derived members of their declared relationship pairs and
must not be explicitly targeted by
InstanceRelationships. - The target relationship descriptor is the authoritative source of the attached relationship's source, target, cardinality, deletion, ordering, duplicate, inheritance, and inverse semantics.
- A qualified relationship key used as a target is an identity reference, not an inline relationship declaration.
- Across
DescribedBy,InstancePropertiesgoverns entries in the described instance's property map andInstanceRelationshipsgoverns its populated declared relationships. TDL does not synthesize or require genericPropertiesorRelationshipsrelationship descriptors.
13.2 Descriptor Relationship Map¶
Syntax:
relationships {
Example:
abstract holon HolonType.TypeDescriptor { type MetaHolonType.MetaTypeDescriptor relationships { InstanceRelationships -> [ (HolonType.TypeDescriptor)-[DescribedBy]->(TypeDescriptor), (HolonType.TypeDescriptor)-[OwnedBy]->(HolonSpace.HolonType) ] AffordsCommand -> [ CloneHolon.CommandType, GetKey.CommandType ] } }
Rules:
- Every map entry name either identifies a relationship member in the describing type's effective instance contract or is admitted by the effective additional-relationship policy. Binding selects one authoritative declared relationship descriptor identity; ambiguity is an error. Subsequent grouping and validation of declared occurrences use that identity rather than the name. A permitted undeclared relationship remains unbound and is grouped by its exact stored name.
- Every target must resolve by key and satisfy the authoritative relationship descriptor's target constraints.
- A scalar target is equivalent to a singleton target collection.
- Bracketed targets represent the complete locally populated target collection for that relationship map entry.
- Target ordering and duplicate handling follow the relationship descriptor.
- Commas between map entries are optional. Commas between bracketed targets are recommended.
- A relationship map may appear on any descriptor kind whose describing type permits the populated
relationships; it is not limited to
holondeclarations.
13.3 Generic Holon Instance¶
Syntax:
instance <HolonKey> {
type <HolonTypeKey>
<PropertyName> <PropertyValue>
relationships {
<RelationshipName> -> <TargetKey>
}
}
Example:
instance ImplementationName.FormatRule {
type FormatRule.KeyRuleType
TypeName "ImplementationName"
TemplateString "{0}"
relationships {
TemplateParameters -> ImplementationName.PropertyType
}
}
Rules:
- Require exactly one explicit
typeclause and lower it toDescribedBy. - Validate the authored key against the effective
InstanceKeyRulesupplied by the explicit type. - Resolve property assignments and relationship-map members through the describing type's effective instance contract.
- Do not admit descriptor-only shorthand such as
abstract,extends,instance_keyrule,source,target,cardinality, orvariants. - Do not imply
ComponentOf; that file-level convenience applies only to descriptor declarations.
14. Declaration Clauses¶
Clauses refine descriptor semantics.
The formal productions for clauses and nested blocks are defined in Appendix B. The core clause families are:
ExtendsClauseTypeClauseValueClausePropertyAssignmentClauseSourceClauseTargetClauseInstanceKeyRuleClauseCardinalityClauseDeletionSemanticClauseRelationshipFlagClauseHolonOpenFlagClauseSchemaOpenFlagClauseRelationshipMapVariantBlock
15. Boolean Flags¶
The following flags are presence-based:
abstract
def
ordered
duplicates
allows_additional_properties
allows_additional_relationships
Presence lowers to an explicit true value.
Absence leaves the corresponding value omitted in LoaderRefRep. When the graph is submitted for
Holon Loading, the guest-side descriptor-default materialization service applies an effective
default where defined. TDL does not define a blanket Boolean default.
DefinesInstanceTypeKind is not a declaration-form flag. It uses the ordinary fixed
property-assignment form and must be authored explicitly on each intended anchor:
DefinesInstanceTypeKind true
The abstract keyword does not imply this assignment, and the assignment is not inherited as a
Boolean value.
Example:
relationship (HolonType)-[ParentOf]->(HolonType) { type MetaDeclaredRelationshipType extends DeclaredRelationshipType source HolonType target HolonType deletion_semantic Allow ordered }
16. Header Blocks¶
Optional descriptor header fields are defined using a header block.
Formal HeaderBlock and HeaderField productions are defined in Appendix B.
Example:
header { description: "Links a type descriptor to the schema that contains it." display_plural: "Component Relationships" }
The header block carries shared descriptor-holon properties declared through the applicable
meta-type contract, not arbitrary structure.
Typical header fields:
description
display_name
display_plural
plural
17. Explicit DescribedBy and Optional Extends¶
Every non-schema declaration must contain exactly one explicit type clause:
type <TypeKey>
The clause lowers to the holon's unique DescribedBy relationship. Declaration-form labels such as
instance, holon, property, and relationship do not select, constrain, or default the
type target. The resolved describing type and its effective specification determine
self-conformance.
type and extends are independent:
typeselects the descriptor whose effective specification the declared holon must conform to;extendsdetermines descriptor classification and the lineage over which every populated descriptor member follows the kernel'sInheritanceRulestable.
The compiler must not merge the two paths.
Every descriptor may contain zero or one extends clause. If omitted, the descriptor has no local
Extends target. No declaration form supplies a default parent.
The unified hierarchy and self-describing meta-type graph are therefore expressible without reserved names or syntax exceptions:
abstract holon TypeDescriptor { type MetaHolonType.MetaTypeDescriptor }
abstract holon HolonType.TypeDescriptor { type MetaHolonType.MetaTypeDescriptor extends TypeDescriptor DefinesInstanceTypeKind true }
abstract holon MetaTypeDescriptor.HolonType { type MetaHolonType.MetaTypeDescriptor extends HolonType.TypeDescriptor }
holon MetaHolonType.MetaTypeDescriptor { type MetaHolonType.MetaTypeDescriptor extends MetaTypeDescriptor.HolonType }
The compiler resolves forward and self references in this explicitly authored graph. It must not infer root status, self-description, meta-type membership, or inheritance from a descriptor's key or declaration-form label.
A descriptor may be self-describing when it satisfies the same describing-type compatibility and
conformance rules as every other descriptor. Core Schema 2.0 authors
MetaHolonType.MetaTypeDescriptor this way. No semantic rule follows DescribedBy transitively,
so TDL does not impose a reflective-root convergence rule or a special self-loop whitelist.
18. Extensibility Rules¶
TDL lowers extends to the shared Schema 2.0 Extends relationship. The grammar does not define a
parallel inheritance policy.
Validation rules:
- A descriptor may have at most one direct
Extendstarget. - Multi-step
Extendschains are valid. - The
Extendstarget must resolve to a descriptor. - The
Extendsgraph must be acyclic. - Every
Extendsedge must remain within the unified descriptor-type hierarchy rooted at abstractTypeDescriptor. - No same-
TypeKindcompatibility rule applies to anExtendsedge. Subtype classification is established by the resulting lineage. DefinesInstanceTypeKindis a required Boolean descriptor property with defaultfalseand the kernel'sLocalrule. A localtruevalue designates that abstract descriptor as an Instance TypeKind anchor; the nearest designated anchor inL(T)determinesInstanceTypeKind(T).TypeDescriptoris the sole descriptor root without anInstanceTypeKind. Every other descriptor must resolve exactly one nearest anchor, and every anchor must be abstract.- Legacy authored
TypeKindandInstanceTypeKindvalues are not current Schema 2.0 descriptor state. Source adapters must not synthesize them from declaration keywords. Any runtime value exposed under those names is a derived projection of the resolved anchor identity. - A descriptor's describing type must be compatible with the meta-type paired to its resolved Instance TypeKind anchor. Declaration forms and abstractness do not infer that pairing.
The shared descriptor-semantics kernel supplies related semantic products:
InstanceTypeKind(T)selects the first locally designated anchor in the self-first lineageL(T).EffectiveValues(T, M)resolves every populated descriptor member according to the kernel'sInheritanceRule(M)and collection policy.Localreturns the local collection,Additivecombines effective ancestor contributions before local contributions, andOverrideselects the complete collection from the nearest type in the self-first lineage that populatesM.EffectiveMemberDefinition(M)resolves the semantic fields of a referenced property or relationship descriptor across that descriptor's ownExtendslineage. It supplies the effective value type, requiredness, default, endpoints, cardinality, collection policy, deletion behavior, and constraints applicable to uses ofM.EffectiveInstanceContract(T)interprets the effectiveInstancePropertiesandInstanceRelationshipstarget collections as contract declarations. The kernel assignsAdditiveto both relationships; it does not provide a separate contract-inheritance algorithm.ConformanceContract(H) = EffectiveInstanceContract(D(H))determines the properties and relationships that holonH, including a descriptor holon, must populate.
Effective collections retain semantic ordering and duplicate occurrences according to the member's
policy. Contract interpretation inspects contribution provenance so additive normalization cannot
hide an inherited-member redeclaration or a same-namespace member-name collision. Override
retains selected and shadowed provenance.
Descriptor self-conformance through DescribedBy is never flattened together with the descriptor's
own Extends lineage. Meta-type contract declarations therefore do not leak into ordinary
described-instance contracts.
Guest-side Holon Validation and runtime descriptor behavior access these rules through
HolonDescriptor and its typed descriptor wrappers. TDL parsing does not own or execute an
alternate contract, semantic-inheritance, or conformance algorithm.
Effective key-rule validation uses the same kernel semantics:
(HolonType.TypeDescriptor)-[InstanceKeyRule]->(KeyRuleType.HolonType)has cardinality1..1; the kernel assigns itOverride.instance_key_rule(T)is the unique target inEffectiveValues(T, InstanceKeyRule).holon_key_rule(H) = instance_key_rule(D(H)).- Key-rule resolution does not perform an additional fallback through
DescribedBy. - Recognize the canonical key-rule descriptors
TypeNameRule.KeyRuleType,SchemaNameRule.KeyRuleType,EnumVariantRule.KeyRuleType,RelationshipRule.KeyRuleType,ExtendedTypeRule.KeyRuleType,DescribedTypeRule.KeyRuleType, andNoneRule.KeyRuleType. TypeKindRule.KeyRuleTypeis retired from the Schema 2.0 corpus.- Treat
NoneRule.KeyRuleTypeas explicit keylessness, not as an absentInstanceKeyRule. MetaTypeDescriptor.HolonTypesuppliesExtendedTypeRule.KeyRuleTypeas the inherited default for descriptor holons. It composes localtype_namewith the immediateExtendstarget's localtype_name, falling back to localtype_namewhenExtendsis absent.- Because
Extendsis definitional, changing the immediate parent is a key-affecting breaking change for descriptor versions subsequently created underExtendedTypeRule. FormatRule.KeyRuleTypeis concrete. Configured format rules are generic holon instances whose own keys are governed byDescribedTypeRule.KeyRuleType.- Validate the required inputs for the selected key rule.
- Every descriptor key is authored. Report a diagnostic when it differs from the key generated by the effective instance key rule of the descriptor's explicit type.
A persisted holon's key is explicit stored state. A later schema version that changes the effective key rule, an input to that rule, or a relevant descriptor ancestor does not recompute or mutate the key of an existing holon version. New holons and explicitly created versions use the schema version bound for their creation; migration and aliases are explicit operations.
19. Validation Model¶
TDL parsing validates concrete syntax and reports failures to lower authored constructs into
LoaderRefRep. It does not resolve loader references, bind members to descriptors, materialize
defaults, or execute descriptor-driven Holon Validation.
Source-to-source conversion therefore requires no descriptor binding. TDL-to-JSON and JSON-to-TDL preserve the explicit loader graph, including omissions. Source provenance may map later guest diagnostics back to TDL locations, but it is not another semantic representation.
When parser output is submitted for Holon Loading, responsibility proceeds in this order:
- the existing Holon Loader resolves keyed references and constructs the staged holonic graph;
WritableHolon::populate_defaultsapplies applicable descriptor-defined defaults to each staged holon;- materialization errors prevent commit from being called;
- commit invokes the shared Holon Validator; and
- commit persists nothing when blocking validation violations remain.
The Holon Validator coordinates validation scope, context, and deterministic violation
accumulation. It invokes the descriptor kernel for the rules and products defined by
descriptor-semantics-rules.md. In particular, TDL does not
redefine:
- structural and schema validity (
DS-STRUCT-*,DS-SCHEMA-*); - Instance TypeKind and describing-type compatibility (
DS-KIND-*); - effective contract and member integrity (
DS-CONTRACT-*); - defaults, inverse pairs, and key-rule integrity (
DS-DEFAULT-*,DS-REL-*,DS-KEY-*); - member binding and holon conformance (
DS-CONFORM-*,DS-BIND-*,DS-PROP-*); or - relationship occurrence, endpoint, collection, and cardinality rules (
DS-OCC-*,DS-CARD-*).
Effective products are computed before conformance is evaluated and are memoized by product kind
and resolved descriptor identity for one immutable graph snapshot. Self-description is finite
because conformance selects an already computed effective specification; it does not recursively
follow DescribedBy.
Default materialization remains outside the kernel as reusable writable-holon completion. Once materialized, a default is ordinary explicit state. A later schema revision does not retroactively change that value, just as a later key-rule revision does not retroactively recompute a persisted key.
20. Parser and Holon Loading Responsibilities¶
A TDL parser and lowerer must:
- create the existing schema-backed
LoaderRefRepholons, properties, and keyed relationship references; - lower every non-schema
typeclause to exactly oneDescribedBytarget; - lower
extendsonly when explicitly authored; - imply
ComponentOfonly for descriptor declarations contributed by a schema file; - lower
depends_onto the schema holon'sDependsOnrelationships; - lower declaration shorthand, fixed property assignments, relationship maps, headers, cardinality, inverse pairing, and explicit unbounded maxima without semantic inference;
- preserve authored values and omissions, including explicit
DefinesInstanceTypeKind true; - lower
abstracttoIsAbstractType truewithout inferring an Instance TypeKind anchor; - preserve reference keys for guest-side
LoaderReferenceResolution; and - limit host diagnostics to syntax and source-to-
LoaderRefRepconstruction failures.
The parser must not synthesize DescribedBy, Extends, DefinesInstanceTypeKind, legacy
TypeKind, or any runtime category projection from a declaration form or local name. It must not
materialize descriptor defaults or invoke the descriptor kernel during source conversion.
It also must not collect, dispatch, or evaluate ValidationRule semantics. Validation Schema
holons and Validations relationships are authored and lowered as ordinary schema-backed holon
content.
When loading, the existing Holon Loader client serializes LoaderRefRep to the guest. Guest loader
components resolve the staged graph, run loader-specific default materialization, and invoke
commit. Commit orchestrates the reusable Holon Validator before persistence. The same validator is
available outside the loader lifecycle, while descriptor-independent PVL remains a separate
Integrity-layer concern.
The current Core Schema corpus is the acceptance fixture for this boundary. It explicitly authors
the DefinesInstanceTypeKind anchor designations, contains no legacy authored TypeKind schema
artifacts, and intentionally leaves omitted false values for guest-side completion. Its remaining
cross-schema dependency cycles must be corrected without weakening the acyclic DependsOn rule.
21. Semantic Diff, Fidelity, and Loader Projection¶
TDL/JSON source-conversion fidelity compares deterministic projections of LoaderRefRep, including
loader holon keys, descriptor keys, explicit properties, keyed relationships, ordering, and literal
values. Formatting, JSON field order, and equivalent source-format shorthand are not differences.
Fidelity checks do not require guest construction, default materialization, or descriptor-driven Holon Validation. A separate load operation may submit either source representation through the existing Holon Loader flow and report guest diagnostics.
22. Example TDL File¶
schema "MAP Metaschema-v0.0.2" {
depends_on "MAP Core Schema-v0.0.7"
header {
description: "Schema containing MAP metaschema descriptors."
}
}
def relationship (TypeDescriptor)-[ComponentOf]->(Schema.HolonType) {
type MetaDeclaredRelationshipType.MetaRelationshipType
extends DeclaredRelationshipType.RelationshipType
relationships {
HasInverse -> Components
}
source TypeDescriptor
target Schema.HolonType
cardinality 1..1
deletion_semantic Block
header {
description: "Links a type descriptor to the schema that contains it."
}
}
inverse relationship (Schema.HolonType)-[Components]->(TypeDescriptor) {
type MetaInverseRelationshipType.MetaRelationshipType
extends InverseRelationshipType.RelationshipType
source Schema.HolonType
target TypeDescriptor
cardinality 0..*
deletion_semantic Block
}
property Description.PropertyType {
type MetaPropertyType.MetaTypeDescriptor
extends PropertyType.TypeDescriptor
value MapStringValueType.StringValueType
IsValueRequired true
}
value MapStringValueType.StringValueType {
type MetaStringValueType.MetaValueType
extends StringValueType.ValueType
}
holon Schema.HolonType {
type MetaHolonType.MetaTypeDescriptor
instance_keyrule SchemaNameRule.KeyRuleType
extends HolonType.TypeDescriptor
allows_additional_properties
relationships {
InstanceProperties -> [
Description.PropertyType
]
}
}
Appendix A: TDL Keyword Contracts¶
This section provides a concise list of the rules used on decompile (from JSON->TDL) to replace JSON clauses with keywords. And likewise, to expand keywords into JSON clauses on compile (TDL->JSON).
Global Principles¶
| Principle | Contract |
|---|---|
| One interchange representation | JSON and TDL both parse to LoaderRefRep. Holon Loading resolves that graph into the staged Holons Core representation. |
| Compile direction | Each keyword defines what semantic content is injected or lowered when authoring TDL. |
| Decompile direction | Each keyword defines what canonical holon content may collapse back into the concise TDL surface. |
| Losslessness | Decompile may collapse content only when recompiling would produce the same semantic holon content. |
| Implied content | Decompile should omit only content implied by file structure or explicit keyword semantics. Declaration form does not imply DescribedBy, Extends, or descriptor-default values. Derived category projections are not serialized. |
| Fixed property form | Schema-defined properties without dedicated syntax use <PropertyName> <PropertyValue> and lower that authored key and value into LoaderRefRep. |
| Literal residue | If current TDL cannot express some content truthfully, preserve that content in literal form rather than collapsing it incorrectly. |
| Explicit type and inheritance | Every non-schema declaration emits its explicit type; descriptor forms emit extends exactly when a local Extends target exists. |
| No name-based reinterpretation | Decompile and compile behavior are driven by explicit syntax and resolved descriptors, not by reserved-looking names or declaration-form defaults. |
| File membership | A file-level schema declaration implies ComponentOf <SchemaKey> for descriptor declarations only. That implied relationship should not be repeated in concise decompiled descriptors. |
Keyword Contracts¶
| Keyword | Compile (TDL -> LoaderRefRep) | Decompile (LoaderRefRep -> TDL) |
|---|---|---|
schema |
Declare the schema key for the file; lower depends_on; imply ComponentOf for following descriptors; lower schema header and openness content. |
Emit the schema key and dependencies; omit descriptor-local ComponentOf values implied by file membership. |
instance |
Author a generic holon from an explicit type, fixed property assignments, and a relationship map. It does not imply descriptor metadata or ComponentOf. |
Emit a generic instance when no descriptor-oriented declaration form applies losslessly. |
| declaration form | Select the surface clauses available for the authored holon shape. It does not infer DescribedBy, Extends, or category metadata. |
Select a lossless surface form from explicit holon semantics without omitting type or populated state; do not emit derived category projections as properties. |
type |
Resolve the supplied type key and lower it to the declaration's unique DescribedBy target. Validate the declaration key against that type's effective instance key rule. |
Always emit the resolved DescribedBy target as type <TypeKey>. |
abstract |
Set is_abstract_type = true. |
Collapse an explicit true value to the abstract prefix when lossless. |
def |
On declared relationships only, set is_definitional = true. |
Collapse an explicit true value to def; never emit def for inverse relationships. |
extends |
Lower to one local Extends <TargetKey> relationship. Omission produces no local Extends. |
Emit extends exactly when the descriptor has a local Extends target. |
value clause |
On property descriptors, lower to ValueType <ValueTypeKey>. |
Collapse the populated ValueType relationship when representable exactly. |
| descriptor property | Lower the authored property key and value into LoaderRefRep. |
Emit schema-defined descriptor properties through the same fixed form. |
source |
On relationship descriptors, lower to SourceType <SourceTypeKey>. |
Collapse the populated SourceType relationship when representable exactly. |
target |
On relationship descriptors, lower to TargetType <TargetTypeKey>. |
Collapse the populated TargetType relationship when representable exactly. |
instance_keyrule |
Lower to InstanceKeyRule <KeyRuleKey> on a holon-type descriptor. The target governs holons described by that descriptor, not the descriptor's own key. |
Collapse the populated InstanceKeyRule target to instance_keyrule. |
relationships { ... } |
Resolve each map entry name through the describing type's effective relationship contract and lower its target keys to a populated descriptor relationship. InstanceProperties targets property keys; InstanceRelationships targets declared relationship keys. A declared relationship authors its inverse pairing as HasInverse -> <InverseRelationshipKey>. |
Emit locally populated relationship target collections as map entries, preserving member names, complete target collections, and ordering when applicable. Emit declared-side HasInverse; do not emit a redundant inverse-side pairing clause. |
header { ... } |
Lower header fields such as description/display fields/type plural metadata to descriptor properties. | Collapse header-shaped descriptor properties back into header { ... } whenever they are representable by the header surface; omit compiled-form duplicates that are fully implied by concise header syntax. |
| openness flags | Lower allows_additional_properties and allows_additional_relationships to explicit true descriptor or schema Boolean properties; preserve absent flags as omissions in LoaderRefRep. |
Collapse true values back to presence-based flags on schema or holon; preserve explicit false values. |
cardinality |
Lower the minimum to min_cardinality; lower a finite maximum to max_cardinality, while * omits it. |
Emit cardinality min..max for a finite maximum or cardinality min..* when max_cardinality is absent. |
deletion_semantic |
Lower to the relationship descriptor property of the same semantic name. | Collapse the property back to the deletion_semantic clause on relationship descriptors only. |
ordered / duplicates |
Set the corresponding relationship Boolean properties to explicit true; preserve absent flags as omissions in LoaderRefRep. |
Collapse true values back to presence-based flags; preserve explicit false values. |
Appendix B. TDL Grammar (EBNF)¶
The grammar below defines the concrete descriptor syntax. It is intentionally
syntactic rather than semantic: rules such as unified-hierarchy Extends validity,
descriptor conformance, required minimum cardinality, optional maximum cardinality, relationship inverse completeness,
and "inverse relationships cannot be definitional" are enforced by validation, not by
the grammar itself.
Lexical conventions:
Identifiermeans a valid MAP identifier token.BareReferencemeans a delimiter-free MAP key token, including compound keys such asDescription.PropertyType.QuotedReferencemeans a JSON string containing a MAP key, required when the key contains whitespace.Referencemeans either reference form; quoting does not change key identity.DescriptorKeymeans either aReferenceor a fully qualified relationship key.Literalmeans a JSON-style scalar literal accepted in descriptor-property assignments or header fields.Integermeans a non-negative base-10 integer literal.NLmeans one or more line breaks.
File ::= SchemaSection DeclarationSection ;
SchemaSection ::= CompactSchemaDecl
| BracedSchemaDecl ;
CompactSchemaDecl ::= "schema" Reference NL
{ DependsOnDecl NL } ;
BracedSchemaDecl ::= "schema" Reference "{" NL
{ SchemaBodyClause NL }
"}" NL ;
SchemaBodyClause ::= DependsOnDecl
| HeaderBlock
| SchemaOpenFlagClause
| PropertyAssignmentClause ;
SchemaOpenFlagClause ::= "allows_additional_properties"
| "allows_additional_relationships" ;
DependsOnDecl ::= "depends_on" Reference ;
DeclarationSection ::= Declaration { DeclarationGap Declaration } ;
DeclarationGap ::= NL { NL } ;
Declaration ::= InstanceDecl
| ValueDecl
| PropertyDecl
| DeclaredRelationshipDecl
| InverseRelationshipDecl
| EnumDecl
| VariantDecl
| HolonDecl ;
InstanceDecl ::= "instance" Reference
( CompactInstanceBody | BracedInstanceBody ) ;
CompactInstanceBody ::= NL TypeClause NL { InstanceBodyClause NL } ;
BracedInstanceBody ::= "{" NL TypeClause NL { InstanceBodyClause NL } "}" ;
InstanceBodyClause ::= PropertyAssignmentClause
| RelationshipMap ;
ValueDecl ::= [ "abstract" ] "value" DescriptorKey
( CompactValueBody | BracedValueBody ) ;
CompactValueBody ::= NL TypeClause NL { ValueBodyClause NL } ;
BracedValueBody ::= "{" NL TypeClause NL { ValueBodyClause NL } "}" ;
ValueBodyClause ::= ExtendsClause
| PropertyAssignmentClause
| RelationshipMap
| HeaderBlock ;
PropertyDecl ::= [ "abstract" ] "property" DescriptorKey
( CompactPropertyBody | BracedPropertyBody ) ;
CompactPropertyBody ::= NL TypeClause NL { PropertyBodyClause NL } ;
BracedPropertyBody ::= "{" NL TypeClause NL { PropertyBodyClause NL } "}" ;
PropertyBodyClause ::= ExtendsClause
| ValueClause
| PropertyAssignmentClause
| RelationshipMap
| HeaderBlock ;
DeclaredRelationshipDecl ::= [ "abstract" ] [ "def" ] "relationship" DescriptorKey
( CompactDeclaredRelationshipBody
| BracedDeclaredRelationshipBody ) ;
CompactDeclaredRelationshipBody ::= NL
TypeClause NL
{ DeclaredRelationshipBodyClause NL } ;
BracedDeclaredRelationshipBody ::= "{" NL
TypeClause NL
{ DeclaredRelationshipBodyClause NL }
"}" ;
DeclaredRelationshipBodyClause ::= SourceClause
| TargetClause
| ExtendsClause
| CardinalityClause
| DeletionSemanticClause
| RelationshipFlagClause
| PropertyAssignmentClause
| RelationshipMap
| HeaderBlock ;
InverseRelationshipDecl ::= [ "abstract" ] "inverse" "relationship" DescriptorKey
( CompactInverseRelationshipBody
| BracedInverseRelationshipBody ) ;
CompactInverseRelationshipBody ::= NL
TypeClause NL
{ InverseRelationshipBodyClause NL } ;
BracedInverseRelationshipBody ::= "{" NL
TypeClause NL
{ InverseRelationshipBodyClause NL }
"}" ;
InverseRelationshipBodyClause ::= SourceClause
| TargetClause
| ExtendsClause
| CardinalityClause
| DeletionSemanticClause
| RelationshipFlagClause
| PropertyAssignmentClause
| RelationshipMap
| HeaderBlock ;
EnumDecl ::= [ "abstract" ] "enum" DescriptorKey
( CompactEnumBody | BracedEnumBody ) ;
CompactEnumBody ::= NL TypeClause NL { EnumBodyClause NL } ;
BracedEnumBody ::= "{" NL TypeClause NL { EnumBodyClause NL } "}" ;
EnumBodyClause ::= ExtendsClause
| PropertyAssignmentClause
| RelationshipMap
| HeaderBlock
| VariantBlock ;
VariantDecl ::= "variant" DescriptorKey
( CompactVariantBody | BracedVariantBody ) ;
CompactVariantBody ::= NL TypeClause NL { VariantBodyClause NL } ;
BracedVariantBody ::= "{" NL TypeClause NL { VariantBodyClause NL } "}" ;
VariantBodyClause ::= ExtendsClause
| HeaderBlock
| RelationshipMap
| PropertyAssignmentClause ;
HolonDecl ::= [ "abstract" ] "holon" DescriptorKey
( CompactHolonBody | BracedHolonBody ) ;
CompactHolonBody ::= NL TypeClause NL { HolonBodyClause NL } ;
BracedHolonBody ::= "{" NL TypeClause NL { HolonBodyClause NL } "}" ;
HolonBodyClause ::= ExtendsClause
| InstanceKeyRuleClause
| PropertyAssignmentClause
| HeaderBlock
| HolonOpenFlagClause
| RelationshipMap ;
HolonOpenFlagClause ::= "allows_additional_properties"
| "allows_additional_relationships" ;
TypeClause ::= "type" DescriptorKey ;
ExtendsClause ::= "extends" DescriptorKey ;
ValueClause ::= "value" DescriptorKey ;
PropertyAssignmentClause ::= Identifier PropertyValue ;
PropertyValue ::= Literal | DescriptorKey ;
SourceClause ::= "source" DescriptorKey ;
TargetClause ::= "target" DescriptorKey ;
InstanceKeyRuleClause ::= "instance_keyrule" DescriptorKey ;
CardinalityClause ::= "cardinality" Integer ".." CardinalityMaximum ;
CardinalityMaximum ::= Integer | "*" ;
DeletionSemanticClause ::= "deletion_semantic" Reference ;
RelationshipFlagClause ::= "ordered"
| "duplicates" ;
RelationshipMap ::= "relationships" "{" NL
{ RelationshipAssignment [ "," ] NL }
"}" ;
RelationshipAssignment ::= Identifier "->" RelationshipTargets ;
RelationshipTargets ::= DescriptorKey
| "[" NL
{ DescriptorKey [ "," ] NL }
"]" ;
QualifiedRelationshipKey ::= "(" DescriptorKey ")-[" Identifier "]->("
DescriptorKey ")" ;
DescriptorKey ::= Reference
| QualifiedRelationshipKey ;
Reference ::= BareReference | QuotedReference ;
VariantBlock ::= "variants" "{" NL
{ VariantItem [ "," ] NL }
"}" ;
VariantItem ::= VariantDecl ;
HeaderBlock ::= "header" "{" NL
{ HeaderField NL }
"}" ;
HeaderField ::= Identifier ":" Literal ;
Appendix C: Mechanical Decompile Keyword Selection¶
This appendix defines how a TDL emitter selects concise TDL declaration forms when projecting LoaderRefRep facts back to TDL.
Decompile is a syntactic source transformation. It must not resolve descriptor references, inspect descriptor contracts, compute effective inheritance, materialize defaults, or perform descriptor-informed validation. Keyword selection is based only on authored loader facts present in the source representation and on source packaging context.
C.1 Inputs Available to Decompile¶
For each loader holon, the emitter may inspect only:
- the loader holon key;
- the top-level
typevalue, which is shorthand forDescribedBy; - explicit property names, values, and ordering;
- explicit relationship names, targets, and ordering;
- containing file and schema context;
- syntactic key structure, such as relationship descriptor keys of the form
(Source)-[Name]->(Target).
The emitter must not inspect the descriptors targeted by any reference. In particular, it must not decide that a holon is a value descriptor, property descriptor, relationship descriptor, enum, variant, or ordinary holon by resolving its type, Extends, ComponentOf, ValueType, SourceType, TargetType, or other relationships.
C.2 General Selection Principle¶
The emitter should select the most concise declaration form that is mechanically faithful to the authored loader facts.
A concise declaration form is mechanically faithful only when recompiling the emitted TDL produces equivalent canonical loader facts after allowed normalization. If a concise form would add facts, remove facts, reorder significant facts, or reinterpret facts, the emitter must use the smallest truthful fallback.
C.3 Schema Declaration¶
Emit a schema declaration when the loader holon has:
typeequal toSchema.HolonType.
The schema holon's DependsOn relationships emit as depends_on clauses. Mechanically recognized schema header fields and schema properties may emit through the schema header or fixed property forms. Unrecognized schema facts remain literal residue if they cannot be represented faithfully by the schema surface.
C.4 Relationship Declaration Forms¶
The emitter may use relationship declaration syntax only when all of the following are true:
- the holon key parses exactly as
(Source)-[Name]->(Target); - the holon has exactly one explicit
SourceTypetarget; - the holon has exactly one explicit
TargetTypetarget; - the explicit
SourceTypetarget matches the parsedSourcesegment; - the explicit
TargetTypetarget matches the parsedTargetsegment; - the emitted TDL relationship name is the parsed
Namesegment; - the holon has a top-level
type; - no other authored fact contradicts the parsed source, name, or target.
When those requirements are met:
- emit
inverse relationshiponly when explicitInverseOffacts are present; - emit
def relationshiponly when explicit definitional facts identify the relationship as definitional; - otherwise emit
relationship.
The emitter may emit inverse-pair clauses only from explicit facts. It must not infer InverseOf or HasInverse from relationship names, source/target reversal, key shape alone, or corpus pairing conventions.
C.5 Enum Declarations¶
The emitter may emit an enum declaration when the enum holon has explicit Variants relationship targets and those targets can be represented faithfully.
Inline variants may be emitted only when:
- every variant target to be inlined is present in the decompile corpus;
- the variant ordering is preserved from the authored
Variantstarget order; - each variant can be represented inline without losing or changing facts;
- recompiling the inline form emits the enum-side
Variantsrelationship rather than inventing inverse-side authorship.
If any variant carries residue that cannot be represented inline, the emitter should use the smallest truthful fallback, such as standalone variant declarations or literal residue, rather than flattening unrelated enum facts.
C.6 Variant Declarations¶
The emitter may emit a variant declaration when the variant membership is mechanically established by explicit authored facts, such as being targeted by exactly one emitted enum's Variants relationship.
The emitter must not infer variant status from key shape alone. A key such as EnumName.MemberName is not sufficient by itself to prove enum membership.
C.7 Descriptor-Oriented Holon Declarations¶
Emit holon when:
- the loader holon has a top-level
type; - the holon is not more specifically and faithfully represented by
schema, relationship syntax,enum, orvariant; - descriptor-oriented shorthand would not inject facts that are absent from the authored loader facts, except for the allowed file-level
ComponentOfpackaging rule.
holon is the safe default descriptor-oriented declaration form when a more specific concise form cannot be selected mechanically.
C.8 Generic Instance Declarations¶
Emit instance when descriptor-oriented forms would be misleading or lossy.
Use instance when:
- emitting
holonor another descriptor-oriented form would implyComponentOfor other descriptor-packaging behavior not present in the authored facts; - the holon represents ordinary non-descriptor data;
- the holon lacks facts required for a faithful descriptor-oriented shorthand;
- preserving the authored facts requires avoiding all descriptor-specific shorthand.
Generic instance declarations receive no implicit ComponentOf.
C.9 Clause Collapse Rules¶
The emitter may collapse explicit facts into dedicated TDL clauses only when the mapping is mechanically exact.
Recognized clause collapses include:
| Loader fact | TDL clause |
|---|---|
top-level type |
type <ref> |
one Extends target |
extends <ref> |
one InstanceKeyRule target |
instance_keyrule <ref> |
one ValueType target |
value <ref> |
one SourceType target on relationship declarations |
source <ref> |
one TargetType target on relationship declarations |
target <ref> |
MinCardinality plus finite MaxCardinality |
cardinality min..max |
MinCardinality with omitted MaxCardinality |
cardinality min..* |
DeletionSemantic |
deletion_semantic <value> |
explicit true IsOrdered |
ordered |
explicit true AllowsDuplicates |
duplicates |
The emitter must not collapse absent values into defaults. Omission remains omission.
Explicit false boolean values must not be rendered as absence when that would change the authored loader facts. If no concise syntax preserves explicit false, the value remains literal residue.
C.10 ComponentOf Omission¶
For descriptor-oriented declarations, an explicit ComponentOf <SchemaKey> relationship may be omitted from the emitted declaration only when all of the following are true:
- the target equals the containing file's
schemakey; - the declaration form is not
instance; - recompiling the emitted TDL will recreate the same
ComponentOffact through file-level schema packaging.
Otherwise, ComponentOf must be preserved explicitly as a literal relationship.
C.11 Literal Residue¶
Any authored loader fact not consumed by a mechanically faithful concise rule must be emitted literally.
Literal residue includes:
- unknown properties;
- unknown relationships;
- explicit false booleans without faithful concise syntax;
- multi-target relationships not represented by a dedicated clause;
- repeated relationship entries whose exact order or grouping cannot otherwise be preserved;
- source facts whose concise rendering would add, remove, or reinterpret authored facts.
Literal fallback must be minimal. If only one property or relationship cannot be rendered concisely, the emitter should preserve the concise declaration and literalize only the problematic fact block.
C.12 Fallback Rule¶
If a concise declaration would compile back to different canonical loader facts, the emitter must fall back to the smallest truthful surface.
Fallback order:
- keep the concise declaration but preserve problematic properties or relationships as literal residue;
- use a less specific descriptor-oriented declaration, such as
holon; - use
instancewhen descriptor-oriented declarations would imply facts not present in the source; - fail decompile only when no supported TDL surface can faithfully represent the authored loader facts.
C.13 Canonical Normalization¶
R7 decompile fidelity uses canonical normalization rather than exact source spelling.
The JSON parser may accept compatible legacy source shapes, including scalar relationship targets or string references, but decompile and recompile should converge to canonical loader JSON. After one normalization pass, repeated round trips should be stable.
Allowed source spelling differences include representation-level differences such as relationship target spelling, provided the normalized loader facts are equivalent. Volatile or orchestration-only metadata is not authored holon content unless explicitly whitelisted by the source-conversion contract.
C.14 Non-Goals¶
The emitter does not:
- resolve loader references;
- inspect referenced descriptors;
- infer descriptor category from inheritance;
- compute effective descriptor contracts;
- materialize defaults;
- validate holon conformance;
- infer relationship inverses;
- infer enum membership from key shape alone;
- preserve arbitrary original JSON formatting or spelling.
Those responsibilities belong to loader resolution, descriptor semantics, validation, or source-format preservation tools outside mechanical TDL decompile.