Pure Holonic Dance API #324
evomimic
started this conversation in
Design Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
2. Problem Statement
Over time, the MAP Dance API has evolved organically across multiple layers of the stack. While it has proven workable, it is not yet holonic — meaning that the key data structures that represent a dance, its request, and its response are not themselves Holons described within the MAP Type System.
The current MAP Dance API is a procedural artifact that predates the new MAP Dance Schema-v0.0.2, which now fully defines how dances, requests, responses, and implementations relate as holons. The schema expresses the ontology of dances as a unified, self-describing model, but the runtime still implements an older, code-driven envelope pattern that duplicates this logic manually.
A. Fragmented API Surface
At present, the Rust client defines separate structs for
DanceRequestandDanceResponse, with enums for payloads and status codes:These procedural structs function as envelopes for data exchange but are not themselves Holons.
Their shape and meaning are defined by Rust code rather than by the MAP Type System, making them opaque to schema-level discovery, validation, and introspection.
B. Ad-hoc Payload Enums
The request and response bodies rely on fixed enums that must be edited and recompiled whenever new payload types are introduced:
This pattern creates a closed world: the host must know every possible body variant at compile time.
It also breaks alignment with the type system—payloads cannot be validated as instances of
HolonTypes, nor can they be extended declaratively by spaces or downstream schemas.C. Contextual Leakage
The same
DanceRequesttype is used across three distinct runtime contexts—TypeScript client, Rust client, and Holochain guest—even though their state models differ:state: Option<SessionState>field remains unused.For example, the same conceptual “CreateEmptyTransient” dance takes different forms depending on where it runs:
Thus, the same logical action is represented by two structurally different envelopes, tied to runtime context rather than schema.
D. Missing Self-Description and Composability
Because
DanceRequestandDanceResponseare not Holons:DescribedBylink to aDanceTypeorDanceResponseType.DescribedBy).TrustChannel,CapabilityEnvelope, orAuditEnvelope.This prevents schema-driven validation, automated documentation, and dynamic composition of dances.
E. Divergence From the Declared Schema
The MAP Dance Schema-v0.0.2 already defines a complete holonic model for dances:
dance_namestringDanceName.PropertyTypeDanceTypeenumDanceTypeholonDanceResponsestructDanceResponseTypeholonResponseStatusCodeenumResponseStatusCode.EnumValue+ variants(HolonType)-[Affords]->(DanceType)and(TypeDescriptor)-[ImplementsDance]->(DanceImplementation)DanceImplementation(Engine,ModuleRef,Entrypoint, etc.)However, none of these holonic descriptors are used by the runtime.
Instead, the Rust API reconstructs them procedurally, duplicating their structure and logic in code.
This schema–runtime divergence means:
AffordsandImplementsDancerelationships.Danceas a first-class holon.F. Summary of the Problem
The current MAP Dance API:
DanceType,DanceResponseType, andDanceImplementationdescriptors.Until the runtime refactors to treat Dance, DanceRequest, and DanceResponse as first-class Holons described by the MAP Dance Schema,
the system will continue to suffer from schema–runtime divergence, limited extensibility, and redundant implementation logic.
Beta Was this translation helpful? Give feedback.
All reactions