Skip to content

TypeDescriptor

Rashaan Lightpool edited this page Apr 21, 2025 · 5 revisions

๐Ÿ“„ Type Descriptors

The MAP Type System represents all types as holons. This includes the types used to define the structure, behavior, and semantics of other holons. These "type holons" are referred to as type descriptors, and they all follow a consistent structural pattern.


๐Ÿ”ง Type Descriptor Pattern

Each MAP type descriptor consists of:

  1. ๐Ÿ“„ TypeHeader โ€” shared metadata for all types, such as name, label, base type, and version
  2. ๐Ÿ“„ XxxType โ€” specialized holon with type-specific fields (e.g. PropertyType, HolonType)
  3. ๐Ÿ“„ Optional ValueType โ€” defines scalar constraints when describing scalar-based data

Together, these elements describe a MAP Type. They are linked together via relationships like:

  • ๐Ÿ”— HAS_ASPECT โ†’ from TypeHeader to its XxxType component
  • ๐Ÿ”— VALUE_TYPE_FOR โ†’ from ValueType to PropertyType
  • ๐Ÿ”— DESCRIBED_BY โ†’ every descriptor is itself described by a descriptor

๐Ÿง  Principle: Types are self-describing. Every descriptor holon is itself described by another descriptor (a meta-descriptor).


๐Ÿง  What Is a TypeHeader?

The TypeHeader is a universal struct shared by all descriptor types. It defines common fields and links for metadata, ownership, and schema organization:

pub struct TypeHeader {
    pub descriptor_name: MapString,
    pub label: MapString,
    pub base_type: BaseType,
    pub description: MapString,
    pub is_dependent: MapBoolean,
    pub is_builtin_type: MapBoolean,
    pub is_value_type: MapBoolean,
    pub version: SemanticVersion,
    pub owned_by: Option<HolonReference>,
    pub component_of: HolonReference,
    pub described_by: Option<HolonReference>,
}

๐Ÿ”ง Pattern: The TypeHeader contains common metadata and establishes that all descriptors are COMPONENT_OF a ๐Ÿ“ Schema.


๐Ÿ“„ Specialized XxxType Holons

Each core and extension descriptor includes a type-specific holon that adds fields and behaviors relevant to that type. For example:

pub struct HolonType {
    pub header: TypeHeader,
    pub type_name: MapString,
    pub properties: HolonCollection,
    pub key_properties: HolonCollection,
    pub source_for: HolonCollection,
    pub dances: HolonCollection,
}

This pattern repeats for all descriptor kinds: PropertyType, RelationshipType, DanceType, etc.

๐Ÿงฉ Each XxxType has its own schema, structure, and constraints. These enable the MAP to interpret and validate holons using these types.


๐ŸŒฑ Agent-Defined Descriptors

MAP supports extensibility by allowing agents to define their own descriptor types:

  • A new descriptor is created using a definer function (e.g. define_holon_type)
  • It receives a Spec object (e.g. HolonTypeSpec) containing all fields
  • This creates and links a TypeHeader and an appropriate XxxType

These descriptors:

  • Live in a ๐Ÿ“ Schema
  • Are OWNED_BY the agentโ€™s HolonSpace
  • Can be reused or referenced by other agents

๐Ÿ“Œ Summary: MAP treats all descriptors as first-class holons. Agent-created descriptors behave the same as built-in ones.


๐Ÿ” Descriptors Are Holons

Type descriptors are ordinary holons. This means:

  • They are versioned via a SemanticVersion holon
  • They participate in normal relationships (COMPONENT_OF, OWNED_BY, DESCRIBED_BY)
  • They are instantiated and staged like any other holon

๐ŸŒ€ Bootstrapping: Because descriptors are holons that are themselves described by descriptors, the MAP type system bootstraps itself into existence.


โš ๏ธ Outdated Concepts

The following concepts from the old wiki page are deprecated or clarified:

  • โœ… TypeDescriptor โ†’ renamed to TypeHeader
  • โŒ EnumVariants do not yet support data-carrying variants โ€” only variant_name is used
  • โŒ The "supertype / subtype_xxx" terminology is no longer preferred. Instead, use the holonic pattern of HAS_ASPECT and component holons
  • โŒ The distinction between "inheritance" and "delegation" is now unnecessary: all descriptors are composed using holonic relationships, not Rust-style inheritance
  • โŒ BaseType is no longer part of the current architecture. Its previous responsibilities are now split across TypeKind (for schema-level classification), ValueType (for scalar kinds), and BaseValue (for runtime data representation).

โš ๏ธ Caution: Do not assume any one-to-one mapping between Rust enum variants and MAP type holons. Descriptors are modeled as composable holons, not enums. Concepts


๐Ÿ“Ž Related Concepts

  • ๐Ÿ“ฆ TypeKind โ€” the semantic category of a type descriptor (replaces the now-deprecated BaseType enum)
  • ๐Ÿงฉ ValueType โ€” the scalar kind used in value descriptors
  • ๐Ÿงฉ BaseValue โ€” runtime value stored in holon properties
  • ๐Ÿ“ Schema โ€” the container for a group of type descriptors
  • ๐Ÿ”— DESCRIBED_BY, COMPONENT_OF, OWNED_BY, HAS_ASPECT โ€” universal descriptor relationships

๐Ÿ“Œ Summary

  • Every MAP type is defined as a descriptor composed of a TypeHeader and a XxxType
  • Descriptors are holons and live in schemas
  • Descriptor types are themselves described by meta-descriptors
  • MAP supports agent-defined extension of types through definer functions and specs
  • Descriptors are versioned, composable, and introspectable

To Do:

  • Add an updated UML class diagram

Clone this wiki locally