{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peoplescourt-ai/json-schema/peoplescourt-ai-partner-case-record-bundle-manifest-schema.json",
  "title": "PartnerCaseRecordBundleManifest",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peoplescourt-ai-case-record-api-openapi.yml#/components/schemas/PartnerCaseRecordBundleManifest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "recipe",
    "partnerId",
    "caseId",
    "externalCaseId",
    "caseRevision",
    "profile",
    "partySide",
    "sourceSnapshotHash",
    "snapshotAt",
    "rules",
    "files",
    "exclusions",
    "bundleId",
    "bundleHash"
  ],
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "case-record-bundle-v2"
    },
    "recipe": {
      "type": "string",
      "const": "sha256-canonical-json-v2"
    },
    "partnerId": {
      "type": "string"
    },
    "caseId": {
      "type": "string"
    },
    "externalCaseId": {
      "type": "string"
    },
    "caseRevision": {
      "type": "integer",
      "minimum": 1
    },
    "dispositionId": {
      "type": "string"
    },
    "awardRevision": {
      "type": "integer",
      "minimum": 1
    },
    "profile": {
      "type": "string",
      "const": "party"
    },
    "partySide": {
      "type": "string",
      "enum": [
        "claimant",
        "respondent"
      ]
    },
    "recordSchema": {
      "type": "string",
      "description": "Schema of the source party record (party-case-record-v1). Opaque to verifiers."
    },
    "metadataSheets": {
      "type": "string",
      "description": "The source bundle's exhibit metadata-sheet state (withheld or included). Opaque to verifiers."
    },
    "sourceSnapshotHash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "snapshotAt": {
      "type": "string",
      "format": "date-time"
    },
    "rules": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "string"
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      }
    },
    "files": {
      "type": "array",
      "minItems": 3,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "path",
          "mediaType",
          "byteLength",
          "sha256",
          "category"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "mediaType": {
            "type": "string"
          },
          "byteLength": {
            "type": "integer",
            "minimum": 1
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "sourceSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "sourceId": {
            "type": "string"
          },
          "category": {
            "$ref": "#/$defs/CaseRecordFileCategory"
          }
        }
      }
    },
    "exclusions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "detail"
        ],
        "properties": {
          "code": {
            "$ref": "#/$defs/CaseRecordExclusionCode"
          },
          "sourceId": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        }
      }
    },
    "bundleId": {
      "type": "string",
      "pattern": "^crb2_[a-f0-9]{64}$"
    },
    "bundleHash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    }
  },
  "$defs": {
    "CaseRecordExclusionCode": {
      "type": "string",
      "description": "Manifest exclusion code. metadata_sheet_withheld marks a party or court bundle that does not carry the exhibit metadata sheets; metadata_sheet_unavailable names an exhibit whose sheet could not be prepared.",
      "enum": [
        "not_disclosed",
        "not_considered",
        "operator_private",
        "secret",
        "hidden_reasoning",
        "missing_source_bytes",
        "source_hash_mismatch",
        "private_record_preparation_certificate",
        "legacy_award_artifacts_unavailable",
        "readable_record_abridged",
        "metadata_sheet_withheld",
        "metadata_sheet_unavailable"
      ]
    },
    "CaseRecordFileCategory": {
      "type": "string",
      "description": "Bundle file category. evidence_metadata_sheet is a transcription of an exhibit’s embedded file metadata. Authorized party bundles indicate whether metadata sheets are included or withheld.",
      "enum": [
        "case",
        "rules",
        "docket",
        "procedural_messages",
        "submission",
        "evidence_metadata",
        "evidence_original",
        "evidence_considered_text",
        "award",
        "transition_certificate",
        "model_provenance",
        "opinion",
        "decision_integrity",
        "reviewer_record",
        "execution_record",
        "run_summary",
        "review_package",
        "readable_record",
        "evidence_metadata_sheet"
      ]
    }
  }
}