{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pergola.wiki/data/pergola-wiki-review-record-schema-v2.0.json",
  "title": "Pergola Wiki independent external review record",
  "description": "Schema for a permissioned, verifiable article-level independent review record. A completed file is not an endorsement, certification or published review until Pergola Wiki verifies it and links it from the public review ledger.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "record_id",
    "article_url",
    "article_language",
    "article_content_version",
    "review_date",
    "reviewer",
    "independence",
    "scope",
    "findings",
    "review_conclusion",
    "resolution_status",
    "evidence_boundary"
  ],
  "properties": {
    "schema_version": {
      "const": "2.0"
    },
    "record_id": {
      "type": "string",
      "pattern": "^pwr-[a-z0-9-]+$"
    },
    "article_url": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://pergola\\.wiki/(?:zh/)?articles/"
    },
    "article_language": {
      "enum": [
        "en",
        "zh-CN"
      ]
    },
    "article_content_version": {
      "const": "1.7"
    },
    "review_date": {
      "type": "string",
      "format": "date"
    },
    "reviewer": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "role_and_specialty",
        "public_verification_url",
        "publication_permission"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 2
        },
        "role_and_specialty": {
          "type": "string",
          "minLength": 3
        },
        "credential_identifier": {
          "type": "string"
        },
        "public_verification_url": {
          "type": "string",
          "format": "uri"
        },
        "organization": {
          "type": "string"
        },
        "publication_permission": {
          "type": "boolean"
        }
      }
    },
    "independence": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "relationship_disclosure",
        "financial_or_employment_conflicts"
      ],
      "properties": {
        "relationship_disclosure": {
          "type": "string",
          "minLength": 2
        },
        "financial_or_employment_conflicts": {
          "type": "string",
          "minLength": 2
        }
      }
    },
    "scope": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "technical_scope",
        "jurisdiction_or_discipline",
        "sources_checked",
        "exclusions"
      ],
      "properties": {
        "technical_scope": {
          "type": "string",
          "minLength": 3
        },
        "jurisdiction_or_discipline": {
          "type": "string",
          "minLength": 2
        },
        "sources_checked": {
          "type": "string",
          "minLength": 2
        },
        "exclusions": {
          "type": "string",
          "minLength": 2
        }
      }
    },
    "findings": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "material_errors",
        "missing_qualifications",
        "source_or_version_corrections",
        "recommended_revisions"
      ],
      "properties": {
        "material_errors": {
          "type": "string"
        },
        "missing_qualifications": {
          "type": "string"
        },
        "source_or_version_corrections": {
          "type": "string"
        },
        "recommended_revisions": {
          "type": "string"
        }
      }
    },
    "review_conclusion": {
      "enum": [
        "no_material_issue_found",
        "revisions_required",
        "outside_scope",
        "withdrawn"
      ]
    },
    "resolution_status": {
      "const": "pending_editorial_resolution"
    },
    "evidence_boundary": {
      "const": "A locally generated record is not proof of publication, endorsement, certification or independent review status. Pergola Wiki must verify identity, credentials, scope, conflicts, permission and editorial resolution before updating the public ledger."
    }
  }
}