[
  {
    "caseId": "BL-001",
    "category": "purchase",
    "description": "Canonical purchase derives exact integer subtotal.",
    "initial": {
      "ledgerBefore": [],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "create_purchase",
        "purchaseId": "purchase.p1",
        "ownerId": "owner.alice",
        "quantity": "3",
        "unitAmountCents": "500",
        "currency": "USD",
        "jurisdiction": "US-CA",
        "registrationVersion": "1",
        "taxAmountCents": "0",
        "registrationAuthorizationVersion": "1"
      }
    ],
    "expected": {
      "outcome": "accepted",
      "error": null,
      "ledgerAppends": [],
      "ledgerNet": "0",
      "spendableBalance": "0",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "currency",
        "jurisdiction",
        "owner",
        "provider_calls",
        "quantity",
        "registration",
        "rollback",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-002",
    "category": "provider",
    "description": "Webhook quantity must match canonical purchase.",
    "initial": {
      "ledgerBefore": [],
      "purchases": [
        {
          "purchaseId": "purchase.p1",
          "ownerId": "owner.alice",
          "quantity": "3",
          "unitAmountCents": "500",
          "itemSubtotalCents": "1500",
          "currency": "USD",
          "jurisdiction": "US-CA",
          "registrationVersion": "1",
          "taxAmountCents": "0",
          "registrationAuthorizationVersion": "1"
        }
      ],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "payment_webhook",
        "eventId": "event.pay1",
        "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "objectId": "payment.obj1",
        "purchaseId": "purchase.p1",
        "ownerId": "owner.alice",
        "quantity": "2",
        "amountCents": "1500",
        "currency": "USD",
        "jurisdiction": "US-CA",
        "paymentState": "paid",
        "signatureVerified": true,
        "taxAmountCents": "0"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "INVALID_QUANTITY",
      "ledgerAppends": [],
      "ledgerNet": "0",
      "spendableBalance": "0",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "claim",
        "currency",
        "effect",
        "jurisdiction",
        "owner",
        "payload_hash",
        "provider_calls",
        "provider_event",
        "provider_object",
        "quantity",
        "rollback",
        "signature",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-003",
    "category": "provider",
    "description": "Webhook amountCents must match canonical purchase.",
    "initial": {
      "ledgerBefore": [],
      "purchases": [
        {
          "purchaseId": "purchase.p1",
          "ownerId": "owner.alice",
          "quantity": "3",
          "unitAmountCents": "500",
          "itemSubtotalCents": "1500",
          "currency": "USD",
          "jurisdiction": "US-CA",
          "registrationVersion": "1",
          "taxAmountCents": "0",
          "registrationAuthorizationVersion": "1"
        }
      ],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "payment_webhook",
        "eventId": "event.pay1",
        "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "objectId": "payment.obj1",
        "purchaseId": "purchase.p1",
        "ownerId": "owner.alice",
        "quantity": "3",
        "amountCents": "1499",
        "currency": "USD",
        "jurisdiction": "US-CA",
        "paymentState": "paid",
        "signatureVerified": true,
        "taxAmountCents": "0"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "AMOUNT_MISMATCH",
      "ledgerAppends": [],
      "ledgerNet": "0",
      "spendableBalance": "0",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "claim",
        "currency",
        "effect",
        "jurisdiction",
        "owner",
        "payload_hash",
        "provider_calls",
        "provider_event",
        "provider_object",
        "quantity",
        "rollback",
        "signature",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-004",
    "category": "provider",
    "description": "Webhook currency must match canonical purchase.",
    "initial": {
      "ledgerBefore": [],
      "purchases": [
        {
          "purchaseId": "purchase.p1",
          "ownerId": "owner.alice",
          "quantity": "3",
          "unitAmountCents": "500",
          "itemSubtotalCents": "1500",
          "currency": "USD",
          "jurisdiction": "US-CA",
          "registrationVersion": "1",
          "taxAmountCents": "0",
          "registrationAuthorizationVersion": "1"
        }
      ],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "payment_webhook",
        "eventId": "event.pay1",
        "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "objectId": "payment.obj1",
        "purchaseId": "purchase.p1",
        "ownerId": "owner.alice",
        "quantity": "3",
        "amountCents": "1500",
        "currency": "EUR",
        "jurisdiction": "US-CA",
        "paymentState": "paid",
        "signatureVerified": true,
        "taxAmountCents": "0"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "CURRENCY_MISMATCH",
      "ledgerAppends": [],
      "ledgerNet": "0",
      "spendableBalance": "0",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "claim",
        "currency",
        "effect",
        "jurisdiction",
        "owner",
        "payload_hash",
        "provider_calls",
        "provider_event",
        "provider_object",
        "quantity",
        "rollback",
        "signature",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-005",
    "category": "provider",
    "description": "Webhook jurisdiction must match canonical purchase.",
    "initial": {
      "ledgerBefore": [],
      "purchases": [
        {
          "purchaseId": "purchase.p1",
          "ownerId": "owner.alice",
          "quantity": "3",
          "unitAmountCents": "500",
          "itemSubtotalCents": "1500",
          "currency": "USD",
          "jurisdiction": "US-CA",
          "registrationVersion": "1",
          "taxAmountCents": "0",
          "registrationAuthorizationVersion": "1"
        }
      ],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "payment_webhook",
        "eventId": "event.pay1",
        "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "objectId": "payment.obj1",
        "purchaseId": "purchase.p1",
        "ownerId": "owner.alice",
        "quantity": "3",
        "amountCents": "1500",
        "currency": "USD",
        "jurisdiction": "US-NY",
        "paymentState": "paid",
        "signatureVerified": true,
        "taxAmountCents": "0"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "JURISDICTION_MISMATCH",
      "ledgerAppends": [],
      "ledgerNet": "0",
      "spendableBalance": "0",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "claim",
        "currency",
        "effect",
        "jurisdiction",
        "owner",
        "payload_hash",
        "provider_calls",
        "provider_event",
        "provider_object",
        "quantity",
        "rollback",
        "signature",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-006",
    "category": "provider",
    "description": "Webhook ownerId must match canonical purchase.",
    "initial": {
      "ledgerBefore": [],
      "purchases": [
        {
          "purchaseId": "purchase.p1",
          "ownerId": "owner.alice",
          "quantity": "3",
          "unitAmountCents": "500",
          "itemSubtotalCents": "1500",
          "currency": "USD",
          "jurisdiction": "US-CA",
          "registrationVersion": "1",
          "taxAmountCents": "0",
          "registrationAuthorizationVersion": "1"
        }
      ],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "payment_webhook",
        "eventId": "event.pay1",
        "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "objectId": "payment.obj1",
        "purchaseId": "purchase.p1",
        "ownerId": "owner.bob",
        "quantity": "3",
        "amountCents": "1500",
        "currency": "USD",
        "jurisdiction": "US-CA",
        "paymentState": "paid",
        "signatureVerified": true,
        "taxAmountCents": "0"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "OWNER_MISMATCH",
      "ledgerAppends": [],
      "ledgerNet": "0",
      "spendableBalance": "0",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "claim",
        "currency",
        "effect",
        "jurisdiction",
        "owner",
        "payload_hash",
        "provider_calls",
        "provider_event",
        "provider_object",
        "quantity",
        "rollback",
        "signature",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-007",
    "category": "provider",
    "description": "Valid webhook records receipt and economic claim separately.",
    "initial": {
      "ledgerBefore": [],
      "purchases": [
        {
          "purchaseId": "purchase.p1",
          "ownerId": "owner.alice",
          "quantity": "3",
          "unitAmountCents": "500",
          "itemSubtotalCents": "1500",
          "currency": "USD",
          "jurisdiction": "US-CA",
          "registrationVersion": "1",
          "taxAmountCents": "0",
          "registrationAuthorizationVersion": "1"
        }
      ],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "payment_webhook",
        "eventId": "event.pay1",
        "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "objectId": "payment.obj1",
        "purchaseId": "purchase.p1",
        "ownerId": "owner.alice",
        "quantity": "3",
        "amountCents": "1500",
        "currency": "USD",
        "jurisdiction": "US-CA",
        "paymentState": "paid",
        "signatureVerified": true,
        "taxAmountCents": "0"
      }
    ],
    "expected": {
      "outcome": "accepted",
      "error": null,
      "ledgerAppends": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "ledgerNet": "3",
      "spendableBalance": "3",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [
          {
            "eventId": "event.pay1",
            "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "objectId": "payment.obj1",
            "eventType": "payment_webhook"
          }
        ],
        "claims": [
          {
            "objectId": "payment.obj1",
            "purchaseId": "purchase.p1",
            "effect": "payment_grant"
          }
        ],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "claim",
        "currency",
        "effect",
        "jurisdiction",
        "owner",
        "payload_hash",
        "provider_calls",
        "provider_event",
        "provider_object",
        "quantity",
        "rollback",
        "signature",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-008",
    "category": "ordering",
    "description": "Same event id and same hash is an idempotent replay.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [
        {
          "purchaseId": "purchase.p1",
          "ownerId": "owner.alice",
          "quantity": "3",
          "unitAmountCents": "500",
          "itemSubtotalCents": "1500",
          "currency": "USD",
          "jurisdiction": "US-CA",
          "registrationVersion": "1",
          "taxAmountCents": "0",
          "registrationAuthorizationVersion": "1"
        }
      ],
      "receipts": [
        {
          "eventId": "event.pay1",
          "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "objectId": "payment.obj1",
          "eventType": "payment_webhook"
        }
      ],
      "claims": [
        {
          "objectId": "payment.obj1",
          "purchaseId": "purchase.p1",
          "effect": "payment_grant"
        }
      ],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "payment_webhook",
        "eventId": "event.pay1",
        "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "objectId": "payment.obj1",
        "purchaseId": "purchase.p1",
        "ownerId": "owner.alice",
        "quantity": "3",
        "amountCents": "1500",
        "currency": "USD",
        "jurisdiction": "US-CA",
        "paymentState": "paid",
        "signatureVerified": true,
        "taxAmountCents": "0"
      }
    ],
    "expected": {
      "outcome": "noop",
      "error": null,
      "ledgerAppends": [],
      "ledgerNet": "3",
      "spendableBalance": "3",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [
          {
            "eventId": "event.pay1",
            "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "objectId": "payment.obj1",
            "eventType": "payment_webhook"
          }
        ],
        "claims": [
          {
            "objectId": "payment.obj1",
            "purchaseId": "purchase.p1",
            "effect": "payment_grant"
          }
        ],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "claim",
        "currency",
        "effect",
        "jurisdiction",
        "owner",
        "payload_hash",
        "provider_calls",
        "provider_event",
        "provider_object",
        "quantity",
        "rollback",
        "signature",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-009",
    "category": "ordering",
    "description": "Same event id with a different payload hash is rejected.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [
        {
          "purchaseId": "purchase.p1",
          "ownerId": "owner.alice",
          "quantity": "3",
          "unitAmountCents": "500",
          "itemSubtotalCents": "1500",
          "currency": "USD",
          "jurisdiction": "US-CA",
          "registrationVersion": "1",
          "taxAmountCents": "0",
          "registrationAuthorizationVersion": "1"
        }
      ],
      "receipts": [
        {
          "eventId": "event.pay1",
          "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "objectId": "payment.obj1",
          "eventType": "payment_webhook"
        }
      ],
      "claims": [
        {
          "objectId": "payment.obj1",
          "purchaseId": "purchase.p1",
          "effect": "payment_grant"
        }
      ],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "payment_webhook",
        "eventId": "event.pay1",
        "payloadHash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
        "objectId": "payment.obj1",
        "purchaseId": "purchase.p1",
        "ownerId": "owner.alice",
        "quantity": "3",
        "amountCents": "1500",
        "currency": "USD",
        "jurisdiction": "US-CA",
        "paymentState": "paid",
        "signatureVerified": true,
        "taxAmountCents": "0"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "EVENT_PAYLOAD_CONFLICT",
      "ledgerAppends": [],
      "ledgerNet": "3",
      "spendableBalance": "3",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [
          {
            "eventId": "event.pay1",
            "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "objectId": "payment.obj1",
            "eventType": "payment_webhook"
          }
        ],
        "claims": [
          {
            "objectId": "payment.obj1",
            "purchaseId": "purchase.p1",
            "effect": "payment_grant"
          }
        ],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "claim",
        "currency",
        "effect",
        "jurisdiction",
        "owner",
        "payload_hash",
        "provider_calls",
        "provider_event",
        "provider_object",
        "quantity",
        "rollback",
        "signature",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-010",
    "category": "reversal",
    "description": "Reversal is allocated from cumulative refunded item subtotal with final residual.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [
        {
          "purchaseId": "purchase.p1",
          "ownerId": "owner.alice",
          "quantity": "3",
          "unitAmountCents": "500",
          "itemSubtotalCents": "1500",
          "currency": "USD",
          "jurisdiction": "US-CA",
          "registrationVersion": "1",
          "taxAmountCents": "0",
          "registrationAuthorizationVersion": "1"
        }
      ],
      "receipts": [
        {
          "eventId": "event.pay1",
          "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "objectId": "payment.obj1",
          "eventType": "payment_webhook"
        }
      ],
      "claims": [
        {
          "objectId": "payment.obj1",
          "purchaseId": "purchase.p1",
          "effect": "payment_grant"
        }
      ],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "refund_webhook",
        "eventId": "event.ref10",
        "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "objectId": "refund.obj10",
        "purchaseId": "purchase.p1",
        "cumulativeRefundedItemSubtotalCents": "500",
        "kind": "refund",
        "signatureVerified": true,
        "ownerId": "owner.alice",
        "quantity": "3",
        "amountCents": "1500",
        "taxAmountCents": "0",
        "currency": "USD",
        "jurisdiction": "US-CA",
        "taxRefundedCents": "0"
      }
    ],
    "expected": {
      "outcome": "accepted",
      "error": null,
      "ledgerAppends": [
        {
          "key": "ledger.ref10",
          "delta": "-1",
          "reason": "payment_refund_reversal",
          "ref": {
            "kind": "reversal",
            "id": "refund.obj10"
          }
        }
      ],
      "ledgerNet": "2",
      "spendableBalance": "2",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [
          {
            "eventId": "event.pay1",
            "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "objectId": "payment.obj1",
            "eventType": "payment_webhook"
          },
          {
            "eventId": "event.ref10",
            "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "objectId": "refund.obj10",
            "eventType": "refund_webhook"
          }
        ],
        "claims": [
          {
            "objectId": "payment.obj1",
            "purchaseId": "purchase.p1",
            "effect": "payment_grant"
          },
          {
            "objectId": "refund.obj10",
            "purchaseId": "purchase.p1",
            "effect": "refund_reversal"
          }
        ],
        "cycles": [],
        "adjustments": [],
        "refundStates": [
          {
            "purchaseId": "purchase.p1",
            "cumulativeRefundedItemSubtotalCents": "500",
            "reversedCredits": "1"
          }
        ]
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "claim",
        "cumulative_allocation",
        "currency",
        "effect",
        "jurisdiction",
        "owner",
        "payload_hash",
        "provider_calls",
        "provider_event",
        "provider_object",
        "quantity",
        "rollback",
        "signature",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-011",
    "category": "reversal",
    "description": "Reversal is allocated from cumulative refunded item subtotal with final residual.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        },
        {
          "key": "ledger.ref0",
          "delta": "-1",
          "reason": "payment_refund_reversal",
          "ref": {
            "kind": "reversal",
            "id": "refund.obj0"
          }
        }
      ],
      "purchases": [
        {
          "purchaseId": "purchase.p1",
          "ownerId": "owner.alice",
          "quantity": "3",
          "unitAmountCents": "500",
          "itemSubtotalCents": "1500",
          "currency": "USD",
          "jurisdiction": "US-CA",
          "registrationVersion": "1",
          "taxAmountCents": "0",
          "registrationAuthorizationVersion": "1"
        }
      ],
      "receipts": [
        {
          "eventId": "event.pay1",
          "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "objectId": "payment.obj1",
          "eventType": "payment_webhook"
        },
        {
          "eventId": "event.ref0",
          "payloadHash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
          "objectId": "refund.obj0",
          "eventType": "refund_webhook"
        }
      ],
      "claims": [
        {
          "objectId": "payment.obj1",
          "purchaseId": "purchase.p1",
          "effect": "payment_grant"
        },
        {
          "objectId": "refund.obj0",
          "purchaseId": "purchase.p1",
          "effect": "refund_reversal"
        }
      ],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [
        {
          "purchaseId": "purchase.p1",
          "cumulativeRefundedItemSubtotalCents": "500",
          "reversedCredits": "1"
        }
      ],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "refund_webhook",
        "eventId": "event.ref11",
        "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "objectId": "refund.obj11",
        "purchaseId": "purchase.p1",
        "cumulativeRefundedItemSubtotalCents": "1000",
        "kind": "refund",
        "signatureVerified": true,
        "ownerId": "owner.alice",
        "quantity": "3",
        "amountCents": "1500",
        "taxAmountCents": "0",
        "currency": "USD",
        "jurisdiction": "US-CA",
        "taxRefundedCents": "0"
      }
    ],
    "expected": {
      "outcome": "accepted",
      "error": null,
      "ledgerAppends": [
        {
          "key": "ledger.ref11",
          "delta": "-1",
          "reason": "payment_refund_reversal",
          "ref": {
            "kind": "reversal",
            "id": "refund.obj11"
          }
        }
      ],
      "ledgerNet": "1",
      "spendableBalance": "1",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [
          {
            "eventId": "event.pay1",
            "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "objectId": "payment.obj1",
            "eventType": "payment_webhook"
          },
          {
            "eventId": "event.ref0",
            "payloadHash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
            "objectId": "refund.obj0",
            "eventType": "refund_webhook"
          },
          {
            "eventId": "event.ref11",
            "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "objectId": "refund.obj11",
            "eventType": "refund_webhook"
          }
        ],
        "claims": [
          {
            "objectId": "payment.obj1",
            "purchaseId": "purchase.p1",
            "effect": "payment_grant"
          },
          {
            "objectId": "refund.obj0",
            "purchaseId": "purchase.p1",
            "effect": "refund_reversal"
          },
          {
            "objectId": "refund.obj11",
            "purchaseId": "purchase.p1",
            "effect": "refund_reversal"
          }
        ],
        "cycles": [],
        "adjustments": [],
        "refundStates": [
          {
            "purchaseId": "purchase.p1",
            "cumulativeRefundedItemSubtotalCents": "1000",
            "reversedCredits": "2"
          }
        ]
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "claim",
        "cumulative_allocation",
        "currency",
        "effect",
        "jurisdiction",
        "owner",
        "payload_hash",
        "provider_calls",
        "provider_event",
        "provider_object",
        "quantity",
        "rollback",
        "signature",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-012",
    "category": "reversal",
    "description": "Reversal is allocated from cumulative refunded item subtotal with final residual.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        },
        {
          "key": "ledger.ref0",
          "delta": "-2",
          "reason": "payment_refund_reversal",
          "ref": {
            "kind": "reversal",
            "id": "refund.obj0"
          }
        }
      ],
      "purchases": [
        {
          "purchaseId": "purchase.p1",
          "ownerId": "owner.alice",
          "quantity": "3",
          "unitAmountCents": "500",
          "itemSubtotalCents": "1500",
          "currency": "USD",
          "jurisdiction": "US-CA",
          "registrationVersion": "1",
          "taxAmountCents": "0",
          "registrationAuthorizationVersion": "1"
        }
      ],
      "receipts": [
        {
          "eventId": "event.pay1",
          "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
          "objectId": "payment.obj1",
          "eventType": "payment_webhook"
        },
        {
          "eventId": "event.ref0",
          "payloadHash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
          "objectId": "refund.obj0",
          "eventType": "refund_webhook"
        }
      ],
      "claims": [
        {
          "objectId": "payment.obj1",
          "purchaseId": "purchase.p1",
          "effect": "payment_grant"
        },
        {
          "objectId": "refund.obj0",
          "purchaseId": "purchase.p1",
          "effect": "refund_reversal"
        }
      ],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [
        {
          "purchaseId": "purchase.p1",
          "cumulativeRefundedItemSubtotalCents": "1000",
          "reversedCredits": "2"
        }
      ],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "refund_webhook",
        "eventId": "event.ref12",
        "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "objectId": "refund.obj12",
        "purchaseId": "purchase.p1",
        "cumulativeRefundedItemSubtotalCents": "1500",
        "kind": "refund",
        "signatureVerified": true,
        "ownerId": "owner.alice",
        "quantity": "3",
        "amountCents": "1500",
        "taxAmountCents": "0",
        "currency": "USD",
        "jurisdiction": "US-CA",
        "taxRefundedCents": "0"
      }
    ],
    "expected": {
      "outcome": "accepted",
      "error": null,
      "ledgerAppends": [
        {
          "key": "ledger.ref12",
          "delta": "-1",
          "reason": "payment_refund_reversal",
          "ref": {
            "kind": "reversal",
            "id": "refund.obj12"
          }
        }
      ],
      "ledgerNet": "0",
      "spendableBalance": "0",
      "deficit": "0",
      "state": {
        "purchases": [
          {
            "purchaseId": "purchase.p1",
            "ownerId": "owner.alice",
            "quantity": "3",
            "unitAmountCents": "500",
            "itemSubtotalCents": "1500",
            "currency": "USD",
            "jurisdiction": "US-CA",
            "registrationVersion": "1",
            "taxAmountCents": "0",
            "registrationAuthorizationVersion": "1"
          }
        ],
        "receipts": [
          {
            "eventId": "event.pay1",
            "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "objectId": "payment.obj1",
            "eventType": "payment_webhook"
          },
          {
            "eventId": "event.ref0",
            "payloadHash": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
            "objectId": "refund.obj0",
            "eventType": "refund_webhook"
          },
          {
            "eventId": "event.ref12",
            "payloadHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
            "objectId": "refund.obj12",
            "eventType": "refund_webhook"
          }
        ],
        "claims": [
          {
            "objectId": "payment.obj1",
            "purchaseId": "purchase.p1",
            "effect": "payment_grant"
          },
          {
            "objectId": "refund.obj0",
            "purchaseId": "purchase.p1",
            "effect": "refund_reversal"
          },
          {
            "objectId": "refund.obj12",
            "purchaseId": "purchase.p1",
            "effect": "refund_reversal"
          }
        ],
        "cycles": [],
        "adjustments": [],
        "refundStates": [
          {
            "purchaseId": "purchase.p1",
            "cumulativeRefundedItemSubtotalCents": "1500",
            "reversedCredits": "3"
          }
        ]
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "claim",
        "cumulative_allocation",
        "currency",
        "effect",
        "jurisdiction",
        "owner",
        "payload_hash",
        "provider_calls",
        "provider_event",
        "provider_object",
        "quantity",
        "rollback",
        "signature",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-013",
    "category": "conversion",
    "description": "customer funding creates explicit active cycle.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "conversion_accept",
        "cycleId": "cycle.customer",
        "ownerId": "owner.alice",
        "fundingKind": "customer",
        "debit": "1",
        "idempotencyKey": "submit.customer"
      }
    ],
    "expected": {
      "outcome": "accepted",
      "error": null,
      "ledgerAppends": [
        {
          "key": "ledger.debit.customer",
          "delta": "-1",
          "reason": "conversion_debit",
          "ref": {
            "kind": "cycle",
            "id": "cycle.customer"
          }
        }
      ],
      "ledgerNet": "2",
      "spendableBalance": "2",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [
          {
            "cycleId": "cycle.customer",
            "ownerId": "owner.alice",
            "fundingKind": "customer",
            "state": "active",
            "debit": "1",
            "compensationEligible": true
          }
        ],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "effect",
        "owner",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-014",
    "category": "conversion",
    "description": "goodwill funding creates explicit active cycle.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "conversion_accept",
        "cycleId": "cycle.goodwill",
        "ownerId": "owner.alice",
        "fundingKind": "goodwill",
        "debit": "1",
        "idempotencyKey": "submit.goodwill"
      }
    ],
    "expected": {
      "outcome": "accepted",
      "error": null,
      "ledgerAppends": [
        {
          "key": "ledger.debit.goodwill",
          "delta": "-1",
          "reason": "conversion_debit",
          "ref": {
            "kind": "cycle",
            "id": "cycle.goodwill"
          }
        }
      ],
      "ledgerNet": "2",
      "spendableBalance": "2",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [
          {
            "cycleId": "cycle.goodwill",
            "ownerId": "owner.alice",
            "fundingKind": "goodwill",
            "state": "active",
            "debit": "1",
            "compensationEligible": false
          }
        ],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "effect",
        "owner",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-015",
    "category": "conversion",
    "description": "Only eligible customer debit cycle is compensated once.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        },
        {
          "key": "ledger.debit.customer",
          "delta": "-1",
          "reason": "conversion_debit",
          "ref": {
            "kind": "cycle",
            "id": "cycle.customer"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [
        {
          "cycleId": "cycle.customer",
          "ownerId": "owner.alice",
          "fundingKind": "customer",
          "state": "active",
          "debit": "1",
          "compensationEligible": true
        }
      ],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "cycle_failed",
        "cycleId": "cycle.customer"
      }
    ],
    "expected": {
      "outcome": "accepted",
      "error": null,
      "ledgerAppends": [
        {
          "key": "ledger.comp.customer",
          "delta": "1",
          "reason": "cycle_failure_compensation",
          "ref": {
            "kind": "cycle",
            "id": "cycle.customer"
          }
        }
      ],
      "ledgerNet": "3",
      "spendableBalance": "3",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [
          {
            "cycleId": "cycle.customer",
            "ownerId": "owner.alice",
            "fundingKind": "customer",
            "state": "compensated",
            "debit": "1",
            "compensationEligible": true
          }
        ],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "effect",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-016",
    "category": "conversion",
    "description": "Goodwill retry failure cannot mint compensation.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [
        {
          "cycleId": "cycle.goodwill",
          "ownerId": "owner.alice",
          "fundingKind": "goodwill",
          "state": "active",
          "debit": "1",
          "compensationEligible": false
        }
      ],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "cycle_failed",
        "cycleId": "cycle.goodwill"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "CYCLE_NOT_ELIGIBLE",
      "ledgerAppends": [],
      "ledgerNet": "3",
      "spendableBalance": "3",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [
          {
            "cycleId": "cycle.goodwill",
            "ownerId": "owner.alice",
            "fundingKind": "goodwill",
            "state": "active",
            "debit": "1",
            "compensationEligible": false
          }
        ],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "effect",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-017",
    "category": "tax",
    "description": "Expired versioned registration fails closed.",
    "initial": {
      "ledgerBefore": [],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "150",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "create_purchase",
        "purchaseId": "purchase.p2",
        "ownerId": "owner.alice",
        "quantity": "1",
        "unitAmountCents": "500",
        "currency": "USD",
        "jurisdiction": "US-CA",
        "registrationVersion": "1",
        "taxAmountCents": "0",
        "registrationAuthorizationVersion": "1"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "REGISTRATION_EXPIRED",
      "ledgerAppends": [],
      "ledgerNet": "0",
      "spendableBalance": "0",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "amount",
        "canonical_purchase",
        "currency",
        "jurisdiction",
        "owner",
        "provider_calls",
        "quantity",
        "registration",
        "rollback",
        "tax"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-018",
    "category": "adjustment",
    "description": "Authorized audited operator adjustment is append-only and idempotent.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": [
        {
          "authorizationId": "auth.senior",
          "operatorId": "operator.senior",
          "version": "1",
          "validFrom": "100",
          "expiresAt": "300",
          "scopes": [
            "support_credit",
            "fraud_correction",
            "billing_correction"
          ],
          "source": "operator_authorization_registry",
          "sourceVersion": "7"
        }
      ]
    },
    "events": [
      {
        "type": "operator_adjustment",
        "adjustmentId": "adjustment.a18",
        "ownerId": "owner.alice",
        "delta": "2",
        "authorizedBy": "operator.senior",
        "reasonCode": "support_credit",
        "auditRecordId": "audit.a18",
        "idempotencyKey": "idem.a18",
        "authorizationId": "auth.senior",
        "authorizationVersion": "1",
        "authorizationSourceVersion": "7",
        "requestedAt": "200",
        "payloadHash": "36fe6ae9337b450487be83d337847d8ec200b0d698febb78b686aeab9e023368"
      }
    ],
    "expected": {
      "outcome": "accepted",
      "error": null,
      "ledgerAppends": [
        {
          "key": "ledger.adjust.a18",
          "delta": "2",
          "reason": "operator_adjustment",
          "ref": {
            "kind": "adjustment",
            "id": "adjustment.a18"
          }
        }
      ],
      "ledgerNet": "5",
      "spendableBalance": "5",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [
          {
            "adjustmentId": "adjustment.a18",
            "ownerId": "owner.alice",
            "delta": "2",
            "authorizedBy": "operator.senior",
            "reasonCode": "support_credit",
            "auditRecordId": "audit.a18",
            "idempotencyKey": "idem.a18",
            "authorizationId": "auth.senior",
            "authorizationVersion": "1",
            "authorizationSourceVersion": "7",
            "requestedAt": "200",
            "payloadHash": "36fe6ae9337b450487be83d337847d8ec200b0d698febb78b686aeab9e023368",
            "auditOutcome": "accepted"
          }
        ],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "audit",
        "authorization",
        "effect",
        "payload_hash",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "accepted"
    }
  },
  {
    "caseId": "BL-019",
    "category": "adjustment",
    "description": "Authorized audited operator adjustment is append-only and idempotent.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": [
        {
          "authorizationId": "auth.senior",
          "operatorId": "operator.senior",
          "version": "1",
          "validFrom": "100",
          "expiresAt": "300",
          "scopes": [
            "support_credit",
            "fraud_correction",
            "billing_correction"
          ],
          "source": "operator_authorization_registry",
          "sourceVersion": "7"
        }
      ]
    },
    "events": [
      {
        "type": "operator_adjustment",
        "adjustmentId": "adjustment.a19",
        "ownerId": "owner.alice",
        "delta": "-1",
        "authorizedBy": "operator.senior",
        "reasonCode": "billing_correction",
        "auditRecordId": "audit.a19",
        "idempotencyKey": "idem.a19",
        "authorizationId": "auth.senior",
        "authorizationVersion": "1",
        "authorizationSourceVersion": "7",
        "requestedAt": "200",
        "payloadHash": "c922e93e46e1b1c9f190b7a6d70a903e8a6ff7a68a705536e06b4de9a7ff39ec"
      }
    ],
    "expected": {
      "outcome": "accepted",
      "error": null,
      "ledgerAppends": [
        {
          "key": "ledger.adjust.a19",
          "delta": "-1",
          "reason": "operator_adjustment",
          "ref": {
            "kind": "adjustment",
            "id": "adjustment.a19"
          }
        }
      ],
      "ledgerNet": "2",
      "spendableBalance": "2",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [
          {
            "adjustmentId": "adjustment.a19",
            "ownerId": "owner.alice",
            "delta": "-1",
            "authorizedBy": "operator.senior",
            "reasonCode": "billing_correction",
            "auditRecordId": "audit.a19",
            "idempotencyKey": "idem.a19",
            "authorizationId": "auth.senior",
            "authorizationVersion": "1",
            "authorizationSourceVersion": "7",
            "requestedAt": "200",
            "payloadHash": "c922e93e46e1b1c9f190b7a6d70a903e8a6ff7a68a705536e06b4de9a7ff39ec",
            "auditOutcome": "accepted"
          }
        ],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "audit",
        "authorization",
        "effect",
        "payload_hash",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "accepted"
    }
  },
  {
    "caseId": "BL-020",
    "category": "adjustment",
    "description": "Adjustment replay by idempotency key is a no-op.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        },
        {
          "key": "ledger.adjust.a18",
          "delta": "2",
          "reason": "operator_adjustment",
          "ref": {
            "kind": "adjustment",
            "id": "adjustment.a18"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [
        {
          "adjustmentId": "adjustment.a18",
          "ownerId": "owner.alice",
          "delta": "2",
          "authorizedBy": "operator.senior",
          "reasonCode": "support_credit",
          "auditRecordId": "audit.a18",
          "idempotencyKey": "idem.a18",
          "authorizationId": "auth.senior",
          "authorizationVersion": "1",
          "authorizationSourceVersion": "7",
          "requestedAt": "200",
          "payloadHash": "36fe6ae9337b450487be83d337847d8ec200b0d698febb78b686aeab9e023368",
          "auditOutcome": "accepted"
        }
      ],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": [
        {
          "authorizationId": "auth.senior",
          "operatorId": "operator.senior",
          "version": "1",
          "validFrom": "100",
          "expiresAt": "300",
          "scopes": [
            "support_credit",
            "fraud_correction",
            "billing_correction"
          ],
          "source": "operator_authorization_registry",
          "sourceVersion": "7"
        }
      ]
    },
    "events": [
      {
        "type": "operator_adjustment",
        "adjustmentId": "adjustment.a18",
        "ownerId": "owner.alice",
        "delta": "2",
        "authorizedBy": "operator.senior",
        "reasonCode": "support_credit",
        "auditRecordId": "audit.a18",
        "idempotencyKey": "idem.a18",
        "authorizationId": "auth.senior",
        "authorizationVersion": "1",
        "authorizationSourceVersion": "7",
        "requestedAt": "200",
        "payloadHash": "36fe6ae9337b450487be83d337847d8ec200b0d698febb78b686aeab9e023368"
      }
    ],
    "expected": {
      "outcome": "noop",
      "error": null,
      "ledgerAppends": [],
      "ledgerNet": "5",
      "spendableBalance": "5",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [
          {
            "adjustmentId": "adjustment.a18",
            "ownerId": "owner.alice",
            "delta": "2",
            "authorizedBy": "operator.senior",
            "reasonCode": "support_credit",
            "auditRecordId": "audit.a18",
            "idempotencyKey": "idem.a18",
            "authorizationId": "auth.senior",
            "authorizationVersion": "1",
            "authorizationSourceVersion": "7",
            "requestedAt": "200",
            "payloadHash": "36fe6ae9337b450487be83d337847d8ec200b0d698febb78b686aeab9e023368",
            "auditOutcome": "accepted"
          }
        ],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "audit",
        "authorization",
        "effect",
        "payload_hash",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "replay_same_hash_noop"
    }
  },
  {
    "caseId": "BL-021",
    "category": "adjustment",
    "description": "Unauthorized adjustment is rejected without audit or ledger mutation.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "operator_adjustment",
        "adjustmentId": "adjustment.bad",
        "ownerId": "owner.alice",
        "delta": "2",
        "authorizedBy": "operator.untrusted",
        "reasonCode": "support_credit",
        "auditRecordId": "audit.bad",
        "idempotencyKey": "idem.bad",
        "authorizationId": "auth.senior",
        "authorizationVersion": "1",
        "authorizationSourceVersion": "7",
        "requestedAt": "200",
        "payloadHash": "ff7930e1c0faee7b5d840de89b6cb7f6c415069de2e7dd7a90eb4b36e6b9d90c"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "ADJUSTMENT_UNAUTHORIZED",
      "ledgerAppends": [],
      "ledgerNet": "3",
      "spendableBalance": "3",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "audit",
        "authorization",
        "effect",
        "payload_hash",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "unauthorized_rejected"
    }
  },
  {
    "caseId": "BL-022",
    "category": "ordering",
    "description": "Competing final-credit requests have exactly one correlated winner.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.one",
          "delta": "1",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": []
    },
    "events": [
      {
        "type": "conversion_accept",
        "cycleId": "cycle.race",
        "ownerId": "owner.alice",
        "fundingKind": "customer",
        "debit": "1",
        "idempotencyKey": "request.a"
      },
      {
        "type": "conversion_accept",
        "cycleId": "cycle.race",
        "ownerId": "owner.alice",
        "fundingKind": "customer",
        "debit": "1",
        "idempotencyKey": "request.b"
      }
    ],
    "expected": {
      "outcome": "correlated",
      "error": null,
      "ledgerAppends": [
        {
          "key": "ledger.race",
          "delta": "-1",
          "reason": "conversion_debit",
          "ref": {
            "kind": "cycle",
            "id": "cycle.race"
          }
        }
      ],
      "ledgerNet": "0",
      "spendableBalance": "0",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [
          {
            "cycleId": "cycle.race",
            "ownerId": "owner.alice",
            "fundingKind": "customer",
            "state": "active",
            "debit": "1",
            "compensationEligible": true
          }
        ],
        "adjustments": [],
        "refundStates": []
      },
      "winner": {
        "constraint": "exactly_one_correlated_winner",
        "alternatives": [
          {
            "label": "request.a",
            "outcome": "accepted",
            "cycleId": "cycle.race",
            "submissionId": "request.a",
            "jobId": "job.race",
            "effectKey": "ledger.race"
          },
          {
            "label": "request.b",
            "outcome": "rejected",
            "cycleId": null,
            "submissionId": "request.b",
            "jobId": null,
            "effectKey": null
          }
        ],
        "matchingWinner": "request.a",
        "jobId": "job.race",
        "effectKey": "ledger.race"
      },
      "assertions": [
        "amount",
        "effect",
        "owner",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "none"
    }
  },
  {
    "caseId": "BL-023",
    "category": "adjustment",
    "description": "Expired operator authorization is rejected with an exact audit outcome.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": [
        {
          "authorizationId": "auth.expired",
          "operatorId": "operator.senior",
          "version": "1",
          "validFrom": "100",
          "expiresAt": "300",
          "scopes": [
            "support_credit"
          ],
          "source": "operator_authorization_registry",
          "sourceVersion": "7"
        }
      ]
    },
    "events": [
      {
        "type": "operator_adjustment",
        "adjustmentId": "adjustment.bad",
        "ownerId": "owner.alice",
        "delta": "2",
        "authorizedBy": "operator.senior",
        "reasonCode": "support_credit",
        "auditRecordId": "audit.bad",
        "idempotencyKey": "idem.bad",
        "authorizationId": "auth.expired",
        "authorizationVersion": "1",
        "authorizationSourceVersion": "7",
        "requestedAt": "400",
        "payloadHash": "ff7930e1c0faee7b5d840de89b6cb7f6c415069de2e7dd7a90eb4b36e6b9d90c"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "ADJUSTMENT_UNAUTHORIZED",
      "ledgerAppends": [],
      "ledgerNet": "3",
      "spendableBalance": "3",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "audit",
        "authorization",
        "effect",
        "payload_hash",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "expired_rejected"
    }
  },
  {
    "caseId": "BL-024",
    "category": "adjustment",
    "description": "Malformed zero-delta adjustment is rejected with an exact audit outcome.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": [
        {
          "authorizationId": "auth.senior",
          "operatorId": "operator.senior",
          "version": "1",
          "validFrom": "100",
          "expiresAt": "300",
          "scopes": [
            "support_credit"
          ],
          "source": "operator_authorization_registry",
          "sourceVersion": "7"
        }
      ]
    },
    "events": [
      {
        "type": "operator_adjustment",
        "adjustmentId": "adjustment.bad",
        "ownerId": "owner.alice",
        "delta": "0",
        "authorizedBy": "operator.senior",
        "reasonCode": "support_credit",
        "auditRecordId": "audit.bad",
        "idempotencyKey": "idem.bad",
        "authorizationId": "auth.senior",
        "authorizationVersion": "1",
        "authorizationSourceVersion": "7",
        "requestedAt": "200",
        "payloadHash": "ff7930e1c0faee7b5d840de89b6cb7f6c415069de2e7dd7a90eb4b36e6b9d90c"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "ADJUSTMENT_INVALID",
      "ledgerAppends": [],
      "ledgerNet": "3",
      "spendableBalance": "3",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "audit",
        "authorization",
        "effect",
        "payload_hash",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "malformed_rejected"
    }
  },
  {
    "caseId": "BL-025",
    "category": "adjustment",
    "description": "Adjustment replay with same key and different payload hash is rejected and audited.",
    "initial": {
      "ledgerBefore": [
        {
          "key": "ledger.grant1",
          "delta": "3",
          "reason": "payment_grant",
          "ref": {
            "kind": "purchase",
            "id": "purchase.p1"
          }
        },
        {
          "key": "ledger.adjust.a18",
          "delta": "2",
          "reason": "operator_adjustment",
          "ref": {
            "kind": "adjustment",
            "id": "adjustment.a18"
          }
        }
      ],
      "purchases": [],
      "receipts": [],
      "claims": [],
      "registrations": [
        {
          "jurisdiction": "US-CA",
          "version": "1",
          "expiresAt": "999",
          "taxEvidenceId": "tax.ev1",
          "authenticatedBy": "tax.admin",
          "validFrom": "100",
          "evaluatedAt": "200",
          "databaseNow": "200",
          "authorizationSourceVersion": "1"
        }
      ],
      "cycles": [],
      "adjustments": [
        {
          "adjustmentId": "adjustment.a18",
          "ownerId": "owner.alice",
          "delta": "2",
          "authorizedBy": "operator.senior",
          "reasonCode": "support_credit",
          "auditRecordId": "audit.a18",
          "idempotencyKey": "idem.a18",
          "authorizationId": "auth.senior",
          "authorizationVersion": "1",
          "authorizationSourceVersion": "7",
          "requestedAt": "200",
          "payloadHash": "36fe6ae9337b450487be83d337847d8ec200b0d698febb78b686aeab9e023368",
          "auditOutcome": "accepted"
        }
      ],
      "evaluationAt": "200",
      "databaseNow": "200",
      "refundStates": [],
      "operatorAuthorizations": [
        {
          "authorizationId": "auth.senior",
          "operatorId": "operator.senior",
          "version": "1",
          "validFrom": "100",
          "expiresAt": "300",
          "scopes": [
            "support_credit",
            "fraud_correction",
            "billing_correction"
          ],
          "source": "operator_authorization_registry",
          "sourceVersion": "7"
        }
      ]
    },
    "events": [
      {
        "type": "operator_adjustment",
        "adjustmentId": "adjustment.a18",
        "ownerId": "owner.alice",
        "delta": "2",
        "authorizedBy": "operator.senior",
        "reasonCode": "support_credit",
        "auditRecordId": "audit.a18",
        "idempotencyKey": "idem.a18",
        "authorizationId": "auth.senior",
        "authorizationVersion": "1",
        "authorizationSourceVersion": "7",
        "requestedAt": "200",
        "payloadHash": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
      }
    ],
    "expected": {
      "outcome": "rejected",
      "error": "EVENT_PAYLOAD_CONFLICT",
      "ledgerAppends": [],
      "ledgerNet": "5",
      "spendableBalance": "5",
      "deficit": "0",
      "state": {
        "purchases": [],
        "receipts": [],
        "claims": [],
        "cycles": [],
        "adjustments": [
          {
            "adjustmentId": "adjustment.a18",
            "ownerId": "owner.alice",
            "delta": "2",
            "authorizedBy": "operator.senior",
            "reasonCode": "support_credit",
            "auditRecordId": "audit.a18",
            "idempotencyKey": "idem.a18",
            "authorizationId": "auth.senior",
            "authorizationVersion": "1",
            "authorizationSourceVersion": "7",
            "requestedAt": "200",
            "payloadHash": "36fe6ae9337b450487be83d337847d8ec200b0d698febb78b686aeab9e023368",
            "auditOutcome": "accepted"
          }
        ],
        "refundStates": []
      },
      "winner": null,
      "assertions": [
        "audit",
        "authorization",
        "effect",
        "payload_hash",
        "provider_calls",
        "rollback"
      ],
      "providerCalls": "0",
      "auditOutcome": "replay_different_hash_rejected"
    }
  }
]
