{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://dharma-ai.io/schemas/repository-package-chunk.schema.json",
  "title": "Repository package byte-transfer chunk; not release authority",
  "type": "object", "additionalProperties": false,
  "required": ["schema", "indexHash", "fileIndex", "chunkIndex", "contentBase64"],
  "properties": {
    "schema": { "const": "dharma.repository-package-chunk/v1" },
    "indexHash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}(?![\\s\\S])" },
    "fileIndex": { "type": "integer", "minimum": 0, "maximum": 511 },
    "chunkIndex": { "type": "integer", "minimum": 0, "maximum": 3 },
    "contentBase64": {
      "type": "string", "maxLength": 87384,
      "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?(?![\\s\\S])"
    }
  },
  "$comment": "Runtime checks exact canonical encoding, expected index binding, chunk byte count and digest. Missing chunks cannot produce a complete package."
}
