MAP Query Architecture¶
This document identifies the concrete runtime architecture for MAP query execution.
Its purpose is to name the actual runtime components, show how they relate, and explain the ingress and execution path for MAP queries at the architectural layer.
It does not define the query algebra, planner semantics, distributed fanout rules, or schema details. Those belong in:
Core Runtime Position¶
MAP query execution is provided by a holons_core resident query engine that
implements the QueryDance.
The query engine is not a separate query-only subsystem. It is reached through the same canonical dance execution seam used elsewhere in MAP.
The core rule is:
Command = ingress envelope and lifecycle policy.
Dance = descriptor-afforded executable behavior.
Query = request payload supplied to a Query Dance.
For query execution, that becomes:
DanceInvocation
-> QueryDance
-> QueryDanceRequest
-> QueryGraph
-> ExecutionInstance
-> HolonCollection result
At the architectural level, the concrete runtime path is:
MAP client or TrustChannel peer
-> ingress adapter
-> DanceInvocation
-> Integration Hub host runtime
-> holons_core::execute_dance_v2(...)
-> QueryDance implementation
-> single-space execution in one HolonSpace / hApp context
-> HolonCollection result
Runtime Components¶
TypeScript Experience Layer¶
The TypeScript experience layer is one caller of MAP query execution.
It may initiate a query through the Commands IPC surface, but it does not own query execution semantics and it does not execute query logic locally.
Tauri IPC Entry Point¶
For command-based ingress, the first concrete runtime component is the Tauri IPC entry point:
dispatch_map_command(request: MapIpcRequest, ...)
This is the single IPC ingress for MAP Commands. It receives MapIpcRequest
from the client side and passes control into the host-side command adapter.
Host-Side MAP Command Adapter¶
The host-side MAP command adapter binds wire-safe IPC payloads into host-side runtime values inside the Integration Hub.
For query execution through Commands, it is responsible for:
- parsing
MapIpcRequest - binding the request into host/runtime shapes
- handling the
TransactionAction::DanceV2command path - carrying or resolving the
HolonReferenceto aDanceInvocation
This is still an ingress component. It is not the query engine itself.
DanceInvocation¶
DanceInvocation is the canonical execution request record shared across query
ingress paths.
It identifies:
- the invoked
DanceType - the
AffordingHolon - the request holon
- the ingress source
For query execution, the request holon is a QueryDanceRequest, which points to
the QueryGraph and its initial bindings.
Integration Hub Host Runtime¶
Commands execute entirely within the Rust Integration Hub host runtime.
This is the canonical dispatch site for MAP query execution. It receives a bound
DanceInvocation, resolves the local dance contract, and invokes the canonical
dance executor.
This host runtime is also the architectural home for cross-space orchestration, though the distributed model itself is outside the scope of this document.
holons_core Dance Executor¶
The canonical dance execution seam is holons_core::execute_dance_v2(...).
This is the key shared runtime component behind both Commands ingress and TrustChannel ingress. Different ingress adapters feed into the same executor.
The executor:
- reads the
DanceInvocation - resolves
DanceInvocation.DanceNameto the localDanceType - validates the invocation and request contract
- binds the invocation into a
BoundDanceInvocationor equivalent resolved form - selects the
DanceImplementation - executes it and returns the dance response
QueryDance Implementation¶
The QueryDance implementation is the query engine proper.
It accepts a QueryDanceRequest, executes the QueryGraph, creates an
ExecutionInstance, and produces the final HolonCollection.
Architecturally, query execution is therefore an ordinary dance executed through
the common holons_core dance runtime.
Guest-Side hApp / HolonSpace Execution Context¶
Single-space query work may execute inside one guest-resident hApp / one
HolonSpace execution context.
This is the local execution site for one space-scoped branch of query work. It is not the general cross-space coordinator.
Ingress Paths¶
MAP Client Via Dance Commands¶
One ingress path begins with a MAP client, typically through the TypeScript experience layer.
The concrete flow is:
- the experience layer issues a command request
- the request enters
dispatch_map_command(...) - the host-side MAP command adapter binds
MapIpcRequestinto host runtime values - query dance invocation is carried through
TransactionAction::DanceV2 - the Integration Hub host runtime dispatches the bound
DanceInvocation - the host calls
holons_core::execute_dance_v2(...) - the executor resolves and runs the
QueryDance
Commands are therefore the client-to-host ingress adapter. They are not the semantic home of query execution.
TrustChannel Ingress¶
Another ingress path begins with TrustChannel-delivered dance traffic.
The concrete flow is:
- a TrustChannel message delivers a Dance Capsule or equivalent trust-channel envelope
- the TrustChannel ingress layer validates that channel's authority
- the ingress layer unwraps the capsule into the canonical
DanceInvocationsurface - the Integration Hub host runtime dispatches that invocation
- the host calls the same
holons_core::execute_dance_v2(...)seam - the executor resolves and runs the same
QueryDance
TrustChannel ingress is a different transport and authority path, not a different query engine.
hApp Guest-Resident Single-Space Execution¶
Single-space query graphs may execute inside the guest-resident hApp context.
The concrete execution rule is:
- the current query work is bound to one
HolonSpace - that space corresponds to one hApp execution context
- query execution runs locally for that one space
- a step execution does not straddle multiple hApps
- the local result is returned through the same
QueryDanceexecution model
This guest-resident path matters because MAP query execution is space-scoped at runtime.
How The Components Relate¶
The concrete relationship between components is:
- The experience layer calls the Tauri IPC entry point when query ingress comes from a client.
- The Tauri IPC entry point forwards to the host-side MAP command adapter.
- The command adapter binds
MapIpcRequestintoTransactionAction::DanceV2carrying aDanceInvocation. - The Integration Hub host runtime dispatches that invocation.
- The host calls
holons_core::execute_dance_v2(...). - The
holons_coreexecutor resolves and runs theQueryDance. - The
QueryDanceexecutes the query against one currentHolonSpace/ hApp context at a time.
TrustChannel ingress differs only in its outer adapter:
- TrustChannel transport and capsule handling replace Tauri IPC and
MapIpcRequest. - After unwrapping, it rejoins the same
DanceInvocation -> execute_dance_v2 -> QueryDancepath.
Architectural Boundaries¶
This runtime architecture depends on a few firm boundaries.
- The query engine lives in the
QueryDanceimplementation executed throughholons_core. dispatch_map_command(...)andMapIpcRequestare command ingress components, not query-semantic components.DanceInvocationis the common execution request surface shared across ingress paths.- The Integration Hub host runtime is the canonical dispatch site.
- TrustChannel ingress is a different adapter into the same host and executor seam.
- Guest-side hApp execution is valid for single-space query graphs, but it is not the cross-space coordinator.
Out Of Scope¶
This document does not attempt to specify:
- the
QueryGraphandQueryStepexecution model in detail - query algebra operators and validation semantics
- projection, path, scalar, or explanation result modeling
- distributed fanout, delegated execution, and result merge rules
- planner algebra or declarative OpenCypher / GQL compilation
- core schema relationship and property definitions
Those concerns belong in the query engine design spec, schema DSL, and distributed query concept documents.