{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paloframework.org/schemas/palo-data-lineage-record.schema.json",
  "title": "PALO Data Lineage and Lifecycle Record",
  "type": "object",
  "required": ["format", "schemaVersion", "recordId", "caseId", "asset", "origins", "transformations", "permissions", "privacy", "annotation", "quality", "uses", "retention", "deletion", "owner", "review"],
  "properties": {
    "format": { "const": "palo-data-lineage-record" },
    "schemaVersion": { "const": "1.0.0" },
    "recordId": { "type": "string" }, "caseId": { "type": "string" },
    "asset": { "type": "object", "required": ["assetId", "name", "version", "role", "digest", "materiality"], "properties": { "assetId": { "type": "string" }, "name": { "type": "string" }, "version": { "type": "string" }, "role": { "enum": ["training", "fine-tuning", "evaluation", "prompt", "retrieval", "embedding", "operational-input", "generated-output", "derived", "other"] }, "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }, "materiality": { "enum": ["low", "moderate", "high", "critical"] } }, "additionalProperties": false },
    "origins": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["sourceId", "sourceType", "collectedAt", "collector", "geography"], "properties": { "sourceId": { "type": "string" }, "sourceType": { "enum": ["first-party", "licensed", "open", "public", "synthetic", "user-provided", "vendor", "unknown"] }, "collectedAt": { "type": "string", "format": "date-time" }, "collector": { "type": "string" }, "geography": { "type": "string" } }, "additionalProperties": false } },
    "transformations": { "type": "array", "items": { "type": "object", "required": ["stepId", "operation", "performedAt", "toolVersion", "outputDigest"], "properties": { "stepId": { "type": "string" }, "operation": { "type": "string" }, "performedAt": { "type": "string", "format": "date-time" }, "toolVersion": { "type": "string" }, "outputDigest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" } }, "additionalProperties": false } },
    "permissions": { "type": "object", "required": ["basis", "licenseOrTerms", "permittedUses", "prohibitedUses", "reviewedBy"], "properties": { "basis": { "enum": ["ownership", "contract", "license", "consent", "law", "public-domain", "undetermined"] }, "licenseOrTerms": { "type": "string" }, "permittedUses": { "$ref": "#/$defs/strings" }, "prohibitedUses": { "type": "array", "items": { "type": "string" } }, "reviewedBy": { "type": "string" } }, "additionalProperties": false },
    "privacy": { "type": "object", "required": ["personalData", "specialCategoryData", "controllerOrProcessorRole", "lawfulBasis", "necessityAssessment", "rightsRoute"], "properties": { "personalData": { "type": "boolean" }, "specialCategoryData": { "type": "boolean" }, "controllerOrProcessorRole": { "enum": ["controller", "joint-controller", "processor", "sub-processor", "not-applicable", "undetermined"] }, "lawfulBasis": { "type": "string" }, "necessityAssessment": { "type": "string" }, "rightsRoute": { "type": "string" } }, "additionalProperties": false },
    "annotation": { "type": "object", "required": ["applicable", "protocolRef", "annotatorCompetenceRef", "agreementMeasure", "disputeRoute"], "properties": { "applicable": { "type": "boolean" }, "protocolRef": { "type": "string" }, "annotatorCompetenceRef": { "type": "string" }, "agreementMeasure": { "type": "string" }, "disputeRoute": { "type": "string" } }, "additionalProperties": false },
    "quality": { "type": "object", "required": ["dimensions", "knownLimits", "acceptedAt", "acceptedBy"], "properties": { "dimensions": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["name", "result", "thresholdDecision"], "properties": { "name": { "type": "string" }, "result": { "type": "string" }, "thresholdDecision": { "enum": ["pass", "conditional", "fail"] } }, "additionalProperties": false } }, "knownLimits": { "$ref": "#/$defs/strings" }, "acceptedAt": { "type": "string", "format": "date-time" }, "acceptedBy": { "type": "string" } }, "additionalProperties": false },
    "uses": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["systemVersion", "purpose", "approved"], "properties": { "systemVersion": { "type": "string" }, "purpose": { "type": "string" }, "approved": { "type": "boolean" } }, "additionalProperties": false } },
    "retention": { "type": "object", "required": ["period", "trigger", "legalHoldRoute", "nextReviewAt"], "properties": { "period": { "type": "string" }, "trigger": { "type": "string" }, "legalHoldRoute": { "type": "string" }, "nextReviewAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false },
    "deletion": { "type": "object", "required": ["method", "covers", "verification", "dueAt"], "properties": { "method": { "type": "string" }, "covers": { "$ref": "#/$defs/strings" }, "verification": { "type": "string" }, "dueAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false },
    "owner": { "type": "string" },
    "review": { "type": "object", "required": ["status", "reviewedAt", "reviewedBy", "validUntil"], "properties": { "status": { "enum": ["accepted", "conditional", "rejected"] }, "reviewedAt": { "type": "string", "format": "date-time" }, "reviewedBy": { "type": "string" }, "validUntil": { "type": "string", "format": "date-time" } }, "additionalProperties": false }
  },
  "$defs": { "strings": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } } },
  "additionalProperties": false
}
