{
  "schema": 1,
  "sqlstate": "3D000",
  "condition_name": "invalid_catalog_name",
  "runner": "scripts/verify_cases.py",
  "targets": {
    "latest": {
      "binary": "Homebrew PostgreSQL 18.6",
      "required": true
    },
    "pg10": {
      "image": "postgres:10",
      "required": true
    }
  },
  "cases": [
    {
      "id": "invalid_database",
      "versions": [
        "10",
        "18"
      ],
      "preconditions": [
        "A runner-owned disposable target is provisioned."
      ],
      "trigger": "Attempt startup against a generated database name that does not exist.",
      "assertions": [
        "The selected server diagnostic has the expected SQLSTATE",
        "The selected recovery/probe assertions pass",
        "Runner-owned resources are cleaned up"
      ],
      "repair": "Follow the case-specific repair statements and verify the resulting state.",
      "cleanup": "Drop the case schema with an owner connection."
    }
  ],
  "evidence_status": "authored",
  "snippets": [
    {
      "id": "invalid_database",
      "case_id": "invalid_database",
      "language": "sql",
      "statements": {
        "probe": "SELECT 1"
      }
    }
  ],
  "runtime": [
    {
      "id": "runtime.3D000-conn-contract-latest.latest",
      "kind": "runtime_observation",
      "run_id": "3D000-conn-contract-latest",
      "target": "latest",
      "status": "passed",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "cases": [
        "invalid_database"
      ],
      "summary_sha256": "ab82d13112fb06fe92ba4a844d508b73fbab3837958d63cc12b2a2050847c412",
      "raw_sha256": "358e4f85f7d99903037b4c73dbf5d6bed1221055f6e7d18b499cc3e52a5a1a4e",
      "case_manifest_sha256": "4ba3384ea04c9e8da120871cc8ab82ab3f19f7b7c2134a78aed63b6f2872cc19",
      "snippet_registry": {
        "sha256": "30f24743d2311ceef0e542957f159bb7398d81672068f068b29fb35278fe718b"
      },
      "environment": {
        "target_kind": "latest",
        "server_version": "18.6 (Homebrew)",
        "server_version_num": "180006",
        "machine": "arm64",
        "platform": "macOS-26.6.2-arm64-arm-64bit-Mach-O",
        "libpq_version": "18.6",
        "psycopg_version": "3.3.5",
        "python_version": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]",
        "locale": "en_US.UTF-8",
        "lc_messages": "C",
        "log_destination": "csvlog,jsonlog"
      },
      "observed": {
        "collector": {
          "primary": "database \"c3d000_missing_cff0e8d38be4\" does not exist",
          "severity": "FATAL",
          "sqlstate": "3D000"
        },
        "diagnostic": {
          "column_name": null,
          "constraint_name": null,
          "context": null,
          "datatype_name": null,
          "exception_type": "OperationalError",
          "internal_position": null,
          "internal_query": null,
          "message_detail": null,
          "message_hint": null,
          "message_primary": null,
          "schema_name": null,
          "severity": null,
          "severity_nonlocalized": null,
          "source_file": null,
          "source_function": null,
          "source_line": null,
          "sqlstate": null,
          "statement_position": null,
          "table_name": null,
          "text": "connection failed: connection to server at \"127.0.0.1\", port 60025 failed: FATAL:  database \"c3d000_missing_cff0e8d38be4\" does not exist"
        },
        "failed_connection_has_no_transaction": true,
        "missing_database": "c3d000_missing_cff0e8d38be4",
        "probe": 1,
        "probe_status": "IDLE",
        "server_error": {
          "C": "3D000",
          "F": "postinit.c",
          "L": "1016",
          "M": "database \"c3d000_missing_cff0e8d38be4\" does not exist",
          "R": "InitPostgres",
          "S": "FATAL",
          "V": "FATAL"
        }
      },
      "assertions": [
        {
          "expected": "3D000",
          "name": "server database SQLSTATE",
          "observed": "3D000",
          "passed": true
        },
        {
          "expected": "FATAL",
          "name": "server database failure is FATAL",
          "observed": "FATAL",
          "passed": true
        },
        {
          "expected": "database \"c3d000_missing_cff0e8d38be4\" does not exist",
          "name": "server missing-database diagnostic",
          "observed": "database \"c3d000_missing_cff0e8d38be4\" does not exist",
          "passed": true
        },
        {
          "expected": "null (startup exception)",
          "name": "driver startup SQLSTATE boundary",
          "observed": null,
          "passed": true
        },
        {
          "expected": "SELECT 1 and IDLE",
          "name": "known database remains usable",
          "observed": {
            "probe": 1,
            "status": "IDLE"
          },
          "passed": true
        }
      ],
      "cleanup": {
        "case": {
          "errors": [],
          "passed": true
        }
      },
      "limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
      "result": {
        "status": "passed",
        "environment": {
          "TimeZone": "Asia/Shanghai",
          "backend_pid": 78739,
          "binary": {
            "bindir": "/opt/homebrew/Cellar/postgresql@18/18.6/bin",
            "pg_config": "/opt/homebrew/bin/pg_config",
            "pg_config_version": "PostgreSQL 18.6 (Homebrew)",
            "postgres": "/opt/homebrew/Cellar/postgresql@18/18.6/bin/postgres"
          },
          "connection_scope": "runner-owned localhost port",
          "current_user": "runner",
          "docker": {},
          "lc_messages": "C",
          "libpq_version": "18.6",
          "locale": "en_US.UTF-8",
          "log_destination": "csvlog,jsonlog",
          "log_error_verbosity": "verbose",
          "log_min_error_statement": "error",
          "log_min_messages": "error",
          "logging_collector": "on",
          "machine": "arm64",
          "max_connections": "100",
          "platform": "macOS-26.6.2-arm64-arm-64bit-Mach-O",
          "psycopg_version": "3.3.5",
          "python_version": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]",
          "server_encoding": "UTF8",
          "server_version": "18.6 (Homebrew)",
          "server_version_num": "180006",
          "target_kind": "latest",
          "wal_level": "logical"
        },
        "cases": [
          {
            "assertions": [
              {
                "expected": "3D000",
                "name": "server database SQLSTATE",
                "observed": "3D000",
                "passed": true
              },
              {
                "expected": "FATAL",
                "name": "server database failure is FATAL",
                "observed": "FATAL",
                "passed": true
              },
              {
                "expected": "database \"c3d000_missing_cff0e8d38be4\" does not exist",
                "name": "server missing-database diagnostic",
                "observed": "database \"c3d000_missing_cff0e8d38be4\" does not exist",
                "passed": true
              },
              {
                "expected": "null (startup exception)",
                "name": "driver startup SQLSTATE boundary",
                "observed": null,
                "passed": true
              },
              {
                "expected": "SELECT 1 and IDLE",
                "name": "known database remains usable",
                "observed": {
                  "probe": 1,
                  "status": "IDLE"
                },
                "passed": true
              }
            ],
            "case_id": "invalid_database",
            "cleanup": {
              "errors": [],
              "passed": true
            },
            "elapsed_seconds": 0.012,
            "observed": {
              "collector": {
                "primary": "database \"c3d000_missing_cff0e8d38be4\" does not exist",
                "severity": "FATAL",
                "sqlstate": "3D000"
              },
              "diagnostic": {
                "column_name": null,
                "constraint_name": null,
                "context": null,
                "datatype_name": null,
                "exception_type": "OperationalError",
                "internal_position": null,
                "internal_query": null,
                "message_detail": null,
                "message_hint": null,
                "message_primary": null,
                "schema_name": null,
                "severity": null,
                "severity_nonlocalized": null,
                "source_file": null,
                "source_function": null,
                "source_line": null,
                "sqlstate": null,
                "statement_position": null,
                "table_name": null,
                "text": "connection failed: connection to server at \"127.0.0.1\", port 60025 failed: FATAL:  database \"c3d000_missing_cff0e8d38be4\" does not exist"
              },
              "failed_connection_has_no_transaction": true,
              "missing_database": "c3d000_missing_cff0e8d38be4",
              "probe": 1,
              "probe_status": "IDLE",
              "server_error": {
                "C": "3D000",
                "F": "postinit.c",
                "L": "1016",
                "M": "database \"c3d000_missing_cff0e8d38be4\" does not exist",
                "R": "InitPostgres",
                "S": "FATAL",
                "V": "FATAL"
              }
            },
            "schema": "c3d000_invalid_database",
            "status": "passed"
          }
        ]
      }
    },
    {
      "id": "runtime.3D000-conn-contract-pg10.pg10",
      "kind": "runtime_observation",
      "run_id": "3D000-conn-contract-pg10",
      "target": "pg10",
      "status": "passed",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "cases": [
        "invalid_database"
      ],
      "summary_sha256": "8b23ff808e37fff48a8617be25efbbb7a7074f06292ee06dcdf553fb26c34ccd",
      "raw_sha256": "80042acbc3e919a79dc5d841dc2a20db68569114af6b97a23a2e7f09f0213f4d",
      "case_manifest_sha256": "4ba3384ea04c9e8da120871cc8ab82ab3f19f7b7c2134a78aed63b6f2872cc19",
      "snippet_registry": {
        "sha256": "30f24743d2311ceef0e542957f159bb7398d81672068f068b29fb35278fe718b"
      },
      "environment": {
        "target_kind": "pg10",
        "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
        "server_version_num": "100021",
        "machine": "arm64",
        "platform": "macOS-26.6.2-arm64-arm-64bit-Mach-O",
        "libpq_version": "18.6",
        "psycopg_version": "3.3.5",
        "python_version": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]",
        "locale": "en_US.UTF-8",
        "lc_messages": "en_US.utf8",
        "log_destination": "csvlog"
      },
      "observed": {
        "collector": {
          "primary": "database \"c3d000_missing_9d55329d2676\" does not exist",
          "severity": "FATAL",
          "sqlstate": "3D000"
        },
        "diagnostic": {
          "column_name": null,
          "constraint_name": null,
          "context": null,
          "datatype_name": null,
          "exception_type": "OperationalError",
          "internal_position": null,
          "internal_query": null,
          "message_detail": null,
          "message_hint": null,
          "message_primary": null,
          "schema_name": null,
          "severity": null,
          "severity_nonlocalized": null,
          "source_file": null,
          "source_function": null,
          "source_line": null,
          "sqlstate": null,
          "statement_position": null,
          "table_name": null,
          "text": "connection failed: connection to server at \"127.0.0.1\", port 60027 failed: FATAL:  database \"c3d000_missing_9d55329d2676\" does not exist"
        },
        "failed_connection_has_no_transaction": true,
        "missing_database": "c3d000_missing_9d55329d2676",
        "probe": 1,
        "probe_status": "IDLE",
        "server_error": {
          "C": "3D000",
          "F": "postinit.c",
          "L": "848",
          "M": "database \"c3d000_missing_9d55329d2676\" does not exist",
          "R": "InitPostgres",
          "S": "FATAL",
          "V": "FATAL"
        }
      },
      "assertions": [
        {
          "expected": "3D000",
          "name": "server database SQLSTATE",
          "observed": "3D000",
          "passed": true
        },
        {
          "expected": "FATAL",
          "name": "server database failure is FATAL",
          "observed": "FATAL",
          "passed": true
        },
        {
          "expected": "database \"c3d000_missing_9d55329d2676\" does not exist",
          "name": "server missing-database diagnostic",
          "observed": "database \"c3d000_missing_9d55329d2676\" does not exist",
          "passed": true
        },
        {
          "expected": "null (startup exception)",
          "name": "driver startup SQLSTATE boundary",
          "observed": null,
          "passed": true
        },
        {
          "expected": "SELECT 1 and IDLE",
          "name": "known database remains usable",
          "observed": {
            "probe": 1,
            "status": "IDLE"
          },
          "passed": true
        }
      ],
      "cleanup": {
        "case": {
          "errors": [],
          "passed": true
        }
      },
      "limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
      "image": "postgres:10",
      "result": {
        "status": "passed",
        "environment": {
          "TimeZone": "Etc/UTC",
          "backend_pid": 78,
          "binary": {},
          "connection_scope": "runner-owned localhost port",
          "current_user": "postgres",
          "docker": {
            "architecture": "arm64",
            "command": "/usr/local/bin/docker",
            "digest": "sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc",
            "id": "sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc",
            "image": "postgres:10",
            "image_created": "2022-06-23T09:11:18.374607054Z",
            "image_ref": "postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc",
            "log_destination": "csvlog",
            "os": "linux",
            "repo_digests": [
              "postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc"
            ]
          },
          "lc_messages": "en_US.utf8",
          "libpq_version": "18.6",
          "locale": "en_US.UTF-8",
          "log_destination": "csvlog",
          "log_error_verbosity": "verbose",
          "log_min_error_statement": "error",
          "log_min_messages": "error",
          "logging_collector": "on",
          "machine": "arm64",
          "max_connections": "100",
          "platform": "macOS-26.6.2-arm64-arm-64bit-Mach-O",
          "psycopg_version": "3.3.5",
          "python_version": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]",
          "server_encoding": "UTF8",
          "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
          "server_version_num": "100021",
          "target_kind": "pg10",
          "wal_level": "logical"
        },
        "cases": [
          {
            "assertions": [
              {
                "expected": "3D000",
                "name": "server database SQLSTATE",
                "observed": "3D000",
                "passed": true
              },
              {
                "expected": "FATAL",
                "name": "server database failure is FATAL",
                "observed": "FATAL",
                "passed": true
              },
              {
                "expected": "database \"c3d000_missing_9d55329d2676\" does not exist",
                "name": "server missing-database diagnostic",
                "observed": "database \"c3d000_missing_9d55329d2676\" does not exist",
                "passed": true
              },
              {
                "expected": "null (startup exception)",
                "name": "driver startup SQLSTATE boundary",
                "observed": null,
                "passed": true
              },
              {
                "expected": "SELECT 1 and IDLE",
                "name": "known database remains usable",
                "observed": {
                  "probe": 1,
                  "status": "IDLE"
                },
                "passed": true
              }
            ],
            "case_id": "invalid_database",
            "cleanup": {
              "errors": [],
              "passed": true
            },
            "elapsed_seconds": 0.015,
            "observed": {
              "collector": {
                "primary": "database \"c3d000_missing_9d55329d2676\" does not exist",
                "severity": "FATAL",
                "sqlstate": "3D000"
              },
              "diagnostic": {
                "column_name": null,
                "constraint_name": null,
                "context": null,
                "datatype_name": null,
                "exception_type": "OperationalError",
                "internal_position": null,
                "internal_query": null,
                "message_detail": null,
                "message_hint": null,
                "message_primary": null,
                "schema_name": null,
                "severity": null,
                "severity_nonlocalized": null,
                "source_file": null,
                "source_function": null,
                "source_line": null,
                "sqlstate": null,
                "statement_position": null,
                "table_name": null,
                "text": "connection failed: connection to server at \"127.0.0.1\", port 60027 failed: FATAL:  database \"c3d000_missing_9d55329d2676\" does not exist"
              },
              "failed_connection_has_no_transaction": true,
              "missing_database": "c3d000_missing_9d55329d2676",
              "probe": 1,
              "probe_status": "IDLE",
              "server_error": {
                "C": "3D000",
                "F": "postinit.c",
                "L": "848",
                "M": "database \"c3d000_missing_9d55329d2676\" does not exist",
                "R": "InitPostgres",
                "S": "FATAL",
                "V": "FATAL"
              }
            },
            "schema": "c3d000_invalid_database",
            "status": "passed"
          }
        ]
      }
    }
  ]
}
