{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://zambo.dev/aer-1/v1.2/schema.json",
  "title": "AER-1 AI Agent Execution Receipt",
  "description": "Core AER-1 receipt fields from draft-zambo-aer1-01.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "id",
    "receipt_schema_version",
    "created_at",
    "tool",
    "provenance_class",
    "canonical_bytes",
    "output_hash",
    "verification_status"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "receipt_schema_version": {
      "type": "string",
      "const": "0.3"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "tool": {
      "type": "object",
      "required": [
        "name",
        "version",
        "scope"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": true
    },
    "provenance_class": {
      "type": "string",
      "enum": [
        "EXECUTED BY ZAMBO",
        "OBSERVED VIA GATEWAY",
        "LOGGED BY AGENT"
      ]
    },
    "canonical_bytes": {
      "type": "string",
      "contentEncoding": "base64",
      "description": "Base64 of the exact UTF-8 bytes hashed below."
    },
    "output_hash": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "verification_status": {
      "type": "string",
      "const": "verified"
    }
  }
}
