{
  "schema_version": "d30-reservation-pg-evidence-v1",
  "existing_services_used": false,
  "cases": [
    {
      "id": "PG00-isolated-settings-real-login",
      "passed": true,
      "result": {
        "session_user": "d30_hold_writer",
        "current_user": "d30_hold_writer"
      }
    },
    {
      "id": "PG01-reserve-independent-capacity",
      "passed": true,
      "result": {
        "hold": {
          "status": "active",
          "hold_id": "H-CANONICAL",
          "version": "1",
          "currency": "USD",
          "entity_id": "CB-A",
          "ledger_id": "CB-GENERAL",
          "account_id": "deposits_ada_usd",
          "created_at": "2026-10-24T22:44:13.853Z",
          "expires_at": "2026-10-24T23:44:13.665Z",
          "updated_at": "2026-10-24T22:44:13.853Z",
          "captured_minor": "0",
          "original_minor": "30000",
          "released_minor": "0",
          "remaining_minor": "30000"
        },
        "journal": null,
        "recorded_at": "2026-10-24T22:44:13.853Z",
        "availability": {
          "reserved_minor": "30000",
          "available_minor": "67600",
          "shortfall_minor": "0",
          "spendable_minor": "67600",
          "posted_balance_minor": "97600"
        },
        "hold_event_sequence": "1"
      }
    },
    {
      "id": "PG02-partial-capture-no-double-subtraction",
      "passed": true,
      "result": {
        "hold": {
          "status": "active",
          "hold_id": "H-CANONICAL",
          "version": "2",
          "currency": "USD",
          "entity_id": "CB-A",
          "ledger_id": "CB-GENERAL",
          "account_id": "deposits_ada_usd",
          "created_at": "2026-10-24T22:44:13.853Z",
          "expires_at": "2026-10-24T23:44:13.665Z",
          "updated_at": "2026-10-24T22:44:14.081Z",
          "captured_minor": "12000",
          "original_minor": "30000",
          "released_minor": "0",
          "remaining_minor": "18000"
        },
        "journal": {
          "status": "committed",
          "command": {
            "legs": [
              {
                "side": "debit",
                "account_id": "deposits_ada_usd",
                "amount_minor": "12000"
              },
              {
                "side": "credit",
                "account_id": "card_settlement_payable_usd",
                "amount_minor": "12000"
              }
            ],
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "journal_id": "J-C-CANONICAL-PARTIAL",
            "effective_at": "2026-10-22T10:00:00.000Z",
            "booking_period": "2026-10",
            "schema_version": "d30-journal-v1",
            "source_available_at": "2026-10-22T10:00:00.000Z",
            "business_operation_id": "JOP-C-CANONICAL-PARTIAL"
          },
          "sequence": "2",
          "movements": [
            {
              "account_id": "deposits_ada_usd",
              "raw_delta_minor": "12000",
              "normal_delta_minor": "-12000"
            },
            {
              "account_id": "card_settlement_payable_usd",
              "raw_delta_minor": "-12000",
              "normal_delta_minor": "12000"
            }
          ],
          "adjustment": {
            "reason": "",
            "authorized": false
          },
          "journal_id": "J-C-CANONICAL-PARTIAL",
          "debit_minor": "12000",
          "recorded_at": "2026-10-24T22:44:14.096Z",
          "credit_minor": "12000",
          "residual_minor": "0",
          "business_operation_id": "JOP-C-CANONICAL-PARTIAL"
        },
        "recorded_at": "2026-10-24T22:44:14.081Z",
        "availability": {
          "reserved_minor": "18000",
          "available_minor": "67600",
          "shortfall_minor": "0",
          "spendable_minor": "67600",
          "posted_balance_minor": "85600"
        },
        "hold_event_sequence": "2"
      }
    },
    {
      "id": "PG03-original-capture-replay",
      "passed": true,
      "result": {
        "hold": {
          "status": "active",
          "hold_id": "H-CANONICAL",
          "version": "2",
          "currency": "USD",
          "entity_id": "CB-A",
          "ledger_id": "CB-GENERAL",
          "account_id": "deposits_ada_usd",
          "created_at": "2026-10-24T22:44:13.853Z",
          "expires_at": "2026-10-24T23:44:13.665Z",
          "updated_at": "2026-10-24T22:44:14.081Z",
          "captured_minor": "12000",
          "original_minor": "30000",
          "released_minor": "0",
          "remaining_minor": "18000"
        },
        "journal": {
          "status": "committed",
          "command": {
            "legs": [
              {
                "side": "debit",
                "account_id": "deposits_ada_usd",
                "amount_minor": "12000"
              },
              {
                "side": "credit",
                "account_id": "card_settlement_payable_usd",
                "amount_minor": "12000"
              }
            ],
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "journal_id": "J-C-CANONICAL-PARTIAL",
            "effective_at": "2026-10-22T10:00:00.000Z",
            "booking_period": "2026-10",
            "schema_version": "d30-journal-v1",
            "source_available_at": "2026-10-22T10:00:00.000Z",
            "business_operation_id": "JOP-C-CANONICAL-PARTIAL"
          },
          "sequence": "2",
          "movements": [
            {
              "account_id": "deposits_ada_usd",
              "raw_delta_minor": "12000",
              "normal_delta_minor": "-12000"
            },
            {
              "account_id": "card_settlement_payable_usd",
              "raw_delta_minor": "-12000",
              "normal_delta_minor": "12000"
            }
          ],
          "adjustment": {
            "reason": "",
            "authorized": false
          },
          "journal_id": "J-C-CANONICAL-PARTIAL",
          "debit_minor": "12000",
          "recorded_at": "2026-10-24T22:44:14.096Z",
          "credit_minor": "12000",
          "residual_minor": "0",
          "business_operation_id": "JOP-C-CANONICAL-PARTIAL"
        },
        "recorded_at": "2026-10-24T22:44:14.081Z",
        "availability": {
          "reserved_minor": "18000",
          "available_minor": "67600",
          "shortfall_minor": "0",
          "spendable_minor": "67600",
          "posted_balance_minor": "85600"
        },
        "hold_event_sequence": "2"
      }
    },
    {
      "id": "PG04-final-partial-capture-release",
      "passed": true,
      "result": {
        "hold": {
          "status": "captured",
          "hold_id": "H-CANONICAL",
          "version": "3",
          "currency": "USD",
          "entity_id": "CB-A",
          "ledger_id": "CB-GENERAL",
          "account_id": "deposits_ada_usd",
          "created_at": "2026-10-24T22:44:13.853Z",
          "expires_at": "2026-10-24T23:44:13.665Z",
          "updated_at": "2026-10-24T22:44:15.069Z",
          "captured_minor": "22000",
          "original_minor": "30000",
          "released_minor": "8000",
          "remaining_minor": "0"
        },
        "journal": {
          "status": "committed",
          "command": {
            "legs": [
              {
                "side": "debit",
                "account_id": "deposits_ada_usd",
                "amount_minor": "10000"
              },
              {
                "side": "credit",
                "account_id": "card_settlement_payable_usd",
                "amount_minor": "10000"
              }
            ],
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "journal_id": "J-C-CANONICAL-FINAL",
            "effective_at": "2026-10-22T10:00:00.000Z",
            "booking_period": "2026-10",
            "schema_version": "d30-journal-v1",
            "source_available_at": "2026-10-22T10:00:00.000Z",
            "business_operation_id": "JOP-C-CANONICAL-FINAL"
          },
          "sequence": "3",
          "movements": [
            {
              "account_id": "deposits_ada_usd",
              "raw_delta_minor": "10000",
              "normal_delta_minor": "-10000"
            },
            {
              "account_id": "card_settlement_payable_usd",
              "raw_delta_minor": "-10000",
              "normal_delta_minor": "10000"
            }
          ],
          "adjustment": {
            "reason": "",
            "authorized": false
          },
          "journal_id": "J-C-CANONICAL-FINAL",
          "debit_minor": "10000",
          "recorded_at": "2026-10-24T22:44:15.082Z",
          "credit_minor": "10000",
          "residual_minor": "0",
          "business_operation_id": "JOP-C-CANONICAL-FINAL"
        },
        "recorded_at": "2026-10-24T22:44:15.069Z",
        "availability": {
          "reserved_minor": "0",
          "available_minor": "75600",
          "shortfall_minor": "0",
          "spendable_minor": "75600",
          "posted_balance_minor": "75600"
        },
        "hold_event_sequence": "3"
      }
    },
    {
      "id": "PG04b-authoritative-head-and-observed-complete-journal-export",
      "passed": true,
      "result": {
        "authoritative_last_sequence": "3",
        "trusted_observer_receipt_at": "2026-10-24T22:44:15.610Z",
        "journal_rows": 3,
        "expected_ada_normal_minor": "75600"
      }
    },
    {
      "id": "PG05-staged-hold-change-and-journal-rollback",
      "passed": true,
      "result": {
        "reason": "PERIOD_CLOSED",
        "sqlstate": "P0001"
      }
    },
    {
      "id": "PG06-failed-operation-leaves-no-durable-identity",
      "passed": true,
      "result": {
        "hold": {
          "status": "active",
          "hold_id": "H-ROLLBACK",
          "version": "2",
          "currency": "USD",
          "entity_id": "CB-A",
          "ledger_id": "CB-GENERAL",
          "account_id": "deposits_rollback_usd",
          "created_at": "2026-10-24T22:44:16.548Z",
          "expires_at": "2026-10-24T23:44:16.343Z",
          "updated_at": "2026-10-24T22:44:17.386Z",
          "captured_minor": "12000",
          "original_minor": "30000",
          "released_minor": "0",
          "remaining_minor": "18000"
        },
        "journal": {
          "status": "committed",
          "command": {
            "legs": [
              {
                "side": "debit",
                "account_id": "deposits_rollback_usd",
                "amount_minor": "12000"
              },
              {
                "side": "credit",
                "account_id": "card_settlement_payable_usd",
                "amount_minor": "12000"
              }
            ],
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "journal_id": "J-C-ROLLBACK",
            "effective_at": "2026-10-22T10:00:00.000Z",
            "booking_period": "2026-10",
            "schema_version": "d30-journal-v1",
            "source_available_at": "2026-10-22T10:00:00.000Z",
            "business_operation_id": "JOP-C-ROLLBACK"
          },
          "sequence": "5",
          "movements": [
            {
              "account_id": "deposits_rollback_usd",
              "raw_delta_minor": "12000",
              "normal_delta_minor": "-12000"
            },
            {
              "account_id": "card_settlement_payable_usd",
              "raw_delta_minor": "-12000",
              "normal_delta_minor": "12000"
            }
          ],
          "adjustment": {
            "reason": "",
            "authorized": false
          },
          "journal_id": "J-C-ROLLBACK",
          "debit_minor": "12000",
          "recorded_at": "2026-10-24T22:44:17.399Z",
          "credit_minor": "12000",
          "residual_minor": "0",
          "business_operation_id": "JOP-C-ROLLBACK"
        },
        "recorded_at": "2026-10-24T22:44:17.386Z",
        "availability": {
          "reserved_minor": "18000",
          "available_minor": "70000",
          "shortfall_minor": "0",
          "spendable_minor": "70000",
          "posted_balance_minor": "88000"
        },
        "hold_event_sequence": "5"
      }
    },
    {
      "id": "PG07-concurrent-duplicate-reserve",
      "passed": true,
      "result": {
        "sessions": 2,
        "barrier": "READY then pg_blocking_pids observed before release",
        "release": "COMMIT",
        "blocked": true,
        "first": {
          "hold": {
            "status": "active",
            "hold_id": "H-DUPLICATE",
            "version": "1",
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "account_id": "deposits_duplicate_usd",
            "created_at": "2026-10-24T22:44:18.428Z",
            "expires_at": "2026-10-24T23:44:18.011Z",
            "updated_at": "2026-10-24T22:44:18.428Z",
            "captured_minor": "0",
            "original_minor": "30000",
            "released_minor": "0",
            "remaining_minor": "30000"
          },
          "journal": null,
          "recorded_at": "2026-10-24T22:44:18.428Z",
          "availability": {
            "reserved_minor": "30000",
            "available_minor": "70000",
            "shortfall_minor": "0",
            "spendable_minor": "70000",
            "posted_balance_minor": "100000"
          },
          "hold_event_sequence": "6"
        },
        "second": {
          "hold": {
            "status": "active",
            "hold_id": "H-DUPLICATE",
            "version": "1",
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "account_id": "deposits_duplicate_usd",
            "created_at": "2026-10-24T22:44:18.428Z",
            "expires_at": "2026-10-24T23:44:18.011Z",
            "updated_at": "2026-10-24T22:44:18.428Z",
            "captured_minor": "0",
            "original_minor": "30000",
            "released_minor": "0",
            "remaining_minor": "30000"
          },
          "journal": null,
          "recorded_at": "2026-10-24T22:44:18.428Z",
          "availability": {
            "reserved_minor": "30000",
            "available_minor": "70000",
            "shortfall_minor": "0",
            "spendable_minor": "70000",
            "posted_balance_minor": "100000"
          },
          "hold_event_sequence": "6"
        }
      }
    },
    {
      "id": "PG08-competing-reservations-capacity",
      "passed": true,
      "result": {
        "sessions": 2,
        "barrier": "READY then pg_blocking_pids observed before release",
        "release": "COMMIT",
        "blocked": true,
        "first": {
          "hold": {
            "status": "active",
            "hold_id": "H-OVER-A",
            "version": "1",
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "account_id": "deposits_overreserve_usd",
            "created_at": "2026-10-24T22:44:19.939Z",
            "expires_at": "2026-10-24T23:44:19.576Z",
            "updated_at": "2026-10-24T22:44:19.939Z",
            "captured_minor": "0",
            "original_minor": "70000",
            "released_minor": "0",
            "remaining_minor": "70000"
          },
          "journal": null,
          "recorded_at": "2026-10-24T22:44:19.939Z",
          "availability": {
            "reserved_minor": "70000",
            "available_minor": "30000",
            "shortfall_minor": "0",
            "spendable_minor": "30000",
            "posted_balance_minor": "100000"
          },
          "hold_event_sequence": "7"
        },
        "second": {
          "reason": "INSUFFICIENT_AVAILABLE_FUNDS"
        }
      }
    },
    {
      "id": "PG09-uncommitted-reserve-rollback-releases-capacity",
      "passed": true,
      "result": {
        "sessions": 2,
        "barrier": "READY then pg_blocking_pids observed before release",
        "release": "ROLLBACK",
        "blocked": true,
        "first": {
          "hold": {
            "status": "active",
            "hold_id": "H-ROLLBACK-RACE",
            "version": "1",
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "account_id": "deposits_rollback_race_usd",
            "created_at": "2026-10-24T22:44:21.295Z",
            "expires_at": "2026-10-24T23:44:20.844Z",
            "updated_at": "2026-10-24T22:44:21.295Z",
            "captured_minor": "0",
            "original_minor": "40000",
            "released_minor": "0",
            "remaining_minor": "40000"
          },
          "journal": null,
          "recorded_at": "2026-10-24T22:44:21.295Z",
          "availability": {
            "reserved_minor": "40000",
            "available_minor": "60000",
            "shortfall_minor": "0",
            "spendable_minor": "60000",
            "posted_balance_minor": "100000"
          },
          "hold_event_sequence": "8"
        },
        "second": {
          "hold": {
            "status": "active",
            "hold_id": "H-ROLLBACK-RACE",
            "version": "1",
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "account_id": "deposits_rollback_race_usd",
            "created_at": "2026-10-24T22:44:21.530Z",
            "expires_at": "2026-10-24T23:44:20.844Z",
            "updated_at": "2026-10-24T22:44:21.530Z",
            "captured_minor": "0",
            "original_minor": "40000",
            "released_minor": "0",
            "remaining_minor": "40000"
          },
          "journal": null,
          "recorded_at": "2026-10-24T22:44:21.530Z",
          "availability": {
            "reserved_minor": "40000",
            "available_minor": "60000",
            "shortfall_minor": "0",
            "spendable_minor": "60000",
            "posted_balance_minor": "100000"
          },
          "hold_event_sequence": "8"
        }
      }
    },
    {
      "id": "PG10-concurrent-identical-capture-one-journal",
      "passed": true,
      "result": {
        "sessions": 2,
        "barrier": "READY then pg_blocking_pids observed before release",
        "release": "COMMIT",
        "blocked": true,
        "first": {
          "hold": {
            "status": "active",
            "hold_id": "H-CAPTURE-RACE",
            "version": "2",
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "account_id": "deposits_capture_race_usd",
            "created_at": "2026-10-24T22:44:22.614Z",
            "expires_at": "2026-10-24T23:44:22.397Z",
            "updated_at": "2026-10-24T22:44:23.018Z",
            "captured_minor": "12000",
            "original_minor": "30000",
            "released_minor": "0",
            "remaining_minor": "18000"
          },
          "journal": {
            "status": "committed",
            "command": {
              "legs": [
                {
                  "side": "debit",
                  "account_id": "deposits_capture_race_usd",
                  "amount_minor": "12000"
                },
                {
                  "side": "credit",
                  "account_id": "card_settlement_payable_usd",
                  "amount_minor": "12000"
                }
              ],
              "currency": "USD",
              "entity_id": "CB-A",
              "ledger_id": "CB-GENERAL",
              "journal_id": "J-C-RACE-IDENTICAL",
              "effective_at": "2026-10-22T10:00:00.000Z",
              "booking_period": "2026-10",
              "schema_version": "d30-journal-v1",
              "source_available_at": "2026-10-22T10:00:00.000Z",
              "business_operation_id": "JOP-C-RACE-IDENTICAL"
            },
            "sequence": "10",
            "movements": [
              {
                "account_id": "deposits_capture_race_usd",
                "raw_delta_minor": "12000",
                "normal_delta_minor": "-12000"
              },
              {
                "account_id": "card_settlement_payable_usd",
                "raw_delta_minor": "-12000",
                "normal_delta_minor": "12000"
              }
            ],
            "adjustment": {
              "reason": "",
              "authorized": false
            },
            "journal_id": "J-C-RACE-IDENTICAL",
            "debit_minor": "12000",
            "recorded_at": "2026-10-24T22:44:23.033Z",
            "credit_minor": "12000",
            "residual_minor": "0",
            "business_operation_id": "JOP-C-RACE-IDENTICAL"
          },
          "recorded_at": "2026-10-24T22:44:23.018Z",
          "availability": {
            "reserved_minor": "18000",
            "available_minor": "70000",
            "shortfall_minor": "0",
            "spendable_minor": "70000",
            "posted_balance_minor": "88000"
          },
          "hold_event_sequence": "10"
        },
        "second": {
          "hold": {
            "status": "active",
            "hold_id": "H-CAPTURE-RACE",
            "version": "2",
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "account_id": "deposits_capture_race_usd",
            "created_at": "2026-10-24T22:44:22.614Z",
            "expires_at": "2026-10-24T23:44:22.397Z",
            "updated_at": "2026-10-24T22:44:23.018Z",
            "captured_minor": "12000",
            "original_minor": "30000",
            "released_minor": "0",
            "remaining_minor": "18000"
          },
          "journal": {
            "status": "committed",
            "command": {
              "legs": [
                {
                  "side": "debit",
                  "account_id": "deposits_capture_race_usd",
                  "amount_minor": "12000"
                },
                {
                  "side": "credit",
                  "account_id": "card_settlement_payable_usd",
                  "amount_minor": "12000"
                }
              ],
              "currency": "USD",
              "entity_id": "CB-A",
              "ledger_id": "CB-GENERAL",
              "journal_id": "J-C-RACE-IDENTICAL",
              "effective_at": "2026-10-22T10:00:00.000Z",
              "booking_period": "2026-10",
              "schema_version": "d30-journal-v1",
              "source_available_at": "2026-10-22T10:00:00.000Z",
              "business_operation_id": "JOP-C-RACE-IDENTICAL"
            },
            "sequence": "10",
            "movements": [
              {
                "account_id": "deposits_capture_race_usd",
                "raw_delta_minor": "12000",
                "normal_delta_minor": "-12000"
              },
              {
                "account_id": "card_settlement_payable_usd",
                "raw_delta_minor": "-12000",
                "normal_delta_minor": "12000"
              }
            ],
            "adjustment": {
              "reason": "",
              "authorized": false
            },
            "journal_id": "J-C-RACE-IDENTICAL",
            "debit_minor": "12000",
            "recorded_at": "2026-10-24T22:44:23.033Z",
            "credit_minor": "12000",
            "residual_minor": "0",
            "business_operation_id": "JOP-C-RACE-IDENTICAL"
          },
          "recorded_at": "2026-10-24T22:44:23.018Z",
          "availability": {
            "reserved_minor": "18000",
            "available_minor": "70000",
            "shortfall_minor": "0",
            "spendable_minor": "70000",
            "posted_balance_minor": "88000"
          },
          "hold_event_sequence": "10"
        }
      }
    },
    {
      "id": "PG11-stale-and-over-capture-no-partial-effects",
      "passed": true,
      "result": [
        {
          "reason": "VERSION_CONFLICT",
          "sqlstate": "P0001"
        },
        {
          "reason": "OVER_CAPTURE",
          "sqlstate": "P0001"
        }
      ]
    },
    {
      "id": "PG12-capture-versus-release",
      "passed": true,
      "result": {
        "sessions": 2,
        "barrier": "READY then pg_blocking_pids observed before release",
        "release": "COMMIT",
        "blocked": true,
        "first": {
          "hold": {
            "status": "captured",
            "hold_id": "H-CAPTURE-RELEASE",
            "version": "2",
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "account_id": "deposits_capture_release_usd",
            "created_at": "2026-10-24T22:44:25.554Z",
            "expires_at": "2026-10-24T23:44:25.339Z",
            "updated_at": "2026-10-24T22:44:25.772Z",
            "captured_minor": "30000",
            "original_minor": "30000",
            "released_minor": "0",
            "remaining_minor": "0"
          },
          "journal": {
            "status": "committed",
            "command": {
              "legs": [
                {
                  "side": "debit",
                  "account_id": "deposits_capture_release_usd",
                  "amount_minor": "30000"
                },
                {
                  "side": "credit",
                  "account_id": "card_settlement_payable_usd",
                  "amount_minor": "30000"
                }
              ],
              "currency": "USD",
              "entity_id": "CB-A",
              "ledger_id": "CB-GENERAL",
              "journal_id": "J-C-CAPTURE-RELEASE",
              "effective_at": "2026-10-22T10:00:00.000Z",
              "booking_period": "2026-10",
              "schema_version": "d30-journal-v1",
              "source_available_at": "2026-10-22T10:00:00.000Z",
              "business_operation_id": "JOP-C-CAPTURE-RELEASE"
            },
            "sequence": "12",
            "movements": [
              {
                "account_id": "deposits_capture_release_usd",
                "raw_delta_minor": "30000",
                "normal_delta_minor": "-30000"
              },
              {
                "account_id": "card_settlement_payable_usd",
                "raw_delta_minor": "-30000",
                "normal_delta_minor": "30000"
              }
            ],
            "adjustment": {
              "reason": "",
              "authorized": false
            },
            "journal_id": "J-C-CAPTURE-RELEASE",
            "debit_minor": "30000",
            "recorded_at": "2026-10-24T22:44:25.786Z",
            "credit_minor": "30000",
            "residual_minor": "0",
            "business_operation_id": "JOP-C-CAPTURE-RELEASE"
          },
          "recorded_at": "2026-10-24T22:44:25.772Z",
          "availability": {
            "reserved_minor": "0",
            "available_minor": "70000",
            "shortfall_minor": "0",
            "spendable_minor": "70000",
            "posted_balance_minor": "70000"
          },
          "hold_event_sequence": "12"
        },
        "second": {
          "reason": "VERSION_CONFLICT"
        }
      }
    },
    {
      "id": "PG13-release-versus-capture",
      "passed": true,
      "result": {
        "sessions": 2,
        "barrier": "READY then pg_blocking_pids observed before release",
        "release": "COMMIT",
        "blocked": true,
        "first": {
          "hold": {
            "status": "released",
            "hold_id": "H-RELEASE-CAPTURE",
            "version": "2",
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "account_id": "deposits_release_capture_usd",
            "created_at": "2026-10-24T22:44:26.866Z",
            "expires_at": "2026-10-24T23:44:26.649Z",
            "updated_at": "2026-10-24T22:44:27.126Z",
            "captured_minor": "0",
            "original_minor": "30000",
            "released_minor": "30000",
            "remaining_minor": "0"
          },
          "journal": null,
          "recorded_at": "2026-10-24T22:44:27.126Z",
          "availability": {
            "reserved_minor": "0",
            "available_minor": "100000",
            "shortfall_minor": "0",
            "spendable_minor": "100000",
            "posted_balance_minor": "100000"
          },
          "hold_event_sequence": "14"
        },
        "second": {
          "reason": "VERSION_CONFLICT"
        }
      }
    },
    {
      "id": "PG14-capture-clock-checked-after-waiting-lock",
      "passed": true,
      "result": {
        "race": {
          "sessions": 2,
          "barrier": "READY then pg_blocking_pids observed before release",
          "release": "COMMIT",
          "blocked": true,
          "first": {
            "hold": {
              "status": "active",
              "hold_id": "H-EXPIRY-BLOCK",
              "version": "1",
              "currency": "USD",
              "entity_id": "CB-A",
              "ledger_id": "CB-GENERAL",
              "account_id": "deposits_expiry_block_usd",
              "created_at": "2026-10-24T22:44:29.428Z",
              "expires_at": "2026-10-24T23:44:28.891Z",
              "updated_at": "2026-10-24T22:44:29.428Z",
              "captured_minor": "0",
              "original_minor": "1",
              "released_minor": "0",
              "remaining_minor": "1"
            },
            "journal": null,
            "recorded_at": "2026-10-24T22:44:29.428Z",
            "availability": {
              "reserved_minor": "1",
              "available_minor": "99999",
              "shortfall_minor": "0",
              "spendable_minor": "99999",
              "posted_balance_minor": "100000"
            },
            "hold_event_sequence": "16"
          },
          "second": {
            "reason": "HOLD_EXPIRED"
          }
        },
        "delayed_stored_active_snapshot": {
          "as_of": "2026-10-24T22:44:31.613Z",
          "holds": [
            {
              "status": "active",
              "hold_id": "H-EXPIRE",
              "version": "1",
              "currency": "USD",
              "entity_id": "CB-A",
              "ledger_id": "CB-GENERAL",
              "account_id": "deposits_expiry_usd",
              "created_at": "2026-10-24T22:44:28.232Z",
              "expires_at": "2026-10-24T22:44:31.008Z",
              "updated_at": "2026-10-24T22:44:28.232Z",
              "captured_minor": "0",
              "original_minor": "10000",
              "released_minor": "0",
              "remaining_minor": "10000"
            }
          ],
          "currency": "USD",
          "entity_id": "CB-A",
          "ledger_id": "CB-GENERAL",
          "account_id": "deposits_expiry_usd",
          "normal_side": "credit",
          "snapshot_at": "2026-10-24T22:44:31.613Z",
          "account_type": "liability",
          "policy_version": "cedar-no-overdraft-v1",
          "schema_version": "d30-availability-v1",
          "pending_incoming": [],
          "posted_balance_minor": "100000"
        },
        "expired": {
          "hold": {
            "status": "expired",
            "hold_id": "H-EXPIRE",
            "version": "2",
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "account_id": "deposits_expiry_usd",
            "created_at": "2026-10-24T22:44:28.232Z",
            "expires_at": "2026-10-24T22:44:31.008Z",
            "updated_at": "2026-10-24T22:44:31.946Z",
            "captured_minor": "0",
            "original_minor": "10000",
            "released_minor": "10000",
            "remaining_minor": "0"
          },
          "journal": null,
          "recorded_at": "2026-10-24T22:44:31.946Z",
          "availability": {
            "reserved_minor": "0",
            "available_minor": "100000",
            "shortfall_minor": "0",
            "spendable_minor": "100000",
            "posted_balance_minor": "100000"
          },
          "hold_event_sequence": "17"
        }
      }
    },
    {
      "id": "PG15-before-expiry-capture-commits-once",
      "passed": true,
      "result": {
        "sessions": 2,
        "barrier": "READY then pg_blocking_pids observed before release",
        "release": "COMMIT",
        "blocked": true,
        "first": {
          "hold": {
            "status": "captured",
            "hold_id": "H-CAPTURE-EXPIRE",
            "version": "2",
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "account_id": "deposits_capture_expire_usd",
            "created_at": "2026-10-24T22:44:32.846Z",
            "expires_at": "2026-10-24T22:44:37.618Z",
            "updated_at": "2026-10-24T22:44:33.079Z",
            "captured_minor": "10000",
            "original_minor": "10000",
            "released_minor": "0",
            "remaining_minor": "0"
          },
          "journal": {
            "status": "committed",
            "command": {
              "legs": [
                {
                  "side": "debit",
                  "account_id": "deposits_capture_expire_usd",
                  "amount_minor": "10000"
                },
                {
                  "side": "credit",
                  "account_id": "card_settlement_payable_usd",
                  "amount_minor": "10000"
                }
              ],
              "currency": "USD",
              "entity_id": "CB-A",
              "ledger_id": "CB-GENERAL",
              "journal_id": "J-C-BEFORE-EXPIRY",
              "effective_at": "2026-10-22T10:00:00.000Z",
              "booking_period": "2026-10",
              "schema_version": "d30-journal-v1",
              "source_available_at": "2026-10-22T10:00:00.000Z",
              "business_operation_id": "JOP-C-BEFORE-EXPIRY"
            },
            "sequence": "17",
            "movements": [
              {
                "account_id": "deposits_capture_expire_usd",
                "raw_delta_minor": "10000",
                "normal_delta_minor": "-10000"
              },
              {
                "account_id": "card_settlement_payable_usd",
                "raw_delta_minor": "-10000",
                "normal_delta_minor": "10000"
              }
            ],
            "adjustment": {
              "reason": "",
              "authorized": false
            },
            "journal_id": "J-C-BEFORE-EXPIRY",
            "debit_minor": "10000",
            "recorded_at": "2026-10-24T22:44:33.092Z",
            "credit_minor": "10000",
            "residual_minor": "0",
            "business_operation_id": "JOP-C-BEFORE-EXPIRY"
          },
          "recorded_at": "2026-10-24T22:44:33.079Z",
          "availability": {
            "reserved_minor": "0",
            "available_minor": "90000",
            "shortfall_minor": "0",
            "spendable_minor": "90000",
            "posted_balance_minor": "90000"
          },
          "hold_event_sequence": "19"
        },
        "second": {
          "reason": "VERSION_CONFLICT"
        }
      }
    },
    {
      "id": "PG16-replay-before-current-account-period-policy",
      "passed": true,
      "result": {
        "hold": {
          "status": "active",
          "hold_id": "H-CLOSED-REPLAY",
          "version": "1",
          "currency": "USD",
          "entity_id": "CB-A",
          "ledger_id": "CB-GENERAL",
          "account_id": "deposits_closed_replay_usd",
          "created_at": "2026-10-24T22:44:38.805Z",
          "expires_at": "2026-10-24T23:44:38.593Z",
          "updated_at": "2026-10-24T22:44:38.805Z",
          "captured_minor": "0",
          "original_minor": "1",
          "released_minor": "0",
          "remaining_minor": "1"
        },
        "journal": null,
        "recorded_at": "2026-10-24T22:44:38.805Z",
        "availability": {
          "reserved_minor": "1",
          "available_minor": "99999",
          "shortfall_minor": "0",
          "spendable_minor": "99999",
          "posted_balance_minor": "100000"
        },
        "hold_event_sequence": "20"
      }
    },
    {
      "id": "PG17-hold-service-has-no-bypass-grants",
      "passed": true,
      "result": [
        {
          "reason": "42501",
          "sqlstate": "42501"
        },
        {
          "reason": "42501",
          "sqlstate": "42501"
        },
        {
          "reason": "42501",
          "sqlstate": "42501"
        },
        {
          "reason": "42501",
          "sqlstate": "42501"
        },
        {
          "reason": "42501",
          "sqlstate": "42501"
        },
        {
          "reason": "42501",
          "sqlstate": "42501"
        },
        {
          "reason": "42501",
          "sqlstate": "42501"
        }
      ]
    },
    {
      "id": "PG18-authorization-before-result-disclosure",
      "passed": true,
      "result": {
        "reason": "SCOPE_FORBIDDEN",
        "sqlstate": "P0001"
      }
    },
    {
      "id": "PG19-changed-capture-identity-conflict",
      "passed": true,
      "result": {
        "reason": "IDEMPOTENCY_CONFLICT",
        "sqlstate": "P0001"
      }
    },
    {
      "id": "PG20-durable-hold-capture-identity-after-restart",
      "passed": true,
      "result": {
        "hold": {
          "status": "active",
          "hold_id": "H-CANONICAL",
          "version": "2",
          "currency": "USD",
          "entity_id": "CB-A",
          "ledger_id": "CB-GENERAL",
          "account_id": "deposits_ada_usd",
          "created_at": "2026-10-24T22:44:13.853Z",
          "expires_at": "2026-10-24T23:44:13.665Z",
          "updated_at": "2026-10-24T22:44:14.081Z",
          "captured_minor": "12000",
          "original_minor": "30000",
          "released_minor": "0",
          "remaining_minor": "18000"
        },
        "journal": {
          "status": "committed",
          "command": {
            "legs": [
              {
                "side": "debit",
                "account_id": "deposits_ada_usd",
                "amount_minor": "12000"
              },
              {
                "side": "credit",
                "account_id": "card_settlement_payable_usd",
                "amount_minor": "12000"
              }
            ],
            "currency": "USD",
            "entity_id": "CB-A",
            "ledger_id": "CB-GENERAL",
            "journal_id": "J-C-CANONICAL-PARTIAL",
            "effective_at": "2026-10-22T10:00:00.000Z",
            "booking_period": "2026-10",
            "schema_version": "d30-journal-v1",
            "source_available_at": "2026-10-22T10:00:00.000Z",
            "business_operation_id": "JOP-C-CANONICAL-PARTIAL"
          },
          "sequence": "2",
          "movements": [
            {
              "account_id": "deposits_ada_usd",
              "raw_delta_minor": "12000",
              "normal_delta_minor": "-12000"
            },
            {
              "account_id": "card_settlement_payable_usd",
              "raw_delta_minor": "-12000",
              "normal_delta_minor": "12000"
            }
          ],
          "adjustment": {
            "reason": "",
            "authorized": false
          },
          "journal_id": "J-C-CANONICAL-PARTIAL",
          "debit_minor": "12000",
          "recorded_at": "2026-10-24T22:44:14.096Z",
          "credit_minor": "12000",
          "residual_minor": "0",
          "business_operation_id": "JOP-C-CANONICAL-PARTIAL"
        },
        "recorded_at": "2026-10-24T22:44:14.081Z",
        "availability": {
          "reserved_minor": "18000",
          "available_minor": "67600",
          "shortfall_minor": "0",
          "spendable_minor": "67600",
          "posted_balance_minor": "85600"
        },
        "hold_event_sequence": "2"
      }
    },
    {
      "id": "PG21-regressed-clock-refuses-current-state-export-and-new-write",
      "passed": true,
      "result": [
        {
          "trusted_watermark_table": "ledger_heads",
          "read_rejection": {
            "reason": "RECORDED_TIME_REGRESSION",
            "sqlstate": "P0001"
          },
          "new_write_rejection": {
            "reason": "RECORDED_TIME_REGRESSION",
            "sqlstate": "P0001"
          },
          "original_replay_retained": true,
          "watermark_restored": true
        },
        {
          "trusted_watermark_table": "hold_controls",
          "read_rejection": {
            "reason": "RECORDED_TIME_REGRESSION",
            "sqlstate": "P0001"
          },
          "new_write_rejection": {
            "reason": "RECORDED_TIME_REGRESSION",
            "sqlstate": "P0001"
          },
          "original_replay_retained": true,
          "watermark_restored": true
        }
      ]
    }
  ],
  "clock_policy": "Actual database clock read after ledger lock; no client clock or test-time override.",
  "limits": [
    "Exact expiry equality is a portable deterministic case; SQL races observe processing before/after the boundary.",
    "Controlled restart is not hardware power-loss evidence.",
    "Unrelated privileged/external posting paths can invalidate the product capacity assumption."
  ],
  "server_settings": {
    "port": "55431",
    "fsync": "on",
    "full_page_writes": "on",
    "synchronous_commit": "on",
    "server_version": "18.1"
  },
  "passed": true,
  "child_stopped_and_removed": true
}
