{
  "schema": 1,
  "sqlstate": "3F000",
  "condition_name": "invalid_schema_name",
  "runner": "scripts/verify_cases.py",
  "targets": {
    "latest": {
      "binary": "Homebrew PostgreSQL 18.6",
      "required": true
    },
    "pg10": {
      "image": "postgres:10",
      "required": true
    }
  },
  "cases": [
    {
      "id": "invalid_schema_name",
      "versions": [
        "10",
        "18"
      ],
      "preconditions": [
        "A runner-owned disposable target is provisioned."
      ],
      "trigger": "Use a missing schema-qualified table, create the schema explicitly, and verify one repaired row.",
      "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_schema_name",
      "case_id": "invalid_schema_name",
      "language": "sql",
      "statements": {
        "trigger": "CREATE TABLE missing_schema.repaired_table (id integer)",
        "create_schema": "CREATE SCHEMA missing_schema",
        "create_table": "CREATE TABLE missing_schema.repaired_table (id integer)",
        "insert": "INSERT INTO missing_schema.repaired_table VALUES (1)",
        "verify": "SELECT count(*) FROM missing_schema.repaired_table",
        "drop_schema": "DROP SCHEMA missing_schema CASCADE"
      }
    }
  ],
  "runtime": [
    {
      "id": "runtime.3F000-conn-test-latest.latest",
      "kind": "runtime_observation",
      "run_id": "3F000-conn-test-latest",
      "target": "latest",
      "status": "passed",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "cases": [
        "invalid_schema_name"
      ],
      "summary_sha256": "9a561e0b5973596704fbffc8d1ac0fe9fdf28952bf8a6b99c7a389ddd4719ca3",
      "raw_sha256": "9dbd0f3c1d1567ba9285d398eb99ad12283459c859af49a905f1e592425eafad",
      "case_manifest_sha256": "24f38a529b6226fed2c5a75d5d25414c6be4616a8e27cb8a72021aca552d8baa",
      "snippet_registry": {
        "sha256": "a51e3e0d667e45c1ef692589bbddb847d49df0689e12d14616eb23ee036d82ac"
      },
      "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": {
        "connection_autocommit": true,
        "diagnostic": {
          "column_name": null,
          "constraint_name": null,
          "context": null,
          "datatype_name": null,
          "exception_type": "InvalidSchemaName",
          "internal_position": null,
          "internal_query": null,
          "message_detail": null,
          "message_hint": null,
          "message_primary": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
          "schema_name": null,
          "severity": "ERROR",
          "severity_nonlocalized": "ERROR",
          "source_file": "namespace.c",
          "source_function": "get_namespace_oid",
          "source_line": "3547",
          "sqlstate": "3F000",
          "statement_position": "14",
          "table_name": null,
          "text": "schema \"c3f000_invalid_schema_name_missing\" does not exist\nLINE 1: CREATE TABLE \"c3f000_invalid_schema_name_missing\".\"repaired_...\n                     ^"
        },
        "missing_schema": "c3f000_invalid_schema_name_missing",
        "repaired_table": "c3f000_invalid_schema_name_missing.repaired_table",
        "row_count": 1,
        "statuses": {
          "after_error": "IDLE",
          "final": "IDLE"
        }
      },
      "assertions": [
        {
          "expected": "3F000",
          "name": "schema SQLSTATE",
          "observed": "3F000",
          "passed": true
        },
        {
          "expected": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
          "name": "schema diagnostic",
          "observed": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
          "passed": true
        },
        {
          "expected": "IDLE, one row, IDLE",
          "name": "schema creation repairs path",
          "observed": {
            "after_error": "IDLE",
            "count": 1,
            "final": "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": 55513,
          "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": "3F000",
                "name": "schema SQLSTATE",
                "observed": "3F000",
                "passed": true
              },
              {
                "expected": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
                "name": "schema diagnostic",
                "observed": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
                "passed": true
              },
              {
                "expected": "IDLE, one row, IDLE",
                "name": "schema creation repairs path",
                "observed": {
                  "after_error": "IDLE",
                  "count": 1,
                  "final": "IDLE"
                },
                "passed": true
              }
            ],
            "case_id": "invalid_schema_name",
            "cleanup": {
              "errors": [],
              "passed": true
            },
            "elapsed_seconds": 0.009,
            "observed": {
              "connection_autocommit": true,
              "diagnostic": {
                "column_name": null,
                "constraint_name": null,
                "context": null,
                "datatype_name": null,
                "exception_type": "InvalidSchemaName",
                "internal_position": null,
                "internal_query": null,
                "message_detail": null,
                "message_hint": null,
                "message_primary": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
                "schema_name": null,
                "severity": "ERROR",
                "severity_nonlocalized": "ERROR",
                "source_file": "namespace.c",
                "source_function": "get_namespace_oid",
                "source_line": "3547",
                "sqlstate": "3F000",
                "statement_position": "14",
                "table_name": null,
                "text": "schema \"c3f000_invalid_schema_name_missing\" does not exist\nLINE 1: CREATE TABLE \"c3f000_invalid_schema_name_missing\".\"repaired_...\n                     ^"
              },
              "missing_schema": "c3f000_invalid_schema_name_missing",
              "repaired_table": "c3f000_invalid_schema_name_missing.repaired_table",
              "row_count": 1,
              "statuses": {
                "after_error": "IDLE",
                "final": "IDLE"
              }
            },
            "schema": "c3f000_invalid_schema_name",
            "status": "passed"
          }
        ]
      }
    },
    {
      "id": "runtime.3F000-conn-test-pg10.pg10",
      "kind": "runtime_observation",
      "run_id": "3F000-conn-test-pg10",
      "target": "pg10",
      "status": "passed",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "cases": [
        "invalid_schema_name"
      ],
      "summary_sha256": "34a08faf372e7b262ae783c0d50a291d75ee8eece30a72c513f3f65482d6bfaa",
      "raw_sha256": "7dc9d41be4105c27ab544456931505332018143becf021604cbd22e206fc537c",
      "case_manifest_sha256": "24f38a529b6226fed2c5a75d5d25414c6be4616a8e27cb8a72021aca552d8baa",
      "snippet_registry": {
        "sha256": "a51e3e0d667e45c1ef692589bbddb847d49df0689e12d14616eb23ee036d82ac"
      },
      "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": {
        "connection_autocommit": true,
        "diagnostic": {
          "column_name": null,
          "constraint_name": null,
          "context": null,
          "datatype_name": null,
          "exception_type": "InvalidSchemaName",
          "internal_position": null,
          "internal_query": null,
          "message_detail": null,
          "message_hint": null,
          "message_primary": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
          "schema_name": null,
          "severity": "ERROR",
          "severity_nonlocalized": "ERROR",
          "source_file": "namespace.c",
          "source_function": "get_namespace_oid",
          "source_line": "3024",
          "sqlstate": "3F000",
          "statement_position": "14",
          "table_name": null,
          "text": "schema \"c3f000_invalid_schema_name_missing\" does not exist\nLINE 1: CREATE TABLE \"c3f000_invalid_schema_name_missing\".\"repaired_...\n                     ^"
        },
        "missing_schema": "c3f000_invalid_schema_name_missing",
        "repaired_table": "c3f000_invalid_schema_name_missing.repaired_table",
        "row_count": 1,
        "statuses": {
          "after_error": "IDLE",
          "final": "IDLE"
        }
      },
      "assertions": [
        {
          "expected": "3F000",
          "name": "schema SQLSTATE",
          "observed": "3F000",
          "passed": true
        },
        {
          "expected": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
          "name": "schema diagnostic",
          "observed": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
          "passed": true
        },
        {
          "expected": "IDLE, one row, IDLE",
          "name": "schema creation repairs path",
          "observed": {
            "after_error": "IDLE",
            "count": 1,
            "final": "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": 79,
          "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": "3F000",
                "name": "schema SQLSTATE",
                "observed": "3F000",
                "passed": true
              },
              {
                "expected": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
                "name": "schema diagnostic",
                "observed": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
                "passed": true
              },
              {
                "expected": "IDLE, one row, IDLE",
                "name": "schema creation repairs path",
                "observed": {
                  "after_error": "IDLE",
                  "count": 1,
                  "final": "IDLE"
                },
                "passed": true
              }
            ],
            "case_id": "invalid_schema_name",
            "cleanup": {
              "errors": [],
              "passed": true
            },
            "elapsed_seconds": 0.014,
            "observed": {
              "connection_autocommit": true,
              "diagnostic": {
                "column_name": null,
                "constraint_name": null,
                "context": null,
                "datatype_name": null,
                "exception_type": "InvalidSchemaName",
                "internal_position": null,
                "internal_query": null,
                "message_detail": null,
                "message_hint": null,
                "message_primary": "schema \"c3f000_invalid_schema_name_missing\" does not exist",
                "schema_name": null,
                "severity": "ERROR",
                "severity_nonlocalized": "ERROR",
                "source_file": "namespace.c",
                "source_function": "get_namespace_oid",
                "source_line": "3024",
                "sqlstate": "3F000",
                "statement_position": "14",
                "table_name": null,
                "text": "schema \"c3f000_invalid_schema_name_missing\" does not exist\nLINE 1: CREATE TABLE \"c3f000_invalid_schema_name_missing\".\"repaired_...\n                     ^"
              },
              "missing_schema": "c3f000_invalid_schema_name_missing",
              "repaired_table": "c3f000_invalid_schema_name_missing.repaired_table",
              "row_count": 1,
              "statuses": {
                "after_error": "IDLE",
                "final": "IDLE"
              }
            },
            "schema": "c3f000_invalid_schema_name",
            "status": "passed"
          }
        ]
      }
    }
  ]
}
