Module modality_mutation_plane::protocol
source · Expand description
The modality mutation plane is comprised of a tree of communicating participants sharing information about mutators and mutations using this protocol.
§Participants
- A participant has a globally unique identifier
- A participant may have zero to many child participants.
- The root participant has zero parents; all other participants have one parent
- A participant may manage zero to many mutators.
§Mutators
- A mutator has a globally unique identifier
- A mutator may only be managed by a single participant
- A mutator may have zero to many “staged” mutations
- These are not-yet-actuated mutations
- Staged mutations are only actuated when their triggering conditions are met
- Staged mutations may be canceled
- A mutator may have zero to one active mutation
- This is the most-recently-actuated mutation
- A mutation is considered no longer active when either the mutator is reset or a new mutation is actuated at the same mutator.
§Mutations
- A mutation has a globally unique identifier
- A mutation has a map of zero to many parameters (key-value pairs)
- A mutation optionally has an associated set of triggering conditions and CRDT-like state tracking of those conditions
- A mutator and its managing participant are responsible for ensuring that a mutation is only ever actuated zero or one times.
§Messages
Messages typically travel in a single direction - either from the leaf/descendant participants towards the root, or from the root/ancestor participants towards the leaf/descendants.
When a participant receives a rootwards message from its children, it is expected to propagate the message to its parent.
When a participant receives a leafwards message from its parent either:
- The message specifically only has meaning for the current participant or its managed mutators
and must be handled locally and not propagated. E.G.
ClearMutationsForMutator
,ChildAuthOutcome
- The message may be relevant to some other participant, and must be propagated to children.
The exception to these rules is UpdateTriggerState
, which travels in both directions.
When a participant receives this message, it attempts to update its internal
triggering state for that mutation. If anything changed in the internal state as a result
of incorporating the contents of the message, an UpdateTriggerState
message should be sent
to the participant’s parent and any children.