{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pg36.example.test/schemas/development-baseline-v1.json",
  "title": "PG36 development baseline registry",
  "type": "object",
  "required": [
    "schema_version",
    "baseline_version",
    "published_on",
    "compatibility",
    "source_chapters",
    "future_evidence_chapters",
    "levels",
    "rules"
  ],
  "properties": {
    "schema_version": {
      "const": 1
    },
    "baseline_version": {
      "type": "string",
      "pattern": "^0\\.1\\.\\d+$"
    },
    "published_on": {
      "type": "string",
      "format": "date"
    },
    "compatibility": {
      "type": "object"
    },
    "source_chapters": {
      "type": "array",
      "items": {
        "pattern": "^ch0[1-5]$"
      },
      "uniqueItems": true
    },
    "future_evidence_chapters": {
      "type": "array",
      "items": {
        "pattern": "^ch(0[7-9]|1[01])$"
      },
      "uniqueItems": true
    },
    "levels": {
      "type": "object",
      "required": [
        "safety",
        "default",
        "preference"
      ]
    },
    "rules": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id",
          "title",
          "level",
          "status",
          "owner",
          "scope",
          "statement",
          "rationale",
          "evidence",
          "exception",
          "checks"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^(SAFE|DEFAULT|PREF)-[A-Z]{4}-[0-9]{3}$"
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "level": {
            "enum": [
              "safety",
              "default",
              "preference"
            ]
          },
          "status": {
            "enum": [
              "active",
              "deprecated"
            ]
          },
          "owner": {
            "type": "string",
            "minLength": 1
          },
          "scope": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            },
            "uniqueItems": true
          },
          "statement": {
            "type": "string",
            "minLength": 1
          },
          "rationale": {
            "type": "string",
            "minLength": 1
          },
          "evidence": {
            "type": "array",
            "minItems": 1
          },
          "exception": {
            "type": "object",
            "required": [
              "mode",
              "requirements"
            ]
          },
          "checks": {
            "type": "array",
            "minItems": 1
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
