{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.org/task-token/confidentiality.schema.json",
  "title": "Confidentiality Descriptor (shared with Token-Bound Executable Skills; TASK-KERNEL v1.0)",
  "type": "object",
  "required": ["schemaVersion", "mode", "profile", "objects"],
  "properties": {
    "schemaVersion": { "type": "string" },
    "mode":          { "type": "string", "const": "encrypted" },
    "profile":       { "type": "string", "minLength": 1,
                       "description": "opaque scheme identifier; unknown profiles MUST NOT be decrypted by guesswork" },
    "objects": {
      "type": "object",
      "minProperties": 1,
      "additionalProperties": {
        "type": "object",
        "required": ["ciphertext", "plaintextHash"],
        "properties": {
          "ciphertext":    { "type": "string",
                             "description": "MUST equal the corresponding CID in the TaskRoot: td.cid when path == td.path, terms.cid when path == terms.path, files[path] otherwise" },
          "plaintextHash": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" }
        },
        "additionalProperties": false
      },
      "$comment": "keys are package paths per the v4.3 path rules"
    },
    "policyHash":    { "type": "string", "$comment": "profile-specific" },
    "keyManagement": { "type": "object", "$comment": "profile-specific" }
  },
  "additionalProperties": true
}
