{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hogarmas.net/content-credentials/collection-baseline-diff-receipt-schema.json",
  "title": "H/M privacy-minimized Collection Baseline Diff receipt",
  "description": "Unsigned aggregate receipt reconstructed from a version 1 compact URL-fragment payload. It excludes package identifiers, package digests, file names, source hashes, aliases, changed fields and changed rows. Its SHA-256 checksum tests consistency, not signature validity or sender identity.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "tool",
    "ruleset",
    "reportDigest",
    "context",
    "comparison",
    "summary",
    "privacy",
    "limitations"
  ],
  "properties": {
    "schema": {
      "const": "hm.content-credentials-collection-baseline-diff-receipt.v1"
    },
    "tool": {
      "const": "https://hogarmas.net/content-credentials/"
    },
    "ruleset": {
      "const": "2026-07-29.1"
    },
    "reportDigest": {
      "type": "string",
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "context": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "syntheticDemo"
      ],
      "properties": {
        "syntheticDemo": {
          "type": "boolean"
        }
      }
    },
    "comparison": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "matchKey",
        "identifierMode",
        "packagesVerifiedFirst",
        "orderCompared"
      ],
      "properties": {
        "matchKey": {
          "const": "source-sha256-multiset"
        },
        "identifierMode": {
          "const": "minimized"
        },
        "packagesVerifiedFirst": {
          "const": true
        },
        "orderCompared": {
          "const": false
        }
      }
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "baselineProcessed",
        "currentProcessed",
        "unchangedOccurrences",
        "changedOccurrences",
        "addedOccurrences",
        "removedOccurrences",
        "unresolvedOccurrences"
      ],
      "properties": {
        "baselineProcessed": {
          "$ref": "#/$defs/count"
        },
        "currentProcessed": {
          "$ref": "#/$defs/count"
        },
        "unchangedOccurrences": {
          "$ref": "#/$defs/count"
        },
        "changedOccurrences": {
          "$ref": "#/$defs/count"
        },
        "addedOccurrences": {
          "$ref": "#/$defs/count"
        },
        "removedOccurrences": {
          "$ref": "#/$defs/count"
        },
        "unresolvedOccurrences": {
          "$ref": "#/$defs/count",
          "maximum": 4000
        }
      }
    },
    "privacy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "reportDigestIncluded",
        "packageIdentifiersIncluded",
        "packageDigestsIncluded",
        "sourceFileNamesIncluded",
        "sourceHashesIncluded",
        "sourceAliasesIncluded",
        "changedFieldsIncluded",
        "changedRowsIncluded",
        "sourcePackagesUploaded",
        "urlFragmentSentInHttpRequest",
        "urlFragmentMayAppearInBrowserHistory"
      ],
      "properties": {
        "reportDigestIncluded": {
          "const": true
        },
        "packageIdentifiersIncluded": {
          "const": false
        },
        "packageDigestsIncluded": {
          "const": false
        },
        "sourceFileNamesIncluded": {
          "const": false
        },
        "sourceHashesIncluded": {
          "const": false
        },
        "sourceAliasesIncluded": {
          "const": false
        },
        "changedFieldsIncluded": {
          "const": false
        },
        "changedRowsIncluded": {
          "const": false
        },
        "sourcePackagesUploaded": {
          "const": false
        },
        "urlFragmentSentInHttpRequest": {
          "const": false
        },
        "urlFragmentMayAppearInBrowserHistory": {
          "const": true
        }
      }
    },
    "limitations": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "cryptographicallySigned",
        "issuerIdentityVerified",
        "reportReproducibleFromReceipt",
        "sourceFilesIncluded",
        "sourcePackagesIncluded",
        "detachedSourceFilesRehashed",
        "changeCauseIdentified",
        "semanticTruthProven",
        "officialC2paCollectionDataHash"
      ],
      "properties": {
        "cryptographicallySigned": {
          "const": false
        },
        "issuerIdentityVerified": {
          "const": false
        },
        "reportReproducibleFromReceipt": {
          "const": false
        },
        "sourceFilesIncluded": {
          "const": false
        },
        "sourcePackagesIncluded": {
          "const": false
        },
        "detachedSourceFilesRehashed": {
          "const": false
        },
        "changeCauseIdentified": {
          "const": false
        },
        "semanticTruthProven": {
          "const": false
        },
        "officialC2paCollectionDataHash": {
          "const": false
        }
      }
    }
  },
  "$defs": {
    "count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 2000
    }
  }
}
