{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/philidor-io/json-schema/philidor-io-health-response-schema.json",
  "title": "HealthResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/philidor-io-system-api-openapi.yml#/components/schemas/HealthResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "vaultCount": {
          "type": "number"
        },
        "lastSync": {
          "type": [
            "string",
            "null"
          ]
        },
        "timestamp": {
          "type": "string"
        },
        "lastScoreRun": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "completedAt": {
              "type": [
                "string",
                "null"
              ]
            },
            "failSafeMode": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "completedAt",
            "failSafeMode"
          ]
        },
        "assetRegistryCoverage": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "totalExposures": {
              "type": "number"
            },
            "withAssetVersion": {
              "type": "number"
            },
            "coveragePercent": {
              "type": "number"
            }
          },
          "required": [
            "totalExposures",
            "withAssetVersion",
            "coveragePercent"
          ]
        },
        "assetIdentityCoverage": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "identityBasis": {
              "type": "string",
              "enum": [
                "chain_and_address"
              ],
              "description": "Identity model. `assetRegistryCoverage` is address-only and credits one address deployed on several chains as covered when any single chain carries an approved version; this counter keys on (chain, address) and does not."
            },
            "totalIdentities": {
              "type": "number"
            },
            "withApprovedVersion": {
              "type": "number"
            },
            "coveragePercent": {
              "type": "number"
            },
            "byChain": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "chainId": {
                    "type": "number"
                  },
                  "totalIdentities": {
                    "type": "number"
                  },
                  "withApprovedVersion": {
                    "type": "number"
                  },
                  "coveragePercent": {
                    "type": "number"
                  }
                },
                "required": [
                  "chainId",
                  "totalIdentities",
                  "withApprovedVersion",
                  "coveragePercent"
                ]
              },
              "description": "Per-chain rows, worst coverage first, so a low-coverage chain cannot be averaged away by the aggregate."
            },
            "computedAt": {
              "type": [
                "string",
                "null"
              ],
              "description": "When the measurement was taken. Computed by a worker once per cycle, not per request, so a value here can be minutes old."
            }
          },
          "required": [
            "identityBasis",
            "totalIdentities",
            "withApprovedVersion",
            "coveragePercent",
            "byChain",
            "computedAt"
          ]
        },
        "assetRegistryQueueBacklog": {
          "type": [
            "number",
            "null"
          ]
        },
        "evidenceSigner": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "ready",
                "missing_config",
                "unhealthy",
                "unregistered"
              ]
            },
            "keyId": {
              "type": [
                "string",
                "null"
              ]
            },
            "signerAddress": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "status",
            "keyId",
            "signerAddress"
          ]
        }
      },
      "required": [
        "status",
        "version",
        "vaultCount",
        "lastSync",
        "timestamp",
        "lastScoreRun",
        "assetRegistryCoverage",
        "assetIdentityCoverage",
        "assetRegistryQueueBacklog",
        "evidenceSigner"
      ]
    }
  },
  "required": [
    "data"
  ]
}