{
  "$defs": {
    "artifact": {
      "oneOf": [
        {
          "additionalProperties": true,
          "properties": {
            "artifact_ref": {
              "pattern": "^(?!/)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u0020\\u007f\\\\:])[^\\s\\\\:]+$",
              "type": "string"
            },
            "id": {
              "minLength": 1,
              "type": "string"
            },
            "path": {
              "pattern": "^(?!/)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u0020\\u007f\\\\:])[^\\s\\\\:]+$",
              "type": "string"
            },
            "sha256": {
              "$ref": "#/$defs/sha256"
            }
          },
          "required": [
            "id",
            "sha256",
            "path"
          ],
          "type": "object"
        },
        {
          "additionalProperties": true,
          "properties": {
            "artifact_ref": {
              "pattern": "^(?!/)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u0020\\u007f\\\\:])[^\\s\\\\:]+$",
              "type": "string"
            },
            "id": {
              "minLength": 1,
              "type": "string"
            },
            "path": {
              "pattern": "^(?!/)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u0020\\u007f\\\\:])[^\\s\\\\:]+$",
              "type": "string"
            },
            "sha256": {
              "$ref": "#/$defs/sha256"
            }
          },
          "required": [
            "id",
            "sha256",
            "artifact_ref"
          ],
          "type": "object"
        }
      ]
    },
    "artifacts": {
      "items": {
        "$ref": "#/$defs/artifact"
      },
      "type": "array"
    },
    "identity": {
      "pattern": "^sha256:[0-9a-f]{64}$",
      "type": "string"
    },
    "runtimePayload": {
      "additionalProperties": false,
      "properties": {
        "bytes": {
          "maximum": 268435456,
          "minimum": 1,
          "type": "integer"
        },
        "id": {
          "pattern": "^[A-Za-z0-9_.:-]{1,256}$",
          "type": "string"
        },
        "kind": {
          "enum": [
            "dbt_project_bundle",
            "dbt_manifest",
            "dbt_selection_lock"
          ]
        },
        "media_type": {
          "maxLength": 200,
          "minLength": 1,
          "type": "string"
        },
        "path": {
          "pattern": "^(?!/)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u0020\\u007f\\\\:])[^\\s\\\\:]+$",
          "type": "string"
        },
        "sha256": {
          "$ref": "#/$defs/sha256"
        }
      },
      "required": [
        "id",
        "kind",
        "path",
        "sha256",
        "bytes",
        "media_type"
      ],
      "type": "object"
    },
    "sha256": {
      "pattern": "^sha256:[A-Fa-f0-9]{64}$",
      "type": "string"
    }
  },
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/release-set-v2.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "artifacts": {
      "additionalProperties": false,
      "properties": {
        "canonical_schemas": {
          "$ref": "#/$defs/artifacts"
        },
        "dag_specs": {
          "$ref": "#/$defs/artifacts"
        },
        "runtime_payloads": {
          "items": {
            "$ref": "#/$defs/runtimePayload"
          },
          "maxItems": 64,
          "minItems": 1,
          "type": "array"
        },
        "workload_packs": {
          "$ref": "#/$defs/artifacts"
        }
      },
      "required": [
        "dag_specs",
        "workload_packs",
        "canonical_schemas",
        "runtime_payloads"
      ],
      "type": "object"
    },
    "producer": {
      "additionalProperties": false,
      "properties": {
        "dpone_version": {
          "pattern": "^[A-Za-z0-9][A-Za-z0-9.!+_-]{0,63}$",
          "type": "string"
        },
        "wire_contract": {
          "enum": [
            "dpone.dbt-airflow-self-service.v1",
            "dpone.dbt-airflow-self-service.v2"
          ]
        }
      },
      "required": [
        "dpone_version",
        "wire_contract"
      ],
      "type": "object"
    },
    "promotion": {
      "additionalProperties": false,
      "properties": {
        "profile": {
          "const": "compact_v2_runtime_connection_context"
        },
        "schema": {
          "const": "dpone.compact-pack-release-promotion.v1"
        }
      },
      "required": [
        "schema",
        "profile"
      ],
      "type": "object"
    },
    "provenance": {
      "additionalProperties": false,
      "properties": {
        "route_certifications": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "airflow_runtime_mode": {
                "minLength": 1,
                "type": "string"
              },
              "certification_level": {
                "enum": [
                  "production-certified",
                  "enterprise-certified"
                ]
              },
              "evidence_reason_codes": {
                "items": {
                  "type": "string"
                },
                "type": "array",
                "uniqueItems": true
              },
              "evidence_refs": {
                "items": {
                  "$ref": "#/$defs/identity"
                },
                "minItems": 1,
                "type": "array",
                "uniqueItems": true
              },
              "evidence_status": {
                "const": "PASS"
              },
              "route_id": {
                "minLength": 1,
                "type": "string"
              },
              "schema_evolution": {
                "minLength": 1,
                "type": "string"
              },
              "snapshot_id": {
                "$ref": "#/$defs/identity"
              },
              "support": {
                "enum": [
                  "supported",
                  "conditional"
                ]
              },
              "transport": {
                "minLength": 1,
                "type": "string"
              },
              "variant_id": {
                "minLength": 1,
                "type": "string"
              }
            },
            "required": [
              "variant_id",
              "route_id",
              "transport",
              "schema_evolution",
              "airflow_runtime_mode",
              "snapshot_id",
              "support",
              "certification_level",
              "evidence_status",
              "evidence_refs",
              "evidence_reason_codes"
            ],
            "type": "object"
          },
          "minItems": 1,
          "type": "array"
        },
        "selection_fingerprints": {
          "items": {
            "$ref": "#/$defs/identity"
          },
          "minItems": 1,
          "type": "array",
          "uniqueItems": true
        },
        "source": {
          "const": "dpone dbt compile"
        },
        "source_snapshot_sha256": {
          "$ref": "#/$defs/identity"
        }
      },
      "required": [
        "source",
        "source_snapshot_sha256",
        "selection_fingerprints",
        "route_certifications"
      ],
      "type": "object"
    },
    "release_id": {
      "$ref": "#/$defs/identity"
    },
    "schema": {
      "const": "dpone.release-set.v2"
    },
    "selection_authority": {
      "const": "dbt_cli"
    },
    "selection_fingerprint": {
      "$ref": "#/$defs/identity"
    }
  },
  "required": [
    "schema",
    "release_id",
    "producer",
    "selection_authority",
    "selection_fingerprint",
    "artifacts",
    "provenance"
  ],
  "title": "dpone GitOps release-set v2",
  "type": "object"
}
