{
  "$defs": {
    "ChangeKind": {
      "description": "Change kind (Keep a Changelog 1.1.0).",
      "oneOf": [
        {
          "enum": [
            "added",
            "changed",
            "deprecated",
            "removed",
            "fixed",
            "security"
          ],
          "type": "string"
        },
        {
          "const": "performance",
          "description": "Performance (extension to Keep a Changelog).",
          "type": "string"
        },
        {
          "const": "internal",
          "description": "Internal refactor (no user impact).",
          "type": "string"
        }
      ]
    },
    "IsoDate": {
      "description": "ISO 8601 date (YYYY-MM-DD).",
      "format": "date",
      "type": "string"
    },
    "PathRef": {
      "description": "Path-based cross-reference relative to .corpospec/ root.\nPattern: `^[a-z0-9_-]+(/[a-z0-9_.-]+)+$`",
      "pattern": "^[a-z0-9_-]+(/[a-z0-9_.-]+)+$",
      "type": "string"
    },
    "ReleaseChangelogEntry": {
      "description": "One changelog entry.",
      "properties": {
        "breaking": {
          "description": "Whether breaking (for Removed / Changed).",
          "type": "boolean"
        },
        "kind": {
          "$ref": "#/$defs/ChangeKind"
        },
        "migration_note": {
          "description": "Migration guidance (if breaking).",
          "type": [
            "string",
            "null"
          ]
        },
        "source_ref": {
          "anyOf": [
            {
              "$ref": "#/$defs/PathRef"
            },
            {
              "type": "null"
            }
          ],
          "description": "PathRef to the PR / commit / BDR that introduced the change."
        },
        "summary": {
          "type": "string"
        }
      },
      "required": [
        "kind",
        "summary",
        "breaking"
      ],
      "type": "object"
    },
    "ReleaseChannel": {
      "description": "Release channel.",
      "oneOf": [
        {
          "const": "internal",
          "description": "Internal-only / pre-alpha.",
          "type": "string"
        },
        {
          "const": "alpha",
          "description": "Public alpha.",
          "type": "string"
        },
        {
          "const": "beta",
          "description": "Public beta.",
          "type": "string"
        },
        {
          "const": "stable",
          "description": "Stable production.",
          "type": "string"
        },
        {
          "const": "lts",
          "description": "Long-term support.",
          "type": "string"
        },
        {
          "const": "security_only",
          "description": "Patched LTS-only / security-fix-only.",
          "type": "string"
        }
      ]
    },
    "ReleaseStatus": {
      "description": "Release lifecycle.",
      "oneOf": [
        {
          "enum": [
            "planned",
            "cutting",
            "released"
          ],
          "type": "string"
        },
        {
          "const": "yanked",
          "description": "Rolled back / yanked.",
          "type": "string"
        },
        {
          "const": "superseded",
          "description": "Superseded by a later patch.",
          "type": "string"
        }
      ]
    },
    "SecurityReviewStatus": {
      "description": "Security-review status.",
      "enum": [
        "not_required",
        "pending",
        "passed",
        "passed_with_caveats",
        "failed"
      ],
      "type": "string"
    },
    "Semver": {
      "description": "Semantic version string (MAJOR.MINOR.PATCH).",
      "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$",
      "type": "string"
    }
  },
  "$id": "https://corpospec.com/schemas/v0.16.0/release-record.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Software release.",
  "properties": {
    "artefact_ref": {
      "$ref": "#/$defs/PathRef",
      "description": "PathRef to the immutable artefact (Docker tag, npm tarball,\ncrate sha)."
    },
    "bdr_refs": {
      "description": "PathRefs to BDRs / decisions covered by this release.",
      "items": {
        "$ref": "#/$defs/PathRef"
      },
      "type": "array"
    },
    "changelog": {
      "items": {
        "$ref": "#/$defs/ReleaseChangelogEntry"
      },
      "type": "array"
    },
    "channel": {
      "$ref": "#/$defs/ReleaseChannel"
    },
    "git_ref": {
      "description": "PathRef to the git tag / commit.",
      "type": "string"
    },
    "id": {
      "$ref": "#/$defs/PathRef"
    },
    "migration_required": {
      "description": "Whether deployment requires migration steps.",
      "type": "boolean"
    },
    "migration_runbook": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the migration runbook."
    },
    "product": {
      "$ref": "#/$defs/PathRef"
    },
    "release_manager": {
      "$ref": "#/$defs/PathRef"
    },
    "released_at": {
      "$ref": "#/$defs/IsoDate"
    },
    "rollback_runbook": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the rollback runbook."
    },
    "sbom_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the SBOM attached to this release."
    },
    "security_review_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "PathRef to the security-review artefact."
    },
    "security_review_status": {
      "$ref": "#/$defs/SecurityReviewStatus"
    },
    "signature_ref": {
      "anyOf": [
        {
          "$ref": "#/$defs/PathRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "Cryptographic signature (cosign / SLSA)."
    },
    "status": {
      "$ref": "#/$defs/ReleaseStatus"
    },
    "version": {
      "$ref": "#/$defs/Semver"
    }
  },
  "required": [
    "id",
    "product",
    "version",
    "channel",
    "status",
    "released_at",
    "release_manager",
    "changelog",
    "artefact_ref",
    "security_review_status",
    "migration_required",
    "git_ref"
  ],
  "title": "ReleaseRecord",
  "type": "object",
  "x-corpospec-pillar": "operations"
}