{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paloframework.org/schemas/palo-policywatcher-review-ledger.schema.json",
  "title": "PALO PolicyWatcher Browser-local Review Ledger",
  "type": "object",
  "required": ["format", "schemaVersion", "exportedAt", "sourceRegistryDigest", "reviews", "localOnly", "authorityBoundary"],
  "properties": {
    "format": { "const": "palo-policywatcher-review-ledger" },
    "schemaVersion": { "const": "1.0.0" },
    "exportedAt": { "type": "string", "format": "date-time" },
    "sourceRegistryDigest": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
    "reviews": {
      "type": "array",
      "maxItems": 500,
      "items": {
        "type": "object",
        "required": ["signalId", "signalDigest", "transportStatus", "reviewState", "updatedAt"],
        "properties": {
          "signalId": { "type": "string", "pattern": "^signal-policywatcher-[a-f0-9-]{36}$" },
          "signalDigest": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
          "transportStatus": { "enum": ["active", "revoked"] },
          "reviewState": { "enum": ["pending-human-review", "in-review", "routed-to-case-file", "reviewed-no-action", "rejected"] },
          "updatedAt": { "type": "string", "format": "date-time" }
        },
        "additionalProperties": false
      }
    },
    "localOnly": { "const": true },
    "authorityBoundary": { "type": "string", "minLength": 80, "maxLength": 1000 }
  },
  "additionalProperties": false
}
