{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/atesta-tech/credentials/main/schemas/AtestaSupplyChainAttestation/v1.0.0-conformance/schema.json",
  "title": "AtestaSupplyChainAttestation",
  "description": "EBSI Verifiable Attestation for supply chain compliance. Addresses LkSG §5 due diligence obligations (Lieferkettensorgfaltspflichtengesetz) and CSDDD Tier-1 supplier risk assessment requirements. Issued by Atesta as a registered EBSI Trusted Issuer.",
  "type": "object",
  "properties": {
    "@context": {
      "type": "array",
      "items": { "type": "string", "format": "uri" },
      "contains": { "const": "https://www.w3.org/2018/credentials/v1" }
    },
    "type": {
      "type": "array",
      "items": { "type": "string" },
      "allOf": [
        { "contains": { "const": "VerifiableCredential" } },
        { "contains": { "const": "VerifiableAttestation" } },
        { "contains": { "const": "AtestaSupplyChainAttestation" } }
      ]
    },
    "id": {
      "type": "string",
      "format": "uri",
      "description": "Unique URI for this credential instance."
    },
    "issuer": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^did:ebsi:",
          "description": "DID of the Atesta issuer registered in the EBSI Trusted Issuers Registry."
        },
        {
          "type": "object",
          "properties": {
            "id": { "type": "string", "pattern": "^did:ebsi:" }
          },
          "required": ["id"]
        }
      ]
    },
    "issuanceDate": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 UTC timestamp of credential issuance."
    },
    "validUntil": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 UTC timestamp after which the attestation expires. Atesta issues with a 30-day rolling validity window."
    },
    "credentialSubject": {
      "$ref": "#/$defs/CredentialSubject"
    },
    "credentialSchema": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uri"
        },
        "type": {
          "type": "string",
          "const": "FullJsonSchemaValidator2021"
        }
      },
      "required": ["id", "type"]
    },
    "credentialStatus": {
      "type": "object",
      "description": "Optional revocation status reference (e.g. StatusList2021).",
      "properties": {
        "id": { "type": "string", "format": "uri" },
        "type": { "type": "string" }
      }
    },
    "proof": {
      "type": "object",
      "description": "Linked Data Proof or JWT proof envelope."
    }
  },
  "required": [
    "@context",
    "type",
    "issuer",
    "issuanceDate",
    "credentialSubject",
    "credentialSchema"
  ],
  "$defs": {
    "CredentialSubject": {
      "type": "object",
      "title": "AtestaSupplyChainAttestation credentialSubject",
      "description": "Claims about a specific supplier legal entity as assessed by the Atesta signal pipeline.",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^did:ebsi:",
          "description": "EBSI DID of the supplier legal entity being attested."
        },
        "supplierName": {
          "type": "string",
          "description": "Registered legal name of the supplier entity."
        },
        "supplierCountry": {
          "type": "string",
          "pattern": "^[A-Z]{2}$",
          "description": "ISO 3166-1 alpha-2 country code of the supplier's primary registered jurisdiction."
        },
        "lksgSection5Status": {
          "type": "string",
          "enum": ["COMPLIANT", "NON_COMPLIANT", "UNDER_REVIEW", "INSUFFICIENT_DATA"],
          "description": "Assessment of supplier compliance with LkSG §5 obligations (risk analysis, prevention, remediation). Mapped from Atesta signal pipeline output. COMPLIANT indicates no material violations detected. NON_COMPLIANT indicates one or more active violations. UNDER_REVIEW indicates active investigation. INSUFFICIENT_DATA indicates signal coverage below confidence threshold."
        },
        "csrddTier1Status": {
          "type": "string",
          "enum": ["COMPLIANT", "NON_COMPLIANT", "UNDER_REVIEW", "INSUFFICIENT_DATA"],
          "description": "Assessment against CSDDD (EU 2024/1760) Tier-1 direct supplier obligations. Aligned with LkSG §5 mapping but scoped to direct commercial relationship. Applicable from CSDDD national transposition deadline (July 2027 for large enterprises)."
        },
        "sanctionsStatus": {
          "type": "string",
          "enum": ["CLEAR", "FLAGGED", "PENDING_REVIEW"],
          "description": "Consolidated sanctions screening result across all monitored lists. CLEAR indicates no matches on any active list as of lastSignalCheck. FLAGGED indicates one or more active matches requiring buyer due diligence. PENDING_REVIEW indicates a potential match under manual investigation."
        },
        "sanctionsList": {
          "type": "array",
          "items": { "type": "string" },
          "description": "When sanctionsStatus is FLAGGED, lists the specific sanctions programmes with active matches (e.g. OFAC_SDN, EU_CONSOLIDATED, UK_OFSI)."
        },
        "lastSignalCheck": {
          "type": "string",
          "format": "date",
          "description": "ISO 8601 date of the most recent full signal pipeline run for this supplier. Buyers should not rely on attestations where lastSignalCheck is older than 45 days."
        },
        "lastSatelliteCheck": {
          "type": "string",
          "format": "date",
          "description": "ISO 8601 date of the most recent Sentinel-2 satellite imagery analysis of the supplier's primary facility."
        },
        "facilityActivityScore": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Normalised operational activity index (0.0–1.0) derived from satellite imagery change detection and logistics data. Values below 0.3 trigger facility inactivity alerts. Not a labour rights assessment."
        },
        "signalSources": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "OFAC",
              "EU_SANCTIONS",
              "UK_OFSI",
              "UN_SANCTIONS",
              "SENTINEL2",
              "BUNDESANZEIGER",
              "US_CUSTOMS",
              "EU_CUSTOMS",
              "ORBIS_COMPANY",
              "NGO_WATCH"
            ]
          },
          "description": "Set of data sources active in the most recent signal pipeline run for this supplier."
        },
        "confidenceScore": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Composite confidence score (0.0–1.0) reflecting signal coverage, recency, and source agreement. Scores below 0.5 indicate low coverage and should be treated as indicative only. Atesta recommends buyers request re-assessment for suppliers below 0.6."
        },
        "assessmentVersion": {
          "type": "string",
          "description": "Internal version identifier for the Atesta assessment model that produced this credential. Used for audit reproducibility."
        }
      },
      "required": [
        "id",
        "supplierName",
        "lksgSection5Status",
        "sanctionsStatus",
        "lastSignalCheck",
        "signalSources",
        "confidenceScore"
      ],
      "additionalProperties": false
    }
  }
}
