{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://urban-os.online/brandbook/docs/page-contract.schema.json",
  "title": "Urban OS page contract",
  "type": "object",
  "required": ["designSystem", "route", "owner", "shell", "primaryOutcome", "locales", "themes", "modules", "qualityGates"],
  "properties": {
    "designSystem": { "const": "3.3.0" },
    "route": { "type": "string", "pattern": "^/" },
    "owner": { "type": "string", "minLength": 2 },
    "shell": { "enum": ["public", "account", "workspace", "spatial"] },
    "currentNavigation": { "enum": ["platform", "community", "library", "journal", "design", "account", "workspace", "spatial"] },
    "primaryOutcome": { "type": "string", "minLength": 12 },
    "locales": { "type": "array", "contains": { "const": "ar" }, "minItems": 6, "uniqueItems": true },
    "themes": { "type": "array", "contains": { "const": "dark" }, "minItems": 2, "uniqueItems": true },
    "modules": {
      "type": "object",
      "required": ["tokens", "contracts", "shellCss", "shellJs", "assistantCss", "assistantJs"],
      "additionalProperties": { "type": "string", "pattern": "^/shared/" }
    },
    "qualityGates": {
      "type": "object",
      "required": ["widths", "locales", "themes", "keyboard", "reducedMotion", "noHorizontalOverflow"],
      "properties": {
        "widths": { "type": "array", "contains": { "const": 390 } },
        "keyboard": { "const": true },
        "reducedMotion": { "const": true },
        "noHorizontalOverflow": { "const": true }
      }
    }
  }
}
