{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hogarmas.net/content-credentials/batch-schema.json",
  "title": "H/M Content Credentials batch report",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "ruleset", "execution", "summary", "files", "privacy", "limitations"],
  "properties": {
    "schema": { "const": "hm.content-credentials-batch.v2" },
    "ruleset": { "const": "2026-07-22.4" },
    "execution": {
      "type": "object",
      "additionalProperties": false,
      "required": ["status", "selectedCount", "processedCount", "remainingCount", "fileConcurrency", "fullReportsRetained"],
      "properties": {
        "status": { "enum": ["complete", "stopped"] },
        "selectedCount": { "type": "integer", "minimum": 1, "maximum": 2000 },
        "processedCount": { "type": "integer", "minimum": 1, "maximum": 2000 },
        "remainingCount": { "type": "integer", "minimum": 0, "maximum": 1999 },
        "fileConcurrency": { "const": 1 },
        "fullReportsRetained": { "const": false }
      }
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": ["fileCount", "completedCount", "errorCount", "manifestPresentCount", "integrityValidCount", "integrityInvalidCount", "signerTrustedCount", "signerUntrustedCount", "aiDeclaredCount"],
      "properties": {
        "fileCount": { "type": "integer", "minimum": 1, "maximum": 2000 },
        "completedCount": { "type": "integer", "minimum": 0, "maximum": 2000 },
        "errorCount": { "type": "integer", "minimum": 0, "maximum": 2000 },
        "manifestPresentCount": { "type": "integer", "minimum": 0, "maximum": 2000 },
        "integrityValidCount": { "type": "integer", "minimum": 0, "maximum": 2000 },
        "integrityInvalidCount": { "type": "integer", "minimum": 0, "maximum": 2000 },
        "signerTrustedCount": { "type": "integer", "minimum": 0, "maximum": 2000 },
        "signerUntrustedCount": { "type": "integer", "minimum": 0, "maximum": 2000 },
        "aiDeclaredCount": { "type": "integer", "minimum": 0, "maximum": 2000 }
      }
    },
    "files": {
      "type": "array",
      "minItems": 1,
      "maxItems": 2000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["fileName", "mimeType", "sizeBytes", "status", "errorCode", "sha256", "manifestPresent", "manifestCount", "integrity", "signerTrust", "aiOrigin", "validationFailureCount"],
        "properties": {
          "fileName": { "type": "string", "minLength": 1, "maxLength": 320 },
          "mimeType": { "type": "string", "maxLength": 120 },
          "sizeBytes": { "type": "integer", "minimum": 0 },
          "status": { "enum": ["complete", "error"] },
          "errorCode": { "enum": ["", "empty", "too-large", "unsupported", "read-error"] },
          "sha256": { "type": "string", "maxLength": 320 },
          "manifestPresent": { "type": "boolean" },
          "manifestCount": { "type": "integer", "minimum": 0 },
          "integrity": { "type": "string", "maxLength": 40 },
          "signerTrust": { "type": "string", "maxLength": 40 },
          "aiOrigin": { "type": "string", "maxLength": 40 },
          "validationFailureCount": { "type": "integer", "minimum": 0 }
        }
      }
    },
    "privacy": {
      "type": "object",
      "additionalProperties": false,
      "required": ["processedLocally", "sourceFilesUploaded", "browserStorageUsed", "exportedFileNamesIncluded", "exportedHashesIncluded"],
      "properties": {
        "processedLocally": { "const": true },
        "sourceFilesUploaded": { "const": false },
        "browserStorageUsed": { "const": false },
        "exportedFileNamesIncluded": { "const": true },
        "exportedHashesIncluded": { "const": true }
      }
    },
    "limitations": {
      "type": "object",
      "additionalProperties": false,
      "required": ["aggregateIsNotScore", "semanticTruthProven", "authorshipProven", "aiAbsenceProven", "legalComplianceCertified"],
      "properties": {
        "aggregateIsNotScore": { "const": true },
        "semanticTruthProven": { "const": false },
        "authorshipProven": { "const": false },
        "aiAbsenceProven": { "const": false },
        "legalComplianceCertified": { "const": false }
      }
    }
  }
}
