{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paloframework.org/schemas/palo-dependency-graph.schema.json",
  "title": "PALO scoped dependency and governance graph",
  "type": "object",
  "properties": {
    "format": {
      "const": "palo-dependency-graph"
    },
    "schemaVersion": {
      "const": "1.0.0"
    },
    "extensionVersion": {
      "const": "0.1.0"
    },
    "tenantId": {
      "type": "string",
      "minLength": 1
    },
    "snapshotAt": {
      "type": "string",
      "format": "date-time"
    },
    "evidenceClass": {
      "enum": [
        "illustrative-local-preview",
        "human-review-required"
      ]
    },
    "authorityBoundary": {
      "type": "string",
      "minLength": 1
    },
    "nodes": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9:._-]{0,159}$"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "validFrom": {
            "type": "string",
            "format": "date-time"
          },
          "validTo": {
            "type": "string",
            "format": "date-time"
          },
          "sourceRefs": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "type": {
            "enum": [
              "Layer",
              "Capability",
              "GovernancePlane",
              "ComponentVersion",
              "AISystemVersion",
              "Agent",
              "ModelVersion",
              "Tool",
              "DataAsset",
              "Provider",
              "Service",
              "PublicPolicy",
              "PolicyVersion",
              "ChangeSignal",
              "GovernanceCase",
              "ApplicabilityAssessment",
              "RequirementVersion",
              "ControlDefinition",
              "ControlImplementation",
              "EvidenceArtifact",
              "EvidenceClaim",
              "EvidenceEvaluation",
              "GateInstance",
              "GateDecisionRecord",
              "Actor"
            ]
          },
          "version": {
            "type": "string",
            "minLength": 1
          },
          "canonicalRef": {
            "type": "string",
            "format": "uri"
          },
          "properties": {
            "type": "object"
          }
        },
        "required": [
          "id",
          "label",
          "type",
          "recordedAt",
          "validFrom",
          "sourceRefs",
          "properties"
        ],
        "additionalProperties": false
      }
    },
    "edges": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9:._-]{0,159}$"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          },
          "validFrom": {
            "type": "string",
            "format": "date-time"
          },
          "validTo": {
            "type": "string",
            "format": "date-time"
          },
          "sourceRefs": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "source": {
            "type": "string",
            "minLength": 1
          },
          "target": {
            "type": "string",
            "minLength": 1
          },
          "relation": {
            "enum": [
              "PROVIDES_CAPABILITY",
              "BELONGS_TO_LAYER",
              "GOVERNS_LAYER",
              "INFORMS",
              "OFFERS",
              "USES_SERVICE",
              "DEPENDS_ON",
              "USES_MODEL",
              "CALLS_TOOL",
              "READS",
              "HAS_VERSION",
              "FROM_VERSION",
              "TO_VERSION",
              "AFFECTS_SERVICE",
              "GOVERNS_VERSION",
              "ASSESSES_SIGNAL",
              "ASSESSES_SYSTEM",
              "IN_CASE",
              "CONSIDERS_REQUIREMENT",
              "REVIEWED_BY",
              "IMPLEMENTS",
              "ADDRESSES_REQUIREMENT",
              "APPLIES_TO_SYSTEM",
              "USES_ARTIFACT",
              "SUPPORTS_TARGET",
              "EVALUATES_CLAIM",
              "REVIEWS_SYSTEM",
              "DECISION_FOR_GATE",
              "DECIDED_BY",
              "BASED_ON_ASSESSMENT",
              "SUPERSEDES"
            ]
          },
          "reviewState": {
            "enum": [
              "proposed",
              "accepted",
              "rejected"
            ]
          },
          "mappingBasis": {
            "type": "string",
            "minLength": 1
          },
          "evidenceRefs": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "required": [
          "id",
          "source",
          "target",
          "relation",
          "recordedAt",
          "validFrom",
          "sourceRefs",
          "reviewState",
          "mappingBasis",
          "evidenceRefs"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "format",
    "schemaVersion",
    "extensionVersion",
    "tenantId",
    "snapshotAt",
    "evidenceClass",
    "authorityBoundary",
    "nodes",
    "edges"
  ],
  "additionalProperties": false
}
