-
Notifications
You must be signed in to change notification settings - Fork 1
TypeDescriptor
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.
Each MAP type descriptor consists of:
- ๐
TypeHeaderโ shared metadata for all types, such as name, label, base type, and version - ๐
XxxTypeโ specialized holon with type-specific fields (e.g.PropertyType,HolonType) - ๐ 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).
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
TypeHeadercontains common metadata and establishes that all descriptors are COMPONENT_OF a ๐Schema.
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.
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
Specobject (e.g.HolonTypeSpec) containing all fields - This creates and links a
TypeHeaderand an appropriateXxxType
These descriptors:
- Live in a ๐
Schema - Are
OWNED_BYthe agentโsHolonSpace - 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.
Type descriptors are ordinary holons. This means:
- They are versioned via a
SemanticVersionholon - 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.
The following concepts from the old wiki page are deprecated or clarified:
- โ
TypeDescriptorโ renamed toTypeHeader - โ EnumVariants do not yet support data-carrying variants โ only
variant_nameis used - โ The "supertype / subtype_xxx" terminology is no longer preferred. Instead, use the holonic pattern of
HAS_ASPECTand component holons - โ The distinction between "inheritance" and "delegation" is now unnecessary: all descriptors are composed using holonic relationships, not Rust-style inheritance
- โ
BaseTypeis no longer part of the current architecture. Its previous responsibilities are now split acrossTypeKind(for schema-level classification),ValueType(for scalar kinds), andBaseValue(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
- ๐ฆ
TypeKindโ the semantic category of a type descriptor (replaces the now-deprecatedBaseTypeenum) - ๐งฉ
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
- Every MAP type is defined as a descriptor composed of a
TypeHeaderand aXxxType - 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
- Add an updated UML class diagram