{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ap-in-indy.github.io/aiignore/schema/0.1/requirements-traceability.schema.json",
  "title": "aiignore normative requirements traceability draft 0.1",
  "type": "object",
  "additionalProperties": false,
  "required": ["formatVersion", "specification", "status", "evidenceBaseUri", "sections"],
  "properties": {
    "formatVersion": { "const": "0.1" },
    "specification": { "const": "0.1" },
    "status": { "const": "experimental" },
    "evidenceBaseUri": {
      "const": "https://github.com/ap-in-indy/aiignore/blob/v0.1.0-alpha.1/"
    },
    "sections": {
      "type": "array",
      "minItems": 16,
      "maxItems": 16,
      "items": { "$ref": "#/$defs/section" }
    }
  },
  "$defs": {
    "path": {
      "type": "string",
      "pattern": "^(?:[A-Za-z0-9._-]+/)*[A-Za-z0-9._-]+(?:#[a-z0-9._-]+)?$",
      "maxLength": 512
    },
    "section": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "section",
        "title",
        "normativeKeywordCount",
        "assurance",
        "evidence",
        "limitations"
      ],
      "properties": {
        "section": { "type": "integer", "minimum": 1, "maximum": 16 },
        "title": { "type": "string", "minLength": 1, "maxLength": 128 },
        "normativeKeywordCount": { "type": "integer", "minimum": 0 },
        "assurance": {
          "type": "string",
          "enum": ["implemented", "implemented-with-external-limits", "process", "informational"]
        },
        "evidence": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": { "$ref": "#/$defs/path" }
        },
        "limitations": {
          "type": "array",
          "uniqueItems": true,
          "items": { "type": "string", "minLength": 12, "maxLength": 512 }
        }
      }
    }
  }
}
