Types and Enums
Source of truth:The QTG v3 domain layer defines all classification values assrc/qtg/domain/types.py,src/qtg/domain/states.pyPublic re-export:src/qtg/domain/__init__.py
enum.StrEnum. They are stored as strings in the DB and referenced as type-safe enums in Python code. This document explains every enum defined in the domain.
Table of Contents
- TransportFamily
- VenueType
- ChainFamily
- CompletionAssurance
- NodeKind
- EdgeType
- GraphShape
- PlanTemplateStatus
- ApprovalStatus
- ReservationStatus
- CallbackOutboxStatus
- RequestState / NodeState
TransportFamily
Top-level classification of transfer method. At the plan-template level, it determines which transport path is used.Usage
- transport classification for plan templates (used in future routing decisions)
- lane separation in executor selection logic
VenueType
Type of venue where funds are located.Usage
- source/destination venue classification in intent
- filtering eligible plan templates by the source_venue_type + destination_venue_type combination during routing decisions
ChainFamily
Blockchain network family. Signing scheme, RPC interface, and address format are consistent within a family.Usage
SignerRegistryEntry.chain_families(JSON array) — list of chain families supported by the signerSigningIntent.chain_family— specifies the chain family in the signing request- decides chain-specific RPC call behavior inside executors
CompletionAssurance
Assurance level required for a node/request to be considered “complete.” It indicates how deep the verification goes.Usage
MovementPlanVersion.completion_policy(JSON) — plan-level completion policyMovementRequest.completion_policy_snapshot— snapshot taken when the request is created- used to decide how far observe nodes should execute
Assurance-level hierarchy
The higher the required assurance level, the more observe nodes are included in the plan graph.NodeKind
Classification of node roles within the plan graph. It is a core distinction in the v3 architecture and directly affects executor selection and state-transition strategy.Importance of the action vs observe distinction
This distinction directly affects the system’s safety model:-
has_side_effectdecision:actionnodes are typically set tohas_side_effect=True. This flag determines theFAILEDvsMANUAL_INTERVENTIONjudgment in state derivation. (See states-and-transitions.md for details.) -
Whether signing is required:
actionnodes may havesigning_required=True(especially on-chain tx).observenodes do not require signing. -
Meaning of UNKNOWN state: UNKNOWN on an
actionnode means a fund movement may have happened. UNKNOWN on anobservenode means only that the lookup failed. -
Recovery strategy:
actionUNKNOWN -> attempt txid confirmation from the provider.observeUNKNOWN -> simple retry.
manual_gate behavior
- If there is a READY node whose
node_keystarts with themanual_prefix - and there are no other active execution nodes
derive_request_state()returnsWAITING_MANUAL_ACTION- when the operator clears the manual gate through the API, the request returns to
EXECUTING
DB usage
MovementPlanNode.node_kind(String(32)) — plan node definitionExecutionContext.node_kind— passed into execution context
EdgeType
Type of connection (edge) between nodes in the plan graph. It determines under which condition the transition moves to the next node.DB usage
MovementPlanEdge.edge_type(String(32))MovementPlanEdge.from_node_id→MovementPlanEdge.to_node_idMovementPlanEdge.condition_expr— additional conditional expression (optional)MovementPlanEdge.priority— priority among the same edge_type
Role in Frontier Advancement
Currently,advance_after_completion() looks up successors of the completed node through get_successor_keys(). Branching logic by edge type is planned for graph_runtime (in v3.0, only the on_success path is active).
GraphShape
Topology shape of the plan graph. Determined at compile time and used to judge runtime requirements.DB usage
MovementPlanVersion.graph_shape(Enum) — plan-version levelMovementPlanVersion.requires_graph_runtime(Boolean) —Truewhen notLINEAR
v3.0 executability
LINEAR graphs. BRANCHING, MERGING, SPLIT, and HYBRID require graph runtime and are marked with MovementPlanVersion.executable_in_v3_0 = False. This constraint is propagated to MovementRequest as well.
PlanTemplateStatus
Lifecycle state of a plan template.DB usage
MovementPlanTemplate.status(Enum, default=draft)
ApprovalStatus
Approval state of a request.DB usage
MovementRequest.approval_status(Enum, default=pending)- Tracked separately from RequestState. When RequestState transitions from
PENDING_APPROVALtoAPPROVED,approval_statusalso changes toapproved.
ReservationStatus
State of hardcap reservation (resource reservation).DB usage
MovementRequest.reservation_status(Enum, default=none)
Detailed release conditions
Based on theshould_release_reservation() function:
Based on should_release_reservation():
REJECTED,EXPIRED-> always releasedCANCELLED,FAILED-> released only when there is no side-effect-bearing COMPLETED node- if a side-effect-completed node exists -> do not release (funds are in transit)
CallbackOutboxStatus
Delivery state of a callback outbox message.DB usage
MovementCallbackOutbox.status(Enum, default=pending)MovementCallbackOutbox.max_attempts(default=5)MovementCallbackOutbox.attempts— current attempt count
RequestState / NodeState
Detailed descriptions of the state enums are organized in states-and-transitions.md. This section records only their location and re-export information.- Defined in:
src/qtg/domain/states.py - Re-export:
qtg.domain.RequestState,qtg.domain.NodeState - RequestState: 12 values (RECEIVED, VALIDATED, PENDING_APPROVAL, APPROVED, EXECUTING, WAITING_MANUAL_ACTION, COMPLETED, FAILED, MANUAL_INTERVENTION, REJECTED, EXPIRED, CANCELLED)
- NodeState: 12 values (BLOCKED, READY, PREPARING, AWAITING_SIGNATURE, SUBMITTING, SUBMITTED, OBSERVING, COMPLETED, FAILED, UNKNOWN, CANCELLED, SKIPPED)
Full enum import path
All domain enums can be imported directly fromqtg.domain:
domain/__init__.py re-exports all public types through __all__.
DB column mapping summary
NodeKind and EdgeType are stored in the DB as String, not SQLAlchemy Enum. Python code uses StrEnum, but at the DB-schema level only string constraints apply.
Cross-References
- states-and-transitions.md — RequestState/NodeState transition graph, derive logic
- error-taxonomy.md — error-to-state-transition mapping
- executor-signer-protocols.md — use of these types in ExecutionContext
- ../infrastructure/data-model.md — DB schema details