{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://opentine.com/schemas/opentine-compliance-profile-1.schema.json",
  "title": "opentine compliance profile (profile_version 1)",
  "description": "A `docs/compliance/NAME.yaml` profile (SPEC 12.5): YAML in its JSON-compatible flow style. Each requirement cites the article or rule it paraphrases; an in-scope requirement lists the evidence facts that show it, an out-of-scope one lists none.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "profile",
    "profile_version",
    "title",
    "jurisdiction",
    "notice",
    "counsel_review",
    "sources",
    "requirements"
  ],
  "properties": {
    "profile": {
      "type": "string"
    },
    "profile_version": {
      "type": "integer",
      "minimum": 0
    },
    "title": {
      "type": "string"
    },
    "jurisdiction": {
      "type": "string"
    },
    "notice": {
      "const": "draft — not legal advice, pending counsel review"
    },
    "counsel_review": {
      "enum": [
        "outstanding",
        "recorded"
      ]
    },
    "sources": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "title",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      }
    },
    "requirements": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "cite",
          "text",
          "scope",
          "evidence"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "cite": {
            "type": "string",
            "minLength": 1
          },
          "text": {
            "type": "string"
          },
          "scope": {
            "enum": [
              "in",
              "out"
            ]
          },
          "evidence": {
            "type": "array",
            "items": {
              "enum": [
                "integrity",
                "signature",
                "signature.authenticated",
                "timestamp",
                "transparency",
                "capture.independent",
                "log.events",
                "log.period",
                "retention.six-months",
                "custody"
              ]
            }
          },
          "note": {
            "type": "string"
          }
        }
      }
    }
  }
}
