{
  "generatedFrom": "Payments Signal canonical architecture registry",
  "notice": "SYNTHETIC / TRAINING ONLY",
  "blueprintId": "architecture-payment-state",
  "versionLabel": "Reference architecture v1",
  "reviewDate": "2026-07-23",
  "traces": [
    {
      "id": "state-happy-path",
      "label": "One durable state journey",
      "summary": "Follow a payment from command to journal, posting, network result, and operator-visible status.",
      "viewId": "container",
      "steps": [
        {
          "id": "state-receive",
          "title": "Receive one command",
          "nodeId": "state-command",
          "plainExplanation": "The caller asks for one change against a known payment identity.",
          "businessState": "COMMAND_RECEIVED"
        },
        {
          "id": "state-transition",
          "title": "Accept one transition",
          "nodeId": "state-machine",
          "interfaceId": "state-command-to-machine",
          "plainExplanation": "The state machine confirms the command is valid for the current state.",
          "businessState": "TRANSITION_ACCEPTED"
        },
        {
          "id": "state-commit",
          "title": "Write the fact",
          "nodeId": "state-journal",
          "interfaceId": "state-machine-to-journal",
          "plainExplanation": "The accepted transition becomes durable before work leaves the core.",
          "businessState": "RECORDED"
        },
        {
          "id": "state-publish",
          "title": "Publish committed work",
          "nodeId": "state-outbox",
          "interfaceId": "state-journal-to-outbox",
          "plainExplanation": "The outbox carries the command using a stable identity and retry policy.",
          "businessState": "DISPATCHED"
        },
        {
          "id": "state-post",
          "title": "Record the accounting result",
          "nodeId": "state-ledger",
          "interfaceId": "state-outbox-to-ledger",
          "plainExplanation": "The ledger posts once and returns its own journal fact.",
          "businessState": "POSTED",
          "ledgerEffect": "Ledger journal reference linked to the payment"
        },
        {
          "id": "state-send",
          "title": "Release the network instruction",
          "nodeId": "state-network",
          "interfaceId": "state-outbox-to-network",
          "plainExplanation": "The external service receives one identified instruction.",
          "businessState": "SENT"
        },
        {
          "id": "state-result",
          "title": "Apply the external result",
          "nodeId": "state-machine",
          "interfaceId": "state-result-to-machine",
          "plainExplanation": "The payment advances only when the external evidence is compatible with its current state.",
          "businessState": "NETWORK_CONFIRMED"
        },
        {
          "id": "state-view",
          "title": "Present an explainable status",
          "nodeId": "state-projection",
          "interfaceId": "state-journal-to-projection",
          "plainExplanation": "Channels and operators see the current state, history, and any remaining uncertainty.",
          "businessState": "VISIBLE"
        }
      ],
      "evidence": [
        {
          "ref": {
            "sourceId": "payments-signal-editorial",
            "label": "simplified-educational-illustration",
            "locator": "State journey",
            "simplifications": "State names and ordering are illustrative; institutions and rails use different lifecycle models."
          },
          "verifiedDate": "2026-07-23",
          "versionContext": "Payments Signal reference architecture v1"
        }
      ]
    }
  ],
  "stressCases": [
    {
      "id": "state-duplicate-delivery",
      "label": "Queue delivers twice",
      "trigger": "The outbox retries after the consumer processed the first delivery but its acknowledgement was lost.",
      "divergesAfterStepId": "state-publish",
      "traceId": "state-happy-path",
      "affectedNodeIds": [
        "state-outbox",
        "state-ledger",
        "state-network"
      ],
      "affectedInterfaceIds": [
        "state-outbox-to-ledger",
        "state-outbox-to-network"
      ],
      "lastConfirmedState": "The outbound work is committed and may already have been processed.",
      "settlementState": "Depends on the first network delivery; the repeat cannot be assumed new.",
      "fundsState": "The posting may already exist under the original key.",
      "owner": "Payment-platform operations",
      "safeAction": "Consumers return the existing result for the same identity and reject changed reuse.",
      "requiredEvidence": [
        "Event ID",
        "Posting key",
        "Network message ID",
        "Consumer result"
      ],
      "recoverySteps": [
        "Deduplicate",
        "Return existing outcome",
        "Advance state once"
      ],
      "evidence": [
        {
          "ref": {
            "sourceId": "payments-signal-editorial",
            "label": "simplified-educational-illustration",
            "locator": "At-least-once delivery stress case",
            "simplifications": "Queue products differ; the invariant is stable identity and idempotent consumption."
          },
          "verifiedDate": "2026-07-23",
          "versionContext": "Payments Signal reference architecture v1"
        }
      ]
    },
    {
      "id": "state-timeout-late-success",
      "label": "Timeout followed by late success",
      "trigger": "The business timer fires, then a positive network status arrives later.",
      "divergesAfterStepId": "state-send",
      "traceId": "state-happy-path",
      "affectedNodeIds": [
        "state-timer",
        "state-machine",
        "state-network",
        "state-operations"
      ],
      "affectedInterfaceIds": [
        "state-timer-to-machine",
        "state-result-to-machine",
        "state-facts-to-ops"
      ],
      "lastConfirmedState": "The instruction was sent; completion was not confirmed before the deadline.",
      "settlementState": "Unknown at timeout; the late status may prove that settlement succeeded.",
      "fundsState": "Any timeout restoration or release must be reconciled against the late success.",
      "owner": "Payment operations with payment-platform support",
      "safeAction": "Treat timeout as uncertainty, block blind retry, and reconcile the late status against the original payment.",
      "requiredEvidence": [
        "Timer event",
        "Original network ID",
        "Late status",
        "Ledger effects",
        "Customer adjustment"
      ],
      "recoverySteps": [
        "Correlate late status",
        "Determine settlement",
        "Correct any temporary customer treatment",
        "Close with evidence"
      ],
      "evidence": [
        {
          "ref": {
            "sourceId": "payments-signal-editorial",
            "label": "simplified-educational-illustration",
            "locator": "Late-success stress case",
            "simplifications": "Exact timeout and restoration rules depend on the payment service."
          },
          "verifiedDate": "2026-07-23",
          "versionContext": "Payments Signal reference architecture v1"
        }
      ]
    },
    {
      "id": "state-stale-operator-command",
      "label": "Operator acts on stale status",
      "trigger": "An operator opens a held payment, but a network result changes its state before the operator presses release.",
      "divergesAfterStepId": "state-view",
      "traceId": "state-happy-path",
      "affectedNodeIds": [
        "state-projection",
        "state-operations",
        "state-command",
        "state-machine"
      ],
      "affectedInterfaceIds": [
        "state-facts-to-ops",
        "state-command-to-machine"
      ],
      "lastConfirmedState": "The screen is older than the authoritative event journal.",
      "settlementState": "The current state may already be final.",
      "fundsState": "No second release or compensating posting is permitted from a stale view.",
      "owner": "Payment operations",
      "safeAction": "Use expected-version checks and reject the stale command before it changes anything.",
      "requiredEvidence": [
        "Displayed version",
        "Current version",
        "Operator identity",
        "Rejected command"
      ],
      "recoverySteps": [
        "Refresh",
        "Explain the new state",
        "Offer only currently permitted actions"
      ],
      "evidence": [
        {
          "ref": {
            "sourceId": "payments-signal-editorial",
            "label": "simplified-educational-illustration",
            "locator": "Stale-command stress case",
            "simplifications": "User-interface implementation varies; the control is version-aware command handling."
          },
          "verifiedDate": "2026-07-23",
          "versionContext": "Payments Signal reference architecture v1"
        }
      ]
    }
  ]
}
