{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://iarpg.com/country-context-proposal.schema.json",
  "title": "IARPG Country Context Proposal",
  "description": "A browser-local proposal that keeps archival orientation, current observations, analyst assumptions, and fictional gameplay translations separate.",
  "type": "object",
  "required": [
    "$schema",
    "record_type",
    "schema_version",
    "release",
    "version",
    "proposal_id",
    "status",
    "truth_boundary",
    "country",
    "sections",
    "current_claims",
    "analyst_assumptions",
    "fictional_gameplay_translations",
    "correction_history",
    "supersession",
    "fairness_review",
    "publication_gate",
    "extensions"
  ],
  "properties": {
    "$schema": {
      "const": "https://iarpg.com/country-context-proposal.schema.json"
    },
    "record_type": {
      "const": "iarpg-country-context-proposal"
    },
    "schema_version": {
      "const": "1.0"
    },
    "release": {
      "const": "IARPG-OPS-2"
    },
    "version": {
      "const": "2.0.21-wip"
    },
    "proposal_id": {
      "type": "string",
      "pattern": "^country-context-[a-z0-9-]+-[a-z0-9-]+$"
    },
    "status": {
      "enum": [
        "draft",
        "review-ready",
        "superseded",
        "quarantined"
      ]
    },
    "truth_boundary": {
      "type": "string",
      "minLength": 80
    },
    "created_utc": {
      "type": "string",
      "format": "date-time"
    },
    "updated_utc": {
      "type": "string",
      "format": "date-time"
    },
    "country": {
      "type": "object",
      "required": [
        "roadmap_name",
        "region",
        "archival_entity_ids",
        "archival_source_entities",
        "locally_used_name",
        "endonym_notes",
        "research_cutoff",
        "profile_scope"
      ],
      "properties": {
        "roadmap_name": {
          "type": "string",
          "minLength": 1
        },
        "region": {
          "type": "string",
          "minLength": 1
        },
        "archival_entity_ids": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          }
        },
        "archival_source_entities": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          }
        },
        "locally_used_name": {
          "type": "string"
        },
        "endonym_notes": {
          "type": "string"
        },
        "research_cutoff": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "profile_scope": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "sections": {
      "type": "object",
      "required": [
        "current_institutions",
        "practical_authority",
        "oversight_and_remedy",
        "rights_and_affected_communities",
        "economy_and_infrastructure",
        "environmental_constraints",
        "alliances_and_issue_specific_relationships",
        "source_disagreements",
        "missing_evidence",
        "uncertainty_statement"
      ],
      "properties": {
        "current_institutions": {
          "type": "string"
        },
        "practical_authority": {
          "type": "string"
        },
        "oversight_and_remedy": {
          "type": "string"
        },
        "rights_and_affected_communities": {
          "type": "string"
        },
        "economy_and_infrastructure": {
          "type": "string"
        },
        "environmental_constraints": {
          "type": "string"
        },
        "alliances_and_issue_specific_relationships": {
          "type": "string"
        },
        "source_disagreements": {
          "type": "string"
        },
        "missing_evidence": {
          "type": "string"
        },
        "uncertainty_statement": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "current_claims": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "claim_id",
          "section",
          "statement",
          "publication_date",
          "access_date",
          "source_identity",
          "source_url",
          "source_type",
          "scope",
          "confidence",
          "perspective_origin",
          "language",
          "review_state",
          "notes"
        ],
        "properties": {
          "claim_id": {
            "type": "string",
            "pattern": "^claim-[a-z0-9-]+$"
          },
          "section": {
            "type": "string"
          },
          "statement": {
            "type": "string",
            "minLength": 1
          },
          "publication_date": {
            "type": "string",
            "format": "date"
          },
          "access_date": {
            "type": "string",
            "format": "date"
          },
          "source_identity": {
            "type": "string",
            "minLength": 1
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          },
          "source_type": {
            "type": "string",
            "minLength": 1
          },
          "scope": {
            "type": "string",
            "minLength": 1
          },
          "confidence": {
            "enum": [
              "high",
              "moderate",
              "low",
              "contested",
              "not-established"
            ]
          },
          "perspective_origin": {
            "enum": [
              "local",
              "affected-community",
              "regional",
              "external",
              "official-self-report"
            ]
          },
          "language": {
            "type": "string",
            "minLength": 1
          },
          "review_state": {
            "enum": [
              "unreviewed",
              "source-checked",
              "claim-checked",
              "second-review",
              "rejected"
            ]
          },
          "notes": {
            "type": "string"
          }
        },
        "additionalProperties": true
      }
    },
    "analyst_assumptions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "assumption_id",
          "statement",
          "rationale",
          "confidence",
          "test_needed"
        ],
        "properties": {
          "assumption_id": {
            "type": "string",
            "pattern": "^assumption-[a-z0-9-]+$"
          },
          "statement": {
            "type": "string",
            "minLength": 1
          },
          "rationale": {
            "type": "string",
            "minLength": 1
          },
          "confidence": {
            "enum": [
              "high",
              "moderate",
              "low",
              "contested",
              "not-established"
            ]
          },
          "test_needed": {
            "type": "string",
            "minLength": 1
          }
        },
        "additionalProperties": true
      }
    },
    "fictional_gameplay_translations": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "translation_id",
          "concept",
          "design_use",
          "safeguards",
          "source_claim_ids"
        ],
        "properties": {
          "translation_id": {
            "type": "string",
            "pattern": "^translation-[a-z0-9-]+$"
          },
          "concept": {
            "type": "string",
            "minLength": 1
          },
          "design_use": {
            "type": "string",
            "minLength": 1
          },
          "safeguards": {
            "type": "string",
            "minLength": 1
          },
          "source_claim_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": true
      }
    },
    "correction_history": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "correction_id",
          "recorded_date",
          "status",
          "description",
          "affected_claim_ids",
          "supersedes",
          "superseded_by"
        ],
        "properties": {
          "correction_id": {
            "type": "string",
            "pattern": "^correction-[a-z0-9-]+$"
          },
          "recorded_date": {
            "type": "string",
            "format": "date"
          },
          "status": {
            "enum": [
              "first-draft",
              "open",
              "resolved",
              "withdrawn"
            ]
          },
          "description": {
            "type": "string",
            "minLength": 1
          },
          "affected_claim_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "supersedes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "superseded_by": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      }
    },
    "supersession": {
      "type": "object",
      "required": [
        "supersedes_proposal_ids",
        "superseded_by",
        "note"
      ],
      "properties": {
        "supersedes_proposal_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "superseded_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "note": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "fairness_review": {
      "type": "object",
      "required": [
        "checked_utc",
        "profiles_compared",
        "findings",
        "adjective_terms",
        "threat_terms",
        "evidence_summary"
      ],
      "properties": {
        "checked_utc": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "profiles_compared": {
          "type": "integer",
          "minimum": 0
        },
        "findings": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "adjective_terms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "threat_terms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "evidence_summary": {
          "type": "object"
        }
      },
      "additionalProperties": true
    },
    "publication_gate": {
      "type": "object",
      "required": [
        "publishable",
        "checked_utc",
        "blockers",
        "warnings"
      ],
      "properties": {
        "publishable": {
          "type": "boolean"
        },
        "checked_utc": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "blockers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "extensions": {
      "type": "object"
    }
  },
  "additionalProperties": true
}
