{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/streetproof-com/json-schema/streetproof-com-entity-summary-schema.json",
  "title": "EntitySummary",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/streetproof-com-openapi.json#/components/schemas/EntitySummary",
  "type": "object",
  "required": [
    "record_type",
    "identity_hierarchy"
  ],
  "properties": {
    "record_type": {
      "type": "string",
      "const": "presence_record",
      "description": "A city-specific evidence record. It is not itself a legal organization or a global brand identity."
    },
    "identity_hierarchy": {
      "$ref": "#/$defs/ReviewedIdentityHierarchy"
    },
    "public_id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "city": {
      "type": [
        "string",
        "null"
      ]
    },
    "industry": {
      "type": [
        "string",
        "null"
      ]
    },
    "record_status": {
      "type": "string",
      "enum": [
        "active",
        "dissolved"
      ],
      "description": "Lifecycle state of the public Presence Record."
    },
    "identity_status": {
      "type": "string",
      "enum": [
        "unclaimed",
        "claimed",
        "identity_verified"
      ],
      "description": "Whether a claimant has proved control of the business identity. This is independent of observation verification."
    },
    "status": {
      "type": "string",
      "enum": [
        "unclaimed",
        "claimed",
        "verified",
        "dissolved"
      ],
      "deprecated": true,
      "description": "Deprecated 2026-07-29; remove after 2026-10-27. Use record_status and identity_status."
    },
    "is_synthetic": {
      "type": "boolean",
      "description": "true = public-beta demonstration data"
    },
    "pps": {
      "type": [
        "number",
        "null"
      ]
    },
    "provisional_pps": {
      "type": [
        "number",
        "null"
      ],
      "description": "0-100 visibility score shown before independent rank eligibility"
    },
    "score_state": {
      "type": "string",
      "enum": [
        "official",
        "provisional",
        "pending"
      ]
    },
    "ranking_state": {
      "type": "string",
      "enum": [
        "insufficient_evidence",
        "eligible",
        "frozen"
      ]
    },
    "ranking_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "independent_observer_count": {
      "type": "integer"
    },
    "independent_observation_count": {
      "type": "integer"
    },
    "observation_day_count": {
      "type": "integer"
    },
    "ranking_gate": {
      "$ref": "#/$defs/RankingGate"
    },
    "first_observed": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "last_observed": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "record_url": {
      "type": "string",
      "format": "uri"
    },
    "identifiers": {
      "$ref": "#/$defs/EntityIdentifiers"
    },
    "classification": {
      "$ref": "#/$defs/EntityClassification"
    }
  },
  "$defs": {
    "EntityClassification": {
      "type": "object",
      "required": [
        "industryCode",
        "industryLabel",
        "classificationStatus",
        "classificationConfidence",
        "classificationSource",
        "classificationModelVersion",
        "classifiedAt",
        "classifiedBy",
        "entityScope",
        "entityScopeConfidence",
        "entityScopeStatus",
        "entityScopeReason"
      ],
      "properties": {
        "industryCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "industryLabel": {
          "type": [
            "string",
            "null"
          ]
        },
        "classificationStatus": {
          "type": "string",
          "enum": [
            "unclassified",
            "suggested",
            "reviewed",
            "approved",
            "rejected"
          ]
        },
        "classificationConfidence": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1
        },
        "classificationSource": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "model",
            "registry",
            "website",
            "owner",
            "human_review",
            "merged",
            null
          ]
        },
        "classificationModelVersion": {
          "type": [
            "string",
            "null"
          ]
        },
        "classifiedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "classifiedBy": {
          "type": [
            "string",
            "null"
          ]
        },
        "entityScope": {
          "type": "string",
          "enum": [
            "local_independent",
            "local_franchise",
            "regional",
            "national",
            "multinational",
            "public_institution",
            "unknown"
          ]
        },
        "entityScopeConfidence": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1
        },
        "entityScopeStatus": {
          "type": "string",
          "enum": [
            "suggested",
            "reviewed",
            "approved",
            "unknown"
          ]
        },
        "entityScopeReason": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "EntityIdentifiers": {
      "type": "object",
      "required": [
        "organizationId",
        "brandId",
        "presenceRecordId",
        "locationId",
        "assetId",
        "parentOrganizationId",
        "franchiseSystemId",
        "operatingEntityId"
      ],
      "properties": {
        "organizationId": {
          "type": [
            "string",
            "null"
          ]
        },
        "brandId": {
          "type": [
            "string",
            "null"
          ]
        },
        "presenceRecordId": {
          "type": "string"
        },
        "locationId": {
          "type": [
            "string",
            "null"
          ]
        },
        "assetId": {
          "type": [
            "string",
            "null"
          ]
        },
        "parentOrganizationId": {
          "type": [
            "string",
            "null"
          ]
        },
        "franchiseSystemId": {
          "type": [
            "string",
            "null"
          ]
        },
        "operatingEntityId": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "RankingGate": {
      "type": "object",
      "required": [
        "status",
        "methodology_version",
        "independent_observers",
        "countable_observations",
        "observation_days",
        "industry_classification",
        "missing_requirements"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "eligible",
            "evidence_building",
            "integrity_review"
          ]
        },
        "methodology_version": {
          "type": "string",
          "const": "2026-07-30.v3"
        },
        "independent_observers": {
          "$ref": "#/$defs/RankingGateProgress"
        },
        "countable_observations": {
          "$ref": "#/$defs/RankingGateProgress"
        },
        "observation_days": {
          "$ref": "#/$defs/RankingGateProgress"
        },
        "industry_classification": {
          "type": "object",
          "required": [
            "industry",
            "state",
            "method",
            "authoritative_for_ranking"
          ],
          "properties": {
            "industry": {
              "type": [
                "string",
                "null"
              ]
            },
            "state": {
              "type": [
                "string",
                "null"
              ]
            },
            "method": {
              "type": [
                "string",
                "null"
              ]
            },
            "authoritative_for_ranking": {
              "type": "boolean"
            }
          }
        },
        "missing_requirements": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "independent_observers",
              "independent_observations",
              "observation_days",
              "industry_classification",
              "industry_classification_review"
            ]
          }
        }
      }
    },
    "RankingGateProgress": {
      "type": "object",
      "required": [
        "current",
        "required",
        "met"
      ],
      "properties": {
        "current": {
          "type": "integer",
          "minimum": 0
        },
        "required": {
          "type": "integer",
          "minimum": 1
        },
        "met": {
          "type": "boolean"
        }
      }
    },
    "ReviewedBrandIdentity": {
      "type": "object",
      "required": [
        "public_id",
        "name",
        "canonical_domain"
      ],
      "properties": {
        "public_id": {
          "type": "string",
          "pattern": "^brand_[a-zA-Z0-9_]+$"
        },
        "name": {
          "type": "string"
        },
        "canonical_domain": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "ReviewedEntityScope": {
      "type": "object",
      "required": [
        "value",
        "review_state",
        "methodology_version"
      ],
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "local_independent",
            "local_franchise",
            "regional",
            "national",
            "multinational",
            "public_institution",
            "unknown"
          ]
        },
        "review_state": {
          "type": "string",
          "enum": [
            "reviewed",
            "unreviewed"
          ]
        },
        "methodology_version": {
          "type": "string",
          "const": "entity-scope-v2"
        }
      }
    },
    "ReviewedIdentityHierarchy": {
      "type": "object",
      "description": "Only manually reviewed identity relationships are published. An unreviewed value means StreetProof has not published a relationship; it does not prove that no relationship exists.",
      "required": [
        "review_state",
        "scope",
        "brand",
        "organizations",
        "note"
      ],
      "properties": {
        "review_state": {
          "type": "string",
          "enum": [
            "reviewed",
            "unreviewed"
          ]
        },
        "scope": {
          "$ref": "#/$defs/ReviewedEntityScope"
        },
        "brand": {
          "oneOf": [
            {
              "$ref": "#/$defs/ReviewedBrandIdentity"
            },
            {
              "type": "null"
            }
          ]
        },
        "organizations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReviewedOrganizationRelationship"
          }
        },
        "organization_brand_relationships": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReviewedOrganizationBrandRelationship"
          }
        },
        "organization_parent_relationships": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReviewedOrganizationParentRelationship"
          }
        },
        "locations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReviewedOperatingLocation"
          }
        },
        "note": {
          "type": "string"
        }
      }
    },
    "ReviewedOperatingLocation": {
      "type": "object",
      "required": [
        "public_id",
        "name",
        "city_name",
        "organization_public_id",
        "brand_public_id",
        "official_url"
      ],
      "properties": {
        "public_id": {
          "type": "string",
          "pattern": "^loc_[a-zA-Z0-9_]+$"
        },
        "name": {
          "type": "string"
        },
        "city_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "organization_public_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "brand_public_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "official_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        }
      }
    },
    "ReviewedOrganizationBrandRelationship": {
      "type": "object",
      "required": [
        "organization_public_id",
        "brand_public_id",
        "relationship_type"
      ],
      "properties": {
        "organization_public_id": {
          "type": "string",
          "pattern": "^org_[a-zA-Z0-9_]+$"
        },
        "brand_public_id": {
          "type": "string",
          "pattern": "^brand_[a-zA-Z0-9_]+$"
        },
        "relationship_type": {
          "type": "string",
          "enum": [
            "owns",
            "operates",
            "licenses"
          ]
        }
      }
    },
    "ReviewedOrganizationParentRelationship": {
      "type": "object",
      "required": [
        "parent_organization_public_id",
        "child_organization_public_id",
        "relationship_type"
      ],
      "properties": {
        "parent_organization_public_id": {
          "type": "string",
          "pattern": "^org_[a-zA-Z0-9_]+$"
        },
        "child_organization_public_id": {
          "type": "string",
          "pattern": "^org_[a-zA-Z0-9_]+$"
        },
        "relationship_type": {
          "type": "string",
          "enum": [
            "parent",
            "subsidiary",
            "operating_group"
          ]
        }
      }
    },
    "ReviewedOrganizationRelationship": {
      "type": "object",
      "required": [
        "relationship_type",
        "public_id",
        "name",
        "organization_type",
        "canonical_domain"
      ],
      "properties": {
        "relationship_type": {
          "type": "string",
          "enum": [
            "operating_organization",
            "parent_organization",
            "franchise_system"
          ]
        },
        "public_id": {
          "type": "string",
          "pattern": "^org_[a-zA-Z0-9_]+$"
        },
        "name": {
          "type": "string"
        },
        "organization_type": {
          "type": "string",
          "enum": [
            "company",
            "public_institution",
            "nonprofit",
            "other"
          ]
        },
        "canonical_domain": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}