{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://iarpg.com/review-ledger.schema.json",
  "title": "IARPG Append-Only Review Ledger",
  "type": "object",
  "required": [
    "ledger_id",
    "ledger_version",
    "release",
    "generated_utc",
    "append_only",
    "entries"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "ledger_id": {
      "type": "string"
    },
    "ledger_version": {
      "const": "1.0.0"
    },
    "release": {
      "type": "string"
    },
    "generated_utc": {
      "type": "string",
      "pattern": "Z$"
    },
    "append_only": {
      "const": true
    },
    "entries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/entry"
      }
    }
  },
  "$defs": {
    "entry": {
      "type": "object",
      "required": [
        "entry_id",
        "timestamp_utc",
        "artifact_id",
        "artifact_digest",
        "action",
        "result",
        "reason_code",
        "related_standard",
        "parent_entry_ids",
        "preserved_extensions"
      ],
      "properties": {
        "entry_id": {
          "type": "string"
        },
        "timestamp_utc": {
          "type": "string",
          "pattern": "Z$"
        },
        "artifact_id": {
          "type": "string"
        },
        "artifact_digest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "action": {
          "type": "string"
        },
        "result": {
          "type": "string"
        },
        "reason_code": {
          "type": "string"
        },
        "related_standard": {
          "type": "string"
        },
        "parent_entry_ids": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "supersedes_entry_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "reverses_entry_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "preserved_extensions": {
          "type": "object"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
