{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/citeladder-com/json-schema/citeladder-com-site-health-dashboard-schema.json",
  "title": "SiteHealthDashboard",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/citeladder-com-site-health-api-openapi.yml#/components/schemas/SiteHealthDashboard",
  "type": "object",
  "properties": {
    "project_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "crawl": {
      "anyOf": [
        {
          "$ref": "#/$defs/SiteCrawl"
        },
        {
          "type": "null"
        }
      ]
    },
    "score_summary": {
      "anyOf": [
        {
          "$ref": "#/$defs/SiteScoreSummary"
        },
        {
          "type": "null"
        }
      ]
    },
    "phase": {
      "type": "string",
      "enum": [
        "empty",
        "discovering",
        "analyzing",
        "dashboard",
        "terminal"
      ]
    },
    "snapshot_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "quota": {
      "$ref": "#/$defs/MonitoredQuota"
    },
    "root_errors": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RootError"
      }
    }
  },
  "required": [
    "project_id",
    "crawl",
    "score_summary",
    "phase",
    "snapshot_id",
    "quota",
    "root_errors"
  ],
  "additionalProperties": false,
  "$defs": {
    "CrawlAnalysisStatus": {
      "type": "string",
      "enum": [
        "pending",
        "running",
        "stopped",
        "completed",
        "partially_completed",
        "failed",
        "cancelled"
      ]
    },
    "CrawlCounters": {
      "type": "object",
      "properties": {
        "discovered": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "selected": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "queued": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "running": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "analyzed": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "errors": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "blocked": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "failure_breakdown": {
          "type": "object",
          "properties": {
            "robots_denied": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "http_4xx": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "http_5xx": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "timeout": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "robots_denied",
            "http_4xx",
            "http_5xx",
            "timeout"
          ],
          "additionalProperties": false
        },
        "activity": {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "working",
                "waiting",
                "stalled",
                "terminal"
              ]
            },
            "reason": {
              "type": "string",
              "enum": [
                "active_work",
                "host_gate",
                "retry_backoff",
                "expired_lease",
                "terminal"
              ]
            },
            "queue_depth": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            "next_available_at": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "state",
            "reason",
            "queue_depth",
            "next_available_at"
          ],
          "additionalProperties": false
        },
        "by_page_kind": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        }
      },
      "required": [
        "discovered",
        "selected",
        "queued",
        "running",
        "analyzed",
        "errors",
        "blocked",
        "failure_breakdown",
        "activity",
        "by_page_kind"
      ],
      "additionalProperties": false
    },
    "CrawlDiscoveryStatus": {
      "type": "string",
      "enum": [
        "pending",
        "running",
        "stopped",
        "completed",
        "sample_completed",
        "failed",
        "cancelled"
      ]
    },
    "CrawlOverallStatus": {
      "type": "string",
      "enum": [
        "draft",
        "validating",
        "queued",
        "running",
        "paused",
        "completed",
        "partially_completed",
        "failed",
        "cancelled"
      ]
    },
    "MonitoredQuota": {
      "type": "object",
      "properties": {
        "used": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "limit": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "used",
        "limit"
      ],
      "additionalProperties": false
    },
    "PageKind": {
      "type": "string",
      "enum": [
        "homepage",
        "article",
        "editorial_index",
        "product",
        "category",
        "pricing",
        "docs",
        "faq",
        "about_contact",
        "service",
        "local",
        "guide",
        "how_to",
        "listicle",
        "comparison",
        "alternative",
        "case_study_review",
        "trust_policy",
        "other"
      ]
    },
    "PageKindScoreSummary": {
      "type": "object",
      "properties": {
        "analyzed_count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "web_fundamentals_score": {
          "type": [
            "number",
            "null"
          ]
        },
        "web_fundamentals_coverage": {
          "type": [
            "number",
            "null"
          ]
        },
        "web_fundamentals_state": {
          "type": "string",
          "enum": [
            "measured",
            "limited_evidence",
            "not_measured",
            "excluded"
          ]
        },
        "aeo_readiness_score": {
          "type": [
            "number",
            "null"
          ]
        },
        "aeo_measurement_coverage": {
          "type": [
            "number",
            "null"
          ]
        },
        "aeo_measurement_state": {
          "type": "string",
          "enum": [
            "measured",
            "limited_evidence",
            "not_measured",
            "excluded"
          ]
        },
        "aeo_measurement_reason": {
          "type": "string"
        }
      },
      "required": [
        "analyzed_count",
        "web_fundamentals_score",
        "web_fundamentals_coverage",
        "web_fundamentals_state",
        "aeo_readiness_score",
        "aeo_measurement_coverage",
        "aeo_measurement_state",
        "aeo_measurement_reason"
      ],
      "additionalProperties": false
    },
    "RootError": {
      "type": "object",
      "properties": {
        "method": {
          "type": "string"
        },
        "target": {
          "type": "string"
        },
        "outcome": {
          "type": "string"
        },
        "error_code": {
          "type": "string"
        },
        "status_code": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "latency_ms": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "method",
        "target",
        "outcome",
        "error_code",
        "status_code",
        "latency_ms"
      ],
      "additionalProperties": false
    },
    "SiteCrawl": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "workspace_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "project_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "profile_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "status": {
          "$ref": "#/$defs/CrawlOverallStatus"
        },
        "discovery_status": {
          "$ref": "#/$defs/CrawlDiscoveryStatus"
        },
        "analysis_status": {
          "$ref": "#/$defs/CrawlAnalysisStatus"
        },
        "root_url": {
          "type": "string"
        },
        "sample_mode": {
          "type": "boolean"
        },
        "seed": {
          "type": "string"
        },
        "inventory_complete": {
          "type": "boolean"
        },
        "partial_reason": {
          "type": "string",
          "enum": [
            "",
            "discovery_incomplete",
            "analysis_incomplete",
            "discovery_and_analysis_incomplete"
          ]
        },
        "visible_url_count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "analyzed_count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "failed_count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "discovery_requested_count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "analysis_requested_count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "counters": {
          "$ref": "#/$defs/CrawlCounters"
        },
        "discovered_count": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "total_url_count": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "has_more_site_urls": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "score_summary": {
          "anyOf": [
            {
              "$ref": "#/$defs/SiteScoreSummary"
            },
            {
              "type": "null"
            }
          ]
        },
        "failure_summary": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "attempts": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status_code": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "target_url": {
                  "type": "string"
                }
              },
              "required": [
                "code",
                "message",
                "attempts",
                "status_code",
                "target_url"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "site_facts": {
          "anyOf": [
            {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            },
            {
              "type": "null"
            }
          ]
        },
        "extractor_version": {
          "type": "string"
        },
        "analyzer_version": {
          "type": "string"
        },
        "rule_version": {
          "type": "string"
        },
        "scoring_version": {
          "type": "string"
        },
        "error_message": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        },
        "started_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "completed_at": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "workspace_id",
        "project_id",
        "profile_id",
        "status",
        "discovery_status",
        "analysis_status",
        "root_url",
        "sample_mode",
        "seed",
        "inventory_complete",
        "partial_reason",
        "visible_url_count",
        "analyzed_count",
        "failed_count",
        "discovery_requested_count",
        "analysis_requested_count",
        "counters",
        "total_url_count",
        "score_summary",
        "failure_summary",
        "site_facts",
        "extractor_version",
        "analyzer_version",
        "rule_version",
        "scoring_version",
        "error_message",
        "created_at",
        "updated_at",
        "started_at",
        "completed_at"
      ],
      "additionalProperties": false
    },
    "SiteScoreSummary": {
      "type": "object",
      "properties": {
        "web_fundamentals_score": {
          "type": [
            "number",
            "null"
          ]
        },
        "web_fundamentals_coverage": {
          "type": [
            "number",
            "null"
          ]
        },
        "web_fundamentals_state": {
          "type": "string",
          "enum": [
            "measured",
            "limited_evidence",
            "not_measured",
            "excluded"
          ]
        },
        "aeo_readiness_score": {
          "type": [
            "number",
            "null"
          ]
        },
        "aeo_measurement_coverage": {
          "type": [
            "number",
            "null"
          ]
        },
        "aeo_measurement_state": {
          "type": "string",
          "enum": [
            "measured",
            "limited_evidence",
            "not_measured",
            "excluded"
          ]
        },
        "search_eligibility": {
          "type": "string",
          "enum": [
            "eligible",
            "blocked",
            "unknown",
            "excluded"
          ]
        },
        "classified_page_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "other_page_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "classification_error_page_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "classification_expected_page_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "classification_coverage": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "classification_state": {
          "type": "string",
          "enum": [
            "complete",
            "partial",
            "not_measured"
          ]
        },
        "classification_reason_groups": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "classification_formula_version": {
          "type": "string"
        },
        "scored_page_kind_set": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PageKind"
          }
        },
        "scored_page_count_by_kind": {
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/PageKind"
          },
          "additionalProperties": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "selected_count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "analyzed_count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "issue_count": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "scoring_version": {
          "type": "string"
        },
        "by_page_kind": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "$ref": "#/$defs/PageKindScoreSummary"
          }
        }
      },
      "required": [
        "web_fundamentals_score",
        "web_fundamentals_coverage",
        "web_fundamentals_state",
        "aeo_readiness_score",
        "aeo_measurement_coverage",
        "aeo_measurement_state",
        "search_eligibility",
        "classified_page_count",
        "other_page_count",
        "classification_error_page_count",
        "classification_expected_page_count",
        "classification_coverage",
        "classification_state",
        "classification_reason_groups",
        "classification_formula_version",
        "scored_page_kind_set",
        "scored_page_count_by_kind",
        "selected_count",
        "analyzed_count",
        "issue_count",
        "scoring_version",
        "by_page_kind"
      ],
      "additionalProperties": false
    }
  }
}