{
  "schema": 1,
  "sqlstate": "57P01",
  "condition_name": "admin_shutdown",
  "sources": [
    {
      "id": "src.errcodes.18.6",
      "kind": "upstream_source",
      "source_role": "condition_definition",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/utils/errcodes.txt",
      "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L435",
      "lines": "435"
    },
    {
      "id": "src.path.0",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/tcop/postgres.c",
      "sha256": "9fb62275b1badf94d01ab351337b60410cd9b3ab1fe63fa9f23d6d2185a21061",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/postgres.c#L2999",
      "lines": "2999-3001"
    },
    {
      "id": "src.path.1",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/tcop/postgres.c",
      "sha256": "9fb62275b1badf94d01ab351337b60410cd9b3ab1fe63fa9f23d6d2185a21061",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/tcop/postgres.c#L3354",
      "lines": "3354-3356"
    },
    {
      "id": "src.path.2",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/replication/syncrep.c",
      "sha256": "ecf3c6bbc44ca69943aad0a16ec9f7eff17b86c8eed635fc5f1bd489e4780493",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/replication/syncrep.c#L302",
      "lines": "302-305"
    },
    {
      "id": "src.path.3",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/access/transam/parallel.c",
      "sha256": "0b0c419c93545aa8abb99e4f36b2a42563c3dfa97ed48b1d6b34b0e53d89e5fe",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/transam/parallel.c#L938",
      "lines": "938-940"
    },
    {
      "id": "manifest.57P01",
      "kind": "local_artifact",
      "source_role": "case_manifest",
      "sha256": "48d4cedc4c42033638f48cc57bde06dfdf82adeedafa2ba2d5be25713c5e3705"
    },
    {
      "id": "snippet-registry.57P01",
      "kind": "local_artifact",
      "source_role": "snippet_registry",
      "sha256": "114acc382b3918b4151994d137f245e0de3a7ea8cc194bf053eff4926626f3d1"
    },
    {
      "id": "runtime.ops-57p01-latest-2.latest",
      "kind": "local_artifact",
      "source_role": "runtime_result",
      "sha256": "3bb14b5b69013d2eae2eff3288abce3c8a03ebe37eb91f2cc1102b9554236ec0"
    },
    {
      "id": "runtime-raw.ops-57p01-latest-2.latest",
      "kind": "local_artifact",
      "source_role": "runtime_raw",
      "sha256": "af36e671c47c60a79b375f939a35abd8fcc1c1276362ca6c1f344ee90f18ab61"
    },
    {
      "id": "runtime.ops-57p01-pg10-1.pg10",
      "kind": "local_artifact",
      "source_role": "runtime_result",
      "sha256": "de98dafdcac66227274122faace891de1444dbfc75e14b92ba42c036a7373f0e"
    },
    {
      "id": "runtime-raw.ops-57p01-pg10-1.pg10",
      "kind": "local_artifact",
      "source_role": "runtime_raw",
      "sha256": "d48f7bfdbedd98370ac1c10a36ae95bff1cec34b740baf258508e3c4fdd4ec6f"
    },
    {
      "id": "src.path.4",
      "kind": "upstream_source",
      "source_role": "resolved_report_context",
      "tag": "REL_18_6",
      "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
      "path": "src/backend/access/transam/xlogfuncs.c",
      "sha256": "6373dff222519c8544541eb120eb6e1f3c921d0b7bb2293689c4e5f98b9d41d0",
      "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/transam/xlogfuncs.c#L737",
      "lines": "737-741"
    }
  ],
  "claims": [
    {
      "id": "identity",
      "statement": "57P01 is admin_shutdown in SQLSTATE Class 57.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Read fixed definition."
    },
    {
      "id": "resolved-paths",
      "statement": "The cited PostgreSQL 18.6 source paths support the concrete phase, message, and lifecycle boundary described.",
      "sources": [
        "src.path.0",
        "src.path.1",
        "src.path.2",
        "src.path.3",
        "src.path.4"
      ],
      "method": "Read complete fixed source contexts.",
      "limits": "Source confirmation is not natural runtime."
    },
    {
      "id": "history",
      "statement": "The locked catalogue records 57P01 from 7.4; that boundary does not prove exact implementation introduction.",
      "sources": [
        "src.errcodes.18.6"
      ],
      "method": "Use catalogue boundary."
    },
    {
      "id": "runtime.representative-case",
      "statement": "The admin_terminate_backend case passed on PostgreSQL 18.6 and 10.21 with SQLSTATE, severity or disconnect outcome, recovery/repair, cleanup, and isolated-target stop assertions.",
      "sources": [
        "runtime.ops-57p01-latest-2.latest",
        "runtime.ops-57p01-pg10-1.pg10",
        "manifest.57P01",
        "snippet-registry.57P01"
      ],
      "method": "Execute the shared registry and inspect the selected summaries.",
      "limits": "This is one bounded mechanism; it does not establish every source branch or business outcome.",
      "runtime": [
        "runtime.ops-57p01-latest-2.latest",
        "runtime.ops-57p01-pg10-1.pg10"
      ]
    }
  ],
  "messages": [
    {
      "id": "message.0",
      "sqlstate": "57P01",
      "primary_template": "terminating connection due to immediate shutdown command",
      "severity_source": "WARNING_CLIENT_ONLY (client-visible warning; process exits after reporting)",
      "sources": [
        "src.path.0"
      ]
    },
    {
      "id": "message.1",
      "sqlstate": "57P01",
      "primary_template": "terminating connection due to administrator command",
      "severity_source": "FATAL",
      "sources": [
        "src.path.1"
      ]
    },
    {
      "id": "message.2",
      "sqlstate": "57P01",
      "primary_template": "canceling the wait for synchronous replication and terminating connection due to administrator command",
      "severity_source": "WARNING",
      "sources": [
        "src.path.2"
      ],
      "detail_template": "The transaction has already committed locally, but might not have been replicated to the standby."
    },
    {
      "id": "message.3",
      "sqlstate": "57P01",
      "primary_template": "postmaster exited during a parallel transaction",
      "severity_source": "FATAL",
      "sources": [
        "src.path.3"
      ]
    },
    {
      "id": "message.4",
      "sqlstate": "57P01",
      "primary_template": "terminating connection due to unexpected postmaster exit",
      "severity_source": "FATAL",
      "sources": [
        "src.path.4"
      ],
      "context_template": "while waiting on promotion"
    }
  ],
  "usage_evidence": [
    {
      "scope": "definition",
      "status": "definition_only",
      "evidence_ids": [
        "identity"
      ]
    },
    {
      "scope": "fixed-source-path",
      "status": "source_path_confirmed",
      "evidence_ids": [
        "resolved-paths"
      ]
    },
    {
      "scope": "selected natural runtime case",
      "status": "observed_runtime",
      "evidence_ids": [
        "runtime.representative-case",
        "runtime.ops-57p01-latest-2.latest",
        "runtime.ops-57p01-pg10-1.pg10"
      ]
    }
  ],
  "runtime": [
    {
      "id": "runtime.ops-57p01-latest-2.latest",
      "run_id": "ops-57p01-latest-2",
      "target": "latest",
      "status": "passed",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": 180006,
      "summary_sha256": "3bb14b5b69013d2eae2eff3288abce3c8a03ebe37eb91f2cc1102b9554236ec0",
      "raw_sha256": "af36e671c47c60a79b375f939a35abd8fcc1c1276362ca6c1f344ee90f18ab61",
      "case_manifest": {
        "id": "manifest.57P01",
        "kind": "local_artifact",
        "source_role": "case_manifest"
      },
      "snippet_registry": {
        "id": "snippet-registry.57P01",
        "kind": "local_artifact",
        "source_role": "snippet_registry",
        "sha256": "114acc382b3918b4151994d137f245e0de3a7ea8cc194bf053eff4926626f3d1"
      },
      "environment": {
        "server_version": "18.6 (Homebrew)",
        "server_version_num": "180006",
        "current_user": "runner",
        "connection_scope": "runner-owned localhost port",
        "log_destination": "csvlog,jsonlog",
        "log_error_verbosity": "verbose",
        "psycopg_version": "3.3.5",
        "libpq_version": "18.6",
        "target_kind": "latest"
      },
      "cases": [
        "admin_terminate_backend"
      ],
      "observed": {
        "admin_pid": "distinct admin PID",
        "admin_status": "IDLE",
        "backend_identity": [
          "runner-created victim",
          "client backend"
        ],
        "driver_diagnostic": {
          "column_name": null,
          "constraint_name": null,
          "context": null,
          "datatype_name": null,
          "exception_type": "AdminShutdown",
          "internal_position": null,
          "internal_query": null,
          "message_detail": null,
          "message_hint": null,
          "message_primary": "terminating connection due to administrator command",
          "schema_name": null,
          "severity": "FATAL",
          "severity_nonlocalized": "FATAL",
          "source_file": "postgres.c",
          "source_function": "ProcessInterrupts",
          "source_line": "3356",
          "sqlstate": "57P01",
          "statement_position": null,
          "table_name": null,
          "text": "terminating connection due to administrator command"
        },
        "fresh_probe": 1,
        "fresh_status": "IDLE",
        "terminate_result": true,
        "termination_scope": "Only the runner-created client backend PID was targeted; the target postmaster and unrelated sessions were not targeted.",
        "victim_connection_closed": true,
        "victim_pid": "runner-created victim PID",
        "victim_probe_before": 1
      },
      "assertions": [
        {
          "expected": "57P01",
          "name": "57P01 SQLSTATE",
          "observed": "57P01",
          "passed": true
        },
        {
          "expected": "FATAL",
          "name": "57P01 FATAL severity",
          "observed": "FATAL",
          "passed": true
        },
        {
          "expected": {
            "admin_pid_distinct": true,
            "backend_type": "client backend",
            "pid": 44110
          },
          "name": "victim was a runner client backend",
          "observed": {
            "admin_pid": 44111,
            "identity": [
              44110,
              "client backend"
            ],
            "victim_pid": 44110
          },
          "passed": true
        },
        {
          "expected": true,
          "name": "pg_terminate_backend confirms termination",
          "observed": true,
          "passed": true
        },
        {
          "expected": {
            "message": "terminating connection due to administrator command",
            "severity": "FATAL"
          },
          "name": "terminated driver reports FATAL admin shutdown",
          "observed": {
            "driver": {
              "column_name": null,
              "constraint_name": null,
              "context": null,
              "datatype_name": null,
              "exception_type": "AdminShutdown",
              "internal_position": null,
              "internal_query": null,
              "message_detail": null,
              "message_hint": null,
              "message_primary": "terminating connection due to administrator command",
              "schema_name": null,
              "severity": "FATAL",
              "severity_nonlocalized": "FATAL",
              "source_file": "postgres.c",
              "source_function": "ProcessInterrupts",
              "source_line": "3356",
              "sqlstate": "57P01",
              "statement_position": null,
              "table_name": null,
              "text": "terminating connection due to administrator command"
            },
            "message": "terminating connection due to administrator command",
            "severity": "FATAL"
          },
          "passed": true
        },
        {
          "expected": true,
          "name": "terminated victim connection is closed",
          "observed": true,
          "passed": true
        },
        {
          "expected": {
            "admin_status": "IDLE",
            "fresh": 1,
            "fresh_status": "IDLE",
            "victim_before": 1
          },
          "name": "fresh connection recovers after targeted termination",
          "observed": {
            "admin_status": "IDLE",
            "fresh": 1,
            "fresh_status": "IDLE",
            "victim_before": 1
          },
          "passed": true
        }
      ],
      "cleanup": {
        "errors": [],
        "passed": true
      }
    },
    {
      "id": "runtime.ops-57p01-pg10-1.pg10",
      "run_id": "ops-57p01-pg10-1",
      "target": "pg10",
      "status": "passed",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": 100021,
      "summary_sha256": "de98dafdcac66227274122faace891de1444dbfc75e14b92ba42c036a7373f0e",
      "raw_sha256": "d48f7bfdbedd98370ac1c10a36ae95bff1cec34b740baf258508e3c4fdd4ec6f",
      "case_manifest": {
        "id": "manifest.57P01",
        "kind": "local_artifact",
        "source_role": "case_manifest"
      },
      "snippet_registry": {
        "id": "snippet-registry.57P01",
        "kind": "local_artifact",
        "source_role": "snippet_registry",
        "sha256": "114acc382b3918b4151994d137f245e0de3a7ea8cc194bf053eff4926626f3d1"
      },
      "environment": {
        "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
        "server_version_num": "100021",
        "current_user": "postgres",
        "connection_scope": "runner-owned localhost port",
        "log_destination": "csvlog",
        "log_error_verbosity": "verbose",
        "psycopg_version": "3.3.5",
        "libpq_version": "18.6",
        "target_kind": "pg10"
      },
      "cases": [
        "admin_terminate_backend"
      ],
      "observed": {
        "admin_pid": "distinct admin PID",
        "admin_status": "IDLE",
        "backend_identity": [
          "runner-created victim",
          "client backend"
        ],
        "driver_diagnostic": {
          "column_name": null,
          "constraint_name": null,
          "context": null,
          "datatype_name": null,
          "exception_type": "AdminShutdown",
          "internal_position": null,
          "internal_query": null,
          "message_detail": null,
          "message_hint": null,
          "message_primary": "terminating connection due to administrator command",
          "schema_name": null,
          "severity": "FATAL",
          "severity_nonlocalized": "FATAL",
          "source_file": "postgres.c",
          "source_function": "ProcessInterrupts",
          "source_line": "2931",
          "sqlstate": "57P01",
          "statement_position": null,
          "table_name": null,
          "text": "terminating connection due to administrator command"
        },
        "fresh_probe": 1,
        "fresh_status": "IDLE",
        "terminate_result": true,
        "termination_scope": "Only the runner-created client backend PID was targeted; the target postmaster and unrelated sessions were not targeted.",
        "victim_connection_closed": true,
        "victim_pid": "runner-created victim PID",
        "victim_probe_before": 1
      },
      "assertions": [
        {
          "expected": "57P01",
          "name": "57P01 SQLSTATE",
          "observed": "57P01",
          "passed": true
        },
        {
          "expected": "FATAL",
          "name": "57P01 FATAL severity",
          "observed": "FATAL",
          "passed": true
        },
        {
          "expected": {
            "admin_pid_distinct": true,
            "backend_type": "client backend",
            "pid": 81
          },
          "name": "victim was a runner client backend",
          "observed": {
            "admin_pid": 82,
            "identity": [
              81,
              "client backend"
            ],
            "victim_pid": 81
          },
          "passed": true
        },
        {
          "expected": true,
          "name": "pg_terminate_backend confirms termination",
          "observed": true,
          "passed": true
        },
        {
          "expected": {
            "message": "terminating connection due to administrator command",
            "severity": "FATAL"
          },
          "name": "terminated driver reports FATAL admin shutdown",
          "observed": {
            "driver": {
              "column_name": null,
              "constraint_name": null,
              "context": null,
              "datatype_name": null,
              "exception_type": "AdminShutdown",
              "internal_position": null,
              "internal_query": null,
              "message_detail": null,
              "message_hint": null,
              "message_primary": "terminating connection due to administrator command",
              "schema_name": null,
              "severity": "FATAL",
              "severity_nonlocalized": "FATAL",
              "source_file": "postgres.c",
              "source_function": "ProcessInterrupts",
              "source_line": "2931",
              "sqlstate": "57P01",
              "statement_position": null,
              "table_name": null,
              "text": "terminating connection due to administrator command"
            },
            "message": "terminating connection due to administrator command",
            "severity": "FATAL"
          },
          "passed": true
        },
        {
          "expected": true,
          "name": "terminated victim connection is closed",
          "observed": true,
          "passed": true
        },
        {
          "expected": {
            "admin_status": "IDLE",
            "fresh": 1,
            "fresh_status": "IDLE",
            "victim_before": 1
          },
          "name": "fresh connection recovers after targeted termination",
          "observed": {
            "admin_status": "IDLE",
            "fresh": 1,
            "fresh_status": "IDLE",
            "victim_before": 1
          },
          "passed": true
        }
      ],
      "cleanup": {
        "errors": [],
        "passed": true
      }
    }
  ]
}
