{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "/marketplace-schemas/report-profile-contribution.schema.json",
  "title": "SecurityRecipes report profile contribution packet",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "generated_at",
    "contribution_target",
    "docs_expectation",
    "profile"
  ],
  "properties": {
    "schema_version": {
      "const": "securityrecipes.marketplace.report-profile.v1"
    },
    "generated_at": {
      "type": "string",
      "format": "date-time"
    },
    "contribution_target": {
      "const": "data/marketplace/report_profiles.json"
    },
    "docs_expectation": {
      "type": "string",
      "minLength": 1
    },
    "profile": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "label",
        "status",
        "category",
        "format",
        "description",
        "sections",
        "example_output"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "status": {
          "const": "community"
        },
        "category": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "format": {
          "type": "string",
          "enum": ["json", "markdown", "markdown+json"]
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 320
        },
        "sections": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "example_output": {
          "type": "object",
          "additionalProperties": true
        },
        "governance": {
          "type": "object",
          "additionalProperties": false,
          "required": ["pack_version", "owner", "reviewed_at", "review_cadence_days"],
          "properties": {
            "pack_version": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
            },
            "owner": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "reviewed_at": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "review_cadence_days": {
              "type": "integer",
              "minimum": 1,
              "maximum": 365
            },
            "docs_href": {
              "type": "string",
              "minLength": 1,
              "maxLength": 240
            },
            "required_pack_ids": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
              }
            },
            "optional_pack_ids": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
              }
            },
            "capability_tags": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9._-]*$"
              }
            }
          }
        }
      }
    }
  }
}
