Map Commands Architecture Direction #420
owleyeview
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.
-
Architecture Direction: Runtime as the Sole MAP Command Ingress
This note documents the architectural direction I am currently implementing. The goal is to align the codebase with the architecture we already intend, simplify the command execution path, and prepare the system for upcoming undo/redo functionality.
This work also advances the goals of issues #405 and #406 (roadmap Phase 2.2 and Phase 3).
I'm sharing it so the team has visibility into the direction and an opportunity to raise concerns before the refactor lands.
Key Direction
The core change is to fully consolidate MAP command execution around Runtime.
The architecture will move toward:
one state tree, one transaction owner, one ingress pathway.
Specifically:
Runtimebecomes the only local command ingress path for MAP operations.Danceremains a first-class command with runtime-detected mutation behavior.Command Ingress
dispatch_map_commandwill become the single Tauri command for MAP operations.The legacy
map_requestpath will be removed fromAppBuilderregistration.All MAP commands will flow through:
This consolidates execution policy, lifecycle validation, and mutation detection in one place.
Command Descriptors
Each MAP command will define a
CommandDescriptordescribing its execution requirements and mutation classification.Descriptor semantics
Built-in commands will declare their mutation behavior statically.
Dancewill use:because dances are extensible and cannot be classified statically.
Example:
Descriptors will live alongside command definitions so execution policy stays close to the commands themselves.
Lifecycle Enforcement
Lifecycle validation currently implemented in
HolochainReceptorwill move into the command dispatch layer.The dispatch layer will enforce:
DanceThis makes the command layer the single source of truth for execution policy.
Receptor Changes
The current
HolochainReceptorandReceptorBehaviorwill be retired from the local MAP command ingress path.Runtimealready executes dances through aTrustChannelwhose backend transport isHolochainConductorClient. Because of this, the old receptor layer is no longer needed as a parallel ingress mechanism.The broader architectural idea of receptors still exists, but their role is narrower:
They are no longer used as privileged local command ingress.
Runtime Mutation Detection for Dance
Because dances are extensible, mutation classification must be detected at runtime.
To support this, transaction-managed holon pools will gain monotonic version counters.
The dispatcher will:
If versions changed, the dispatcher knows the operation mutated transaction-managed state.
This works naturally with the dance round-trip behavior.
During a dance:
import_staged_holons()andimport_transient_holons()If those import methods only bump version counters when the pool actually changes, then mutation detection becomes automatic:
This allows mutation detection without special-case dance logic.
Important detail
Pool imports must bump version counters only when the imported state differs.
If a read-only dance returns the same pool contents it received, the import should be a no-op. Otherwise we would produce false mutation signals.
The version counters provide the correct abstraction level for:
Gesture-Based Snapshot Control
Undo/redo checkpointing will be controlled by request options, not by command descriptors.
RequestOptionsincludes:gesture_idgesture_labelsnapshot_afterThis supports cases where a single user interaction triggers multiple commands and only the final command should close the gesture and capture a snapshot.
gesture_idprovides a stable grouping identifier so two sequential gestures with the same label are still distinct.Runtime Setup Flow
The intended Tauri setup flow becomes:
Register only
dispatch_map_commandfor MAP operations.Holochain plugin fires
setup-completed.run_complete_setupperforms:apply setups
initialize runtime
RuntimeSessionbecomes the owner of all transaction lifecycle.Runtimebecomes the only ingress surface.Cleanup Work
This direction implies the following cleanup work:
map_requestfromAppBuilderHolochainReceptorfrom the command pathgesture_idto request optionsNaming Consideration
Once the current
HolochainReceptoris removed, it may make sense to renameHolochainConductorClienttoHolochainReceptor.This would align naming with the architecture diagram and reflect the newer meaning of receptors as trust-mediated outbound adapters.
This rename is optional and not required for the refactor.
Open Questions
A few details still need decisions:
GetAllSpaces command
We may want a
GetAllSpacesMAP command depending on how multi-space management evolves.CommandDescriptor location
The current direction is to colocate descriptors with command variants, but this can still be adjusted if needed.
Remove
LocalReceptorandReceptorFactoryI suggest removing the current implementations of:
LocalReceptorReceptorFactoryor at minimum marking them as legacy compatibility code pending removal.
If we no longer support receptor-based local ingress, these abstractions are no longer central to the architecture.
Summary
The intended architecture becomes:
Runtimeis the only MAP command ingressDanceremains extensible with runtime mutation detectionThis completes the transition toward a cleaner MAP execution model built around commands, transactions, and runtime dispatch.
Beta Was this translation helpful? Give feedback.
All reactions