{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hireeli-io/json-schema/hireeli-io-protocol-receipt-schema.json",
  "title": "ProtocolReceipt",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hireeli-io-openapi.json#/components/schemas/ProtocolReceipt",
  "type": "object",
  "required": [
    "decision",
    "resourceId",
    "status",
    "url",
    "revertible",
    "revert_hint",
    "caps",
    "audit_id"
  ],
  "properties": {
    "decision": {
      "type": "string",
      "description": "The exact accepted operation."
    },
    "resourceId": {
      "type": "string",
      "description": "The decided resource ID."
    },
    "status": {
      "type": "string",
      "description": "The state Eli verified after the decision."
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "revertible": {
      "type": "boolean",
      "description": "Whether Eli exposes a guarded machine revert for this completed action."
    },
    "revert_hint": {
      "type": [
        "string",
        "null"
      ],
      "description": "The exact safe next step for a revert or immutable follow-up."
    },
    "caps": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "used",
        "limit",
        "window"
      ],
      "properties": {
        "used": {
          "type": "integer",
          "minimum": 0
        },
        "limit": {
          "type": "integer",
          "minimum": 0
        },
        "window": {
          "type": "string",
          "enum": [
            "day"
          ]
        }
      },
      "additionalProperties": false,
      "description": "Durable protocol write counter returned by the shared execution core."
    },
    "audit_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Durable protocol-decision audit row for this machine write."
    },
    "change_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Exact owned-site change reconciled by a content rollback, when applicable."
    },
    "publication_receipt_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Immutable publication receipt preserved across rollback."
    },
    "reversal_receipt_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Immutable verified rollback receipt, when rollback completed."
    }
  },
  "additionalProperties": true
}