{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aicompanyconstitution.org/constitution.schema.json",
  "title": "AI-native company constitutional publication record",
  "type": "object",
  "required": [
    "schema_version",
    "publication_date",
    "publication_status",
    "assurance",
    "authority_notice",
    "normative_text",
    "explanatory_material",
    "downloads"
  ],
  "properties": {
    "schema_version": {
      "type": "string"
    },
    "publication_date": {
      "type": "string"
    },
    "publication_status": {
      "type": "string"
    },
    "assurance": {
      "type": "object"
    },
    "authority_notice": {
      "type": "string"
    },
    "normative_text": {
      "type": "object",
      "required": [
        "preamble",
        "application",
        "articles"
      ],
      "properties": {
        "preamble": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "application": {
          "type": "object"
        },
        "articles": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "title",
              "clauses"
            ],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^A[0-9]{2}$"
              },
              "title": {
                "type": "string"
              },
              "clauses": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "text",
                    "url"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^A[0-9]{2}\\.[0-9]+$"
                    },
                    "text": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "explanatory_material": {
      "type": "object"
    },
    "downloads": {
      "type": "object"
    },
    "reuse_license": {
      "type": [
        "string",
        "null"
      ]
    },
    "licensing": {
      "type": "object",
      "required": [
        "status",
        "grant_in_effect",
        "license_id",
        "license_url",
        "scope",
        "exclusions"
      ],
      "properties": {
        "status": {
          "type": "string"
        },
        "grant_in_effect": {
          "type": "boolean"
        },
        "license_id": {
          "type": "string"
        },
        "license_url": {
          "type": "string",
          "format": "uri"
        },
        "scope": {
          "type": "string"
        },
        "exclusions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  },
  "additionalProperties": true
}
